当前位置: 首页>>代码示例>>PHP>>正文


PHP App::registerAdmin方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:amin-hedayati,项目名称:updater,代码行数:34,代码来源:application.php

示例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');
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:10,代码来源:application.php

示例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']);
 }
开发者ID:rafalwojciechowski,项目名称:news,代码行数:11,代码来源:appconfig.php

示例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');
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:14,代码来源:app.php

示例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');
     }
 }
开发者ID:DOM-Digital-Online-Media,项目名称:apps,代码行数:17,代码来源:app.php

示例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');
开发者ID:venjek,项目名称:ocdownloader,代码行数:18,代码来源:app.php

示例7: registerAdminPage

 /**
  * Registers the admin page
  */
 public function registerAdminPage()
 {
     App::registerAdmin($this->app->getAppName(), 'config/admin');
 }
开发者ID:jmeile,项目名称:agreedisclaimer,代码行数:7,代码来源:config.php

示例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();
开发者ID:r2evans,项目名称:passwordpolicy,代码行数:13,代码来源:app.php

示例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
开发者ID:AdamWill,项目名称:apps,代码行数:31,代码来源:app.php

示例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);
 }
开发者ID:loulancn,项目名称:core,代码行数:13,代码来源:api.php

示例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');
开发者ID:deic-dk,项目名称:files_zenodo,代码行数:24,代码来源:app.php

示例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']]);
开发者ID:LukasReschke,项目名称:TestRepoSigning,代码行数:31,代码来源:app.php

示例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());
});
开发者ID:schiessle,项目名称:popularitycontestclient,代码行数:25,代码来源:app.php

示例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')));
开发者ID:netcon-source,项目名称:apps,代码行数:25,代码来源:app.php

示例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');
开发者ID:scolebrook,项目名称:impersonate,代码行数:13,代码来源:app.php


注:本文中的OCP\App::registerAdmin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。