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


PHP umiHierarchy::getElement方法代碼示例

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


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

示例1: systemWhoLocked

 public function systemWhoLocked($element_id)
 {
     $ePage = umiHierarchy::getElement($element_id);
     $oPage = $ePage->getObject();
     return $oPage->getValue("lock_user");
 }
開發者ID:BGCX261,項目名稱:zimmerli-svn-to-git,代碼行數:6,代碼來源:__admin.php

示例2: placeComments

 /**
  * @desc
  */
 private function placeComments($parentId, $templateString, umiHierarchy $hierarchy, $commentHType, &$total)
 {
     static $postHType = 0;
     if (!$postHType) {
         $postHType = umiHierarchyTypesCollection::getInstance()->getTypeByName('blogs20', 'post')->getId();
     }
     $parent = $hierarchy->getElement($parentId, true);
     if (!$parent instanceof umiHierarchyElement) {
         throw new publicException("Unknown parent element for comments");
     }
     $rootComments = $parent->getTypeId() == $postHType;
     $sel = new selector('pages');
     $sel->where('hierarchy')->page($parentId)->childs(1);
     $sel->types('hierarchy-type')->id($commentHType);
     $sel->where('is_spam')->notequals(1);
     if ($rootComments) {
         $page = (int) getRequest('p');
         $sel->limit($page * $this->comments_per_page, $this->comments_per_page);
     }
     $result = $sel->result();
     $total = $sel->length();
     $aLines = array();
     foreach ($result as $oComment) {
         $commentId = $oComment->getId();
         $temp = 0;
         $pubTime = $oComment->getValue('publish_time');
         $aLineParam = array();
         $aLineParam['attribute:cid'] = $commentId;
         $aLineParam['name'] = $oComment->getName();
         $aLineParam['content'] = $this->prepareContent($oComment->getValue('content'));
         $aLineParam['author_id'] = $oComment->getValue('author_id');
         $aLineParam['publish_time'] = $pubTime instanceof umiDate ? $pubTime->getFormattedDate('U') : time();
         $aLineParam['subnodes:subcomments'] = $this->placeComments($commentId, $templateString, $hierarchy, $commentHType, $temp);
         $aLines[] = self::parseTemplate($templateString, $aLineParam, $commentId);
     }
     return $aLines;
 }
開發者ID:BGCX261,項目名稱:zimmerli-svn-to-git,代碼行數:40,代碼來源:class.php


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