本文整理汇总了PHP中OCP\App::register方法的典型用法代码示例。如果您正苦于以下问题:PHP App::register方法的具体用法?PHP App::register怎么用?PHP App::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\App
的用法示例。
在下文中一共展示了App::register方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
/**
* @brief ownCloud Games Integration
* @site http://oc-apps2.sourceforge.net/
*
* @author Pierre Fauconnier
* @copyright 2014 Pierre Fauconnier
* @license CeCILL v2.1 - http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*/
// ownCloud calls appinfo/app.php every time it runs. This is the place to
// Register navigation entries, and connect signals and slots
define(__NAMESPACE__.'\K_APP_NAME', 'oc_apps2_games');
\OCP\App::register(Array(
'id' => K_APP_NAME,
'order' => 60,
'name' => 'Games2 +'
));
\OCP\App::addNavigationEntry(Array(
'id' => namespace\K_APP_NAME,
'order' => 60,
'href' => \OCP\Util::linkTo(K_APP_NAME, 'main.php'),
'icon' => \OCP\Util::imagePath(K_APP_NAME, 'games-card_game.png'),
'name' => 'Games2 +'
));
//\OC_Hook::connect('OC_DB','install', 'installer');
//\OC_Hook::connect('OC_DB','update', 'updater');
/*
$myFile = \OC_App::getAppPath('oc_apps2_games').'/appinfo/apps2_game_map.csv';
if ( @is_readable($myFile) ) {
示例2: Application
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Documents\AppInfo;
use OCA\Documents\Filter\Office;
use OCA\Documents\Config;
$app = new Application();
$c = $app->getContainer();
\OCP\App::register(['order' => 70, 'id' => 'documents', 'name' => 'Documents']);
//\OCP\App::registerAdmin('documents', 'settings');
\OCP\App::registerAdmin('documents', 'admin');
\OCP\App::registerPersonal('documents', 'personal');
$navigationEntry = function () use($c) {
return ['id' => 'documents_index', 'order' => 2, 'href' => \OCP\Util::linkTo('documents/', 'index.php'), 'icon' => \OCP\Util::imagePath('documents', 'documents.svg'), 'name' => $c->query('L10N')->t('Documents')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
//Script for registering file actions
$url = \OC::$server->getRequest()->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
\OCP\Util::addScript('documents', 'viewer/viewer');
}
if (Config::getConverter() !== 'off') {
$docFilter = new Office(['read' => ['target' => 'application/vnd.oasis.opendocument.text', 'format' => 'odt:writer8', 'extension' => 'odt'], 'write' => ['target' => 'application/msword', 'format' => 'doc', 'extension' => 'doc']]);
$docxFilter = new Office(['read' => ['target' => 'application/vnd.oasis.opendocument.text', 'format' => 'odt:writer8', 'extension' => 'odt'], 'write' => ['target' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'format' => 'docx', 'extension' => 'docx']]);