本文整理汇总了PHP中PFApplicationHelper::getActiveMenuItemId方法的典型用法代码示例。如果您正苦于以下问题:PHP PFApplicationHelper::getActiveMenuItemId方法的具体用法?PHP PFApplicationHelper::getActiveMenuItemId怎么用?PHP PFApplicationHelper::getActiveMenuItemId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFApplicationHelper
的用法示例。
在下文中一共展示了PFApplicationHelper::getActiveMenuItemId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMilestoneRoute
/**
* Creates a link to a milestone item view
*
* @param string $milestone_slug The milestone slug
* @param string $project_slug The project slug. Optional
*
* @return string $link The link
*/
public static function getMilestoneRoute($milestone_slug, $project_slug = '')
{
if (!$project_slug) {
$project_slug = PFApplicationHelper::getActiveProjectId();
}
$link = 'index.php?option=com_pfmilestones&view=milestone&filter_project=' . $project_slug . '&id=' . $milestone_slug;
// Get the id from the slug
if (strrpos($milestone_slug, ':') !== false) {
$slug_parts = explode(':', $milestone_slug);
$milestone_id = (int) $slug_parts[0];
} else {
$milestone_id = (int) $milestone_slug;
}
$needles = array('id' => array($milestone_slug));
$item = PFApplicationHelper::itemRoute($needles, 'com_pfmilestones.milestone');
if (!$item) {
$app = JFactory::getApplication();
// Stay on current menu item if we are viewing a milestone list
if ($app->input->get('option') == 'com_pfmilestones' && $app->input->get('view') == 'milestones') {
$item = PFApplicationHelper::getActiveMenuItemId();
} else {
// Find overview menu item
$item = PFApplicationHelper::itemRoute(null, 'com_pfmilestones.milestones');
}
}
if ($item) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例2: getProjectEditRoute
/**
* Creates a link to the project form
*
* @param string $project_slug The project slug. Optional
*
* @return string $link The link
*/
public static function getProjectEditRoute($project_slug = '')
{
$link = 'index.php?option=com_pfprojects&task=form.edit&id=' . $project_slug;
// Get the form menu item
$item = PFApplicationHelper::itemRoute(null, 'com_pfprojects.form');
if (!$item) {
$app = JFactory::getApplication();
// Stay on current menu item if we are viewing a project list
if ($app->input->get('option') == 'com_pfprojects' && $app->input->get('view') == 'projects') {
$item = PFApplicationHelper::getActiveMenuItemId();
} else {
// Find overview menu item
$item = PFApplicationHelper::itemRoute(null, 'com_pfprojects.projects');
}
}
if ($item) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例3: defined
* @package pkg_projectfork
* @subpackage com_pfprojects
*
* @author Tobias Kuhn (eaxs)
* @copyright Copyright (C) 2006-2016 Tobias Kuhn. All rights reserved.
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL, see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('pfhtml.script.listform');
$list_order = $this->escape($this->state->get('list.ordering'));
$list_dir = $this->escape($this->state->get('list.direction'));
$user = JFactory::getUser();
$app = JFactory::getApplication();
$nulldate = JFactory::getDbo()->getNullDate();
$uid = $user->get('id');
$itemid = PFApplicationHelper::getActiveMenuItemId();
$filter_in = $this->state->get('filter.isset') ? 'in ' : '';
$milestones_enabled = PFApplicationHelper::enabled('com_pfmilestones');
$tasks_enabled = PFApplicationHelper::enabled('com_pftasks');
$time_enabled = PFApplicationHelper::enabled('com_pftime');
$repo_enabled = PFApplicationHelper::enabled('com_pfrepo');
$forum_enabled = PFApplicationHelper::enabled('com_pfforum');
$users_enabled = PFApplicationHelper::enabled('com_pfusers');
$cmnts_enabled = PFApplicationHelper::enabled('com_pfcomments');
$is_ssl = JFactory::getURI()->isSSL();
$list_url = PFprojectsHelperRoute::getProjectsRoute($this->params->get('filter_category'), $itemid);
$return_url = base64_encode($list_url);
$print_url = $list_url . '&tmpl=component&layout=print';
$print_opt = 'width=1024,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no';
?>
<div id="projectfork" class="category-list<?php