本文整理汇总了PHP中OCP\App::registerAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP App::registerAdmin方法的具体用法?PHP App::registerAdmin怎么用?PHP App::registerAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\App
的用法示例。
在下文中一共展示了App::registerAdmin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $urlParams = [])
{
parent::__construct('updater', $urlParams);
$container = $this->getContainer();
/**
* Controllers
*/
$container->registerService('UpdateController', function ($c) {
return new UpdateController($c->query('AppName'), $c->query('Request'), $c->query('L10N'));
});
$container->registerService('BackupController', function ($c) {
return new BackupController($c->query('AppName'), $c->query('Request'), $c->query('Config'), $c->query('L10N'));
});
$container->registerService('AdminController', function ($c) {
return new AdminController($c->query('AppName'), $c->query('Request'), $c->query('Config'), $c->query('L10N'));
});
$container->registerService('L10N', function ($c) {
return $c->query('ServerContainer')->getL10N($c->query('AppName'));
});
$container->registerService('Config', function ($c) {
return new Config($c->query('ServerContainer')->getConfig());
});
$container->registerService('Channel', function ($c) {
return new Channel($c->query('L10N'));
});
//Startup
if (\OC_Util::getEditionString() === '') {
\OCP\App::registerAdmin('updater', 'admin');
$appPath = $container->query('Config')->getBackupBase();
if (!@file_exists($appPath)) {
Helper::mkdir($appPath);
}
}
}
示例2: registerSettings
/**
* Register settings templates
*/
public function registerSettings()
{
$container = $this->getContainer();
$backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
\OCP\App::registerAdmin('files_external', 'settings');
\OCP\App::registerPersonal('files_external', 'personal');
}
示例3: registerAll
/**
* Registers all config options
*/
public function registerAll()
{
$this->registerNavigation();
$this->registerHooks();
// Fuck it lets just do this quick and dirty until core supports this
Backgroundjob::addRegularTask($this->config['cron']['job'], 'run');
App::registerAdmin($this->config['id'], $this->config['admin']);
}
示例4: init
public static function init()
{
self::$l10n = \OCP\Util::getL10N(self::APP_ID);
\OC::$CLASSPATH['OCA\\Updater\\Backup'] = self::APP_ID . '/lib/backup.php';
\OC::$CLASSPATH['OCA\\Updater\\Downloader'] = self::APP_ID . '/lib/downloader.php';
\OC::$CLASSPATH['OCA\\Updater\\Updater'] = self::APP_ID . '/lib/updater.php';
\OC::$CLASSPATH['OCA\\Updater\\Helper'] = self::APP_ID . '/lib/helper.php';
\OC::$CLASSPATH['OCA\\Updater\\Location'] = self::APP_ID . '/lib/location.php';
\OC::$CLASSPATH['OCA\\Updater\\Location_3rdparty'] = self::APP_ID . '/lib/location/3rdparty.php';
\OC::$CLASSPATH['OCA\\Updater\\Location_Apps'] = self::APP_ID . '/lib/location/apps.php';
\OC::$CLASSPATH['OCA\\Updater\\Location_Core'] = self::APP_ID . '/lib/location/core.php';
//Allow config page
\OCP\App::registerAdmin(self::APP_ID, 'admin');
}
示例5: init
public static function init()
{
//check if curl extension installed
if (!in_array('curl', get_loaded_extensions())) {
\OCP\Util::writeLog(self::APP_ID, 'This app needs cUrl PHP extension', \OCP\Util::DEBUG);
return false;
}
\OC::$CLASSPATH['OCA\\User_persona\\Policy'] = self::APP_PATH . 'lib/policy.php';
\OCP\App::registerAdmin(self::APP_ID, 'settings');
if (!\OCP\User::isLoggedIn()) {
\OC::$CLASSPATH['OCA\\User_persona\\Validator'] = self::APP_PATH . 'lib/validator.php';
\OC::$CLASSPATH['OC_USER_PERSONA'] = self::APP_PATH . 'user_persona.php';
\OC_User::useBackend('persona');
\OCP\Util::connectHook('OC_User', 'post_login', "OCA\\User_persona\\Validator", "postlogin_hook");
\OCP\Util::addScript(self::APP_ID, 'utils');
}
}
示例6:
<?php
/**
* ownCloud - ocDownloader
*
* This file is licensed under the Creative Commons BY-SA License version 3 or
* later. See the COPYING file.
*
* @author Xavier Beurois <www.sgc-univ.net>
* @copyright Xavier Beurois 2015
*/
namespace OCA\ocDownloader\AppInfo;
$l = \OC::$server->getL10N('ocdownloader');
$g = \OC::$server->getURLGenerator();
\OCP\App::addNavigationEntry(['id' => 'ocdownloader', 'order' => 10, 'href' => $g->linkToRoute('ocdownloader.Index.Add'), 'icon' => $g->imagePath('ocdownloader', 'ocdownloader.svg'), 'name' => 'ocDownloader']);
\OCP\App::registerAdmin('ocdownloader', 'settings/admin');
\OCP\App::registerPersonal('ocdownloader', 'settings/personal');
示例7: registerAdminPage
/**
* Registers the admin page
*/
public function registerAdminPage()
{
App::registerAdmin($this->app->getAppName(), 'config/admin');
}
示例8: Application
<?php
namespace OCA\PasswordPolicy\AppInfo;
use OCP\AppFramework\App;
use OCA\PasswordPolicy\Hooks\PasswordPolicyHooks;
use OCA\PasswordPolicy\Appinfo;
use OCA\PasswordPolicy\Appinfo\Application;
\OCP\App::registerAdmin('passwordpolicy', 'admin');
\OCP\App::registerPersonal('passwordpolicy', 'personal');
//\OCP\Util::connectHook('OC_User', 'pre_setPassword', 'OCA\PasswordPolicy\Hooks\PasswordPolicyHooks', 'pre_setPassword');
$app = new Application();
$app->getContainer()->query('PasswordPolicyHooks')->register();
示例9: array
* License as published by the Free Software Foundation; either
* version 3 of the license, or any later version.
*
* 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/>.
*
*/
/**
* @file appinfo/app.php
* @brief Basic registration of app inside ownCloud
* @author Christian Reiner
*/
\OCP\App::registerAdmin('imprint', 'settings');
\OCP\Util::addStyle('imprint', 'reference');
\OCP\Util::addScript('imprint', 'reference');
// add imprint positioning options as meta tags to the html head to avoid additional ajax requests
\OCP\Util::addHeader('meta', array('data-imprint-position-user' => \OCP\Config::getAppValue('imprint', 'position-user', '')));
\OCP\Util::addHeader('meta', array('data-imprint-position-guest' => \OCP\Config::getAppValue('imprint', 'position-guest', '')));
\OCP\Util::addHeader('meta', array('data-imprint-position-login' => \OCP\Config::getAppValue('imprint', 'position-login', '')));
// offer application as standalone entry in the menu?
if ('true' === \OCP\Config::getAppValue('imprint', 'standalone', 'false')) {
// no js required, we add the imprint as a normal app to the navigation
\OCP\App::addNavigationEntry(array('id' => 'imprint', 'order' => 99999, 'href' => \OCP\Util::linkTo('imprint', 'index.php'), 'icon' => \OCP\Util::imagePath('imprint', 'imprint-light.svg'), 'name' => \OCP\Util::getL10N('imprint')->t("Legal notice")));
}
// if
示例10: registerAdmin
/**
* Tells ownCloud to include a template in the admin overview
* @param string $mainPath the path to the main php file without the php
* suffix, relative to your apps directory! not the template directory
* @param string $appName the name of the app, defaults to the current one
*/
public function registerAdmin($mainPath, $appName = null)
{
if ($appName === null) {
$appName = $this->appName;
}
\OCP\App::registerAdmin($appName, $mainPath);
}
示例11:
<?php
/*
* files_zenodo, ownCloud integration to Zenodo (zenodo.org)
*
* Written 2016 by Lars N\xc3\xa6sbye Christensen, DeIC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Load our fileactions script
\OCP\Util::addScript('files_zenodo', 'fileactions');
// Register the panel in Admin settings
\OCP\App::registerAdmin('files_zenodo', 'settings');
示例12: 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::registerAdmin('documents', 'admin');
\OCP\App::registerPersonal('documents', 'personal');
$navigationEntry = function () use($c) {
return ['id' => 'documents_index', 'order' => 2, 'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('documents.document.index'), 'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('documents', 'documents.svg'), 'name' => $c->query('L10N')->t('Documents')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
//Script for registering file actions
$request = \OC::$server->getRequest();
if (isset($request->server['REQUEST_URI'])) {
$url = $request->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
\OCP\Util::addScript('documents', 'viewer/viewer');
}
}
if ($c->query('AppConfig')->isConverterEnabled()) {
$docFilter = new Office(['read' => ['target' => 'application/vnd.oasis.opendocument.text', 'format' => 'odt:writer8', 'extension' => 'odt'], 'write' => ['target' => 'application/msword', 'format' => 'doc', 'extension' => 'doc']]);
示例13:
<?php
/**
* @author Joas Schilling <nickvergessen@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program 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, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
\OCP\App::registerAdmin('popularitycontestclient', 'admin');
\OC::$server->getNotificationManager()->registerNotifier(function () {
return new \OCA\PopularityContestClient\Notifier(\OC::$server->getL10NFactory());
});
示例14:
<?php
/**
* ownCloud - App Template plugin
*
* @author Bernhard Posselt
* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* 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/>.
*
*/
require_once \OC_App::getAppPath('apptemplate_advanced') . '/appinfo/bootstrap.php';
\OCP\App::registerAdmin('apptemplate_advanced', 'admin/settings');
\OCP\App::addNavigationEntry(array('id' => 'apptemplate_advanced', 'order' => 74, 'href' => \OC_Helper::linkToRoute('apptemplate_advanced_index'), 'icon' => \OCP\Util::imagePath('apptemplate_advanced', 'example.png'), 'name' => \OC_L10N::get('apptemplate_advanced')->t('Advanced App Template')));
示例15:
<?php
/**
* ownCloud - impersonate
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Jörn Friedrich Dreyer <jfd@owncloud.com>
* @copyright Jörn Friedrich Dreyer 2015
*/
// --- register settings -----------------------------------------------
\OCP\App::registerAdmin('impersonate', 'settings/admin');