<?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 ($hour || $minute || $month || $day || $year) { $timestamp = mktime($hour, $minute, 0, $month, $day, $year); $timestamp = TSfromLocalTS($timestamp); } else { $timestamp = 0; } if ($newly_added) { $this->params[$wid . '_fld___NEW_ID_' . $newly_added_idx . '__-PRESET'] = $timestamp; } else { $this->params[$wid . '_fld_' . $linkid . '-PRESET'] = $timestamp; } } // For List Formfields if ($formfieldinfo['FORMFIELD'] == 9) { $old_entries = $entrymaskMgr->getListValuesByLinkID($linkid); $entries = $this->params[$wid . '_fld_' . $linkid . '-ENTRIES[]']; $entry_ids = $this->params[$wid . '_fld_' . $linkid . '-ENTRY_IDS[]']; array_pop($entries); array_pop($entry_ids); // Check which entries to add $to_add = array(); foreach ($entry_ids as $entry_idx => $entry_id) { $add = true; foreach ($old_entries as $old_entry) { if ($entry_id == $old_entry['ID']) { $add = false; } } if ($add) { array_push($to_add, $entries[$entry_idx]);
$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']); } } } $output = $cos; $smarty->assign('dummymode', true); } elseif ($siteID == 'cblock' && $pageID == 'cblock') { // Contentblock Preview Mode $co_id = $this->request->parameters['co']; if ($co_id) { $cb = sCblockMgr()->getCblock($co_id); $co = $cb->get(); if (!$co['FOLDER']) { $co_site = $this->request->parameters['co_site']; $co_page = $this->request->parameters['co_page']; $cos = array();
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']); } } } }