<?php // Check if the folder for blind contentblocks already exists and create it if it doesn't exist $embeddedCblockFolder = (int) sConfig()->getVar("CONFIG/EMBEDDED_CBLOCKFOLDER"); $siteMgr = new Sites(); $sites = $siteMgr->getList(); $ygid = $this->request->parameters['yg_id']; $refresh = $this->request->parameters['refresh']; $entrymask = explode('-', $ygid); $entrymask = $entrymask[0]; $icons = new Icons(); $mailingMgr = new MailingMgr(); $entrymaskMgr = new Entrymasks(); $entrymaskInfo = $entrymaskMgr->get($entrymask); // Get all contentblocks with this entrymask $contentblock_ids = sCblockMgr()->getCblockLinkByEntrymaskId($entrymask); $contentblocks = array(); $contentblocks_blind = array(); foreach ($contentblock_ids as $contentblock_id) { $dcb = sCblockMgr()->getCblock($contentblock_id['CBLOCKID']); if ($dcb) { $co_data = $dcb->get(); $objectparents = sCblockMgr()->getParents($contentblock_id['CBLOCKID']); array_pop($objectparents); $co_data['PARENTS'] = $objectparents; $dcb = sCblockMgr()->getCblock($contentblock_id['CBLOCKID']); $co_data['CBLOCKINFO'] = $dcb->get(); $co_data['CBLOCKINFO']['RWRITE'] = $dcb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $contentblock_id['CBLOCKID'], "RWRITE"); $co_data['CBLOCKINFO']['RDELETE'] = $dcb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $contentblock_id['CBLOCKID'], "RDELETE"); $styleData = getStyleForContentblock($co_data['CBLOCKINFO']); $co_data['STYLE'] = $styleData;
<?php $ygid = $this->request->parameters['yg_id']; $entrymask = explode('-', $ygid); $entrymask = $entrymask[0]; $entrymaskMgr = new Entrymasks(); $entrymaskInfo = $entrymaskMgr->get($entrymask); $objectparents = $entrymaskMgr->getParents($entrymask); $objectparents[count($objectparents) - 1][0]['NAME'] = $itext['TXT_ENTRYMASKS'] != '' ? $itext['TXT_ENTRYMASKS'] : '$TXT_ENTRYMASKS'; $entrymasks = $entrymaskMgr->getEntrymaskFormfields($entrymask); foreach ($entrymasks as $entrymask_idx => $entrymask) { if (($entrymask['FORMFIELD'] == 11 || $entrymask['FORMFIELD'] == 12) && $entrymasks[$entrymask_idx]['PRESET']) { $entrymasks[$entrymask_idx]['PRESET'] = TStoLocalTS($entrymasks[$entrymask_idx]['PRESET']); } if ($entrymask['FORMFIELD'] == 9) { $entrymasks[$entrymask_idx]['LVALUES'] = $entrymaskMgr->getListValuesByLinkID($entrymask['ID']); } } $smarty->assign("entrymaskInfo", $entrymaskInfo); $smarty->assign("objectparents", $objectparents); $smarty->assign("objecttype", "entrymask"); $smarty->assign("entrymasks", $entrymasks); $smarty->assign('win_no', $this->request->parameters['win_no']); $smarty->assign("uinfo", $uinfo); $smarty->assign("controls", $controls); $smarty->display('file:' . $this->page_template);
if ($pageInfo['DELETED'] == 1) { $pageInfo['RWRITE'] = false; $pageInfo['RSTAGE'] = false; } } $selectiondialog = $this->request->parameters['selectiondialog']; if ($selectiondialog != null || $selectiondialog == "1") { $smarty->assign("displaymode", 'dialog'); } if ($this->request->parameters['displaymode'] != '') { $smarty->assign("displaymode", $this->request->parameters['displaymode']); } $smarty->assign('extensiondir', $this->extensiondir); if ($siteID == 'dummy' && $pageID == 'dummy') { // Entrymask Preview Mode $entrymaskMgr = new Entrymasks(); $co_id = $this->request->parameters['co']; $co_info = $entrymaskMgr->get($co_id); if (!$co_info['FOLDER']) { $cos = array(); $cos[0]['CONTENTAREA'] = 'dummy'; $cos[0]['OBJECTID'] = 'dummy' . $co_id; $cos[0]['EMBEDDED'] = 1; $cos[0]['ENTRYMASKS'][0]['FORMFIELDS'] = $entrymaskMgr->getEntrymaskFormfields($co_id); $cos[0]['ENTRYMASKS'][0]['ENTRYMASKNAME'] = $co_info['NAME']; foreach ($cos[0]['ENTRYMASKS'][0]['FORMFIELDS'] as $formfield_idx => $formfield) { if ($formfield['FORMFIELD'] == 9) { $cos[0]['ENTRYMASKS'][0]['FORMFIELDS'][$formfield_idx]['LVALUES'] = $entrymaskMgr->getListValuesByLinkID($formfield['ID']); } } }
$myObject = $myMgr->getPage($pageID); $myObjectInfo = $myObject->get(); $historyType = HISTORYTYPE_PAGE; $historyStr = "PAGE"; $myQueue = new JSQueue(NULL, $siteID); } $contentblockID = $this->params['contentblockId']; $cb = sCblockMgr()->getCblock($contentblockID); $contentarea = $this->params['contentareaID']; $parentwindow = $this->params['openerRefID']; $refresh = $this->params['refresh']; $target_id = $this->params['targetId']; $target_pos = $this->params['targetPosition']; $copymode = $this->params['copymode']; $templateMgr = new Templates(); $entrymaskMgr = new Entrymasks(); $contentarea = str_replace('wid_' . $parentwindow . '_ca_', '', $contentarea); if ($target_id != '' && $target_pos != '') { // Get code for contentarea_id $contentarea_id = $contentarea; $contentarea = ''; $contentareas = $templateMgr->getContentareas($myObjectInfo['TEMPLATEID']); foreach ($contentareas as $pagecontentarea) { if ($pagecontentarea['ID'] == $contentarea_id) { $contentarea = $pagecontentarea['CODE']; } } if ($contentblockID > 0) { // Check if already there $add_co = true; for ($i = 0; $i < count($contentareas); $i++) {
/** * 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); }
$siteID = $data[1]; $filterTab = $this->request->parameters['versionfilter_tab']; $filterAction = $this->request->parameters['versionfilter_action']; $filterTimeframe = $this->request->parameters['versionfilter_timeframe']; $filterObject = $this->request->parameters['versionfilter_objecttype']; $icons = new Icons(); if ($filterTab == '') { $filterTab = 'ALL'; } if ($filterAction == '') { $filterAction = 'ALL'; } if ($filterTimeframe == '') { $filterTimeframe = 'LAST_WEEK'; } $entrymaskMgr = new Entrymasks(); $viewMgr = new Views(); $tagMgr = new Tags(); $filetypeMgr = sFiletypes(); $tab_mappings = array('TXT_MAILING_H_TEMPLATE' => 'P_PROPERTIES', 'TXT_MAILING_H_COREMOVE' => 'P_CONTENT', 'TXT_MAILING_H_EMREMOVE' => 'P_CONTENT', 'TXT_MAILING_H_COADD' => 'P_CONTENT', 'TXT_MAILING_H_EMADD' => 'P_CONTENT', 'TXT_MAILING_H_EMCOPY' => 'P_CONTENT', 'TXT_MAILING_H_COORDER' => 'P_CONTENT', 'TXT_MAILING_H_PROP' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_FILE' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_FILE_REMOVED' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_RICHTEXT' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_TAG' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_CBLOCK' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_PAGE' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_DATE' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_DATETIME' => 'P_PROPERTIES', 'TXT_MAILING_H_PROP_LINK' => 'P_PROPERTIES', 'TXT_MAILING_H_AUTOPUBLISH_CHANGED' => 'P_PUBLISHING', 'TXT_MAILING_H_AUTOPUBLISH_ADDED' => 'P_PUBLISHING', 'TXT_MAILING_H_GROUPADD' => 'P_USERGROUPS', 'TXT_MAILING_H_GROUPREMOVE' => 'P_USERGROUPS', 'TXT_MAILING_H_NEWVERSION_FROM' => 'P_VERSIONS', 'TXT_MAILING_H_NEWVERSION' => 'P_VERSIONS', 'TXT_MAILING_H_APPROVE' => 'P_VERSIONS', 'TXT_MAILING_H_AUTOPUBLISH' => 'P_VERSIONS', 'TXT_MAILING_H_PAUSED' => 'P_VERSIONS', 'TXT_MAILING_H_CANCELLED' => 'P_VERSIONS', 'TXT_MAILING_H_RESUMED' => 'P_VERSIONS', 'TXT_MAILING_H_SENDING' => 'P_VERSIONS', 'TXT_CBLOCK_H_EMADD' => 'P_CONTENT', 'TXT_CBLOCK_H_EMREMOVE' => 'P_CONTENT', 'TXT_CBLOCK_H_EMORDER' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_1' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_2' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_3' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_4_ON' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_4_OFF' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_5' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_6' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_7' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_8' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_9' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_10' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_11' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_12' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_15' => 'P_CONTENT', 'TXT_CBLOCK_H_PROP' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_CHECKON' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_CHECKOFF' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_FILE' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_RICHTEXT' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_TAG' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_CBLOCK' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_LINK' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_PAGE' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_DATE' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_DATETIME' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PROP_PASSWORD' => 'P_PROPERTIES', 'TXT_CBLOCK_H_PNAME' => 'P_PROPERTIES', 'TXT_TAG_H_ASSIGN' => 'P_TAGS', 'TXT_TAG_H_REMOVE' => 'P_TAGS', 'TXT_TAG_H_TAGORDER' => 'P_TAGS', 'TXT_CBLOCK_H_NEWVERSION' => 'P_VERSIONS', 'TXT_CBLOCK_H_NEWVERSION_FROM' => 'P_VERSIONS', 'TXT_CBLOCK_H_TRASHED' => 'P_VERSIONS', 'TXT_CBLOCK_H_RESTORED' => 'P_VERSIONS', 'TXT_CBLOCK_H_APPROVE' => 'P_VERSIONS', 'TXT_CBLOCK_H_PUBLISH' => 'P_VERSIONS', 'TXT_CBLOCK_H_PUBLISHED_UPDATED' => 'P_VERSIONS', 'TXT_CBLOCK_H_AUTOPUBLISH' => 'P_VERSIONS', 'TXT_CBLOCK_H_AUTOPUBLISH_ADDED' => 'P_PUBLISHING', 'TXT_CBLOCK_H_AUTOPUBLISH_CHANGED' => 'P_PUBLISHING', 'TXT_CBLOCK_H_AUTOPUBLISH_DELETED' => 'P_PUBLISHING', 'TXT_FILE_H_ADDVIEW' => 'P_VIEWS', 'TXT_FILE_H_REMOVEVIEW' => 'P_VIEWS', 'TXT_FILE_H_CROP' => 'P_VIEWS', 'TXT_FILE_H_PROP' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_CHECKON' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_CHECKOFF' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_FILE' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_RICHTEXT' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_TAG' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_CBLOCK' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_LINK' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_PAGE' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_DATE' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_DATETIME' => 'P_PROPERTIES', 'TXT_FILE_H_PROP_PASSWORD' => 'P_PROPERTIES', 'TXT_FILE_H_APPROVE' => 'P_VERSIONS', 'TXT_FILE_H_NEWVERSION' => 'P_VERSIONS', 'TXT_FILE_H_NEWVERSION_FROM' => 'P_VERSIONS', 'TXT_FILE_H_TRASHED' => 'P_VERSIONS', 'TXT_FILE_H_RESTORED' => 'P_VERSIONS', 'TXT_FILE_H_TYPECHANGE' => 'P_FILEINFO', 'TXT_FILE_H_REUPLOAD' => 'P_FILEINFO', 'TXT_FILE_H_UPLOAD' => 'P_FILEINFO', 'TXT_TAG_H_ASSIGN' => 'P_TAGS', 'TXT_TAG_H_REMOVE' => 'P_TAGS', 'TXT_TAG_H_TAGORDER' => 'P_TAGS', 'TXT_PAGE_H_COORDER' => 'P_CONTENT', 'TXT_OBJECT_H_EXTREMOVE' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTADD' => 'P_EXTENSIONS', 'TXT_PAGE_H_COREMOVE' => 'P_CONTENT', 'TXT_PAGE_H_EMREMOVE' => 'P_CONTENT', 'TXT_PAGE_H_COADD' => 'P_CONTENT', 'TXT_PAGE_H_EMADD' => 'P_CONTENT', 'TXT_PAGE_H_COORDER' => 'P_CONTENT', 'TXT_PAGE_H_EMCOPY' => 'P_CONTENT', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_1' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_2' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_3' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_4_ON' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_4_OFF' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_5' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_6' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_7' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_8' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_9' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_10' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_11' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_12' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_13' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_14' => 'P_EXTENSIONS', 'TXT_OBJECT_H_EXTEDIT_FRMFLD_15' => 'P_EXTENSIONS', 'TXT_COMMON_H_COEDIT_FRMFLD_1' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_2' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_3' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_4_ON' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_4_OFF' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_5' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_6' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_7' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_8' => 'P_CONTENT', 'TXT_COMMON_H_COEDIT_FRMFLD_9' => 'P_CONTENT', 'TXT_PAGE_H_PROP' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_CHECKON' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_CHECKOFF' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_FILE' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_RICHTEXT' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_TAG' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_CBLOCK' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_LINK' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_PAGE' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_DATE' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_DATETIME' => 'P_PROPERTIES', 'TXT_PAGE_H_PROP_PASSWORD' => 'P_PROPERTIES', 'TXT_PAGE_H_PNAME' => 'P_PROPERTIES', 'TXT_TAG_H_ASSIGN' => 'P_TAGS', 'TXT_TAG_H_REMOVE' => 'P_TAGS', 'TXT_TAG_H_TAGORDER' => 'P_TAGS', 'TXT_PAGE_H_HIDDEN_0' => 'P_APPEARANCE', 'TXT_PAGE_H_HIDDEN_1' => 'P_APPEARANCE', 'TXT_PAGE_H_ACTIVE_0' => 'P_APPEARANCE', 'TXT_PAGE_H_ACTIVE_1' => 'P_APPEARANCE', 'TXT_PAGE_H_TEMPLATE' => 'P_APPEARANCE', 'TXT_PAGE_H_NAVIGATION' => 'P_APPEARANCE', 'TXT_PAGE_H_NONAVIGATION' => 'P_APPEARANCE', 'TXT_PAGE_H_ACTIVE_0' => 'P_APPEARANCE', 'TXT_PAGE_H_ACTIVE_1' => 'P_APPEARANCE', 'TXT_PAGE_H_SUBPAGEORDER' => 'P_APPEARANCE', 'TXT_PAGE_H_NEWVERSION' => 'P_VERSIONS', 'TXT_PAGE_H_NEWVERSION_FROM' => 'P_VERSIONS', 'TXT_PAGE_H_APPROVE' => 'P_VERSIONS', 'TXT_PAGE_H_PUBLISH' => 'P_VERSIONS', 'TXT_PAGE_H_PUBLISHED_UPDATED' => 'P_VERSIONS', 'TXT_PAGE_H_AUTOPUBLISH' => 'P_VERSIONS', 'TXT_PAGE_H_PUBLISH' => 'P_VERSIONS', 'TXT_PAGE_H_TRASHED' => 'P_VERSIONS', 'TXT_PAGE_H_RESTORED' => 'P_VERSIONS', 'TXT_PAGE_H_AUTOPUBLISH_ADDED' => 'P_PUBLISHING', 'TXT_PAGE_H_AUTOPUBLISH_CHANGED' => 'P_PUBLISHING', 'TXT_PAGE_H_AUTOPUBLISH_DELETED' => 'P_PUBLISHING', 'TXT_COMMON_H_COMMENT_ADD' => 'P_COMMENTS', 'TXT_COMMON_H_COMMENT_CHANGE' => 'P_COMMENTS', 'TXT_COMMON_H_COMMENT_REMOVE' => 'P_COMMENTS', 'TXT_COMMON_H_COMMENT_APPROVED' => 'P_COMMENTS', 'TXT_COMMON_H_COMMENT_MARKED_AS_SPAM' => 'P_COMMENTS', 'TXT_EXTENSION_H_LOGENTRY' => 'P_EXTENSIONS'); $tab_mappings_reverse = array(); foreach ($tab_mappings as $tab_mappings_idx => $tab_mappings_item) { if (!is_array($tab_mappings_reverse[$tab_mappings_item])) { $tab_mappings_reverse[$tab_mappings_item] = array($tab_mappings_idx); } else { array_push($tab_mappings_reverse[$tab_mappings_item], $tab_mappings_idx); } } function sumchanges($changeslist, $newchangeslist, $objecttype = "NONE", $cms) { $addwhere = count($changeslist);
<?php header('Content-type: text/xml'); $tmpUser = new User(sUserMgr()->getCurrentUserID()); $tmpUserInfo = $tmpUser->get(); $adminAllowed = $tmpUser->checkPermission('RENTRYMASKS'); if ($adminAllowed || $this->request->parameters['selectiondialog'] == '1' || $this->request->parameters['action'] == 'insertcontent') { $icons = new Icons(); $selectiondialog = $this->request->parameters['selectiondialog']; if ($selectiondialog || $selectiondialog == "1" || $this->request->parameters['action'] == 'insertcontent') { $noclick = 'noclick'; } else { $noclick = ''; } // All entrymasks $entrymaskMgr = new Entrymasks(); $entrymasks = $entrymaskMgr->getList(); $yo = $entrymaskMgr->tree->nest($entrymasks); $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_ENTRYMASKS'] != '' ? $itext['TXT_ENTRYMASKS'] : '$TXT_ENTRYMASKS', 'URL' => $root_link, 'IC' => $this->imgpath . '/window/x.gif', 'EXP' => 'true', 'CHK' => 'false', 'CSTSTYLE' => 'root nodelete', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $entrymasks[0]['ID'] . '-entrymask', 'YG_TYPE' => 'entrymask', 'YG_PROPERTY' => 'name', 'DND' => 'false', 'XTRA' => $noclick); array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level++, 'PROPS' => $props)); gen_tree($yo[1]['CHILDREN'], $icons->icon, $this->imgpath, $xml_tree, $tree_id, $tree_level, $noclick); } function gen_tree($current, $icons, $imgpath, &$xml_tree, &$tree_id, &$tree_level, $noclick) { while (list($key, $value) = each($current)) { if ($current[$key]['FOLDER']) { $img = $imgpath . 'icons/ico_folder_s.png,' . $imgpath . 'icons/ico_folderopen_s.png'; $cststyle = '';
/** * Adds an Entrymask to this Cblock (by identifier) * * @param string $identifier Entrymask identifier * @return int Entrymask Cblock Link Id */ function addEntrymaskByIdentifier($identifier) { $entrymasks = new Entrymasks(); $entrymaskInfo = $entrymasks->getByIdentifier($identifier); $this->markAsChanged(); return $this->addEntrymask($entrymaskInfo['OBJECTID']); }
$value = str_replace('\\n', "\n", $value); $value = convertShortURLsToSpecialURLs($value); } // Set the new property if ($templateMgr->setName($data[0], $value) === false) { $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']); } else { $value = str_replace("\n", '\\n', $value); $jsQueue->add($data[0], HISTORYTYPE_TEMPLATE, 'OBJECT_CHANGE', sGuiUS(), 'template', NULL, NULL, $this->reponsedata[$property]->yg_id, 'name', $value); $koala->queueScript("Koala.yg_fadeFields(\$('" . $winID . "'), '.changed');"); // Special case for name $jsQueue->add($data[0], HISTORYTYPE_TEMPLATE, 'REFRESH_WINDOW', sGuiUS(), 'name'); } break; case 'entrymask': $entrymaskMgr = new Entrymasks(); // Get the entrymask $entrymask = $entrymaskMgr->get($data[0]); $oldname = $entrymask['NAME']; $value = str_replace("\r", '', str_replace("\n", '\\n', $this->reponsedata[$property]->value)); if ($oldname == $value) { // No update needed, henceforth break break; } // Check for empty name if (trim($value) == '') { //$jsQueue->add ($data[0], HISTORYTYPE_ENTRYMASK, 'OBJECT_CHANGE', sGuiUS(), 'entrymask', NULL, NULL, $this->reponsedata[$property]->yg_id, 'name', $oldvalue); //$jsQueue->add ($data[0], HISTORYTYPE_FILE, 'REFRESH_WINDOW', sGuiUS(), 'name'); $koala->alert($itext['TXT_CANT_CHANGE_ENTRYMASKTITLE_TO_EMPTY_VALUE']); break; }
<?php $jsQueue = new JSQueue(NULL); $entrymaskMgr = new Entrymasks(); $reftracker = new Reftracker(); switch ($action) { case 'entrymaskSaveConfig': $objectID = $this->params['objectID']; $wid = $this->params['wid']; $formfields = $this->params['formfields[]']; $formfield_types = $this->params['formfield_types[]']; $formfield_indexes = $this->params['formfield_indexes[]']; $haderror = false; // Ensure that $formfields is an array if (!is_array($formfields) && isset($formfields)) { $formfields = array($formfields); } // Ensure that $formfield_types is an array if (!is_array($formfield_types) && isset($formfield_types)) { $formfield_types = array($formfield_types); } // Ensure that $formfield_indexes is an array if (!is_array($formfield_indexes) && isset($formfield_indexes)) { $formfield_indexes = array($formfield_indexes); } $name = $this->params['name']; $code = $this->params['code']; // Set the new name if ($entrymaskMgr->setInfo($objectID, $name, $code) === false) { $koala->callJSFunction('Koala.yg_error', 'entrymask', $objectID . '-entrymask', 'code'); $haderror = true;
function getAdditionalFormfieldData(&$controlFormfields) { $entrymaskMgr = new Entrymasks(); $tagMgr = new Tags(); $filetypeMgr = new Filetypes(); for ($w = 0; $w < count($controlFormfields); $w++) { $controlFormfields[$w]['LVALUES'] = NULL; $controlFormfields[$w]['DISPLAYNAME'] = NULL; // Date & Datetime if ($controlFormfields[$w]['TYPE'] == 'DATE' || $controlFormfields[$w]['TYPE'] == 'DATETIME') { if ($controlFormfields[$w]['VALUE']) { $controlFormfields[$w]['VALUE'] = TStoLocalTS($controlFormfields[$w]['VALUE']); } } // Link if ($controlFormfields[$w]['TYPE'] == 'LINK') { $special_url = resolveSpecialURL($controlFormfields[$w]['URL']); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($controlFormfields[$w]['VALUE01']); if ($special_url_info['TYPE'] == 'IMG' || $special_url_info['TYPE'] == 'DOWN') { $controlFormfields[$w]['IS_FILE'] = true; $file = sFileMgr()->getFile($special_url_info['ID']); $link_fileinfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $controlFormfields[$w]['IDENTIFIER'] = $link_filetype['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $link_filetype['CODE']; $controlFormfields[$w]['COLOR'] = $link_filetype['COLOR']; $controlFormfields[$w]['FILE_ID'] = $special_url_info['ID']; } else { $pageMgr = new PageMgr($special_url_info['SITE']); $page = $pageMgr->getPage($special_url_info['ID']); $link_pageInfo = $page->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_pageInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; } } else { if (preg_match_all(sApp()->URLRegEx1, $controlFormfields[$w]['VALUE01'], $internal) > 0) { if ($internal[2][0] == 'download') { $controlFormfields[$w]['IS_FILE'] = true; $link_file = str_replace('/', '', $internal[3][0]); $file = sFileMgr()->getFile($link_file); $link_fileinfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $controlFormfields[$w]['IDENTIFIER'] = $link_filetype['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $link_filetype['CODE']; $controlFormfields[$w]['COLOR'] = $link_filetype['COLOR']; $controlFormfields[$w]['FILE_ID'] = $link_file; } else { $link_site = $internal[3][0]; $link_page = str_replace('/', '', $internal[5][0]); $pageMgr = new PageMgr($link_site); $page = $pageMgr->getPage($link_page); $link_pageInfo = $page->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_pageInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; } } elseif (substr($controlFormfields[$w]['URL'], 0, 7) == 'mailto:') { $controlFormfields[$w]['IS_EMAIL'] = true; } else { $linkInfo = checkLinkInternalExternal($controlFormfields[$w]['URL']); switch ($linkInfo['TYPE']) { case 'external': $controlFormfields[$w]['DISPLAYNAME'] = $controlFormfields[$w]['URL']; break; case 'internal': $controlFormfields[$w]['DISPLAYNAME'] = $linkInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; break; case 'file': $controlFormfields[$w]['IS_FILE'] = true; $controlFormfields[$w]['DISPLAYNAME'] = $linkInfo['NAME']; $controlFormfields[$w]['IDENTIFIER'] = $linkInfo['INFO']['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $linkInfo['INFO']['CODE']; $controlFormfields[$w]['COLOR'] = $linkInfo['INFO']['COLOR']; $controlFormfields[$w]['FILE_ID'] = $linkInfo['INFO']['FILE_ID']; break; } } } } // File if ($controlFormfields[$w]['TYPE'] == 'FILE') { if (trim($controlFormfields[$w]['FILE_ID'])) { $file = sFileMgr()->getFile($controlFormfields[$w]['FILE_ID']); if ($file) { $fileInfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $fileInfo['NAME']; $controlFormfields[$w]['IDENTIFIER'] = $fileInfo['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $fileInfo['CODE']; $controlFormfields[$w]['COLOR'] = $fileInfo['COLOR']; } } } // File if ($controlFormfields[$w]['TYPE'] == 'FILEFOLDER') { if (trim($controlFormfields[$w]['FILE_ID'])) { $file = sFileMgr()->getFile($controlFormfields[$w]['FILE_ID']); if ($file) { $fileInfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $fileInfo['NAME']; } } } // Contentblock if ($controlFormfields[$w]['TYPE'] == 'CO') { if (trim($controlFormfields[$w]['CBLOCK_ID'])) { $cb = sCblockMgr()->getCblock($controlFormfields[$w]['CBLOCK_ID']); $info = $cb->get(); $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // Tag if ($controlFormfields[$w]['TYPE'] == 'TAG') { if (trim($controlFormfields[$w]['TAG_ID'])) { $info = $tagMgr->get($controlFormfields[$w]['TAG_ID']); $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // Page if ($controlFormfields[$w]['TYPE'] == 'PAGE') { if (trim($controlFormfields[$w]['SITE_ID']) && trim($controlFormfields[$w]['PAGE_ID'])) { $tmpPageMgr = new PageMgr($controlFormfields[$w]['SITE_ID']); $tmpPage = $tmpPageMgr->getPage($controlFormfields[$w]['PAGE_ID']); $info = $tmpPage->get(); $info['RWRITE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $controlFormfields[$w]['PAGE_ID'], "RWRITE"); $info['RDELETE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $controlFormfields[$w]['PAGE_ID'], "RDELETE"); $iconData = getIconForPage($info); $controlFormfields[$w]['ICON'] = $iconData['iconclass']; $controlFormfields[$w]['STYLE'] = $iconData['style']; $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // List if ($controlFormfields[$w]['TYPE'] == 'LIST') { if (trim($controlFormfields[$w]['ENTRYMASKFORMFIELD'])) { $controlFormfields[$w]['LIST_VALUES'] = $entrymaskMgr->getListValuesByLinkID($controlFormfields[$w]['ENTRYMASKFORMFIELD']); } } } }