本文整理汇总了PHP中TBGContext::_selected_project方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::_selected_project方法的具体用法?PHP TBGContext::_selected_project怎么用?PHP TBGContext::_selected_project使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGContext
的用法示例。
在下文中一共展示了TBGContext::_selected_project方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCurrentProject
/**
* Set the currently selected project
*
* @param TBGProject $project The project, or null if none
*/
public static function setCurrentProject($project)
{
self::getResponse()->setBreadcrumb(null);
self::$_selected_project = $project;
if ($project instanceof TBGProject) {
$projectsubmenulinks = null;
$clientsubmenulinks = null;
if (count(TBGProject::getAll()) > 1) {
$projectsubmenulinks = array();
foreach (TBGProject::getAll() as $existing_project) {
if (!$project->hasClient() || $existing_project->hasClient() && $project->getClient()->getID() == $existing_project->getClient()->getID()) {
$projectsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $existing_project->getKey())), 'title' => $existing_project->getName());
}
}
}
if (self::$_selected_project->hasClient()) {
$clientsubmenulinks = array();
foreach (TBGClient::getAll() as $client) {
if ($client->hasAccess()) {
$clientsubmenulinks[] = array('url' => self::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName());
}
}
self::setCurrentClient(self::$_selected_project->getClient());
}
if (strtolower(TBGSettings::getTBGname()) != strtolower($project->getName()) || self::isClientContext()) {
self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home'));
if (self::isClientContext()) {
self::getResponse()->addBreadcrumb(self::getCurrentClient()->getName(), self::getRouting()->generate('client_dashboard', array('client_id' => self::getCurrentClient()->getID())), $clientsubmenulinks);
}
}
self::getResponse()->addBreadcrumb($project->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => TBGContext::getCurrentProject()->getKey())), $projectsubmenulinks, 'selected_project');
} else {
self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home'));
}
}
示例2: setCurrentProject
/**
* Set the currently selected project
*
* @param TBGProject $project The project, or null if none
*/
public static function setCurrentProject($project)
{
self::getResponse()->setBreadcrumb(null);
self::$_selected_project = $project;
}