本文整理匯總了PHP中Alias::getActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP Alias::getActive方法的具體用法?PHP Alias::getActive怎麽用?PHP Alias::getActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Alias
的用法示例。
在下文中一共展示了Alias::getActive方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parseAlias
//.........這裏部分代碼省略.........
$strAlias = $objAlias->getAlias();
if (!empty($strAlias)) {
$strUrl = $objAlias->getUrl();
if (is_numeric($strUrl)) {
$objElement = Element::selectByPk($strUrl);
if (is_object($objElement)) {
$strUrlHref = "?eid={$strUrl}&cmd=" . CMD_EDIT . "&cid=" . NAV_PCMS_ELEMENTS;
$strUrl = Element::recursivePath($strUrl);
} else {
$strUrlHref = "?cid=" . NAV_PCMS_ALIASES;
$strUrl = "<b>" . $objLang->get("aliasUnavailable", "label") . "</b>";
}
}
$objTpl->setCurrentBlock("multiview-item");
$objTpl->setVariable("MULTIITEM_VALUE", $objAlias->getId());
$objTpl->setVariable("BUTTON_REMOVE_HREF", "javascript:Alias.remove({$objAlias->getId()});");
$objTpl->setVariable("BUTTON_REMOVE", $objLang->get("delete", "button"));
$objTpl->setVariable("MULTIITEM_HREF", "?cid=" . NAV_PCMS_ALIASES . "&eid={$objAlias->getId()}&cmd=" . CMD_EDIT);
$objTpl->setVariable("MULTIITEM_TYPE_CLASS", "alias");
$objTpl->setVariable("MULTIITEM_ALIAS", $objAlias->getAlias());
$objTpl->setVariable("MULTIITEM_POINTS_TO", $objLang->get("pointsTo", "label"));
$objTpl->setVariable("MULTIITEM_URL", $strUrl);
$objTpl->setVariable("MULTIITEM_URL_HREF", $strUrlHref);
if ($objLanguages->count() > 1) {
if ($objAlias->getLanguageId() > 0) {
$strLanguage = ContentLanguage::selectByPK($objAlias->getLanguageId())->getName();
$objTpl->setVariable("MULTIITEM_LANGUAGE", sprintf($objLang->get("forLanguage", "label"), $strLanguage));
} else {
$objTpl->setVariable("MULTIITEM_LANGUAGE", $objLang->get("forAllLanguages", "label"));
}
} else {
$objTpl->setVariable("MULTIITEM_LANGUAGE", "");
}
if (!$objAlias->getActive()) {
$objTpl->setVariable("MULTIITEM_ACTIVE", " class=\"inactive\"");
}
$objTpl->parseCurrentBlock();
$listCount++;
if ($listCount >= $_SESSION["listCount"]) {
break;
}
}
}
//*** Render page navigation.
$pageCount = ceil($totalCount / $_SESSION["listCount"]);
if ($pageCount > 0) {
$currentPage = ceil(($intPosition + 1) / $_SESSION["listCount"]);
$previousPos = $intPosition - $_SESSION["listCount"] > 0 ? $intPosition - $_SESSION["listCount"] : 0;
$nextPos = $intPosition + $_SESSION["listCount"] < $totalCount ? $intPosition + $_SESSION["listCount"] : $intPosition;
$objTpl->setVariable("PAGENAV_PAGE", sprintf($objLang->get("pageNavigation", "label"), $currentPage, $pageCount));
$objTpl->setVariable("PAGENAV_PREVIOUS", $objLang->get("previous", "button"));
$objTpl->setVariable("PAGENAV_PREVIOUS_HREF", "?cid=" . NAV_PCMS_ALIASES . "&pos={$previousPos}");
$objTpl->setVariable("PAGENAV_NEXT", $objLang->get("next", "button"));
$objTpl->setVariable("PAGENAV_NEXT_HREF", "?cid=" . NAV_PCMS_ALIASES . "&pos={$nextPos}");
//*** Top page navigation.
for ($intCount = 0; $intCount < $pageCount; $intCount++) {
$objTpl->setCurrentBlock("multiview-pagenavitem-top");
$position = $intCount * $_SESSION["listCount"];
if ($intCount != $intPosition / $_SESSION["listCount"]) {
$objTpl->setVariable("PAGENAV_HREF", "href=\"?cid=" . NAV_PCMS_ALIASES . "&pos={$position}\"");
}
$objTpl->setVariable("PAGENAV_VALUE", $intCount + 1);
$objTpl->parseCurrentBlock();
}
//*** Bottom page navigation.
for ($intCount = 0; $intCount < $pageCount; $intCount++) {