Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • _processCmsTags
  • addArtspec
  • addslashes_deep
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • endsWith
  • extractNumber
  • generateDisplayFilePath
  • generateInfoButton
  • generateJs
  • getAktuellType
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • modTestModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • putFileContents
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setHelpContext
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • stripslashes_deep
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • xmlFileToArray
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the backend page for displaying all content of an article.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       Backend
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Fulai Zhang
 10:  * @copyright        four for business AG <www.4fb.de>
 11:  * @license          http://www.contenido.org/license/LIZENZ.txt
 12:  * @link             http://www.4fb.de
 13:  * @link             http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: $backendPath = cRegistry::getBackendPath();
 19: $backendUrl = cRegistry::getBackendUrl();
 20: 
 21: cInclude('includes', 'functions.str.php');
 22: cInclude('includes', 'functions.pathresolver.php');
 23: 
 24: if (!isset($idcat)) {
 25:     cRegistry::shutdown();
 26:     return;
 27: }
 28: 
 29: $edit = 'true';
 30: $scripts = '';
 31: 
 32: //save / set value
 33: if ($action == 'savecontype' || $action == 10) {
 34:     if ($data != '') {
 35:         $data = explode('||', substr($data, 0, -2));
 36:         foreach ($data as $value) {
 37:             $value = explode('|', $value);
 38:             if ($value[3] == '%$%EMPTY%$%') {
 39:                 $value[3] = '';
 40:             } else {
 41:                 $value[3] = str_replace('%$%SEPERATOR%$%', '|', $value[3]);
 42:             }
 43:             conSaveContentEntry($value[0], 'CMS_' . $value[1], $value[2], $value[3]);
 44:         }
 45: 
 46:         conMakeArticleIndex($idartlang, $idart);
 47: 
 48:         // restore orginal values
 49:         $data = $_REQUEST['data'];
 50:         $value = $_REQUEST['value'];
 51: 
 52:         $notification->displayNotification("info", i18n("Changes saved"));
 53:     }
 54: 
 55:     conGenerateCodeForArtInAllCategories($idart);
 56: } else if ($action == 'deletecontype') {
 57:     if (isset($_REQUEST['idcontent']) && is_numeric($_REQUEST['idcontent'])) {
 58:         $oContentColl = new cApiContentCollection();
 59: 
 60:         $linkedTypes = array(
 61:             4 => 22, // if a CMS_IMG is deleted, the corresponding CMS_IMAGEEDITOR will be deleted too
 62:             22 => 4  // the same goes for the other way round
 63:         );
 64: 
 65:         $contentItem = new cApiContent((int) $_REQUEST["idcontent"]);
 66:         if (isset($linkedTypes[$contentItem->get("idtype")])) {
 67:             $linkedIds = $oContentColl->getIdsByWhereClause("`idartlang`='" . $idartlang . "' AND `idtype`='" . $linkedTypes[$contentItem->get("idtype")] . "' AND `value`='" . $contentItem->get("value") . "'");
 68:             foreach ($linkedIds as $linkedId) {
 69:                 $oContentColl->delete($linkedId);
 70:             }
 71:         }
 72:         $oContentColl->delete((int) $_REQUEST['idcontent']);
 73:         $notification->displayNotification("info", i18n("Changes saved"));
 74: 
 75:         conGenerateCodeForArtInAllCategories($idart);
 76:     }
 77: }
 78: 
 79: //get active value
 80: 
 81: $result = array();
 82: $aList = array();
 83: $typeAktuell = array();
 84: $sortID = array("CMS_HTMLHEAD", "CMS_HEAD", "CMS_HTML", "CMS_TEXT",
 85:     "CMS_IMG", "CMS_IMGDESCR", "CMS_IMGEDITOR",
 86:     "CMS_LINK", "CMS_LINKTARGET", "CMS_LINKDESCR",
 87:     "CMS_LINKEDITOR",
 88:     "CMS_DATE", "CMS_TEASER", "CMS_FILELIST");
 89: 
 90: $aIdtype = array();
 91: $sql = "SELECT DISTINCT typeid FROM %s WHERE idartlang = %d ORDER BY typeid";
 92: $db->query($sql, $cfg["tab"]["content"], $_REQUEST["idartlang"]);
 93: while ($db->nextRecord()) {
 94:     $aIdtype[] = $db->f("typeid");
 95: }
 96: 
 97: foreach ($sortID as $name) {
 98: //    $sql = "SELECT b.idtype as idtype, b.type as name, a.typeid as id, a.value as value FROM " . $cfg["tab"]["content"] . " as a, " . $cfg["tab"]["type"] . " as b WHERE a.idartlang = " . cSecurity::toInteger($_REQUEST["idartlang"]) . " AND a.idtype = b.idtype AND b.type = '" . cSecurity::toString($name) . "' ORDER BY idtype, typeid, idcontent";
 99:     $sql = "SELECT b.idtype as idtype, b.type as name, a.typeid as id, a.value as value FROM %s AS a, %s AS b "
100:             . "WHERE a.idartlang = %d AND a.idtype = b.idtype AND b.type = '%s' ORDER BY idtype, typeid, idcontent";
101:     $db->query($sql, $cfg["tab"]["content"], $cfg["tab"]["type"], $_REQUEST["idartlang"], $name);
102:     while ($db->nextRecord() && $db->f("value") != '') {
103:         $result[$db->f("name")][$db->f("id")] = $db->f("value");
104:         if (!in_array($db->f("name"), $aList)) {
105:             $aList[$db->f("idtype")] = $db->f("name");
106:         }
107:     }
108: }
109: 
110: $typeAktuell = getAktuellType($typeAktuell, $aList);
111: //print_r($typeAktuell);
112: //create Layoutcode
113: //if ($action == 'con_content') {
114: //@fulai.zhang: Mark submenuitem 'Editor' in the CONTENIDO Backend (Area: Contenido --> Articles --> Editor)
115: $markSubItem = markSubMenuItem(5, true);
116: 
117: //Include tiny class
118: include($backendPath . 'external/wysiwyg/tinymce3/editorclass.php');
119: $oEditor = new cTinyMCEEditor('', '');
120: $oEditor->setToolbar('inline_edit');
121: 
122: //Get configuration for popup und inline tiny
123: $sConfigInlineEdit = $oEditor->getConfigInlineEdit();
124: $sConfigFullscreen = $oEditor->getConfigFullscreen();
125: 
126: $page = new cGuiPage("con_content_list");
127: 
128: //Replace vars in Script
129: 
130: $page->set('s', 'CONTENIDO_FULLHTML', $backendUrl);
131: 
132: //Set urls to file browsers
133: $page->set('s', 'IMAGE', $backendUrl . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=imagebrowser');
134: $page->set('s', 'FILE', $backendUrl . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=filebrowser');
135: $page->set('s', 'FLASH', $backendUrl . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=imagebrowser');
136: $page->set('s', 'MEDIA', $backendUrl . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=imagebrowser');
137: $page->set('s', 'FRONTEND', cRegistry::getFrontendUrl());
138: 
139: //Add tiny options and fill function leave_check()
140: $page->set('s', 'TINY_OPTIONS', $sConfigInlineEdit);
141: $page->set('s', 'TINY_FULLSCREEN', $sConfigFullscreen);
142: $page->set('s', 'IDARTLANG', $idartlang);
143: $page->set('s', 'CON_PATH', $backendUrl);
144: $page->set('s', 'CLOSE', i18n('Close editor'));
145: $page->set('s', 'SAVE', i18n('Close editor and save changes'));
146: $page->set('s', 'QUESTION', i18n('Do you want to save changes?'));
147: 
148: if (getEffectiveSetting('system', 'insite_editing_activated', 'true') == 'false') {
149:     $page->set('s', 'USE_TINY', '');
150: } else {
151:     $page->set('s', 'USE_TINY', 'swapTiny(this);');
152: }
153: 
154: //Show path of selected category to user
155: $breadcrumb = renderBackendBreadcrumb($syncoptions, true, true);
156: $page->set('s', 'CATEGORY', $breadcrumb);
157: 
158: if (count($result) <= 0) {
159:     $page->displayInfo(i18n("Article has no raw data"));
160:     $page->abortRendering();
161:     //$layoutcode .= '<div>--- ' . i18n("none") . ' ---</div>';
162: } else {
163:     foreach ($aIdtype as $idtype) {
164:         foreach ($sortID as $name) {
165:             if (in_array($name, array_keys($result)) && $result[$name][$idtype] != '') {
166:                 if (in_array($name . "[" . $idtype . "]", $typeAktuell)) {
167:                     $class = '';
168:                 } else {
169:                     $class = ' noactive';
170:                 }
171:                 $page->set("d", "EXTRA_CLASS", $class);
172:                 $page->set("d", "NAME", $name);
173:                 $page->set("d", "ID_TYPE", $idtype);
174:                 $page->next();
175:             }
176:         }
177:     }
178: }
179: 
180: //breadcrumb onclick
181: if (!isset($syncfrom)) {
182:     $syncfrom = -1;
183: }
184: $syncoptions = $syncfrom;
185: $page->set("s", "SYNCHOPTIONS", $syncoptions);
186: 
187: $page->set("s", "IDART", $idart);
188: $page->set("s", "IDCAT", $idcat);
189: $page->set("s", "IDLANG", $lang);
190: $page->set("s", "IDARTLANG", $idartlang);
191: $page->set("s", "IDCLIENT", $client);
192: 
193: // generate code
194: $code = _processCmsTags($aList, $result, true, $page->render(null, true));
195: ;
196: 
197: if ($code == "0601") {
198:     markSubMenuItem("1");
199:     $code = "<script type='text/javascript'>location.href = '" . $backendUrl . "main.php?frame=4&area=con_content_list&action=con_content&idart=" . $idart . "&idcat=" . $idcat . "&contenido=" . $contenido . "'; /*console.log(location.href);*/</script>";
200: } else {
201:     // inject some additional markup
202:     $code = cString::iReplaceOnce("</head>", "$markSubItem $scripts\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$encoding[$lang]\"></head>", $code);
203: }
204: 
205: if ($cfg["debug"]["codeoutput"]) {
206:     cDebug::out(conHtmlSpecialChars($code));
207: }
208: 
209: //show ContentTypeList
210: chdir(cRegistry::getFrontendPath());
211: eval("?>\n" . $code . "\n<?php\n");
212: //}
213: 
214: cRegistry::shutdown();
215: 
216: /**
217:  * Processes replacements of all existing CMS_... tags within passed code
218:  *
219:  * @param  array   $aList  CMS_...tags list
220:  * @param  array   $contentList  all CMS variables
221:  * @param  bool    $saveKeywords  Flag to save collected keywords during replacement process.
222:  * @param  array   $contentList  Assoziative list of CMS variables
223:  */
224: function _processCmsTags($aList, $contentList, $saveKeywords = true, $layoutCode) {
225:     // #####################################################################
226:     // NOTE: Variables below are required in included/evaluated content type
227:     // codes!
228:     global $db, $db2, $sess, $cfg, $code, $cfgClient, $encoding;
229: 
230:     // NOTE: Variables below are additionally required in included/evaluated
231:     // content type codes within backend edit mode!
232:     global $edit, $editLink, $belang;
233: 
234:     $idcat = $_REQUEST['idcat'];
235:     $idart = $_REQUEST['idart'];
236:     $lang = $_REQUEST['lang'];
237:     $client = $_REQUEST['client'];
238:     $idartlang = $_REQUEST['idartlang'];
239:     $contenido = $_REQUEST['contenido'];
240: 
241:     if (!is_object($db2)) {
242:         $db2 = cRegistry::getDb();
243:     }
244:     // End: Variables required in content type codes
245:     // #####################################################################
246: 
247:     $match = array();
248:     $keycode = array();
249: 
250:     // $a_content is used by included/evaluated content type codes below
251:     $a_content = $contentList;
252: 
253:     // Select all cms_type entries
254:     $_typeList = array();
255:     $oTypeColl = new cApiTypeCollection();
256:     $oTypeColl->select();
257:     while ($oType = $oTypeColl->next()) {
258:         $_typeList[] = $oType->toObject();
259:     }
260: 
261:     // Replace all CMS_TAGS[]
262:     foreach ($_typeList as $_typeItem) {
263:         $key = strtolower($_typeItem->type);
264:         $type = $_typeItem->type;
265:         if (in_array($type, $aList)) {
266:             // Try to find all CMS_{type}[{number}] values, e. g. CMS_HTML[1]
267:             // $tmp = preg_match_all('/(' . $type . ')\[+([a-z0-9_]+)+\]/i',
268:             // $this->_layoutCode, $match);
269:             $tmp = preg_match_all('/(' . $type . '\[+(\d)+\])/i', $layoutCode, $match);
270: 
271:             $a_[$key] = $match[0];
272: 
273:             $success = array_walk($a_[$key], 'extractNumber');
274: 
275:             $search = array();
276:             $replacements = array();
277: 
278:             $backendPath = cRegistry::getBackendPath();
279: 
280:             $typeCodeFile = $backendPath . 'includes/type/code/include.' . $type . '.code.php';
281:             $cTypeClassFile = $backendPath . 'classes/content_types/class.content.type.' . strtolower(str_replace('CMS_', '', $type)) . '.php';
282:             // classname format: CMS_HTMLHEAD -> cContentTypeHtmlhead
283:             $className = 'cContentType' . ucfirst(strtolower(str_replace('CMS_', '', $type)));
284: 
285:             foreach ($a_[$key] as $val) {
286:                 if (cFileHandler::exists($cTypeClassFile)) {
287:                     $tmp = $a_content[$_typeItem->type][$val];
288:                     $cTypeObject = new $className($tmp, $val, $a_content);
289:                     if (cRegistry::isBackendEditMode()) {
290:                         $tmp = $cTypeObject->generateEditCode();
291:                     } else {
292:                         $tmp = $cTypeObject->generateViewCode();
293:                     }
294:                 } else if (cFileHandler::exists($typeCodeFile)) {
295:                     // include CMS type code
296:                     include ($typeCodeFile);
297:                 } elseif (!empty($_typeItem->code)) {
298:                     // old version, evaluate CMS type code
299:                     cDeprecated("Move code for $type from table into file system (contenido/includes/cms/code/)");
300:                     eval($_typeItem->code);
301:                 }
302:                 $sql = "SELECT a.idcontent
303:                     FROM " . $cfg["tab"]["content"] . " as a, " . $cfg["tab"]["type"] . " as b
304:                     WHERE a.idartlang=" . cSecurity::toInteger($_REQUEST["idartlang"]) .
305:                         " AND a.idtype=b.idtype AND a.typeid = " . cSecurity::toInteger($val) . " AND b.type = '" . cSecurity::toString($type) . "'
306:                     ORDER BY a.idartlang, a.idtype, a.typeid";
307:                 $db->query($sql);
308:                 while ($db->nextRecord()) {
309:                     $idcontent = $db->f("idcontent");
310:                 }
311:                 $backendUrl = cRegistry::getBackendUrl();
312: 
313:                 $search[$val] = sprintf('%s[%s]', $type, $val);
314:                 $path = $backendUrl . 'main.php?area=con_content_list&action=deletecontype&changeview=edit&idart=' . $idart . '&idartlang=' . $idartlang .
315:                         '&idcat=' . $idcat . '&client=' . $client . '&lang=' . $lang . '&frame=4&contenido=' . $contenido . '&idcontent=' . $idcontent;
316:                 if ($_typeItem->idtype == 20 || $_typeItem->idtype == 21) {
317:                     $tmp = str_replace('";?>', '', $tmp);
318:                     $tmp = str_replace('<?php echo "', '', $tmp);
319:                     //echo "<textarea>"."?".">\n".stripslashes($tmp)."\n\";?"."><"."?php\n"."</textarea>";
320:                 }
321:                 $replacements[$val] = $tmp .
322:                         '<a href="javascript:setcontent(\'1\',\'' . $path . '\');">
323:                 <img border="0" src="' . $backendUrl . 'images/delete.gif">
324:                 </a>';
325:                 $keycode[$type][$val] = $tmp .
326:                         '<a href="javascript:setcontent(\'1\',\'' . $path . '\');">
327:                 <img border="0" src="' . $backendUrl . 'images/delete.gif">
328:                 </a>';
329:             }
330: 
331:             $code = str_ireplace($search, $replacements, $layoutCode);
332:             // execute CEC hook
333:             $code = cApiCecHook::executeAndReturn('Contenido.Content.conGenerateCode', $code);
334:             $layoutCode = stripslashes($code);
335:         }
336:     }
337:     $layoutCode = str_ireplace("<<", "[", $layoutCode);
338:     $layoutCode = str_ireplace(">>", "]", $layoutCode);
339:     return $layoutCode;
340: }
341: 
342: /**
343:  * Processes get all existing active CMS_... tags within passed code
344:  *
345:  * @param  array   $r  active CMS variables
346:  * @param  array   $aList  CMS_...tags list
347:  */
348: function getAktuellType($r, $aList) {
349:     $idcat = $_REQUEST['idcat'];
350:     $idart = $_REQUEST['idart'];
351:     $lang = $_REQUEST['lang'];
352:     $client = $_REQUEST['client'];
353:     global $db, $db2, $sess, $cfg, $code, $cfgClient, $encoding;
354: 
355:     // Select all cms_type entries
356:     $_typeList = array();
357:     $oTypeColl = new cApiTypeCollection();
358:     $oTypeColl->select();
359:     while ($oType = $oTypeColl->next()) {
360:         $_typeList[] = $oType->toObject();
361:     }
362: 
363:     // generate code
364:     $code = conGenerateCode($idcat, $idart, $lang, $client, false, false, false);
365:     foreach ($_typeList as $_typeItem) {
366:         $type = $_typeItem->type;
367:         if (in_array($type, $aList)) {
368:             // Try to find all CMS_{type}[{number}] values, e. g. CMS_HTML[1]
369:             $tmp = preg_match_all('/(' . $type . '\[+(\d)+\])/i', $code, $match);
370:             foreach ($match[0] as $s) {
371:                 if (!in_array($s, $r)) {
372:                     array_push($r, $s);
373:                 }
374:             }
375:         }
376:     }
377:     return $r;
378: }
379: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0