本文整理汇总了PHP中Templates::getNavis方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::getNavis方法的具体用法?PHP Templates::getNavis怎么用?PHP Templates::getNavis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::getNavis方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sanitize
<?php
$templateid = (int) sanitize($this->request->parameters['template']);
$naviid = (int) sanitize($this->request->parameters['navigation']);
$templateMgr = new Templates();
$navis = $templateMgr->getNavis($templateid);
for ($i = 0; $i < count($navis); $i++) {
if ($navis[$i]["ID"] == $naviid) {
$naviinfo = $navis[$i];
}
}
$smarty->assign('naviinfo', $naviinfo);
$smarty->display("file:" . getrealpath($this->page_template));
示例2: sGuiUS
}
break;
case 'setPageNavigation':
$wid = $this->params['wid'];
$navigation = $this->params['navigationId'];
// Check if we really got sane values
if ($navigation != 'navigation') {
$page->setNavigation($navigation);
// Check if we got '0' as navigation (none)
if ($navigation == 0) {
$jsQueue->add($pageID, HISTORYTYPE_PAGE, 'PAGE_HIDE', sGuiUS(), 'name');
// Add to history
$page->history->add(HISTORYTYPE_PAGE, NULL, NULL, "TXT_PAGE_H_NONAVIGATION");
} else {
$jsQueue->add($pageID, HISTORYTYPE_PAGE, 'PAGE_UNHIDE', sGuiUS(), 'name');
$templatenavis = $templateMgr->getNavis($pageInfo['TEMPLATEID']);
foreach ($templatenavis as $templatenavi_item) {
if ($templatenavi_item['ID'] == $navigation) {
$navigation_name = $templatenavi_item['NAME'];
}
}
// Add to history
$page->history->add(HISTORYTYPE_PAGE, NULL, $navigation_name, "TXT_PAGE_H_NAVIGATION");
}
$jsQueue->add($pageID, HISTORYTYPE_PAGE, 'HIGHLIGHT_PAGE', sGuiUS(), 'name');
$koala->queueScript("Koala.windows['wid_" . $wid . "'].refreshNavigation();");
}
break;
case 'setPagePName':
$value = $page->filterPName($this->params['value']);
if ($pageMgr->getPageIdByPname($value)) {
示例3: getQueuedCommands
//.........这里部分代码省略.........
}
if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) {
// Nur Leserecht (hellgrau)
$statusClass .= " nowrite";
}
if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) {
// Nur Leserecht (hellgrau)
$statusClass .= " nodelete";
}
$objectName = $objectInfo['NAME'];
$objectParents = sCblockMgr()->getParents($objectID);
$parentNodeId = $objectParents[0][0]["ID"];
if ($queuedCommandRaw['NEWVALUE'] == sGuiUS() && $queuedCommandRaw['TEXT'] != 'list') {
$andSelect = 'true';
} else {
$andSelect = 'false';
}
if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) {
$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addListItem(\'' . $parentNodeId . '-cblock\', \'' . addslashes(json_encode($objectInfo)) . '\', \'' . $queuedCommandRaw['TEXT'] . '\');';
}
$queuedCommands[$queuedCommandRaw['ID']] .= 'Koala.yg_addChild(\'cblock\', \'' . $parentNodeId . '-cblock\', \'name\', \'' . $objectName . '\', \'cblock\', \'' . $objectID . '-cblock\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');';
break;
case 'PAGE_ADD':
if ($pageObj) {
$objectInfo = $pageObj->get();
$icon = $icons->icon['page_small'];
$statusClass = '';
$inactive = false;
if ($objectInfo["ACTIVE"] == "0") {
$icon = $icons->icon['page_inactive_small'];
$inactive = true;
}
$naviinfo = NULL;
$navis = $templateMgr->getNavis($objectInfo["TEMPLATEID"]);
for ($i = 0; $i < count($navis); $i++) {
if ($navis[$i]["ID"] == $objectInfo["NAVIGATIONID"]) {
$naviinfo = $navis[$i];
}
}
if ($objectInfo["HIDDEN"] == "1" || $objectInfo["TEMPLATEID"] == "0" || !$naviinfo['ID']) {
$icon = $icons->icon['page_hidden_small'];
if ($inactive == true) {
$icon = $icons->icon['page_inactive_hidden_small'];
}
}
if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") {
// Editiert (grün)
$statusClass = "changed";
} elseif ($objectInfo["HASCHANGED"] == "1") {
$statusClass = "changed";
}
if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) {
// Nur Leserecht (hellgrau)
$statusClass .= " nowrite";
}
if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) {
// Nur Leserecht (hellgrau)
$statusClass .= " nodelete";
}
if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) {
$statusClass .= " nosub";
}
$objectName = $objectInfo['NAME'];
$objectParents = $pageMgr->getParents($objectID);
$parentNodeId = $objectParents[0][0]["ID"];
if (!$parentNodeId) {
示例4: setTemplate
/**
* Assigns a Template to this Page
*
* @param int $templateId Template Id
* @return bool TRUE on success or FALSE in case of an error
* @throws Exception
*/
function setTemplate($templateId)
{
$pageID = (int) $this->_id;
$templateId = (int) $templateId;
if ($this->permissions->checkInternal($this->_uid, $pageID, "RWRITE")) {
// Get old navigation
$templateMgr = new Templates();
$pageInfo = $this->get();
$oldTemplateId = $pageInfo['TEMPLATEID'];
$oldNaviId = $pageInfo['NAVIGATIONID'];
$navis = $templateMgr->getNavis($oldTemplateId);
for ($i = 0; $i < count($navis); $i++) {
if ($navis[$i]["ID"] == $oldNaviId) {
$naviInfo = $navis[$i];
}
}
$oldNaviInfo = $naviInfo;
// Get navigations for new template
$navis = $templateMgr->getNavis($templateId);
for ($i = 0; $i < count($navis); $i++) {
if ($navis[$i]['CODE'] == $oldNaviInfo['CODE']) {
$matchingNavi = $navis[$i]['ID'];
}
}
$version = (int) $this->getVersion();
$sql = "UPDATE yg_site_" . $this->_site . "_properties SET TEMPLATEID = ? WHERE (OBJECTID = ?) AND VERSION = ?;";
$result = sYDB()->Execute($sql, $templateId, $pageID, $version);
if ($result === false) {
throw new Exception(sYDB()->ErrorMsg());
}
if ($matchingNavi) {
// Matching new navigation was found, set to matching navi
$this->setNavigation($matchingNavi);
} else {
// Get all navigations and check if a default navigation is set (if no matching navi was found)
$navigations = $templateMgr->getNavis($templateId);
$hasdefaultnavi = false;
foreach ($navigations as $idx => $navigation) {
if ($navigation['DEFAULT'] == 1) {
$hasdefaultnavi = true;
$defaultnavi = $navigation['ID'];
}
}
if ($hasdefaultnavi) {
$this->setNavigation($defaultnavi);
} else {
// No default navigation was found, set to nothing (and thus hide the hide page)
$this->setNavigation(0);
}
}
$this->markAsChanged();
return true;
} else {
return false;
}
}
示例5: explode
$refresh = $this->request->parameters['refresh'];
$initload = $this->request->parameters['initload'];
$sortby = $this->request->parameters['sortby'];
$show = $this->request->parameters['show'];
$view = $this->request->parameters['view'];
$template = explode('-', $ygid);
$site = $template[1];
$template = $template[0];
$templateMgr = new Templates();
$templateInfo = $templateMgr->getTemplate($template);
$objectparents = $templateMgr->getParents($template);
$objectparents[count($objectparents) - 1][0]['NAME'] = $itext['TXT_TEMPLATES'] != '' ? $itext['TXT_TEMPLATES'] : '$TXT_TEMPLATES';
// Get all contentareas
$contentareas = $templateMgr->getContentareas($template);
// Get all navigations
$navigations = $templateMgr->getNavis($template);
$hasdefault = false;
foreach ($navigations as $idx => $navigation) {
if ($navigation['DEFAULT'] == 1) {
$hasdefault = true;
$defaultnavi = $navigation['CODE'];
}
}
if (!$hasdefault) {
$navigations[0]['DEFAULT'] = 1;
$defaultnavi = $navigations[0]['CODE'];
}
// Check for template preview
$templatepreviewdir = getRealpath(sConfig()->getVar('CONFIG/DIRECTORIES/TEMPLATEPREVIEWDIR')) . '/';
$found_files = glob($templatepreviewdir . $template . '-*');
if ($found_files !== false && count($found_files) > 0) {
示例6: array
$found = false;
for ($s2 = 0; $s2 < count($filecontentareas); $s2++) {
if ($filecontentareas[$s2]['CODE'] == $contentareas[$s]['CODE']) {
$found = true;
}
}
if ($found == false) {
$rfilecontentareas[]['CODE'] = $contentareas[$s]['CODE'];
}
}
// Check for added/removed navigations
$filenavis = $templateMgr->getNavisFromTempFile($old_template_files[count($old_template_files) - 1]);
if (count($old_template_files) > 1) {
$navis = $templateMgr->getNavisFromTempFile($old_template_files[count($old_template_files) - 2]);
} else {
$navis = $templateMgr->getNavis($templateid);
}
$a = 0;
$r = 0;
$afilenavis = array();
$rfilenavis = array();
for ($s = 0; $s < count($filenavis); $s++) {
$alreadythere = false;
for ($s2 = 0; $s2 < count($navis); $s2++) {
if ($filenavis[$s]['CODE'] == $navis[$s2]['CODE']) {
$alreadythere = true;
}
}
if ($alreadythere == false) {
$afilenavis[$a]['CODE'] = $filenavis[$s]['CODE'];
$a++;
示例7: getIconForPage
function getIconForPage($pageInfo)
{
$img = 'page_small';
$iconclass = 'page';
$cststyle = '';
$inactive = false;
if ($pageInfo["ACTIVE"] == "0") {
$img = 'page_inactive_small';
$iconclass = 'pageinactive';
$inactive = true;
}
$naviinfo = NULL;
$templateMgr = new Templates();
$navis = $templateMgr->getNavis($pageInfo["TEMPLATEID"]);
for ($i = 0; $i < count($navis); $i++) {
if ($navis[$i]["ID"] == $pageInfo["NAVIGATIONID"]) {
$naviinfo = $navis[$i];
}
}
if ($pageInfo["HIDDEN"] == "1" || $pageInfo["TEMPLATEID"] == "0" || !$naviinfo['ID']) {
$img = 'page_hidden_small';
$iconclass = 'pagehidden';
if ($inactive == true) {
$img = 'page_inactive_hidden_small';
$iconclass = 'pagehiddeninactive';
}
}
if ($pageInfo["VERSIONPUBLISHED"] + 2 != $pageInfo["VERSION"] && $pageInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $pageInfo["HASCHANGED"] == "1") {
// Editiert (grün)
$cststyle = "changed";
} elseif ($pageInfo["HASCHANGED"] == "1") {
$cststyle = "changed";
}
if ($pageInfo["RWRITE"] == "0") {
// Nur Leserecht (hellgrau)
$cststyle .= " nowrite";
}
if ($pageInfo["RDELETE"] == "0") {
// Nur Leserecht (hellgrau)
$cststyle .= " nodelete";
}
if ($pageInfo["RSUB"] == "0") {
$cststyle .= " nosub";
}
return array('img' => $img, 'iconclass' => $iconclass, 'style' => $cststyle);
}