本文整理匯總了PHP中WebPage::DisplaySet方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebPage::DisplaySet方法的具體用法?PHP WebPage::DisplaySet怎麽用?PHP WebPage::DisplaySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebPage
的用法示例。
在下文中一共展示了WebPage::DisplaySet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DisplayRequestLists
/**
* Helper to display lists (UserRequest, Incident, etc.)
* Adjust the presentation depending on the following cases:
* - no item at all
* - items of one class only
* - items of several classes
*/
function DisplayRequestLists(WebPage $oP, $aClassToSet)
{
$iNotEmpty = 0;
// Count of types for which there are some items to display
foreach ($aClassToSet as $sClass => $oSet) {
if ($oSet->Count() > 0) {
$iNotEmpty++;
}
}
if ($iNotEmpty == 0) {
$oP->p(Dict::S('Portal:NoOpenRequest'));
} else {
foreach ($aClassToSet as $sClass => $oSet) {
if ($iNotEmpty > 1) {
// Differentiate the sublists
$oP->add("<h2>" . MetaModel::GetName($sClass) . "</h2>\n");
}
if ($oSet->Count() > 0) {
$sZList = GetConstant($sClass, 'LIST_ZLIST');
$aZList = explode(',', $sZList);
$oP->DisplaySet($oSet, $aZList, Dict::S('Portal:NoOpenRequest'));
}
}
}
}