本文整理汇总了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;
}