本文整理汇总了PHP中Templates::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::getList方法的具体用法?PHP Templates::getList怎么用?PHP Templates::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::getList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageMgr
$mailing = $mailingMgr->getMailing($pageID);
$mailingInfo = $mailing->get();
$preselected = $mailingInfo["TEMPLATEID"];
} else {
$pageMgr = new PageMgr($siteID);
$page = $pageMgr->getPage($pageID);
$pageInfo = $page->get();
$preselected = $pageInfo["TEMPLATEID"];
}
}
if ($action == 'choosefolder') {
// Check if folders are available
$templateMgr = new Templates();
$siteMgr = new Sites();
$siteinfo = $siteMgr->get($siteID);
$templatesTree = $templateMgr->getList();
$hasNoFolders = true;
foreach ($templatesTree as $templatesTreeItem) {
if ($templatesTreeItem['LEVEL'] > 1) {
if ($templatesTreeItem['FOLDER'] == 1) {
$hasNoFolders = false;
}
}
}
$smarty->assign("hasNoFolders", $hasNoFolders);
}
}
$smarty->assign("site", $siteID);
$smarty->assign("preselected", $preselected);
$smarty->assign("action", $action);
$smarty->assign("opener_reference", $this->request->parameters['opener_reference']);
示例2: sGuiUS
$successfullyDeleted = $templateMgr->remove($template);
if (in_array($template, $successfullyDeleted)) {
if ($tmpTemplateInfo['FOLDER']) {
$jsQueue->add($template, HISTORYTYPE_TEMPLATE, 'OBJECT_DELETE', sGuiUS(), 'templatefolder', NULL, NULL, $template . '-template', 'name');
} else {
$jsQueue->add($template, HISTORYTYPE_TEMPLATE, 'OBJECT_DELETE', sGuiUS(), 'template', NULL, NULL, $template . '-template', 'name');
}
}
}
break;
case 'addTemplate':
$template = $this->params['template'];
// Check if root node is selected
if ($template === 'root') {
// Get real Page-ID of Root-Node
$templates = $templateMgr->getList();
$template = $templates[0]['ID'];
}
// Check if a folder is selected
$templateInfo = $templateMgr->getTemplate($template);
if ($templateInfo['FOLDER'] == 1) {
// Add new child node
$new_id = $templateMgr->add($template);
$templateMgr->setName($new_id, $itext['TXT_NEW_OBJECT']);
//$templateMgr->setIdentifier( $new_id, $itext['TXT_NEW_OBJECT'] );
if ($new_id != false) {
$icons = new Icons();
if ($template == 1) {
// Rootfolder
$koala->callJSFunction('Koala.yg_addChild', 'template', $template . '-template', 'name', $itext['TXT_NEW_OBJECT'], 'template', $new_id . '-template', 'name', $icons->icon['template_small'], 'nosub', true);
} else {
示例3: Templates
}
$templateMgr = new Templates();
$newpage = (int) $this->request->parameters['page'];
$action = $this->request->parameters['action'];
if ($action == 'choose') {
$noclick = 'noclick';
} else {
$noclick = '';
}
$onlyFolders = false;
if ($this->page == 'templatefolders_tree_nodes') {
$onlyFolders = true;
}
// Get all templates
if ($templateRoot > 0) {
$tree = $templateMgr->getList($templateRoot);
$rootid = $templateRoot;
} else {
$tree = $templateMgr->getList();
$rootid = 1;
}
$yo = $templateMgr->tree->nest($tree);
$xml_tree = array();
$tree_id = 0;
$tree_level = 0;
$props = array('TREE_ID' => $tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'root_1', 'CAPTION' => $itext['TXT_TEMPLATES'] != '' ? $itext['TXT_TEMPLATES'] : '$TXT_TEMPLATES', 'URL' => $root_link, 'IC' => $this->imgpath . '/window/x.gif', 'EXP' => 'true', 'CHK' => 'false', 'CSTSTYLE' => 'root', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $tree[0]['ID'] . '-template', 'YG_TYPE' => 'template', 'YG_PROPERTY' => 'name', 'XTRA' => $onlyFolders || $noclick != '' ? 'noclick' : '');
if ($onlyFolders) {
$props['YG_TYPE'] = 'templatefolder';
}
array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level++, 'PROPS' => $props));
gen_tree($yo[$rootid]['CHILDREN'], $this->imgpath, $xml_tree, $tree_id, $tree_level, $noclick, $onlyFolders);
示例4: setDefaultPermissions
/**
* Sets the default permissions for Objects without an Admin
*
* @param int $usergroupId Usergroup Id
* @return bool TRUE on success or FALSE in case of an error
*/
function setDefaultPermissions($usergroupId)
{
// For Templates
$templateMgr = new Templates();
$allTemplates = $templateMgr->getList();
$permissionList = array();
foreach ($allTemplates as $allTemplate) {
$permissionList[] = array('RREAD' => 1, 'RSUB' => 1, 'RWRITE' => 1, 'RDELETE' => 1, 'OID' => $allTemplate['ID'], 'USERGROUPID' => $usergroupId);
}
$templateMgr->permissions->setPermissions($permissionList);
// For Views
$viewMgr = new Views();
$allViews = $viewMgr->getList();
$permissionList = array();
foreach ($allViews as $allView) {
$permissionList[] = array('RREAD' => 1, 'RSUB' => 1, 'RWRITE' => 1, 'RDELETE' => 1, 'OID' => $allView['ID'], 'USERGROUPID' => $usergroupId);
}
$viewMgr->permissions->setPermissions($permissionList);
// For Entrymasks
$entrymaskMgr = new Entrymasks();
$allEntrymasks = $entrymaskMgr->getList();
$permissionList = array();
foreach ($allEntrymasks as $allEntrymask) {
$permissionList[] = array('RREAD' => 1, 'RSUB' => 1, 'RWRITE' => 1, 'RDELETE' => 1, 'OID' => $allEntrymask['ID'], 'USERGROUPID' => $usergroupId);
}
$entrymaskMgr->permissions->setPermissions($permissionList);
// For Cblock blindfolder
$embeddedCblockFolder = (int) sConfig()->getVar("CONFIG/EMBEDDED_CBLOCKFOLDER");
$permissionList = array();
$permissionList[] = array('RREAD' => 1, 'RSUB' => 1, 'RWRITE' => 1, 'OID' => $embeddedCblockFolder, 'USERGROUPID' => $usergroupId);
sCblockMgr()->permissions->setPermissions($permissionList);
// Remove rights for Cblock root node
$cblockRootNodeId = sCblockMgr()->tree->getRoot();
$permissionList = array();
$permissionList[] = array('RREAD' => 0, 'RSUB' => 0, 'RWRITE' => 0, 'RDELETE' => 0, 'OID' => $cblockRootNodeId, 'USERGROUPID' => $usergroupId);
sCblockMgr()->permissions->setPermissions($permissionList);
}