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


PHP Project::hasClient方法代码示例

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


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

示例1: populateBreadcrumbs

 public static function populateBreadcrumbs()
 {
     $childbreadcrumbs = array();
     if (self::$_selected_project instanceof Project) {
         $t = self::$_selected_project;
         $hierarchy_breadcrumbs = array();
         $projects_processed = array();
         while ($t instanceof Project) {
             if (array_key_exists($t->getKey(), $projects_processed)) {
                 // We have a cyclic dependency! Oh no!
                 // If this happens, throw an exception
                 throw new \Exception(self::geti18n()->__('A loop has been found in the project heirarchy. Go to project configuration, and alter the subproject setting for this project so that this project is not a subproject of one which is a subproject of this one.'));
             }
             $projects_processed[$t->getKey()] = $t;
             $itemsubmenulinks = self::getResponse()->getPredefinedBreadcrumbLinks('project_summary', $t);
             if ($t->hasChildren()) {
                 $itemsubmenulinks[] = array('separator' => true);
                 foreach ($t->getChildren() as $child) {
                     if (!$child->hasAccess()) {
                         continue;
                     }
                     $itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName());
                 }
             }
             $hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks);
             if ($t->hasParent()) {
                 $parent = $t->getParent();
                 $t = $t->getParent();
             } else {
                 $t = null;
             }
         }
         if (self::$_selected_project->hasClient()) {
             self::setCurrentClient(self::$_selected_project->getClient());
         }
         if (mb_strtolower(Settings::getSiteHeaderName()) != mb_strtolower(self::$_selected_project->getName()) || self::isClientContext()) {
             self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), self::getRouting()->generate('home'), self::getResponse()->getPredefinedBreadcrumbLinks('main_links', self::$_selected_project));
             if (self::isClientContext()) {
                 self::getResponse()->addBreadcrumb(self::getCurrentClient()->getName(), self::getRouting()->generate('client_dashboard', array('client_id' => self::getCurrentClient()->getID())), self::getResponse()->getPredefinedBreadcrumbLinks('client_list'));
             }
         }
         // Add root breadcrumb first, so reverse order
         $hierarchy_breadcrumbs = array_reverse($hierarchy_breadcrumbs);
         foreach ($hierarchy_breadcrumbs as $breadcrumb) {
             $class = null;
             if ($breadcrumb[0]->getKey() == self::getCurrentProject()->getKey()) {
                 $class = 'selected_project';
             }
             self::getResponse()->addBreadcrumb($breadcrumb[0]->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => $breadcrumb[0]->getKey())), $breadcrumb[1], $class);
         }
     } else {
         self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), self::getRouting()->generate('home'), self::getResponse()->getPredefinedBreadcrumbLinks('main_links'));
     }
 }
开发者ID:JonathanRH,项目名称:thebuggenie,代码行数:54,代码来源:Context.php

示例2: populateBreadcrumbs

 public static function populateBreadcrumbs()
 {
     $childbreadcrumbs = array();
     if (self::$_selected_project instanceof Project) {
         $t = self::$_selected_project;
         $hierarchy_breadcrumbs = array();
         $projects_processed = array();
         while ($t instanceof Project) {
             if (array_key_exists($t->getKey(), $projects_processed)) {
                 // We have a cyclic dependency! Oh no!
                 // If this happens, throw an exception
                 throw new \Exception(self::geti18n()->__('A loop has been found in the project heirarchy. Go to project configuration, and alter the subproject setting for this project so that this project is not a subproject of one which is a subproject of this one.'));
             } else {
                 $all_projects = array_merge(Project::getAllRootProjects(true), Project::getAllRootProjects(false));
                 // If this is a root project, display a list of other root projects, then t is null
                 if (!$t->hasParent() && count($all_projects) > 1) {
                     $itemsubmenulinks = array();
                     foreach ($all_projects as $child) {
                         if (!$child->hasAccess()) {
                             continue;
                         }
                         $itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName());
                     }
                     $hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks);
                     $projects_processed[$t->getKey()] = $t;
                     $t = null;
                     continue;
                 } elseif (!$t->hasParent()) {
                     $hierarchy_breadcrumbs[] = array($t, null);
                     $projects_processed[$t->getKey()] = $t;
                     $t = null;
                     continue;
                 } else {
                     // What we want to do here is to build a list of the children of the parent unless we are the only one
                     $parent = $t->getParent();
                     $children = $parent->getChildren();
                     $itemsubmenulinks = null;
                     if ($parent->hasChildren() && count($children) > 1) {
                         $itemsubmenulinks = array();
                         foreach ($children as $child) {
                             if (!$child->hasAccess()) {
                                 continue;
                             }
                             $itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName());
                         }
                     }
                     $hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks);
                     $projects_processed[$t->getKey()] = $t;
                     $t = $parent;
                     continue;
                 }
             }
         }
         $clientsubmenulinks = null;
         if (self::$_selected_project->hasClient()) {
             $clientsubmenulinks = array();
             foreach (Client::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 (mb_strtolower(Settings::getSiteHeaderName()) != mb_strtolower(self::$_selected_project->getName()) || self::isClientContext()) {
             self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), 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);
             }
         }
         // Add root breadcrumb first, so reverse order
         $hierarchy_breadcrumbs = array_reverse($hierarchy_breadcrumbs);
         foreach ($hierarchy_breadcrumbs as $breadcrumb) {
             $class = null;
             if ($breadcrumb[0]->getKey() == self::getCurrentProject()->getKey()) {
                 $class = 'selected_project';
             }
             self::getResponse()->addBreadcrumb($breadcrumb[0]->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => $breadcrumb[0]->getKey())), $breadcrumb[1], $class);
         }
     } else {
         self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), self::getRouting()->generate('home'));
     }
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:82,代码来源:Context.php


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