case 'TEXTAREA': $tempformfield['FORMFIELD'] = 2; $tempformfield['VALUE'] = replaceSpecialURLs($props[$c]['VALUE']); break; case 'RICHTEXT': $tempformfield['FORMFIELD'] = 3; $tempformfield['VALUE'] = replaceSpecialURLs($props[$c]['VALUE']); break; case 'CHECKBOX': $tempformfield['FORMFIELD'] = 4; break; case 'LINK': $tempformfield['FORMFIELD'] = 5; $special_url = resolveSpecialURL($props[$c]['VALUE']); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($props[$c]['VALUE']); if ($special_url_info['TYPE'] == 'IMG' || $special_url_info['TYPE'] == 'DOWN') { $tempformfield['IS_FILE'] = true; if ($special_url_info['ID']) { $file = sFileMgr()->getFile($special_url_info['ID']); $link_fileinfo = $file->get(); $tempformfield['LINKTITLE'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $tempformfield['IDENTIFIER'] = $link_filetype['IDENTIFIER']; $tempformfield['TYPECODE'] = $link_filetype['TYPECODE']; $tempformfield['COLOR'] = $link_filetype['COLOR']; $tempformfield['FILE_ID'] = $special_url_info['ID']; } } else { $pageMgr = new PageMgr($special_url_info['SITE']); $page = $pageMgr->getPage($special_url_info['ID']);
$data = explode('-', $this->reponsedata['null']->yg_id); $pageID = $data[0]; $siteID = $data[1]; } if ($pageID && $siteID) { $pageMgr = new PageMgr($siteID); $page = $pageMgr->getPage($pageID); $pageInfo = $page->get(); $jsQueue = new JSQueue(NULL, $siteID); } switch ($action) { case 'checkSpecialLinkType': $url = $this->params['url']; $result = getSpecialURLInfo($url); if (!$result) { $result = getSpecialURLInfo(createSpecialURLfromShortURL($url)); } echo json_encode($result); break; case 'checkLinkExternal': $url = $this->params['url']; $result = checkLinkInternalExternal($url); if ($result['TYPE'] == 'external') { echo $result['TYPE']; } else { echo $result['NAME']; } break; case 'savePagePublishingSettings': $autopublish_data = json_decode($this->params['autopublishData'], true); $changed_field = $this->params['changedField'];
} if ($history[$i]['TEXT'] == 'TXT_PAGE_H_PROP_DATE') { $history[$i]['NEWVALUE'] = date($itext['DATE_FORMAT'], TStoLocalTS($history[$i]['NEWVALUE'])); } if ($history[$i]['TEXT'] == 'TXT_PAGE_H_PROP_DATETIME') { $dateString = date($itext['DATE_FORMAT'], TStoLocalTS($history[$i]['NEWVALUE'])); $timeString = date('H', TStoLocalTS($history[$i]['NEWVALUE'])) . ':' . date('i', TStoLocalTS($history[$i]['NEWVALUE'])); $history[$i]['NEWVALUE'] = $dateString . ' ' . $timeString; } if ($history[$i]['TEXT'] == 'TXT_PAGE_H_PROP_LINK') { $special_url = resolveSpecialURL($history[$i]['NEWVALUE']); if ($special_url !== false) { $target_aid = ''; $target_id = ''; $target_type = 0; $special_url_info = getSpecialURLInfo($history[$i]['NEWVALUE']); if ($special_url_info['TYPE'] == 'DOWN') { $target_type = 'FILE'; $target_id = $special_url_info['ID']; if ($target_id) { $file = sFileMgr()->getFile($target_id); if ($file) { $objectInfo = $file->get(); $history[$i]['NEWVALUE'] = '<span onmouseover="$K.yg_hoverFileHint(\'' . $target_id . '\', event);"><span style="display:inline-block;" class="filetype ' . $objectInfo['COLOR'] . '">' . $objectInfo['CODE'] . '</span> ' . "<a onclick=\"\$K.yg_openObjectDetails('" . $target_id . "', 'file', '" . $objectInfo['NAME'] . "', {color:'" . $objectInfo['COLOR'] . "',typecode:'" . $objectInfo['CODE'] . "'});\">" . $objectInfo['NAME'] . "</a></span>"; } } } else { if ($special_url_info['TYPE'] == 'IMG') { $target_type = 'IMAGE'; $target_id = $special_url_info['ID']; if ($target_id) {
if ($objectdynprops[$objectdynprops_cnt]['VALUE']['site'] && $objectdynprops[$objectdynprops_cnt]['VALUE']['page']) { $pageMgr = new PageMgr($objectdynprops[$objectdynprops_cnt]['VALUE']['site']); $currPage = $pageMgr->getPage($objectdynprops[$objectdynprops_cnt]['VALUE']['page']); $pageInfo = $currPage->get(); $objectdynprops[$objectdynprops_cnt]['PAGETITLE'] = $pageInfo['NAME']; } } if ($object_property['TYPE'] == 'DATETIME' || $object_property['TYPE'] == 'DATE') { if ($objectdynprops[$objectdynprops_cnt]['VALUE']) { $objectdynprops[$objectdynprops_cnt]['VALUE'] = TStoLocalTS($objectdynprops[$objectdynprops_cnt]['VALUE']); } } if ($object_property['TYPE'] == 'LINK') { $special_url = resolveSpecialURL($objectdynprops[$objectdynprops_cnt]['VALUE']); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($objectdynprops[$objectdynprops_cnt]['VALUE']); if ($special_url_info['TYPE'] == 'IMG' || $special_url_info['TYPE'] == 'DOWN') { $objectdynprops[$objectdynprops_cnt]['IS_FILE'] = true; if ($special_url_info['ID']) { $tmpFile = sFileMgr()->getFile($special_url_info['ID']); if ($tmpFile) { $link_fileinfo = $tmpFile->get(); $objectdynprops[$objectdynprops_cnt]['LINKTITLE'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $objectdynprops[$objectdynprops_cnt]['FILEIDENTIFIER'] = $link_filetype['IDENTIFIER']; $objectdynprops[$objectdynprops_cnt]['FILEABBREVIATION'] = $link_filetype['CODE']; $objectdynprops[$objectdynprops_cnt]['FILECOLOR'] = $link_filetype['COLOR']; $objectdynprops[$objectdynprops_cnt]['FILE_ID'] = $special_url_info['ID']; } } } else {
/** * Updates References to Images (internal Links) * * @param int $srcType Source Reference Type * @param int $srcObjectId Source Object Id * @param int $srcVersion Source Object version * @param string $html HTML Code */ private function updateImgHrefFromHtml($srcType, $srcObjectId, $srcVersion, $html) { $srcType = (int) $srcType; $srcObjectId = (int) $srcObjectId; $srcVersion = (int) $srcVersion; $regexp_img = "<img\\s[^>]*src=(\"??)([^\" >]*?)[^>]*(.*)>"; if (preg_match_all("/{$regexp_img}/siU", stripslashes($html), $matches, PREG_SET_ORDER) > 0) { foreach ($matches as $match) { $targetUrl = $match[2]; $trgtObjectId = ""; $trgtType = 0; $special_url = resolveSpecialURL($targetUrl); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($targetUrl); switch ($special_url_info['TYPE']) { case 'DOWN': $trgtType = REFTYPE_FILE; break; case 'IMG': $trgtType = REFTYPE_IMAGE; break; case 'PAGE': $trgtType = REFTYPE_PAGE; break; } $trgtObjectId = $special_url_info['ID']; if ($trgtType != 0) { $this->addRef($srcType, $srcObjectId, $srcVersion, $trgtType, $trgtObjectId); } } else { $linkType = checkLinkInternalExternal($targetUrl); $targetUrlArray = explode('/', $targetUrl); switch ($linkType['TYPE']) { case 'internal': $trgtType = REFTYPE_PAGE; $trgtObjectId = $linkType['INFO']['ID']; break; case 'file': if ($targetUrlArray[1] == 'image') { $trgtType = REFTYPE_IMAGE; } else { $trgtType = REFTYPE_FILE; } $trgtObjectId = $linkType['INFO']['FILE_ID']; break; } $this->addRef($srcType, $srcObjectId, $srcVersion, $trgtType, $trgtObjectId); } } } }
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']); } } } }