當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KunenaForumCategoryHelper::getOrphaned方法代碼示例

本文整理匯總了PHP中KunenaForumCategoryHelper::getOrphaned方法的典型用法代碼示例。如果您正苦於以下問題:PHP KunenaForumCategoryHelper::getOrphaned方法的具體用法?PHP KunenaForumCategoryHelper::getOrphaned怎麽用?PHP KunenaForumCategoryHelper::getOrphaned使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KunenaForumCategoryHelper的用法示例。


在下文中一共展示了KunenaForumCategoryHelper::getOrphaned方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAdminCategories

 public function getAdminCategories()
 {
     if ($this->_admincategories === false) {
         $params = array('ordering' => $this->getState('list.ordering'), 'direction' => $this->getState('list.direction') == 'asc' ? 1 : -1, 'search' => $this->getState('filter.search'), 'unpublished' => 1, 'published' => $this->getState('filter.published'), 'filter_title' => $this->getState('filter.title'), 'filter_type' => $this->getState('filter.type'), 'filter_access' => $this->getState('filter.access'), 'filter_locked' => $this->getState('filter.locked'), 'filter_allow_polls' => $this->getState('filter.allow_polls'), 'filter_review' => $this->getState('filter.review'), 'filter_anonymous' => $this->getState('filter.anonymous'), 'action' => 'admin');
         $catid = $this->getState('item.id', 0);
         $categories = array();
         $orphans = array();
         if ($catid) {
             $categories = KunenaForumCategoryHelper::getParents($catid, $this->getState('filter.levels'), array('unpublished' => 1, 'action' => 'none'));
             $categories[] = KunenaForumCategoryHelper::get($catid);
         } else {
             $orphans = KunenaForumCategoryHelper::getOrphaned($this->getState('filter.levels'), $params);
         }
         $categories = array_merge($categories, KunenaForumCategoryHelper::getChildren($catid, $this->getState('filter.levels'), $params));
         $categories = array_merge($orphans, $categories);
         $categories = KunenaForumCategoryHelper::getIndentation($categories);
         $this->setState('list.total', count($categories));
         if ($this->getState('list.limit')) {
             $this->_admincategories = array_slice($categories, $this->getState('list.start'), $this->getState('list.limit'));
         } else {
             $this->_admincategories = $categories;
         }
         $admin = 0;
         $acl = KunenaAccess::getInstance();
         /** @var KunenaForumCategory $category */
         foreach ($this->_admincategories as $category) {
             // TODO: Following is needed for J!2.5 only:
             $parent = $category->getParent();
             $siblings = array_keys(KunenaForumCategoryHelper::getCategoryTree($category->parent_id));
             $category->up = $this->me->isAdmin($parent) && reset($siblings) != $category->id;
             $category->down = $this->me->isAdmin($parent) && end($siblings) != $category->id;
             $category->reorder = $this->me->isAdmin($parent);
             // Get ACL groups for the category.
             $access = $acl->getCategoryAccess($category);
             $category->accessname = array();
             foreach ($access as $item) {
                 $category->accessname[] = $item['title'];
             }
             $category->accessname = implode(' / ', $category->accessname);
             // Checkout?
             if ($this->me->isAdmin($category) && $category->isCheckedOut(0)) {
                 $category->editor = KunenaFactory::getUser($category->checked_out)->getName();
             } else {
                 $category->checked_out = 0;
                 $category->editor = '';
             }
             $admin += $this->me->isAdmin($category);
         }
         $this->setState('list.count.admin', $admin);
     }
     if (!empty($orphans)) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_CATEGORY_ORPHAN_DESC'), 'notice');
     }
     return $this->_admincategories;
 }
開發者ID:proyectoseb,項目名稱:University,代碼行數:55,代碼來源:categories.php


注:本文中的KunenaForumCategoryHelper::getOrphaned方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。