diff --git a/ajax/controller.php b/ajax/controller.php index e8230bfe..fe62ab51 100644 --- a/ajax/controller.php +++ b/ajax/controller.php @@ -1,7 +1,7 @@ sendResponse(); } @@ -57,7 +57,7 @@ class Controller { //If there is no existing session we need to start a new one if (!$session || empty($session)){ - $officeView = View::initOfficeView($uid); + $documentsView = View::initDocumentsView($uid); $genesisPath = View::storeDocument($uid, $path); if (!$genesisPath){ @@ -173,7 +173,7 @@ class Controller { $invites = array(); } - $tmpl = new \OCP\Template('office', 'part.sessions', ''); + $tmpl = new \OCP\Template('documents', 'part.sessions', ''); $tmpl->assign('invites', $invites); $tmpl->assign('sessions', $sessions); echo $tmpl->fetchPage(); diff --git a/ajax/documents.php b/ajax/documents.php index d658abb0..39948881 100644 --- a/ajax/documents.php +++ b/ajax/documents.php @@ -3,8 +3,8 @@ // Init owncloud \OCP\User::checkLoggedIn(); -\OCP\JSON::checkAppEnabled('office'); +\OCP\JSON::checkAppEnabled('documents'); -$documents=\OCA\Office\Storage::getDocuments(); +$documents=\OCA\Documents\Storage::getDocuments(); OCP\JSON::success(array('documents' => $documents)); diff --git a/ajax/otpoll.php b/ajax/otpoll.php index ff42d3db..b73a8bba 100644 --- a/ajax/otpoll.php +++ b/ajax/otpoll.php @@ -36,31 +36,31 @@ */ OCP\JSON::checkLoggedIn(); - OCP\JSON::checkAppEnabled('office'); + OCP\JSON::checkAppEnabled('documents'); // session_write_close(); $response = array(); try{ - $request = new OCA\Office\Request(); + $request = new OCA\Documents\Request(); $command = $request->getParam('command'); switch ($command){ case 'query_memberdata_list': $esId = $request->getParam('args/es_id'); - $inactiveMembers = \OCA\Office\Member::cleanSession($esId); + $inactiveMembers = \OCA\Documents\Member::cleanSession($esId); if (is_array($inactiveMembers)){ foreach ($inactiveMembers as $member){ - \OCA\Office\Op::removeCursor($esId, $member['member_id']); + \OCA\Documents\Op::removeCursor($esId, $member['member_id']); } } $ids = $request->getParam('args/member_ids'); - $members = OCA\Office\Member::getMembersAsArray($ids); + $members = OCA\Documents\Member::getMembersAsArray($ids); $response["memberdata_list"] = array_map( function($x){ $x['display_name'] = \OCP\User::getDisplayName($x['uid']); // Stub - $x['avatar_url'] = \OCP\Util::linkToRoute('office_user_avatar'); + $x['avatar_url'] = \OCP\Util::linkToRoute('documents_user_avatar'); return $x; }, $members @@ -75,9 +75,9 @@ try{ $ops = $request->getParam('args/client_ops'); $hasOps = is_array($ops) && count($ops)>0; - $currentHead = OCA\Office\Op::getHeadSeq($esId); + $currentHead = OCA\Documents\Op::getHeadSeq($esId); try { - OCA\Office\Member::updateMemberActivity($memberId); + OCA\Documents\Member::updateMemberActivity($memberId); } catch (\Exception $e){ } @@ -88,7 +88,7 @@ try{ if ($hasOps) { // incoming ops without conflict // Add incoming ops, respond with a new head - $newHead = OCA\Office\Op::addOpsArray($esId, $memberId, $ops); + $newHead = OCA\Documents\Op::addOpsArray($esId, $memberId, $ops); $response["result"] = 'added'; $response["head_seq"] = $newHead ? $newHead : $currentHead; } else { @@ -98,7 +98,7 @@ try{ $response["head_seq"] = $currentHead; } } else { // HEADs do not match - $response["ops"] = OCA\Office\Op::getOpsAfterJson($esId, $seqHead); + $response["ops"] = OCA\Documents\Op::getOpsAfterJson($esId, $seqHead); $response["head_seq"] = $currentHead; $response["result"] = $hasOps ? 'conflict' : 'new_ops'; } diff --git a/ajax/sessions.php b/ajax/sessions.php index 89cad3d5..5fe5b9fb 100644 --- a/ajax/sessions.php +++ b/ajax/sessions.php @@ -1,10 +1,10 @@ \OCP\Config::getAppValue('office', 'unstable', 'false') + 'value' => \OCP\Config::getAppValue('documents', 'unstable', 'false') )); } exit(); \ No newline at end of file diff --git a/ajax/userController.php b/ajax/userController.php index 59c654cb..5470ea7b 100644 --- a/ajax/userController.php +++ b/ajax/userController.php @@ -1,7 +1,7 @@ 70, 'id' => 'office', 'name' => 'Office')); -OCP\App::registerAdmin('office', 'settings'); +OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents')); +OCP\App::registerAdmin('documents', 'settings'); OCP\App::addNavigationEntry(array( - 'id' => 'office_index', + 'id' => 'documents_index', 'order' => 80, - 'href' => OCP\Util::linkTo('office', 'index.php'), - 'icon' => OCP\Util::imagePath('office', 'office.png'), - 'name' => 'Office') + 'href' => OCP\Util::linkTo('documents', 'index.php'), + 'icon' => OCP\Util::imagePath('documents', 'documents.png'), + 'name' => 'Documents') ); -OC::$CLASSPATH['OCA\Office\Controller'] = 'office/ajax/controller.php'; -OC::$CLASSPATH['OCA\Office\UserController'] = 'office/ajax/userController.php'; -OC::$CLASSPATH['OCA\Office\Download\Simple'] = 'office/lib/download/simple.php'; -OC::$CLASSPATH['OCA\Office\Download\Range'] = 'office/lib/download/range.php'; +OC::$CLASSPATH['OCA\Documents\Controller'] = 'documents/ajax/controller.php'; +OC::$CLASSPATH['OCA\Documents\UserController'] = 'documents/ajax/userController.php'; +OC::$CLASSPATH['OCA\Documents\Download\Simple'] = 'documents/lib/download/simple.php'; +OC::$CLASSPATH['OCA\Documents\Download\Range'] = 'documents/lib/download/range.php'; diff --git a/appinfo/database.xml b/appinfo/database.xml index 5a433030..af4baa4c 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -5,7 +5,7 @@ false utf8 - *dbprefix*office_session + *dbprefix*documents_session es_id @@ -20,7 +20,7 @@ false 512 - Relative to owner office storage /welcome.odt + Relative to owner documents storage /welcome.odt genesis_hash @@ -45,7 +45,7 @@ - office_session_ei_index + documents_session_ei_idx true true @@ -57,7 +57,7 @@
- *dbprefix*office_member + *dbprefix*documents_member member_id @@ -109,7 +109,7 @@
- *dbprefix*office_op + *dbprefix*documents_op seq @@ -151,7 +151,7 @@ - office_op_eis_index + documents_op_eis_idx true es_id @@ -165,7 +165,7 @@
- *dbprefix*office_invite + *dbprefix*documents_invite es_id diff --git a/appinfo/info.xml b/appinfo/info.xml index ef648c51..c335b82e 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -1,7 +1,7 @@ - office - Office + documents + Documents An ownCloud app to work with office documents AGPL Frank Karlitschek diff --git a/appinfo/routes.php b/appinfo/routes.php index e90aa859..1ef5e571 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -1,6 +1,6 @@ create('office_genesis', 'ajax/genesis/{es_id}') +$this->create('documents_genesis', 'ajax/genesis/{es_id}') ->post() - ->action('\OCA\Office\Controller', 'serve') + ->action('\OCA\Documents\Controller', 'serve') ; -$this->create('office_genesis', 'ajax/genesis/{es_id}') +$this->create('documents_genesis', 'ajax/genesis/{es_id}') ->get() - ->action('\OCA\Office\Controller', 'serve') + ->action('\OCA\Documents\Controller', 'serve') ; -$this->create('office_session_start', 'ajax/session/start') +$this->create('documents_session_start', 'ajax/session/start') ->get() - ->action('\OCA\Office\Controller', 'startSession') + ->action('\OCA\Documents\Controller', 'startSession') ; -$this->create('office_session_start', 'ajax/session/start') +$this->create('documents_session_start', 'ajax/session/start') ->post() - ->action('\OCA\Office\Controller', 'startSession') + ->action('\OCA\Documents\Controller', 'startSession') ; -$this->create('office_session_list', 'ajax/session/list') +$this->create('documents_session_list', 'ajax/session/list') ->get() - ->action('\OCA\Office\Controller', 'listSessions') + ->action('\OCA\Documents\Controller', 'listSessions') ; -$this->create('office_session_list', 'ajax/session/list') +$this->create('documents_session_list', 'ajax/session/list') ->post() - ->action('\OCA\Office\Controller', 'listSessions') + ->action('\OCA\Documents\Controller', 'listSessions') ; -$this->create('office_session_info', 'ajax/session/info') +$this->create('documents_session_info', 'ajax/session/info') ->post() - ->action('\OCA\Office\Controller', 'sessionInfo') + ->action('\OCA\Documents\Controller', 'sessionInfo') ; -$this->create('office_session_listhtml', 'ajax/session/listHtml') +$this->create('documents_session_listhtml', 'ajax/session/listHtml') ->get() - ->action('\OCA\Office\Controller', 'listSessionsHtml') + ->action('\OCA\Documents\Controller', 'listSessionsHtml') ; -$this->create('office_session_listhtml', 'ajax/session/listHtml') +$this->create('documents_session_listhtml', 'ajax/session/listHtml') ->post() - ->action('\OCA\Office\Controller', 'listSessionsHtml') + ->action('\OCA\Documents\Controller', 'listSessionsHtml') ; -$this->create('office_session_join', 'ajax/session/join/{es_id}') +$this->create('documents_session_join', 'ajax/session/join/{es_id}') ->get() - ->action('\OCA\Office\Controller', 'joinSession') + ->action('\OCA\Documents\Controller', 'joinSession') ; -$this->create('office_session_join', 'ajax/session/join/{es_id}') +$this->create('documents_session_join', 'ajax/session/join/{es_id}') ->post() - ->action('\OCA\Office\Controller', 'joinSession') + ->action('\OCA\Documents\Controller', 'joinSession') ; -$this->create('office_session_save', 'ajax/session/save') +$this->create('documents_session_save', 'ajax/session/save') ->post() - ->action('\OCA\Office\Controller', 'save') + ->action('\OCA\Documents\Controller', 'save') ; -$this->create('office_user_avatar', 'ajax/user/avatar') +$this->create('documents_user_avatar', 'ajax/user/avatar') ->get() - ->action('\OCA\Office\UserController', 'sendAvatar') + ->action('\OCA\Documents\UserController', 'sendAvatar') ; -$this->create('office_user_invite', 'ajax/user/invite') +$this->create('documents_user_invite', 'ajax/user/invite') ->post() - ->action('\OCA\Office\UserController', 'invite') + ->action('\OCA\Documents\UserController', 'invite') ; -$this->create('office_user_search', 'ajax/user/search') +$this->create('documents_user_search', 'ajax/user/search') ->get() - ->action('\OCA\Office\UserController', 'search') + ->action('\OCA\Documents\UserController', 'search') ; diff --git a/css/style.css b/css/style.css index 2463a050..9f6dd1c8 100755 --- a/css/style.css +++ b/css/style.css @@ -3,7 +3,7 @@ font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } -#office-content{ +#documents-content{ padding-top: 3em; } diff --git a/img/office.png b/img/documents.png similarity index 100% rename from img/office.png rename to img/documents.png diff --git a/img/office.svg b/img/documents.svg similarity index 100% rename from img/office.svg rename to img/documents.svg diff --git a/index.php b/index.php index 471fcfe4..6e5f9fb2 100755 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ printPage(); diff --git a/js/office.js b/js/documents.js similarity index 78% rename from js/office.js rename to js/documents.js index 51fcfe39..a724f1a5 100644 --- a/js/office.js +++ b/js/documents.js @@ -1,15 +1,15 @@ /*globals $,OC,fileDownloadPath,t,document,odf,webodfEditor,alert,require,dojo,runtime */ -var officeMain = { +var documentsMain = { useUnstable : false, onStartup: function() { "use strict"; - OC.addScript('office', 'webodf_bootstrap', function() { - OC.addScript('office', 'webodf-debug').done(function() { + OC.addScript('documents', 'webodf_bootstrap', function() { + OC.addScript('documents', 'webodf-debug').done(function() { require({}, ["dojo/ready"], function(ready) { ready(function() { require({}, ["webodf/editor/Editor"], function(Editor) { if (Editor && typeof(Editor) === 'function') { - officeMain.initialized = 1; + documentsMain.initialized = 1; } else { alert("initialization of webodf/editor/Editor\n" + "failed somehow..."); @@ -19,7 +19,7 @@ var officeMain = { }); }); }); - //setInterval(officeMain.updateInfo, 10000); + //setInterval(documentsMain.updateInfo, 10000); }, initSession: function(response) { "use strict"; @@ -30,7 +30,7 @@ var officeMain = { return; } - OC.addScript('office', 'editor/boot_editor').done(function() { + OC.addScript('documents', 'editor/boot_editor').done(function() { var doclocation = response.es_id; // fade out file list and show WebODF canvas @@ -82,7 +82,7 @@ var officeMain = { cb(memberId); }, callback: function(webodfEditorInstance) { - officeMain.webodfEditorInstance = webodfEditorInstance; + documentsMain.webodfEditorInstance = webodfEditorInstance; } } ); @@ -93,24 +93,24 @@ var officeMain = { startSession: function(fileid) { "use strict"; console.log('starting session for fileid '+fileid); - if (officeMain.initialized === undefined) { + if (documentsMain.initialized === undefined) { alert("WebODF Editor not yet initialized..."); return; } $.post( - OC.Router.generate('office_session_start'), + OC.Router.generate('documents_session_start'), {'fileid': fileid}, - officeMain.initSession + documentsMain.initSession ); }, joinSession: function(esId) { console.log('joining session '+esId); $.post( - OC.Router.generate('office_session_join') + '/' + esId, + OC.Router.generate('documents_session_join') + '/' + esId, {}, - officeMain.initSession + documentsMain.initSession ); }, @@ -120,13 +120,13 @@ var officeMain = { fileIds.push($(e).attr('data-file')); }); $.post( - OC.Router.generate('office_session_info'), + OC.Router.generate('documents_session_info'), {items: fileIds}, function (response){ if (response && response.info && response.info.length){ for (var i=0;i 0) { @@ -293,7 +293,7 @@ $(document).ready(function() { event.preventDefault(); var item = $( '
  • ' + el.item.label + 'execute(array( $esId, $userId, @@ -26,11 +26,11 @@ class Invite { time() )); - return \OCP\DB::insertid(`*PREFIX*office_invite`); + return \OCP\DB::insertid(`*PREFIX*documents_invite`); } public static function accept($esId){ - $query = \OCP\DB::prepare('UPDATE `*PREFIX*office_invite` SET `status`=? WHERE `es_id`=? AND `uid`=?'); + $query = \OCP\DB::prepare('UPDATE `*PREFIX*documents_invite` SET `status`=? WHERE `es_id`=? AND `uid`=?'); $query->execute(array( self::STATUS_ACCEPTED, $esId, @@ -39,7 +39,7 @@ class Invite { } public static function decline($esId){ - $query = \OCP\DB::prepare('UPDATE `*PREFIX*office_invite` SET `status`=? WHERE `es_id`=? AND `uid`=?'); + $query = \OCP\DB::prepare('UPDATE `*PREFIX*documents_invite` SET `status`=? WHERE `es_id`=? AND `uid`=?'); $query->execute(array( self::STATUS_DECLINED, $esId, @@ -49,13 +49,13 @@ class Invite { public static function getAllInvites(){ - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_invite` WHERE `uid`= ?'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_invite` WHERE `uid`= ?'); $result = $query->execute(array(\OCP\User::getUser())); return $result->fetchAll(); } public static function getSenderStatusesAsArray(){ - $l10n = \OCP\Util::getL10N('office'); + $l10n = \OCP\Util::getL10N('documents'); return array( self::STATUS_SENT => $l10n->t('Sent'), @@ -65,7 +65,7 @@ class Invite { } public static function getRecipientStatusesAsArray(){ - $l10n = \OCP\Util::getL10N('office'); + $l10n = \OCP\Util::getL10N('documents'); return array( self::STATUS_SENT => $l10n->t('Incoming'), diff --git a/lib/member.php b/lib/member.php index ca1ff012..500eef1c 100644 --- a/lib/member.php +++ b/lib/member.php @@ -1,7 +1,7 @@ execute(array( $esId, \OCP\User::getUser(), @@ -28,11 +28,11 @@ class Member { time() )); - return \OCP\DB::insertid(`*PREFIX*office_member`); + return \OCP\DB::insertid(`*PREFIX*documents_member`); } public static function getMember($id){ - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_member` WHERE `member_id`= ?'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_member` WHERE `member_id`= ?'); $result = $query->execute(array($id)); return $result->fetchRow(); } @@ -45,13 +45,13 @@ class Member { $placeholders = array_fill(0, $memberCount, '?'); $stmt = implode(', ', $placeholders); - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_member` WHERE `member_id`IN (' . $stmt . ')'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_member` WHERE `member_id`IN (' . $stmt . ')'); $result = $query->execute($ids); return $result->fetchAll(); } public static function updateMemberActivity($memberId){ - $query = \OCP\DB::prepare('UPDATE `*PREFIX*office_member` SET `last_activity`=? WHERE `member_id`=?'); + $query = \OCP\DB::prepare('UPDATE `*PREFIX*documents_member` SET `last_activity`=? WHERE `member_id`=?'); $query->execute(array( time(), $memberId @@ -65,7 +65,7 @@ class Member { $activeSince = $lastActivity; } - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_member` WHERE `es_id`= ? and `last_activity` > ?'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_member` WHERE `es_id`= ? and `last_activity` > ?'); $result = $query->execute(array($esId, $activeSince)); return $result->fetchAll(); } @@ -78,7 +78,7 @@ class Member { public static function cleanSession($esId){ $time = self::getInactivityPeriod(); - $query = \OCP\DB::prepare('SELECT `member_id` FROM `*PREFIX*office_member` WHERE `es_id`= ? AND `last_activity`execute(array( $esId, $time, @@ -97,7 +97,7 @@ class Member { * @param timestamp $time */ protected static function deactivate($esId, $time){ - $query = \OCP\DB::prepare('UPDATE `*PREFIX*office_member` SET `status`=? WHERE `es_id`=? AND `last_activity`execute(array( self::MEMBER_STATUS_INACTIVE, $esId, diff --git a/lib/op.php b/lib/op.php index ba162dcd..bf331e5f 100644 --- a/lib/op.php +++ b/lib/op.php @@ -1,6 +1,6 @@ execute(array( $esId, $memberId, @@ -22,7 +22,7 @@ class Op { )); // throw something - if query fails - thats fatal - return \OCP\DB::insertid(`*PREFIX*office_op`); + return \OCP\DB::insertid(`*PREFIX*documents_op`); } public static function addOpsArray($esId, $memberId, $ops){ @@ -38,7 +38,7 @@ class Op { * @returns "" when there are no Ops, or the seq of the last Op */ public static function getHeadSeq($esId){ - $query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*office_op` WHERE `es_id`=? ORDER BY `seq` DESC LIMIT 1'); + $query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*documents_op` WHERE `es_id`=? ORDER BY `seq` DESC LIMIT 1'); $result = $query->execute(array( $esId )) @@ -67,7 +67,7 @@ class Op { if ($seq == ""){ $seq = -1; } - $query = \OCP\DB::prepare('SELECT `opspec` FROM `*PREFIX*office_op` WHERE `es_id`=? AND `seq`>? ORDER BY `seq` ASC'); + $query = \OCP\DB::prepare('SELECT `opspec` FROM `*PREFIX*documents_op` WHERE `es_id`=? AND `seq`>? ORDER BY `seq` ASC'); $result = $query->execute(array($esId, $seq)); return $result->fetchAll(); } diff --git a/lib/request.php b/lib/request.php index bdcfe735..07f51a54 100644 --- a/lib/request.php +++ b/lib/request.php @@ -1,6 +1,6 @@ self::getUniqueSessionId(), @@ -32,20 +32,20 @@ class Session { } public static function getAll(){ - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_session`'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_session`'); $result = $query->execute(); return $result->fetchAll(); } public static function getSession($id){ - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_session` WHERE `es_id`= ?'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_session` WHERE `es_id`= ?'); $result = $query->execute(array($id)); return $result->fetchRow(); } public static function getInfo($esId){ - $query = \OCP\DB::prepare('SELECT s.*, COUNT(`m`.`member_id`) AS users FROM `*PREFIX*office_session` AS s LEFT JOIN `*PREFIX*office_member` AS m ON `s`.`es_id`=`m`.`es_id` AND `m`.`status`='. Member::MEMBER_STATUS_ACTIVE .' AND `m`.`uid` != ? WHERE `s`.`es_id` = ? GROUP BY `m`.`es_id`'); + $query = \OCP\DB::prepare('SELECT s.*, COUNT(`m`.`member_id`) AS users FROM `*PREFIX*documents_session` AS s LEFT JOIN `*PREFIX*documents_member` AS m ON `s`.`es_id`=`m`.`es_id` AND `m`.`status`='. Member::MEMBER_STATUS_ACTIVE .' AND `m`.`uid` != ? WHERE `s`.`es_id` = ? GROUP BY `m`.`es_id`'); $result = $query->execute( array( \OCP\User::getUser(), @@ -61,7 +61,7 @@ class Session { } public static function getSessionByFileId($fileId){ - $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_session` WHERE `file_id`= ?'); + $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*documents_session` WHERE `file_id`= ?'); $result = $query->execute(array($fileId)); return $result->fetchRow(); } @@ -74,7 +74,7 @@ class Session { $placeholders = array_fill(0, $fileIdCount, '?'); $stmt = implode(', ', $placeholders); - $query = \OCP\DB::prepare('SELECT s.*, COUNT(`m`.`member_id`) AS users FROM `*PREFIX*office_session` AS s LEFT JOIN `*PREFIX*office_member` AS m ON `s`.`es_id`=`m`.`es_id` AND `m`.`status`='. Member::MEMBER_STATUS_ACTIVE .' AND `m`.`uid` != ? WHERE `s`.`file_id` IN (' . $stmt .') GROUP BY `m`.`es_id`'); + $query = \OCP\DB::prepare('SELECT s.*, COUNT(`m`.`member_id`) AS users FROM `*PREFIX*documents_session` AS s LEFT JOIN `*PREFIX*documents_member` AS m ON `s`.`es_id`=`m`.`es_id` AND `m`.`status`='. Member::MEMBER_STATUS_ACTIVE .' AND `m`.`uid` != ? WHERE `s`.`file_id` IN (' . $stmt .') GROUP BY `m`.`es_id`'); $result = $query->execute( array_merge(array(\OCP\User::getUser()), $fileIds) ); diff --git a/lib/storage.php b/lib/storage.php index f945f113..13386f72 100755 --- a/lib/storage.php +++ b/lib/storage.php @@ -1,7 +1,7 @@ is_dir(self::OFFICE_DIRNAME)) { - $view->mkdir(self::OFFICE_DIRNAME); + if (!$view->is_dir(self::DOCUMENTS_DIRNAME)) { + $view->mkdir(self::DOCUMENTS_DIRNAME); } - //if (!self::$officeView){ - // self::$officeView = new \OC\Files\View('/' . $uid . self::OFFICE_DIRNAME); + //if (!self::$documentsView){ + // self::$documentsView = new \OC\Files\View('/' . $uid . self::DOCUMENTS_DIRNAME); //} // it was a bad idea to use a static method. // to be changed later - return new \OC\Files\View('/' . $uid . self::OFFICE_DIRNAME); + return new \OC\Files\View('/' . $uid . self::DOCUMENTS_DIRNAME); } public static function storeDocument($uid, $filePath){ @@ -43,13 +43,13 @@ class View extends \OC\Files\View{ $newName = '/' . sha1($view->file_get_contents($relPath)) . '.odt'; - $view->copy($relPath, self::OFFICE_DIRNAME . $newName); + $view->copy($relPath, self::DOCUMENTS_DIRNAME . $newName); \OC_FileProxy::$enabled = $proxyStatus; return $newName; } public static function getHashByGenesis($uid, $genesisPath){ - $officeView = self::initOfficeView($uid); - return sha1($officeView->file_get_contents($genesisPath)); + $documentsView = self::initDocumentsView($uid); + return sha1($documentsView->file_get_contents($genesisPath)); } } diff --git a/settings.php b/settings.php index 3536a4f3..a03e6051 100644 --- a/settings.php +++ b/settings.php @@ -1,7 +1,7 @@ assign('unstable', $unstable); return $tmpl->fetchPage(); diff --git a/templates/documents.php b/templates/documents.php index 433947a4..db1e287d 100755 --- a/templates/documents.php +++ b/templates/documents.php @@ -5,7 +5,7 @@ -
    +
    • diff --git a/templates/settings.php b/templates/settings.php index 82f4ba29..13cf0e05 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -1,5 +1,5 @@ -
      - t('Office')) ?> +
      + t('Documents')) ?>