$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']);
$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 {
} $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);
/** * 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); }