本文整理汇总了PHP中PFApplicationHelper::itemRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP PFApplicationHelper::itemRoute方法的具体用法?PHP PFApplicationHelper::itemRoute怎么用?PHP PFApplicationHelper::itemRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFApplicationHelper
的用法示例。
在下文中一共展示了PFApplicationHelper::itemRoute方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getUserRoute
/**
* Creates a link to a user item view
*
* @param string $id The user slug
*
* @return string $link The link
*/
public static function getUserRoute($id)
{
static $dest = null;
if (is_null($dest)) {
$params = JComponentHelper::getParams('com_projectfork');
$dest = $params->get('user_profile_link');
}
$link = null;
switch ($dest) {
case 'cb':
$link = self::getCBRoute($id);
break;
case 'js':
$link = self::getJSRoute($id);
break;
case 'kunena':
$link = self::getKRoute($id);
break;
}
if (!empty($link)) {
return $link;
}
// Default - Projectfork Profile
$link = 'index.php?option=com_pfusers&view=user';
$link .= '&id=' . $id;
$needles = array('id' => array((int) $id));
if ($item = PFApplicationHelper::itemRoute($needles, 'com_pfusers.user')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pfusers.users')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例3: getProjectsRoute
/**
* Creates a link to the projects overview
*
* @return string $link The link
*/
public static function getProjectsRoute()
{
$link = 'index.php?option=com_pfprojects&view=projects';
if ($item = PFApplicationHelper::itemRoute(null, 'com_pfprojects.projects')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例4: getProjectEditRoute
public static function getProjectEditRoute($project)
{
$link = 'index.php?option=com_pfprojects&task=form.edit&id=' . $project;
if ($item = PFApplicationHelper::itemRoute(null, 'com_pfprojects.form')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pfprojects.projects')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例5: getAlbumsRoute
/**
* Creates a link to the albums overview
*
* @return string $link The link
*/
public static function getAlbumsRoute($project = '')
{
$link = 'index.php?option=com_pfdesigns&view=albums';
if ($project) {
$link .= '&filter_project=' . $project;
}
if ($item = PFApplicationHelper::itemRoute(null, 'com_pfdesigns.albums')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例6: getMilestoneRoute
/**
* Creates a link to a milestone item view
*
* @param string $id The milestone slug
* @param string $project The project slug. Optional
*
* @return string $link The link
*/
public static function getMilestoneRoute($id, $project = '')
{
$link = 'index.php?option=com_pfmilestones&view=milestone&filter_project=' . $project . '&id=' . $id;
$needles = array('id' => array((int) $id));
if ($item = PFApplicationHelper::itemRoute($needles, 'com_pfmilestones.milestone')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pfmilestones.milestones')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例7: getTimesheetRoute
/**
* Creates a link to the timesheet overview
*
* @param string $project The project slug. Optional
*
* @return string $link The link
*/
public static function getTimesheetRoute($project = '')
{
$link = 'index.php?option=com_pftime&view=timesheet';
$link .= '&filter_project=' . $project;
$needles = array('filter_project' => array((int) $project));
if ($item = PFApplicationHelper::itemRoute($needles, 'com_pftime.timesheet')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pftime.timesheet')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例8: getRepliesRoute
/**
* Creates a link to a topic item view
*
* @param string $id The topic slug
* @param string $project The project slug. Optional
*
* @return string $link The link
*/
public static function getRepliesRoute($id, $project = '')
{
$link = 'index.php?option=com_pfforum&view=replies';
$link .= '&filter_project=' . $project;
$link .= '&filter_topic=' . $id;
$needles = array('id' => array((int) $id));
if ($item = PFApplicationHelper::itemRoute($needles, 'com_pfforum.topics')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pfforum.topics')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例9: getTaskRoute
/**
* Creates a link to a task item view
*
* @param string $id The task slug
* @param string $project The project slug. Optional
* @param string $milestone The milestone slug. Optional
* @param string $list The list slug. Optional
*
* @return string $link The link
*/
public static function getTaskRoute($id, $project = '', $milestone = '', $list = '')
{
$link = 'index.php?option=com_pftasks&view=task';
$link .= '&filter_project=' . $project;
$link .= '&filter_milestone=' . $milestone;
$link .= '&filter_tasklist=' . $list;
$link .= '&id=' . $id;
$needles = array('id' => array((int) $id));
if ($item = PFApplicationHelper::itemRoute($needles, 'com_pftasks.task')) {
$link .= '&Itemid=' . $item;
} elseif ($item = PFApplicationHelper::itemRoute(null, 'com_pftasks.tasks')) {
$link .= '&Itemid=' . $item;
}
return $link;
}
示例10: 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;
}
示例11: getNoteRevisionsRoute
/**
* Creates a link to a note revision list
*
* @param string $note The note slug
* @param string $project The project slug. Optional
* @param string $dir The directory slug. Optional
* @param string $path The full directory path. Optional
*
*
* @return string $link The link
*/
public static function getNoteRevisionsRoute($note, $project = '', $dir = '', $path = '')
{
$path = self::getRepositoryPath($project, $path);
$link = 'index.php?option=com_pfrepo&view=noterevisions';
$link .= '&filter_project=' . $project;
$link .= '&filter_parent_id=' . $dir;
$link .= '&path=' . $path;
$link .= '&id=' . $note;
$item = PFApplicationHelper::itemRoute(null, 'com_pfrepo.repository');
if ($item) {
$link .= '&Itemid=' . $item;
}
return $link;
}