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


PHP WebPage::GetStartCollapsibleSection方法代碼示例

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


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

示例1: GetRenderContent

 public function GetRenderContent(WebPage $oPage, $aExtraParams = array(), $sId)
 {
     $sHtml = '';
     $bTruncated = false;
     $oSet = new CMDBObjectSet($this->m_oFilter, array('date' => false));
     if ($this->iLimitStart > 0 || $this->iLimitCount > 0) {
         $oSet->SetLimit($this->iLimitCount, $this->iLimitStart);
         if ($this->iLimitCount - $this->iLimitStart < $oSet->Count()) {
             $bTruncated = true;
         }
     }
     $sHtml .= "<!-- filter: " . $this->m_oFilter->ToOQL() . "-->\n";
     switch ($this->m_sStyle) {
         case 'toggle':
             // First the latest change that the user is allowed to see
             do {
                 $oLatestChangeOp = $oSet->Fetch();
             } while (is_object($oLatestChangeOp) && $oLatestChangeOp->GetDescription() == '');
             if (is_object($oLatestChangeOp)) {
                 // There is one change in the list... only when the object has been created !
                 $sDate = $oLatestChangeOp->GetAsHTML('date');
                 $oChange = MetaModel::GetObject('CMDBChange', $oLatestChangeOp->Get('change'));
                 $sUserInfo = $oChange->GetAsHTML('userinfo');
                 $sHtml .= $oPage->GetStartCollapsibleSection(Dict::Format('UI:History:LastModified_On_By', $sDate, $sUserInfo));
                 $sHtml .= $this->GetHistoryTable($oPage, $oSet);
                 $sHtml .= $oPage->GetEndCollapsibleSection();
             }
             break;
         case 'table':
         default:
             if ($bTruncated) {
                 $sFilter = $this->m_oFilter->serialize();
                 $sHtml .= '<div id="history_container"><p>';
                 $sHtml .= Dict::Format('UI:TruncatedResults', $this->iLimitCount, $oSet->Count());
                 $sHtml .= ' ';
                 $sHtml .= '<a href="#" onclick="DisplayHistory(\'#history_container\', \'' . $sFilter . '\', 0, 0); return false;">' . Dict::S('UI:DisplayAll') . '</a>';
                 $sHtml .= $this->GetHistoryTable($oPage, $oSet);
                 $sHtml .= '</p></div>';
                 $oPage->add_ready_script("\$('#{$sId} table.listResults tr:last td').addClass('truncated');");
             } else {
                 $sHtml .= $this->GetHistoryTable($oPage, $oSet);
             }
     }
     return $sHtml;
 }
開發者ID:henryavila,項目名稱:itop,代碼行數:45,代碼來源:displayblock.class.inc.php


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