本文整理汇总了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++) {