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


PHP App::addNavigationEntry方法代码示例

本文整理汇总了PHP中OCP\App::addNavigationEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP App::addNavigationEntry方法的具体用法?PHP App::addNavigationEntry怎么用?PHP App::addNavigationEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCP\App的用法示例。


在下文中一共展示了App::addNavigationEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

/**
 * ownCloud - passman
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Sander Brand <brantje@gmail.com>
 * @copyright Sander Brand 2014
 */
namespace OCA\Passman\AppInfo;

\OCP\App::registerAdmin('passman', 'admin-settings');
\OCP\App::addNavigationEntry(array('id' => 'passman', 'order' => 10, 'href' => \OCP\Util::linkToRoute('passman.page.index'), 'icon' => \OCP\Util::imagePath('passman', 'app.png'), 'name' => \OC_L10N::get('Passwords')->t('Passwords')));
\OCP\Backgroundjob::registerJob('OCA\\Passman\\Cron\\RunCron');
\OC::$server->getActivityManager()->registerExtension(function () {
    return new \OCA\Passman\Activity();
});
开发者ID:viki53,项目名称:passman,代码行数:19,代码来源:app.php

示例2: App

<?php

use OCP\AppFramework\App;
$app = new App('passwords');
$container = $app->getContainer();
$l = \OCP\Util::getL10N('passwords');
\OCP\App::registerAdmin('passwords', 'templates/admin.settings');
\OCP\App::registerPersonal('passwords', 'templates/personal.settings');
$urlGenerator = $container->query('OCP\\IURLGenerator');
$l10n = $container->query('OCP\\IL10N');
\OCP\App::addNavigationEntry(array('id' => 'passwords', 'order' => 9999, 'href' => $urlGenerator->linkToRoute('passwords.page.index'), 'icon' => $urlGenerator->imagePath('passwords', 'app.svg'), 'name' => $l10n->t('Passwords')));
开发者ID:jbateman3,项目名称:KeePass-ownCloud,代码行数:11,代码来源:app.php

示例3: 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

示例4: Application

<?php

/**
 * owncloud - talk
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Vincent Petry <pvince81@owncloud.com>
 * @copyright Vincent Petry 2014
 */
namespace OCA\Talk\AppInfo;

$app = new Application();
$c = $app->getContainer();
\OCP\App::registerAdmin($c->query('AppName'), 'settings/admin');
\OCP\App::addNavigationEntry(array('id' => 'talk', 'order' => 10, 'href' => \OCP\Util::linkToRoute('talk.page.index'), 'icon' => \OCP\Util::imagePath('talk', 'app.svg'), 'name' => \OC_L10N::get('talk')->t('Talk')));
开发者ID:evaluation-alex,项目名称:talk,代码行数:17,代码来源:app.php

示例5: User_Files_Restore

<?php

/**
 * ownCloud - User Files Restore
 *
 * @author Patrick Paysant <ppaysant@linagora.com>
 * @copyright 2015 CNRS DSI
 * @license This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
 */
namespace OCA\User_Files_Restore;

use OCA\User_Files_Restore\App\User_Files_Restore;
$app = new User_Files_Restore();
$c = $app->getContainer();
/**
 * add navigation
 */
\OCP\App::addNavigationEntry(array('id' => 'user_files_restore', 'order' => 10, 'href' => \OCP\Util::linkToRoute('user_files_restore.page.index'), 'icon' => \OCP\Util::imagePath($c->query('AppName'), 'restoreApp.svg'), 'name' => $c->query('L10N')->t('Restore')));
/**
 * Load js and overlay icon
 */
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () use($c) {
    \OCP\Util::addscript($c->query('AppName'), 'app');
    \OCP\Util::addscript($c->query('AppName'), 'userfilesrestoretabview');
    \OCP\Util::addscript($c->query('AppName'), 'filesplugin');
    \OCP\Util::addStyle($c->query('AppName'), 'restore');
});
开发者ID:ppaysant,项目名称:user_files_restore,代码行数:28,代码来源:app.php

示例6: define

*/
// 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) ) {
	$myHandle = @fopen($myFile,'r');
	if ( $myHandle ) {
		\OCP\DB::beginTransaction();
		$mySQL = <<<EOR
INSERT	INTO *PREFIX*apps2_games_map(game_id,author,map_id,json,jsol)
VALUES	(?,?,?,?,?)
EOR;
开发者ID:ArcherSys,项目名称:ArcherSysOSCloud7,代码行数:31,代码来源:app.php

示例7:

<?php

/**
 * ownCloud - breakout
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Volkan Gezer <volkangezer@gmail.com>
 * @copyright Volkan Gezer 2014
 */
namespace OCA\Breakout\AppInfo;

\OCP\App::addNavigationEntry(array('id' => 'breakout', 'order' => 10, 'href' => \OCP\Util::linkToRoute('breakout.page.index'), 'icon' => \OCP\Util::imagePath('breakout', 'icon_128.png'), 'name' => \OC_L10N::get('breakout')->t('Breakout')));
开发者ID:vgezer,项目名称:breakout,代码行数:14,代码来源:app.php

示例8:

//namespace OCA\GpsTracks\AppInfo;
//use OCP\AppFramework\App;
//
//$app = new App('gpstracks');
//$container = $app->getContainer();
//
//$container->query('OCP\INavigationManager')->add(function () use ($container) {
//	$urlGenerator = $container->query('OCP\IURLGenerator');
//	$l10n = $container->query('OCP\IL10N');
//	return [
//		// the string under which your app will be referenced in owncloud
//		'id' => 'gpstracks',
//
//		// sorting weight for the navigation. The higher the number, the higher
//		// will it be listed in the navigation
//		'order' => 10,
//
//		// the route that will be shown on startup
//		'href' => $urlGenerator->linkToRoute('gpstracks.page.index'),
//
//		// the icon that will be shown in the navigation
//		// this file needs to exist in img/
//		'icon' => $urlGenerator->imagePath('gpstracks', 'app.svg'),
//
//		// the title of your application. This will be used in the
//		// navigation or on the settings page of your app
//		'name' => $l10n->t('Gps Tracks'),
//	];
//});
\OCP\App::addNavigationEntry(['id' => 'gpstracks', 'order' => 10, 'href' => \OCP\Util::linkToRoute('gpstracks.page.index'), 'icon' => \OCP\Util::imagePath('gpstracks', 'app.svg'), 'name' => \OC_L10N::get('gpstracks')->t('Gps Tracks')]);
开发者ID:sken2,项目名称:oc_gpstracks,代码行数:30,代码来源:app.php

示例9:

<?php

/**
 * ownCloud - ExifView
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author shi <shi@example.com>
 * @copyright shi 2015
 */
namespace OCA\ExifView\AppInfo;

\OCP\App::addNavigationEntry(['id' => 'binder', 'order' => 10, 'href' => \OCP\Util::linkToRoute('exifview.page.index'), 'icon' => \OCP\Util::imagePath('exifview', 'app.svg'), 'name' => \OC_L10N::get('exifview')->t('ExifView')]);
开发者ID:sken2,项目名称:oc_exifview,代码行数:14,代码来源:app.php

示例10:

<?php

/**
 * ownCloud - weather
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Loic Blot <loic.blot@unix-experience.fr>
 * @copyright Loic Blot 2015
 */
namespace OCA\Weather\AppInfo;

if (class_exists('\\OCP\\AppFramework\\App')) {
    \OCP\App::addNavigationEntry(array('id' => 'weather', 'order' => 10, 'href' => \OCP\Util::linkToRoute('weather.city.index'), 'icon' => \OCP\Util::imagePath('weather', 'app-icon.png'), 'name' => \OCP\Util::getL10N('weather')->t('Weather')));
} else {
    $msg = 'Can not enable the OwnBoard app because the App Framework App is disabled';
    \OCP\Util::writeLog('weather', $msg, \OCP\Util::ERROR);
}
开发者ID:nerzhul,项目名称:owncloud-weather,代码行数:19,代码来源:app.php

示例11: getServiceUrl

    // config key to store Url of the hosted Etherpad service
    const CONFIG_ETHERPAD_URL = 'etherpad_url';
    // Default value for Url of the hosted Etherpad service
    const CONFIG_ETHERPAD_URL_DEFAULT = 'http://beta.etherpad.org/p/';
    // Url of the hosted Etherpad solution
    const CONFIG_USERNAME = 'etherpad_username';
    const ERROR_URL_INVALID = 'invalid URL';
    const ERROR_USERNAME_INVALID = 'invalid username';
    public static function getServiceUrl()
    {
        return self::getValue(self::CONFIG_ETHERPAD_URL, self::CONFIG_ETHERPAD_URL_DEFAULT);
    }
    public static function setServiceUrl($url)
    {
        return \OCP\Config::setUserValue(\OCP\User::getUser(), self::APP_ID, self::CONFIG_ETHERPAD_URL, $url);
    }
    public static function getUsername()
    {
        return self::getValue(self::CONFIG_USERNAME, \OCP\User::getUser());
    }
    public static function setUsername($username)
    {
        return \OCP\Config::setUserValue(\OCP\User::getUser(), self::APP_ID, self::CONFIG_USERNAME, $username);
    }
    protected static function getValue($key, $defaultValue)
    {
        return \OCP\Config::getUserValue(\OCP\User::getUser(), self::APP_ID, $key, $defaultValue);
    }
}
\OCP\App::addNavigationEntry(array('id' => 'ownpad_lite_index', 'order' => 90, 'href' => \OCP\Util::linkTo(App::APP_ID, 'index.php'), 'icon' => \OCP\Util::imagePath('settings', 'users.svg'), 'name' => \OC_L10N::get(App::APP_ID)->t('My pad')));
开发者ID:netcon-source,项目名称:apps,代码行数:30,代码来源:app.php

示例12:

<?php

/**
 * ownCloud - gitviewer
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author var Eggertsson <aevar@eggertsson.org>
 * @copyright var Eggertsson 2015
 */
namespace OCA\GitViewer\AppInfo;

\OCP\App::addNavigationEntry(['id' => 'gitviewer', 'order' => 10, 'href' => \OCP\Util::linkTo('gitviewer', 'index.php'), 'icon' => \OCP\Util::imagePath('gitviewer', 'app.svg'), 'name' => \OC_L10N::get('gitviewer')->t('Git Viewer')]);
开发者ID:aevare,项目名称:gitviewer,代码行数:14,代码来源:app.php

示例13:

 * 
 * This file is part of oclife.
 * 
 * oclife is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * oclife 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 General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with oclife.  If not, see <http://www.gnu.org/licenses/>.
 */
\OCP\App::addNavigationEntry(array('id' => 'oclife', 'order' => 10, 'href' => \OCP\Util::linkToRoute('oclife_index'), 'icon' => \OCP\Util::imagePath('oclife', 'nav-icon.svg'), 'name' => 'Tags'));
// Handle translations
//$l = new \OC_L10N('oclife');
$l = \OCP\Util::getL10N('oclife');
// Add what's needed by TagManager
\OCP\Util::addStyle('oclife', 'bootstrap-tokenfield');
\OCP\Util::addStyle('oclife', 'oclife_fileInfo');
\OCP\Util::addScript('oclife', 'bootstrap-tokenfield/bootstrap-tokenfield');
\OCP\Util::addScript('oclife', 'bootstrap-tokenfield/typeahead.bundle');
\OCP\Util::addScript('oclife', 'bootstrap-tokenfield/affix');
\OCP\App::registerAdmin('oclife', 'settings');
\OCP\Util::addscript('oclife', 'oclife/oclife_fileExtendedInfo');
// Register filesystem hooks to remove thumbnails and tags DB entries
\OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\\OCLife\\utilities', 'cleanupForDelete');
\OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\\OCLife\\utilities', 'cleanupForRename');
开发者ID:Greenworker,项目名称:oclife,代码行数:31,代码来源:app.php

示例14:

<?php

/**
 * ownCloud - Secure Container
 *
 * @author Lukas Zurschmiede
 * @copyright 2014 Lukas Zurschmiede <l.zurschmiede@ranta.ch>
 *
 * 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/>.
 */
namespace OCA\secure_container\AppInfo;

\OCP\App::addNavigationEntry(array('id' => 'secure_container', 'order' => 10, 'href' => \OCP\Util::linkToRoute('secure_container.page.index'), 'icon' => \OCP\Util::imagePath('secure_container', 'app.svg'), 'name' => \OC_L10N::get('secure_container')->t('Secure Container')));
开发者ID:kjuanman,项目名称:oc_SecureContainer,代码行数:24,代码来源:app.php

示例15: addNavigationEntry

 /**
  * Creates a new navigation entry
  * @param array $entry containing: id, name, order, icon and href key
  */
 public function addNavigationEntry(array $entry)
 {
     \OCP\App::addNavigationEntry($entry);
 }
开发者ID:hjimmy,项目名称:owncloud,代码行数:8,代码来源:api.php


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