diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-21 15:30:19 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-21 15:30:19 +0200 |
commit | 5cd14425f9cc4ff122bd3c324ce9f3be80844e91 (patch) | |
tree | 60c626e5bcf04af9c50dc7d3e58ab6d3202453cf /lib | |
parent | 9d324db05481620fd9a6883c1315e0b31fc21c45 (diff) | |
parent | afdad5c74da5c163b01f43046224b376a23f4e60 (diff) | |
download | nextcloud-server-5cd14425f9cc4ff122bd3c324ce9f3be80844e91.tar.gz nextcloud-server-5cd14425f9cc4ff122bd3c324ce9f3be80844e91.zip |
Merge branch 'master' into files_encryption
Conflicts:
apps/files_trashbin/l10n/nn_NO.php
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/nb_NO.php | 2 | ||||
-rw-r--r-- | lib/vcategories.php | 31 |
2 files changed, 33 insertions, 0 deletions
diff --git a/lib/l10n/nb_NO.php b/lib/l10n/nb_NO.php index fc95561d3b4..23146154c77 100644 --- a/lib/l10n/nb_NO.php +++ b/lib/l10n/nb_NO.php @@ -15,6 +15,8 @@ "Files" => "Filer", "Text" => "Tekst", "Images" => "Bilder", +"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din nettservev er ikke konfigurert korrekt for filsynkronisering. WebDAV ser ut til å ikke funkere.", +"Please double check the <a href='%s'>installation guides</a>." => "Vennligst dobbelsjekk <a href='%s'>installasjonsguiden</a>.", "seconds ago" => "sekunder siden", "1 minute ago" => "1 minutt siden", "%d minutes ago" => "%d minutter siden", diff --git a/lib/vcategories.php b/lib/vcategories.php index 5975e688b75..91c72d5dfae 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -325,6 +325,37 @@ class OC_VCategories { } /** + * @brief Rename category. + * @param string $from The name of the existing category + * @param string $to The new name of the category. + * @returns bool + */ + public function rename($from, $to) { + $id = $this->array_searchi($from, $this->categories); + if($id === false) { + OCP\Util::writeLog('core', __METHOD__.', category: ' . $from. ' does not exist', OCP\Util::DEBUG); + return false; + } + + $sql = 'UPDATE `' . self::CATEGORY_TABLE . '` SET `category` = ? ' + . 'WHERE `uid` = ? AND `type` = ? AND `id` = ?'; + try { + $stmt = OCP\DB::prepare($sql); + $result = $stmt->execute(array($to, $this->user, $this->type, $id)); + if (OC_DB::isError($result)) { + OC_Log::write('core', __METHOD__. 'DB error: ' . OC_DB::getErrorMessage($result), OC_Log::ERROR); + return false; + } + } catch(Exception $e) { + OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(), + OCP\Util::ERROR); + return false; + } + $this->categories[$id] = $to; + return true; + } + + /** * @brief Add a new category. * @param $names A string with a name or an array of strings containing * the name(s) of the categor(y|ies) to add. |