本文整理汇总了PHP中OCP\App::setActiveNavigationEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP App::setActiveNavigationEntry方法的具体用法?PHP App::setActiveNavigationEntry怎么用?PHP App::setActiveNavigationEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\App
的用法示例。
在下文中一共展示了App::setActiveNavigationEntry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('pdflintview');
\OCP\App::setActiveNavigationEntry( 'pdflintview' );
\OCP\Util::addScript('pdflintview', 'ajaxaggregator');
?>
示例2:
* 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\Documents;
\OCP\User::checkLoggedIn();
\OCP\JSON::checkAppEnabled('documents');
\OCP\App::setActiveNavigationEntry('documents_index');
\OCP\Util::addStyle('documents', 'style');
\OCP\Util::addStyle('documents', '3rdparty/webodf/dojo-app');
\OCP\Util::addScript('documents', 'documents');
\OCP\Util::addScript('files', 'file-upload');
\OCP\Util::addScript('files', 'jquery.iframe-transport');
\OCP\Util::addScript('files', 'jquery.fileupload');
$tmpl = new \OCP\Template('documents', 'documents', 'user');
$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', true);
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
$tmpl->assign('enable_previews', $previewsEnabled);
$tmpl->assign('useUnstable', $unstable);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
示例3: pieces
<?php namespace apps2_games;
/**
* @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
*/
// Main -> fired by ownCloud via appinfo/app.php
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled(K_APP_NAME);
\OCP\App::setActiveNavigationEntry(K_APP_NAME);
//
$myJSON =<<<EOJ
[
{"id":"minesweeper"
,"js":"g/jsminesweeper/JsMinesweeper.html"
,"caption":"Mine Sweeper"
,"ico":"img/minesweeper.png"
,"title":"Minesweeper is a small naval warship designed to engage in minesweeping.<br>By using various mechanisms intended to counter the threat posed by naval mines, minesweepers keep waterways clear for shipping."
},{"id":"titactoe"
,"js":"g/tictactoe/tictactoe.html"
,"caption":"Tic-Tac-Toe"
,"ico":"img/tictactoe.png"
,"title":"Tic-tac-toe (or Noughts and crosses, Xs and Os, Terni Lapilli) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3\u00d73 grid.<br>The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game."
},{"id":"fiveInRow"
,"js":"g/fiveInRow/fir.html"
,"caption":"Five in Row"
,"ico":"img/FiR.jpg"
,"title":"Traditionally played with Go pieces (black and white stones) on a go board with 19\u00d719 intersections.<br>User plays first, then players alternate in placing a mark of their own on an empty place. The winner is the first player to get an unbroken row of five marks horizontally, vertically, or diagonally."
示例4: activateNavigationEntry
/**
* Sets the current navigation entry to the currently running app
*/
public function activateNavigationEntry()
{
\OCP\App::setActiveNavigationEntry($this->appName);
}
示例5:
* 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/>.
*
*/
/**
* @file index.php
* This is the apps central view
* @access public
* @author Christian Reiner
*/
// Session checks
\OCP\App::checkAppEnabled('imprint');
\OCP\Util::addScript('imprint', 'content');
\OCP\App::setActiveNavigationEntry('imprint');
\OCP\Util::addStyle('imprint', 'reference');
// prepare view
$tmpl_view = \OCP\User::isLoggedIn() ? 'user' : 'guest';
// fetch content
$tmpl = new \OCP\Template('imprint', 'tmpl_index', $tmpl_view);
// render template
$tmpl->printPage();
示例6: array
<?php
// Look up other security checks in the docs!
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('ocDashboard');
\OCP\App::setActiveNavigationEntry('ocDashboard');
OCP\Util::addscript('ocDashboard', 'ocDashboard');
OCP\Util::addscript('ocDashboard', 'ajaxService');
OCP\Util::addStyle('ocDashboard', 'ocDashboard');
$user = OCP\User::getUser();
$w = array();
OC::$CLASSPATH['ocdWidgets'] = 'ocDashboard/appinfo/widgetConfigs.php';
OC::$CLASSPATH['ocdFactory'] = 'ocDashboard/lib/factory.php';
foreach (ocdWidgets::$widgets as $widget) {
// if widget is enabled
if (OCP\Config::getUserValue($user, "ocDashboard", "ocDashboard_" . $widget['id']) == "yes") {
$w[] = ocdFactory::getWidget($widget)->getData();
}
}
//if all deactivated
if (empty($w)) {
$l = new OC_L10N('ocDashboard');
$w[0]['error'] = "You can configure this site in your personal settings.";
$w[0]['id'] = "none";
$w[0]['name'] = "";
$w[0]['status'] = "3";
$w[0]['interval'] = "0";
$w[0]['icon'] = "";
}
$tpl = new OCP\Template("ocDashboard", "main", "user");
$tpl->assign('widgets', $w);
示例7:
* 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/>.
*
*/
// check if the user has the right permissions to access the activities
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('activity');
// activate the right navigation entry
\OCP\App::setActiveNavigationEntry('activity');
// load the needed js scripts and css
\OCP\Util::addScript('activity', 'script');
\OCP\Util::addStyle('activity', 'style');
$navigation = new \OCA\Activity\Navigation(\OCP\Util::getL10N('activity'), \OC::$server->getActivityManager(), \OC::$server->getURLGenerator());
$navigation->setRSSToken(\OCP\Config::getUserValue(\OCP\User::getUser(), 'activity', 'rsstoken'));
// get the page that is requested. Needed for endless scrolling
$data = new \OCA\Activity\Data(\OC::$server->getActivityManager());
$page = $data->getPageFromParam() - 1;
$filter = $data->getFilterFromParam();
// show activity template
$tmpl = new \OCP\Template('activity', 'list', 'user');
$tmpl->assign('filter', $filter);
$tmpl->assign('appNavigation', $navigation->getTemplate($filter));
$tmpl->printPage();
示例8: VideosManager
*
* 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/>.
*
*/
namespace OCA\Videos;
\OCP\User::checkLoggedIn();
\OCP\JSON::checkAppEnabled('videos');
\OCP\App::setActiveNavigationEntry('videos_index');
\OCP\Util::addStyle('videos', 'style');
\OCP\Util::addScript('videos', 'app');
\OCP\Util::addScript('videos/3rdparty', 'masonry.pkgd');
\OCP\Util::addStyle('files_videoviewer', 'style');
\OCP\Util::addStyle('files_videoviewer', 'mediaelementplayer');
\OCP\Util::addscript('files_videoviewer', 'viewer');
$manager = new VideosManager();
$videos = $manager->getVideos();
$tmpl = new \OCP\Template('videos', 'videos', 'user');
$tmpl->assign('videos', $videos);
$tmpl->printPage();