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:  * Defines the general CONTENIDO functions
   4:  *
   5:  * @package Core
   6:  * @subpackage Backend
   7:  * @version SVN Revision $Rev:$
   8:  *
   9:  * @author Jan Lengowski
  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: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
  16: 
  17: cInclude('includes', 'functions.file.php');
  18: 
  19: /**
  20:  * Extracts the available content-types from the database
  21:  *
  22:  * Creates an array $a_content[type][number] = content string
  23:  * f.e. $a_content['CMS_HTML'][1] = content string
  24:  * Same for array $a_description
  25:  *
  26:  * @param int $idartlang Language specific ID of the arcticle
  27:  */
  28: function getAvailableContentTypes($idartlang) {
  29:     global $db, $cfg, $a_content, $a_description;
  30: 
  31:     $sql = "SELECT
  32:                 *
  33:             FROM
  34:                 " . $cfg["tab"]["content"] . " AS a,
  35:                 " . $cfg["tab"]["art_lang"] . " AS b,
  36:                 " . $cfg["tab"]["type"] . " AS c
  37:             WHERE
  38:                 a.idtype    = c.idtype AND
  39:                 a.idartlang = b.idartlang AND
  40:                 b.idartlang = " . (int) $idartlang;
  41: 
  42:     $db->query($sql);
  43: 
  44:     while ($db->nextRecord()) {
  45:         $a_content[$db->f('type')][$db->f('typeid')] = $db->f('value');
  46:         $a_description[$db->f('type')][$db->f('typeid')] = i18n($db->f('description'));
  47:     }
  48: }
  49: 
  50: /**
  51:  * Checks if an article is assigned to multiple categories
  52:  *
  53:  * @param int $idart Article-Id
  54:  * @return bool Article assigned to multiple categories
  55:  */
  56: function isArtInMultipleUse($idart) {
  57:     global $cfg;
  58: 
  59:     $db = cRegistry::getDb();
  60:     $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = " . (int) $idart;
  61:     $db->query($sql);
  62: 
  63:     return ($db->affectedRows() > 1);
  64: }
  65: 
  66: /**
  67:  * Checks if a value is alphanumeric
  68:  *
  69:  * @param mixed $test Value to test
  70:  * @param bool $umlauts [Use german Umlaute] Optional
  71:  * @return bool Value is alphanumeric
  72:  */
  73: function isAlphanumeric($test, $umlauts = true) {
  74:     if ($umlauts == true) {
  75:         $match = "/^[a-z0-9ÄäÖöÜüß ]+$/i";
  76:     } else {
  77:         $match = "/^[a-z0-9 ]+$/i";
  78:     }
  79: 
  80:     return (preg_match($match, $test));
  81: }
  82: 
  83: /**
  84:  * Returns whether a string is UTF-8 encoded or not
  85:  *
  86:  * @param string $input
  87:  * @return bool
  88:  */
  89: function isUtf8($input) {
  90:     $len = strlen($input);
  91: 
  92:     for ($i = 0; $i < $len; $i++) {
  93:         $char = ord($input[$i]);
  94:         $n = 0;
  95: 
  96:         if ($char < 0x80) { // ASCII char
  97:             continue;
  98:         } else if (($char & 0xE0) === 0xC0 && $char > 0xC1) { // 2 byte long
  99:                                                               // char
 100:             $n = 1;
 101:         } else if (($char & 0xF0) === 0xE0) { // 3 byte long char
 102:             $n = 2;
 103:         } else if (($char & 0xF8) === 0xF0 && $char < 0xF5) { // 4 byte long
 104:                                                               // char
 105:             $n = 3;
 106:         } else {
 107:             return false;
 108:         }
 109: 
 110:         for ($j = 0; $j < $n; $j++) {
 111:             $i++;
 112: 
 113:             if ($i == $len || (ord($input[$i]) & 0xC0) !== 0x80) {
 114:                 return false;
 115:             }
 116:         }
 117:     }
 118:     return true;
 119: }
 120: 
 121: /**
 122:  * Returns multi-language month name (canonical) by its numeric value
 123:  *
 124:  * @param int $month
 125:  * @return string
 126:  */
 127: function getCanonicalMonth($month) {
 128:     switch ($month) {
 129:         case 1:
 130:             return (i18n("January"));
 131:             break;
 132:         case 2:
 133:             return (i18n("February"));
 134:             break;
 135:         case 3:
 136:             return (i18n("March"));
 137:             break;
 138:         case 4:
 139:             return (i18n("April"));
 140:             break;
 141:         case 5:
 142:             return (i18n("May"));
 143:             break;
 144:         case 6:
 145:             return (i18n("June"));
 146:             break;
 147:         case 7:
 148:             return (i18n("July"));
 149:             break;
 150:         case 8:
 151:             return (i18n("August"));
 152:             break;
 153:         case 9:
 154:             return (i18n("September"));
 155:             break;
 156:         case 10:
 157:             return (i18n("October"));
 158:             break;
 159:         case 11:
 160:             return (i18n("November"));
 161:             break;
 162:         case 12:
 163:             return (i18n("December"));
 164:             break;
 165:     }
 166: }
 167: 
 168: /**
 169:  * Get multi-language day
 170:  *
 171:  * @param int $iDay The day number of date(w)
 172:  * @return string Dayname of current language
 173:  */
 174: function getCanonicalDay($iDay) {
 175:     switch ($iDay) {
 176:         case 1:
 177:             return (i18n("Monday"));
 178:             break;
 179:         case 2:
 180:             return (i18n("Tuesday"));
 181:             break;
 182:         case 3:
 183:             return (i18n("Wednesday"));
 184:             break;
 185:         case 4:
 186:             return (i18n("Thursday"));
 187:             break;
 188:         case 5:
 189:             return (i18n("Friday"));
 190:             break;
 191:         case 6:
 192:             return (i18n("Saturday"));
 193:             break;
 194:         case 0:
 195:             return (i18n("Sunday"));
 196:             break;
 197:         default:
 198:             break;
 199:     }
 200: }
 201: 
 202: /**
 203:  * Returns a formatted date and/or timestring according to the current settings
 204:  *
 205:  * @param mixed $timestamp a timestamp. If no value is given the current time
 206:  *        will be used.
 207:  * @param bool $date if true the date will be included in the string
 208:  * @param bool $time if true the time will be included in the string
 209:  * @return string the formatted time string.
 210:  */
 211: function displayDatetime($timestamp = "", $date = false, $time = false) {
 212:     if ($timestamp == "") {
 213:         $timestamp = time();
 214:     } else {
 215:         $timestamp = strtotime($timestamp);
 216:     }
 217: 
 218:     $ret = "";
 219: 
 220:     if ($date && !$time) {
 221:         $ret = date(getEffectiveSetting("dateformat", "date", "Y-m-d"), $timestamp);
 222:     } else if ($time && !$date) {
 223:         $ret = date(getEffectiveSetting("dateformat", "time", "H:i:s"), $timestamp);
 224:     } else {
 225:         $ret = date(getEffectiveSetting("dateformat", "full", "Y-m-d H:i:s"), $timestamp);
 226:     }
 227:     return $ret;
 228: }
 229: 
 230: /**
 231:  * Returns the id of passed area
 232:  *
 233:  * @param int|string $area Area name or id
 234:  * @return int string
 235:  */
 236: function getIDForArea($area) {
 237:     if (!is_numeric($area)) {
 238:         $oArea = new cApiArea();
 239:         if ($oArea->loadBy('name', $area)) {
 240:             $area = $oArea->get('idarea');
 241:         }
 242:     }
 243: 
 244:     return $area;
 245: }
 246: 
 247: /**
 248:  * Returns the parent id of passed area
 249:  *
 250:  * @param mixed $area
 251:  * @return int
 252:  */
 253: function getParentAreaId($area) {
 254:     $oAreaColl = new cApiAreaCollection();
 255:     return $oAreaColl->getParentAreaID($area);
 256: }
 257: 
 258: /**
 259:  * Write JavaScript to mark
 260:  *
 261:  * @param int $menuitem Which menuitem to mark
 262:  * @param bool $return Return or echo script
 263:  */
 264: function markSubMenuItem($menuitem, $return = false) {
 265:     $str = '
 266:     <script type="text/javascript">
 267:     // @todo  Use conMarkSubmenuItem(id) in general.js, but we have to ensure to load the file!
 268:     (function(id){
 269:         var menuItem;
 270: 
 271:         try {
 272:             // Check if we are in a dual-frame or a quad-frame
 273:             if (parent.parent.frames[0].name == "header") {
 274:                 if (parent.frames["right_top"].document.getElementById(id)) {
 275:                     menuItem = parent.frames["right_top"].document.getElementById(id).getElementsByTagName("a")[0];
 276:                     parent.frames["right_top"].sub.clicked(menuItem);
 277:                 }
 278:             } else {
 279:                 // Check if submenuItem is existing and mark it
 280:                 if (parent.parent.frames["right"].frames["right_top"].document.getElementById(id)) {
 281:                     menuItem = parent.parent.frames["right"].frames["right_top"].document.getElementById(id).getElementsByTagName("a")[0];
 282:                     parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem);
 283:                 }
 284:             }
 285:         } catch (e) {}
 286:     })("c_' . $menuitem . '");
 287:     </script>';
 288: 
 289:     if ($return) {
 290:         return $str;
 291:     } else {
 292:         echo $str;
 293:     }
 294: }
 295: 
 296: /**
 297:  * Redirect to main area
 298:  *
 299:  * @param bool $send Redirect Yes/No
 300:  */
 301: function backToMainArea($send) {
 302:     if ($send) {
 303:         // Global vars
 304:         global $area, $sess, $idart, $idcat, $idartlang, $idcatart, $frame;
 305: 
 306:         // Get main area
 307:         $oAreaColl = new cApiAreaCollection();
 308:         $parent = $oAreaColl->getParentAreaID($area);
 309: 
 310:         // Create url string
 311:         $url_str = 'main.php?' . 'area=' . $parent . '&' . 'idcat=' . $idcat . '&' . 'idart=' . $idart . '&' . 'idartlang=' . $idartlang . '&' . 'idcatart=' . $idcatart . '&' . 'force=1&' . 'frame=' . $frame;
 312:         $url = $sess->url($url_str);
 313: 
 314:         // Redirect
 315:         header("location: $url");
 316:     }
 317: }
 318: 
 319: /**
 320:  * Returns list of languages (language ids) by passed client.
 321:  *
 322:  * @param int $client
 323:  * @return array
 324:  */
 325: function getLanguagesByClient($client) {
 326:     $oClientLangColl = new cApiClientLanguageCollection();
 327:     return $oClientLangColl->getLanguagesByClient($client);
 328: }
 329: 
 330: /**
 331:  * Returns all languages (language ids and names) of an client
 332:  *
 333:  * @param int $client
 334:  * @return array List of languages where the key is the language id and value
 335:  *         the language name
 336:  */
 337: function getLanguageNamesByClient($client) {
 338:     $oClientLangColl = new cApiClientLanguageCollection();
 339:     return $oClientLangColl->getLanguageNamesByClient($client);
 340: }
 341: 
 342: /**
 343:  * Adds slashes to passed string if PHP setting for magic quotes is disabled
 344:  *
 345:  * @param string $code String by reference
 346:  */
 347: function set_magic_quotes_gpc(&$code) {
 348:     global $cfg;
 349:     if (!$cfg['simulate_magic_quotes']) {
 350:         if (get_magic_quotes_gpc() == 0) {
 351:             $code = addslashes($code);
 352:         }
 353:     }
 354: }
 355: 
 356: /**
 357:  * Returns a list with all clients and languages.
 358:  *
 359:  * @return array Indexed array where the value is an assoziative array as
 360:  *         follows:
 361:  *         <pre>
 362:  *         - $arr[0]['idlang']
 363:  *         - $arr[0]['langname']
 364:  *         - $arr[0]['idclient']
 365:  *         - $arr[0]['clientname']
 366:  *         </pre>
 367:  */
 368: function getAllClientsAndLanguages() {
 369:     global $db, $cfg;
 370: 
 371:     $sql = "SELECT
 372:                 a.idlang as idlang,
 373:                 a.name as langname,
 374:                 b.name as clientname,
 375:                 b.idclient as idclient
 376:              FROM
 377:                 " . $cfg["tab"]["lang"] . " as a,
 378:                 " . $cfg["tab"]["clients_lang"] . " as c,
 379:                 " . $cfg["tab"]["clients"] . " as b
 380:              WHERE
 381:                 a.idlang = c.idlang AND
 382:                 c.idclient = b.idclient";
 383:     $db->query($sql);
 384: 
 385:     $aRs = array();
 386:     while ($db->nextRecord()) {
 387:         $aRs[] = array(
 388:             'idlang' => $db->f('idlang'),
 389:             'langname' => $db->f('langname'),
 390:             'idclient' => $db->f('idclient'),
 391:             'clientname' => $db->f('clientname')
 392:         );
 393:     }
 394:     return $aRs;
 395: }
 396: 
 397: function getmicrotime() {
 398:     list($usec, $sec) = explode(' ', microtime());
 399:     return ((float) $usec + (float) $sec);
 400: }
 401: 
 402: function isGroup($uid) {
 403:     $user = new cApiUser();
 404:     if ($user->loadByPrimaryKey($uid) === false) {
 405:         return true;
 406:     } else {
 407:         return false;
 408:     }
 409: }
 410: 
 411: function getGroupOrUserName($uid) {
 412:     $user = new cApiUser();
 413:     if ($user->loadByPrimaryKey($uid) === false) {
 414:         $group = new cApiGroup();
 415:         // Yes, it's a group. Let's try to load the group members!
 416:         if ($group->loadByPrimaryKey($uid) === false) {
 417:             return false;
 418:         } else {
 419:             return $group->getGroupName(true);
 420:         }
 421:     } else {
 422:         return $user->getField('realname');
 423:     }
 424: }
 425: 
 426: /**
 427:  * Checks if passed email address is valid or not
 428:  *
 429:  * @param string $email
 430:  * @param bool $strict No more used!
 431:  */
 432: function isValidMail($email, $strict = false) {
 433:     $validator = cValidatorFactory::getInstance('email');
 434:     return $validator->isValid($email);
 435: }
 436: 
 437: function htmldecode($string) {
 438:     $trans_tbl = conGetHtmlTranslationTable(HTML_ENTITIES);
 439:     $trans_tbl = array_flip($trans_tbl);
 440:     $ret = strtr($string, $trans_tbl);
 441:     return $ret;
 442: }
 443: 
 444: /**
 445:  * Loads the client information from the database and stores it in
 446:  * config.client.php.
 447:  * Reinitializes the $cfgClient array and fills it wih updated information if
 448:  * provided.
 449:  *
 450:  * @param number $idclient client id which will be updated
 451:  * @param string $htmlpath new HTML path. Starting with "http://"
 452:  * @param string $frontendpath path the to the frontend
 453:  */
 454: function updateClientCache($idclient = 0, $htmlpath = '', $frontendpath = '') {
 455:     global $cfg, $cfgClient, $errsite_idcat, $errsite_idart, $db;
 456: 
 457:     if (!is_array($cfgClient)) {
 458:         $cfgClient = array();
 459:     }
 460: 
 461:     if (!is_object($db)) {
 462:         $db = cRegistry::getDb();
 463:     }
 464: 
 465:     if ($idclient != 0 && $htmlpath != '' && $frontendpath != '') {
 466:         $cfgClient[$idclient]['path']['frontend'] = cSecurity::escapeString($frontendpath);
 467:         $cfgClient[$idclient]['path']['htmlpath'] = cSecurity::escapeString($htmlpath);
 468:     }
 469: 
 470:     $sql = 'SELECT idclient, name, errsite_cat, errsite_art FROM ' . $cfg['tab']['clients'];
 471:     $db->query($sql);
 472: 
 473:     $htmlpaths = array();
 474:     $frontendpaths = array();
 475:     foreach ($cfgClient as $id => $aclient) {
 476:         if (is_array($aclient)) {
 477:             $htmlpaths[$id] = $aclient["path"]["htmlpath"];
 478:             $frontendpaths[$id] = $aclient["path"]["frontend"];
 479:         }
 480:     }
 481:     unset($cfgClient);
 482:     $cfgClient = array();
 483: 
 484:     foreach ($htmlpaths as $id => $path) {
 485:         $cfgClient[$id]["path"]["htmlpath"] = $htmlpaths[$id];
 486:         $cfgClient[$id]["path"]["frontend"] = $frontendpaths[$id];
 487:     }
 488: 
 489:     while ($db->nextRecord()) {
 490:         $iClient = $db->f('idclient');
 491:         $cfgClient['set'] = 'set';
 492: 
 493:         $cfgClient[$iClient]['name'] = conHtmlSpecialChars(str_replace(array(
 494:             '*/',
 495:             '/*',
 496:             '//'
 497:         ), '', $db->f('name')));
 498: 
 499:         $errsite_idcat[$iClient] = $db->f('errsite_cat');
 500:         $errsite_idart[$iClient] = $db->f('errsite_art');
 501:         $cfgClient[$iClient]["errsite"]["idcat"] = $errsite_idcat[$iClient];
 502:         $cfgClient[$iClient]["errsite"]["idart"] = $errsite_idart[$iClient];
 503: 
 504:         $cfgClient[$iClient]['images'] = $cfgClient[$iClient]['path']['htmlpath'] . 'images/';
 505:         $cfgClient[$iClient]['upload'] = 'upload/';
 506: 
 507:         $cfgClient[$iClient]['htmlpath']['frontend'] = $cfgClient[$iClient]['path']['htmlpath'];
 508: 
 509:         $cfgClient[$iClient]['upl']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'upload/';
 510:         $cfgClient[$iClient]['upl']['htmlpath'] = $cfgClient[$iClient]['htmlpath']['frontend'] . 'upload/';
 511:         $cfgClient[$iClient]['upl']['frontendpath'] = 'upload/';
 512: 
 513:         $cfgClient[$iClient]['css']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'css/';
 514: 
 515:         $cfgClient[$iClient]['js']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'js/';
 516: 
 517:         $cfgClient[$iClient]['tpl']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'templates/';
 518: 
 519:         $cfgClient[$iClient]['cache']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'cache/';
 520:         $cfgClient[$iClient]['cache']['frontendpath'] = 'cache/';
 521: 
 522:         $cfgClient[$iClient]['code']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'cache/code/';
 523:         $cfgClient[$iClient]['code']['frontendpath'] = 'cache/code/';
 524: 
 525:         $cfgClient[$iClient]['xml']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'xml/';
 526:         $cfgClient[$iClient]['xml']['frontendpath'] = 'xml/';
 527: 
 528:         $cfgClient[$iClient]['template']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'templates/';
 529:         $cfgClient[$iClient]['template']['frontendpath'] = 'templates/';
 530: 
 531:         $cfgClient[$iClient]['data']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/';
 532: 
 533:         $cfgClient[$iClient]['module']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/modules/';
 534:         $cfgClient[$iClient]['module']['frontendpath'] = 'data/modules/';
 535: 
 536:         $cfgClient[$iClient]['config']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/config/' . CON_ENVIRONMENT . '/';
 537:         $cfgClient[$iClient]['config']['frontendpath'] = 'data/config/';
 538: 
 539:         $cfgClient[$iClient]['layout']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/layouts/';
 540:         $cfgClient[$iClient]['layout']['frontendpath'] = 'data/layouts/';
 541: 
 542:         $cfgClient[$iClient]['log']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/logs/';
 543:         $cfgClient[$iClient]['log']['frontendpath'] = 'data/logs/';
 544: 
 545:         $cfgClient[$iClient]['version']['path'] = $cfgClient[$iClient]['path']['frontend'] . 'data/version/';
 546:         $cfgClient[$iClient]['version']['frontendpath'] = 'data/version/';
 547:     }
 548: 
 549:     $aConfigFileContent = array();
 550:     $aConfigFileContent[] = '<?php';
 551:     $aConfigFileContent[] = 'global $cfgClient;';
 552:     $aConfigFileContent[] = '';
 553: 
 554:     foreach ($cfgClient as $iIdClient => $aClient) {
 555:         if ((int) $iIdClient > 0 && is_array($aClient)) {
 556: 
 557:             $aConfigFileContent[] = '/* ' . $aClient['name'] . ' */';
 558:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["name"] = "' . $aClient['name'] . '";';
 559:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["errsite"]["idcat"] = "' . $aClient["errsite"]["idcat"] . '";';
 560:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["errsite"]["idart"] = "' . $aClient["errsite"]["idart"] . '";';
 561:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["images"] = "' . $aClient["path"]["htmlpath"] . 'images/";';
 562:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["upload"] = "upload/";';
 563: 
 564:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["path"]["frontend"] = "' . $aClient["path"]["frontend"] . '";';
 565: 
 566:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["htmlpath"]["frontend"] = "' . $aClient["path"]["htmlpath"] . '";';
 567: 
 568:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["upl"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "upload/";';
 569:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["upl"]["htmlpath"] = "' . $aClient["htmlpath"]["frontend"] . 'upload/";';
 570:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["upl"]["frontendpath"] = "upload/";';
 571: 
 572:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["css"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "css/";';
 573: 
 574:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["js"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "js/";';
 575: 
 576:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["tpl"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "templates/";';
 577: 
 578:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["cache"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "cache/";';
 579:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["cache"]["frontendpath"] = "cache/";';
 580: 
 581:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["code"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "cache/code/";';
 582:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["code"]["frontendpath"] = "cache/code/";';
 583: 
 584:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["xml"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "xml/";';
 585:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["xml"]["frontendpath"] = "xml/";';
 586: 
 587:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["template"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "templates/";';
 588:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["template"]["frontendpath"] = "templates/";';
 589: 
 590:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["data"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/";';
 591: 
 592:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["module"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/modules/";';
 593:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["module"]["frontendpath"] = "data/modules/";';
 594: 
 595:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["config"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/config/' . CON_ENVIRONMENT . '/";';
 596:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["config"]["frontendpath"] = "data/config/";';
 597: 
 598:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["layout"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/layouts/";';
 599:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["layout"]["frontendpath"] = "data/layouts/";';
 600: 
 601:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["log"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/logs/";';
 602:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["log"]["frontendpath"] = "data/logs/";';
 603: 
 604:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["version"]["path"] = $cfgClient[' . $iIdClient . ']["path"]["frontend"] . "data/version/";';
 605:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["version"]["frontendpath"] = "data/version/";';
 606:             $aConfigFileContent[] = '$cfgClient[' . $iIdClient . ']["path"]["htmlpath"] = "' . $aClient['path']['htmlpath'] . '";';
 607:             $aConfigFileContent[] = '';
 608:         }
 609:     }
 610:     $aConfigFileContent[] = '$cfgClient["set"] = "set";';
 611:     $aConfigFileContent[] = '?>';
 612: 
 613:     cFileHandler::write($cfg['path']['contenido_config'] . 'config.clients.php', implode(PHP_EOL, $aConfigFileContent));
 614: 
 615:     return $cfgClient;
 616: }
 617: 
 618: /**
 619:  * Sets a system property entry
 620:  *
 621:  * @modified Timo Trautmann 22.02.2008 Support for editing name and type
 622:  *
 623:  * @param string $type The type of the item
 624:  * @param string $name The name of the item
 625:  * @param string $value The value of the item
 626:  * @param int $idsystemprop The sysprop id, use optional. If set it allows to
 627:  *        modify type name and value
 628:  */
 629: function setSystemProperty($type, $name, $value, $idsystemprop = 0) {
 630:     if ($type == '' || $name == '') {
 631:         return false;
 632:     }
 633: 
 634:     $idsystemprop = (int) $idsystemprop;
 635: 
 636:     $systemPropColl = new cApiSystemPropertyCollection();
 637: 
 638:     if ($idsystemprop == 0) {
 639:         $prop = $systemPropColl->setValueByTypeName($type, $name, $value);
 640:     } else {
 641:         $prop = $systemPropColl->setTypeNameValueById($type, $name, $value, $idsystemprop);
 642:     }
 643: }
 644: 
 645: /**
 646:  * Remove a system property entry
 647:  *
 648:  * @param string $type The type of the item
 649:  * @param string $name The name of the item
 650:  * @return bool
 651:  */
 652: function deleteSystemProperty($type, $name) {
 653:     $systemPropColl = new cApiSystemPropertyCollection();
 654:     $systemPropColl->deleteByTypeName($type, $name);
 655: }
 656: 
 657: /**
 658:  * Retrieves all available system properties.
 659:  * Array format:
 660:  *
 661:  * $array[$type][$name] = $value;
 662:  *
 663:  * @modified Timo Trautmann 22.02.2008 Support for editing name and type editing
 664:  * by primaray key idsystemprop
 665:  * if bGetPropId is set:
 666:  * $array[$type][$name][value] = $value;
 667:  * $array[$type][$name][idsystemprop] = $idsystemprop;
 668:  *
 669:  * @param bool $bGetPropId If true special mode is activated which generates for
 670:  *        each property a third array, which also contains idsystemprop value
 671:  * @return array
 672:  */
 673: function getSystemProperties($bGetPropId = false) {
 674:     $return = array();
 675: 
 676:     $systemPropColl = new cApiSystemPropertyCollection();
 677:     $props = $systemPropColl->fetchAll('type ASC, name ASC, value ASC');
 678:     foreach ($props as $prop) {
 679:         $item = $prop->toArray();
 680: 
 681:         if ($bGetPropId) {
 682:             $return[$item['type']][$item['name']]['value'] = $item['value'];
 683:             $return[$item['type']][$item['name']]['idsystemprop'] = $item['idsystemprop'];
 684:         } else {
 685:             $return[$item['type']][$item['name']] = $item['value'];
 686:         }
 687:     }
 688: 
 689:     return $return;
 690: }
 691: 
 692: /**
 693:  * Gets a system property entry
 694:  *
 695:  * @param string $type The type of the item
 696:  * @param string $name The name of the item
 697:  * @return string bool property value or false if nothing was found
 698:  */
 699: function getSystemProperty($type, $name) {
 700:     $systemPropColl = new cApiSystemPropertyCollection();
 701:     $prop = $systemPropColl->fetchByTypeName($type, $name);
 702:     return ($prop)? $prop->get('value') : false;
 703: }
 704: 
 705: /**
 706:  * Gets system property entries
 707:  *
 708:  * @param string $type The type of the properties
 709:  * @return array Assoziative array like $arr[name] = value
 710:  */
 711: function getSystemPropertiesByType($type) {
 712:     $return = array();
 713: 
 714:     $systemPropColl = new cApiSystemPropertyCollection();
 715:     $props = $systemPropColl->fetchByType($type);
 716:     foreach ($props as $prop) {
 717:         $return[$prop->get('name')] = $prop->get('value');
 718:     }
 719:     if (count($return) > 1) {
 720:         ksort($return);
 721:     }
 722:     return $return;
 723: }
 724: 
 725: /**
 726:  * Returns the current effective setting for a property.
 727:  *
 728:  * The order is:
 729:  * System => Client => Group => User
 730:  *
 731:  * System properties can be overridden by the group, and group
 732:  * properties can be overridden by the user.
 733:  *
 734:  * @param string $type The type of the item
 735:  * @param string $name The name of the item
 736:  * @param string $default Optional default value
 737:  * @return mixed boolean false if nothing was found
 738:  */
 739: function getEffectiveSetting($type, $name, $default = '') {
 740:     return cEffectiveSetting::get($type, $name, $default);
 741: }
 742: 
 743: /**
 744:  * Returns the current effective settings for a type of properties.
 745:  *
 746:  * The order is:
 747:  * System => Client => Group => User
 748:  *
 749:  * System properties can be overridden by the group, and group
 750:  * properties can be overridden by the user.
 751:  *
 752:  * @param string $type The type of the item
 753:  * @return array Value
 754:  */
 755: function getEffectiveSettingsByType($type) {
 756:     return cEffectiveSetting::getByType($type);
 757: }
 758: 
 759: /**
 760:  * Retrieve list of article specifications for current client and language
 761:  *
 762:  * @return array list of article specifications
 763:  */
 764: function getArtspec() {
 765:     global $db, $cfg, $lang, $client;
 766:     $sql = "SELECT artspec, idartspec, online, artspecdefault FROM " . $cfg['tab']['art_spec'] . "
 767:             WHERE client = " . (int) $client . " AND lang = " . (int) $lang . " ORDER BY artspec ASC";
 768:     $db->query($sql);
 769: 
 770:     $artspec = array();
 771: 
 772:     while ($db->nextRecord()) {
 773:         $artspec[$db->f("idartspec")]['artspec'] = $db->f("artspec");
 774:         $artspec[$db->f("idartspec")]['online'] = $db->f("online");
 775:         $artspec[$db->f("idartspec")]['default'] = $db->f("artspecdefault");
 776:     }
 777:     return $artspec;
 778: }
 779: 
 780: /**
 781:  * Add new article specification
 782:  *
 783:  * @param string $artspectext specification text
 784:  * @param int $online Online status (1 or 0)
 785:  * @return void
 786:  */
 787: function addArtspec($artspectext, $online) {
 788:     global $db, $cfg, $lang, $client;
 789: 
 790:     if (isset($_POST['idartspec'])) { // update
 791:         $fields = array(
 792:             'artspec' => $artspectext,
 793:             'online' => (int) $online
 794:         );
 795:         $where = array(
 796:             'idartspec' => (int) $_POST['idartspec']
 797:         );
 798:         $sql = $db->buildUpdate($cfg['tab']['art_spec'], $fields, $where);
 799:     } else {
 800:         $fields = array(
 801:             'client' => (int) $client,
 802:             'lang' => (int) $lang,
 803:             'artspec' => $artspectext,
 804:             'online' => 0,
 805:             'artspecdefault' => 0
 806:         );
 807:         $sql = $db->buildInsert($cfg['tab']['art_spec'], $fields);
 808:     }
 809:     $db->query($sql);
 810: }
 811: 
 812: /**
 813:  * Delete specified article specification
 814:  *
 815:  * @param int $idartspec article specification id
 816:  */
 817: function deleteArtspec($idartspec) {
 818:     global $db, $cfg;
 819:     $sql = "DELETE FROM " . $cfg['tab']['art_spec'] . " WHERE idartspec = " . (int) $idartspec;
 820:     $db->query($sql);
 821: 
 822:     $sql = "UPDATE " . $cfg["tab"]["art_lang"] . " SET artspec = 0 WHERE artspec = " . (int) $idartspec;
 823:     $db->query($sql);
 824: }
 825: 
 826: /**
 827:  * Set article specifications online
 828:  *
 829:  * Flag to switch if an article specification should be shown the frontend or
 830:  * not
 831:  *
 832:  * @param int $idartspec article specification id
 833:  * @param int $online 0/1 switch the status between on an offline
 834:  */
 835: function setArtspecOnline($idartspec, $online) {
 836:     global $db, $cfg;
 837:     $sql = "UPDATE " . $cfg['tab']['art_spec'] . " SET online = " . (int) $online . " WHERE idartspec = " . (int) $idartspec;
 838:     $db->query($sql);
 839: }
 840: 
 841: /**
 842:  * Set a default article specification
 843:  *
 844:  * While creating a new article this defined article specification will be
 845:  * default setting
 846:  *
 847:  * @param int $idartspec Article specification id
 848:  */
 849: function setArtspecDefault($idartspec) {
 850:     global $db, $cfg, $lang, $client;
 851:     $sql = "UPDATE " . $cfg['tab']['art_spec'] . " SET artspecdefault=0 WHERE client = " . (int) $client . " AND lang = " . (int) $lang;
 852:     $db->query($sql);
 853: 
 854:     $sql = "UPDATE " . $cfg['tab']['art_spec'] . " SET artspecdefault = 1 WHERE idartspec = " . (int) $idartspec;
 855:     $db->query($sql);
 856: }
 857: 
 858: /**
 859:  * Build a Article select Box
 860:  *
 861:  * @param string $sName Name of the SelectBox
 862:  * @param string $iIdCat category id
 863:  * @param string $sValue Value of the SelectBox
 864:  * @return string HTML
 865:  */
 866: function buildArticleSelect($sName, $iIdCat, $sValue) {
 867:     global $cfg, $lang;
 868: 
 869:     $db = cRegistry::getDb();
 870: 
 871:     $selectElem = new cHTMLSelectElement($sName, "", $sName);
 872:     $selectElem->appendOptionElement(new cHTMLOptionElement(i18n("Please choose"), ""));
 873: 
 874:     $sql = "SELECT b.title, b.idart FROM
 875:                " . $cfg["tab"]["art"] . " AS a, " . $cfg["tab"]["art_lang"] . " AS b, " . $cfg["tab"]["cat_art"] . " AS c
 876:                WHERE c.idcat = " . (int) $iIdCat . "
 877:                AND b.idlang = " . (int) $lang . " AND b.idart = a.idart and b.idart = c.idart
 878:                ORDER BY b.title";
 879: 
 880:     $db->query($sql);
 881: 
 882:     while ($db->nextRecord()) {
 883:         if ($sValue != $db->f('idart')) {
 884:             $selectElem->appendOptionElement(new cHTMLOptionElement($db->f('title'), $db->f('idart')));
 885:         } else {
 886:             $selectElem->appendOptionElement(new cHTMLOptionElement($db->f('title'), $db->f('idart'), true));
 887:         }
 888:     }
 889: 
 890:     return $selectElem->toHTML();
 891: }
 892: 
 893: /**
 894:  * Build a Category / Article select Box
 895:  *
 896:  * @param string Name of the SelectBox
 897:  * @param string Value of the SelectBox
 898:  * @param int Value of highest level that should be shown
 899:  * @param string Optional css class for select
 900:  * @return string HTML
 901:  */
 902: function buildCategorySelect($sName, $sValue, $sLevel = 0, $sClass = '') {
 903:     global $cfg, $client, $lang;
 904: 
 905:     $db = cRegistry::getDb();
 906:     $db2 = cRegistry::getDb();
 907: 
 908:     $selectElem = new cHTMLSelectElement($sName, "", $sName);
 909:     $selectElem->setClass($sClass);
 910:     $selectElem->appendOptionElement(new cHTMLOptionElement(i18n("Please choose"), ""));
 911: 
 912:     if ($sLevel > 0) {
 913:         $addString = "AND c.level < " . (int) $sLevel;
 914:     }
 915: 
 916:     $sql = "SELECT a.idcat AS idcat, b.name AS name, c.level FROM
 917:            " . $cfg["tab"]["cat"] . " AS a, " . $cfg["tab"]["cat_lang"] . " AS b,
 918:            " . $cfg["tab"]["cat_tree"] . " AS c WHERE a.idclient = " . (int) $client . "
 919:            AND b.idlang = " . (int) $lang . " AND b.idcat = a.idcat AND c.idcat = a.idcat " . $addString . "
 920:            ORDER BY c.idtree";
 921: 
 922:     $db->query($sql);
 923: 
 924:     $categories = array();
 925: 
 926:     while ($db->nextRecord()) {
 927:         $categories[$db->f("idcat")]["name"] = $db->f("name");
 928: 
 929:         $sql2 = "SELECT level FROM " . $cfg["tab"]["cat_tree"] . " WHERE idcat = " . (int) $db->f("idcat");
 930:         $db2->query($sql2);
 931: 
 932:         if ($db2->nextRecord()) {
 933:             $categories[$db->f("idcat")]["level"] = $db2->f("level");
 934:         }
 935: 
 936:         $sql2 = "SELECT a.title AS title, b.idcatart AS idcatart FROM
 937:                 " . $cfg["tab"]["art_lang"] . " AS a,  " . $cfg["tab"]["cat_art"] . " AS b
 938:                 WHERE b.idcat = '" . $db->f("idcat") . "' AND a.idart = b.idart AND
 939:                 a.idlang = " . (int) $lang;
 940: 
 941:         $db2->query($sql2);
 942: 
 943:         while ($db2->nextRecord()) {
 944:             $categories[$db->f("idcat")]["articles"][$db2->f("idcatart")] = $db2->f("title");
 945:         }
 946:     }
 947: 
 948:     foreach ($categories as $tmpidcat => $props) {
 949:         $spaces = "&nbsp;&nbsp;";
 950: 
 951:         for ($i = 0; $i < $props["level"]; $i++) {
 952:             $spaces .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 953:         }
 954: 
 955:         $tmp_val = $tmpidcat;
 956: 
 957:         if ($sValue != $tmp_val) {
 958:             $selectElem->appendOptionElement(new cHTMLOptionElement($spaces . ">" . $props["name"], $tmp_val));
 959:         } else {
 960:             $selectElem->appendOptionElement(new cHTMLOptionElement($spaces . ">" . $props["name"], $tmp_val, true));
 961:         }
 962:     }
 963: 
 964:     return $selectElem->toHTML();
 965: }
 966: 
 967: /**
 968:  * Converts a size in bytes in a human readable form
 969:  *
 970:  * @param int $number Some number of bytes
 971:  * @return string
 972:  */
 973: function humanReadableSize($number) {
 974:     $base = 1024;
 975:     $suffixes = array(
 976:         'Bytes',
 977:         'KiB',
 978:         'MiB',
 979:         'GiB',
 980:         'TiB',
 981:         'PiB',
 982:         'EiB'
 983:     );
 984: 
 985:     $usesuf = 0;
 986:     $n = (float) $number; // Appears to be necessary to avoid rounding
 987:     while ($n >= $base) {
 988:         $n /= (float) $base;
 989:         $usesuf++;
 990:     }
 991: 
 992:     $places = 2 - floor(log10($n));
 993:     $places = max($places, 0);
 994:     $retval = number_format($n, $places, '.', '') . ' ' . $suffixes[$usesuf];
 995:     return $retval;
 996: }
 997: 
 998: /**
 999:  * Converts a byte size like "8M" to the absolute number of bytes
1000:  *
1001:  * @param string $sizeString contains the size acquired from ini_get for example
1002:  * @return number
1003:  */
1004: function machineReadableSize($sizeString) {
1005:     $val = trim($sizeString);
1006:     $last = strtolower($val[strlen($val) - 1]);
1007:     $val = (float) substr($val, 0, strlen($val) - 1);
1008:     switch ($last) {
1009:         case 'g':
1010:             $val *= 1024;
1011:         case 'm':
1012:             $val *= 1024;
1013:         case 'k':
1014:             $val *= 1024;
1015:     }
1016: 
1017:     return $val;
1018: }
1019: 
1020: /**
1021:  * Checks if the script is being runned from the web
1022:  *
1023:  * @return bool True if the script is running from the web
1024:  */
1025: function isRunningFromWeb() {
1026:     if ($_SERVER['PHP_SELF'] == '' || php_sapi_name() == 'cgi' || php_sapi_name() == 'cli') {
1027:         return false;
1028:     }
1029: 
1030:     return true;
1031: }
1032: 
1033: /**
1034:  * Scans a given plugin directory and places the found plugins into the array
1035:  * $cfg['plugins'].
1036:  *
1037:  * Result:
1038:  * $cfg['plugins']['frontendusers'] => array with all found plugins
1039:  *
1040:  * Note: Plugins are only "found" if the following directory structure if found:
1041:  *
1042:  * entity/
1043:  * plugin1/plugin1.php
1044:  * plugin2/plugin2.php
1045:  *
1046:  * The plugin's directory and file name have to be the same, otherwise the
1047:  * function
1048:  * won't find them!
1049:  *
1050:  * @param string $entity Name of the directory to scan
1051:  * @return void
1052:  */
1053: function scanPlugins($entity) {
1054:     global $cfg;
1055: 
1056:     $basedir = cRegistry::getBackendPath() . $cfg['path']['plugins'] . $entity . '/';
1057:     if (is_dir($basedir) === false) {
1058:         return;
1059:     }
1060: 
1061:     $pluginorder = getSystemProperty('plugin', $entity . '-pluginorder');
1062:     $lastscantime = getSystemProperty('plugin', $entity . '-lastscantime');
1063: 
1064:     $plugins = array();
1065: 
1066:     // Fetch and trim the plugin order
1067:     if ($pluginorder != '') {
1068:         $plugins = explode(',', $pluginorder);
1069:         foreach ($plugins as $key => $plugin) {
1070:             $plugins[$key] = trim($plugin);
1071:         }
1072:     }
1073: 
1074:     // Don't scan all the time, but each 5 minutes
1075:     if ($lastscantime + 300 < time()) {
1076:         setSystemProperty('plugin', $entity . '-lastscantime', time());
1077:         if (is_dir($basedir)) {
1078:             if (false !== $dh = opendir($basedir)) {
1079:                 while (($file = readdir($dh)) !== false) {
1080:                     if (is_dir($basedir . $file) && $file != 'includes' && $file != '.' && $file != '..') {
1081:                         if (!in_array($file, $plugins)) {
1082:                             if (cFileHandler::exists($basedir . $file . '/' . $file . '.php')) {
1083:                                 $plugins[] = $file;
1084:                             }
1085:                         }
1086:                     }
1087:                 }
1088:                 closedir($dh);
1089:             }
1090:         }
1091: 
1092:         foreach ($plugins as $key => $value) {
1093:             if (!is_dir($basedir . $value) || !cFileHandler::exists($basedir . $value . '/' . $value . '.php')) {
1094:                 unset($plugins[$key]);
1095:             }
1096:         }
1097: 
1098:         sort($plugins);
1099: 
1100:         $pluginorder = implode(',', $plugins);
1101:         setSystemProperty('plugin', $entity . '-pluginorder', $pluginorder);
1102:     }
1103: 
1104:     foreach ($plugins as $key => $value) {
1105:         if (!is_dir($basedir . $value) || !cFileHandler::exists($basedir . $value . '/' . $value . '.php')) {
1106:             unset($plugins[$key]);
1107:         } else {
1108:             i18nRegisterDomain($entity . '_' . $value, $basedir . $value . '/locale/');
1109:         }
1110:     }
1111: 
1112:     $cfg['plugins'][$entity] = $plugins;
1113: }
1114: 
1115: /**
1116:  * Includes plugins for a given entity.
1117:  *
1118:  * @param $entity Name of the directory to scan
1119:  */
1120: function includePlugins($entity) {
1121:     global $cfg;
1122: 
1123:     if (is_array($cfg['plugins'][$entity])) {
1124:         foreach ($cfg['plugins'][$entity] as $plugin) {
1125:             plugin_include($entity, $plugin . '/' . $plugin . '.php');
1126:         }
1127:     }
1128: }
1129: 
1130: /**
1131:  * Calls the plugin's store methods.
1132:  *
1133:  * @param string $entity Name of the directory to scan
1134:  */
1135: function callPluginStore($entity) {
1136:     global $cfg;
1137: 
1138:     // Check out if there are any plugins
1139:     if (is_array($cfg['plugins'][$entity])) {
1140:         foreach ($cfg['plugins'][$entity] as $plugin) {
1141:             if (function_exists($entity . '_' . $plugin . '_wantedVariables') && function_exists($entity . '_' . $plugin . '_store')) {
1142:                 $wantVariables = call_user_func($entity . '_' . $plugin . '_wantedVariables');
1143: 
1144:                 if (is_array($wantVariables)) {
1145:                     $varArray = array();
1146:                     foreach ($wantVariables as $value) {
1147:                         $varArray[$value] = stripslashes($GLOBALS[$value]);
1148:                     }
1149:                 }
1150:                 $store = call_user_func($entity . '_' . $plugin . '_store', $varArray);
1151:             }
1152:         }
1153:     }
1154: }
1155: 
1156: /**
1157:  * Creates a random name (example: Passwords).
1158:  *
1159:  * @param int $nameLength Length of the generated string
1160:  * @return string Random name
1161:  */
1162: function createRandomName($nameLength) {
1163:     $NameChars = 'abcdefghijklmnopqrstuvwxyz';
1164:     $Vouel = 'aeiou';
1165:     $Name = '';
1166: 
1167:     for ($index = 1; $index <= $nameLength; $index++) {
1168:         if ($index % 3 == 0) {
1169:             $randomNumber = rand(1, strlen($Vouel));
1170:             $Name .= substr($Vouel, $randomNumber - 1, 1);
1171:         } else {
1172:             $randomNumber = rand(1, strlen($NameChars));
1173:             $Name .= substr($NameChars, $randomNumber - 1, 1);
1174:         }
1175:     }
1176: 
1177:     return $Name;
1178: }
1179: 
1180: function setHelpContext($area) {
1181:     global $cfg;
1182: 
1183:     if ($cfg['help'] == true) {
1184:         $hc = "parent.parent.parent.frames[0].document.getElementById('help').setAttribute('data', '$area');";
1185:     } else {
1186:         $hc = '';
1187:     }
1188: 
1189:     return $hc;
1190: }
1191: 
1192: /**
1193:  * Defines a constant if not defined before.
1194:  *
1195:  * @param string $constant Name of constant to define
1196:  * @param mixed $value It's value
1197:  */
1198: function defineIfNotDefined($constant, $value) {
1199:     if (!defined($constant)) {
1200:         define($constant, $value);
1201:     }
1202: }
1203: 
1204: /**
1205:  * CONTENIDO die-alternative.
1206:  * Logs the message and calls die().
1207:  *
1208:  * @param string $file File name (use __FILE__)
1209:  * @param int $line Line number (use __LINE__)
1210:  * @param string $message Message to display
1211:  */
1212: function cDie($file, $line, $message) {
1213:     cError($file, $line, $message);
1214:     die("$file $line: $message");
1215: }
1216: 
1217: /**
1218:  * Returns a formatted string with a stack trace ready for output.
1219:  * "\tfunction1() called in file $filename($line)"
1220:  * "\tfunction2() called in file $filename($line)"
1221:  * ...
1222:  *
1223:  * @param int $startlevel The startlevel. Note that 0 is always buildStackString
1224:  *        and 1 is the function called buildStackString (e.g. cWarning)
1225:  * @return string
1226:  */
1227: function buildStackString($startlevel = 2) {
1228:     $e = new Exception();
1229:     $stack = $e->getTrace();
1230: 
1231:     $msg = '';
1232: 
1233:     for ($i = $startlevel; $i < count($stack); $i++) {
1234:         $filename = basename($stack[$i]['file']);
1235: 
1236:         $msg .= "\t" . $stack[$i]['function'] . "() called in file " . $filename . "(" . $stack[$i]['line'] . ")\n";
1237:     }
1238: 
1239:     return $msg;
1240: }
1241: 
1242: /**
1243:  * CONTENIDO warning
1244:  *
1245:  * Examples:
1246:  * <pre>
1247:  * // New version
1248:  * cWarning('Some warning message');
1249:  * // Old version
1250:  * cWarning(__FILE__, __LINE__, 'Some warning message');
1251:  * </pre>
1252:  *
1253:  * @param Multiple parameters
1254:  */
1255: function cWarning() {
1256:     global $cfg;
1257: 
1258:     $args = func_get_args();
1259:     if (count($args) == 3) {
1260:         // Old version
1261:         $file = $args[0];
1262:         $line = $args[1];
1263:         $message = $args[2];
1264:     } else {
1265:         // New version
1266:         $file = '';
1267:         $line = '';
1268:         $message = $args[0];
1269:     }
1270: 
1271:     $msg = "[" . date("Y-m-d H:i:s") . "] ";
1272:     $msg .= "Warning: \"" . $message . "\" at ";
1273: 
1274:     $e = new Exception();
1275:     $stack = $e->getTrace();
1276:     $function_name = $stack[1]['function'];
1277: 
1278:     $msg .= $function_name . "() [" . basename($stack[0]['file']) . "(" . $stack[0]['line'] . ")]\n";
1279: 
1280:     if ($cfg['debug']['log_stacktraces'] == true) {
1281:         $msg .= buildStackString();
1282:         $msg .= "\n";
1283:     }
1284: 
1285:     cFileHandler::write($cfg['path']['contenido_logs'] . 'errorlog.txt', $msg, true);
1286: 
1287:     trigger_error($message, E_USER_WARNING);
1288: }
1289: 
1290: /**
1291:  * CONTENIDO error
1292:  *
1293:  * Examples:
1294:  * <pre>
1295:  * // New version
1296:  * cWarning('Some error message');
1297:  * // Old version
1298:  * cWarning(__FILE__, __LINE__, 'Some error message');
1299:  * </pre>
1300:  *
1301:  * @param Multiple parameters
1302:  */
1303: function cError($message) {
1304:     global $cfg;
1305: 
1306:     $args = func_get_args();
1307:     if (count($args) == 3) {
1308:         // Old version
1309:         $file = $args[0];
1310:         $line = $args[1];
1311:         $message = $args[2];
1312:     } else {
1313:         // New version
1314:         $file = '';
1315:         $line = '';
1316:         $message = $args[0];
1317:     }
1318: 
1319:     $msg = "[" . date("Y-m-d H:i:s") . "] ";
1320:     $msg .= "Error: \"" . $message . "\" at ";
1321: 
1322:     $e = new Exception();
1323:     $stack = $e->getTrace();
1324:     $function_name = $stack[1]['function'];
1325: 
1326:     $msg .= $function_name . "() called in " . basename($stack[1]['file']) . "(" . $stack[1]['line'] . ")\n";
1327: 
1328:     if ($cfg['debug']['log_stacktraces'] == true) {
1329:         $msg .= buildStackString();
1330:         $msg .= "\n";
1331:     }
1332: 
1333:     cFileHandler::write($cfg['path']['contenido_logs'] . 'errorlog.txt', $msg, true);
1334: 
1335:     trigger_error($message, E_USER_ERROR);
1336: }
1337: 
1338: /**
1339:  * Writes a note to deprecatedlog.txt
1340:  *
1341:  * @param string $amsg Optional message (e.g. "Use function XYZ instead")
1342:  */
1343: function cDeprecated($message = '') {
1344:     global $cfg;
1345: 
1346:     if (isset($cfg['debug']['log_deprecations']) && $cfg['debug']['log_deprecations'] == false) {
1347:         return;
1348:     }
1349: 
1350:     $e = new Exception();
1351:     $stack = $e->getTrace();
1352:     $function_name = $stack[1]['function'];
1353: 
1354:     $msg = "Deprecated call: " . $function_name . "() [" . basename($stack[0]['file']) . "(" . $stack[0]['line'] . ")]: ";
1355:     if ($message != '') {
1356:         $msg .= "\"" . $message . "\"" . "\n";
1357:     } else {
1358:         $msg .= "\n";
1359:     }
1360: 
1361:     if ($cfg['debug']['log_stacktraces'] == true) {
1362:         $msg .= buildStackString(2);
1363:         $msg .= "\n";
1364:     }
1365: 
1366:     cFileHandler::write($cfg['path']['contenido_logs'] . 'deprecatedlog.txt', $msg, true);
1367: }
1368: 
1369: /**
1370:  * Returns the name of the numeric frame given
1371:  *
1372:  * @param int $frame Frame number
1373:  * @return string Canonical name of the frame
1374:  */
1375: function getNamedFrame($frame) {
1376:     switch ($frame) {
1377:         case 1:
1378:             return 'left_top';
1379:             break;
1380:         case 2:
1381:             return 'left_bottom';
1382:             break;
1383:         case 3:
1384:             return 'right_top';
1385:             break;
1386:         case 4:
1387:             return 'right_bottom';
1388:             break;
1389:         default:
1390:             return '';
1391:             break;
1392:     }
1393: }
1394: 
1395: /**
1396:  * Starts the timing for a specific function
1397:  *
1398:  * @param string $function Name of the function
1399:  * @param array $parameters All parameters for the function to measure
1400:  * @return int uuid for this measure process
1401:  */
1402: function startTiming($function, $parameters = array()) {
1403:     global $_timings, $cfg;
1404: 
1405:     if ($cfg['debug']['functiontiming'] == false) {
1406:         return;
1407:     }
1408: 
1409:     // Create (almost) unique ID
1410:     $uuid = md5(uniqid(rand(), true));
1411: 
1412:     if (!is_array($parameters)) {
1413:         cWarning(__FILE__, __LINE__, "Warning: startTiming's parameters parameter expects an array");
1414:         $parameters = array();
1415:     }
1416: 
1417:     $_timings[$uuid]['parameters'] = $parameters;
1418:     $_timings[$uuid]['function'] = $function;
1419: 
1420:     $_timings[$uuid]['start'] = getmicrotime();
1421: 
1422:     return $uuid;
1423: }
1424: 
1425: /**
1426:  * Ends the timing process and logs it to the timings file
1427:  *
1428:  * @param $uuid int UUID which has been used for timing
1429:  */
1430: function endAndLogTiming($uuid) {
1431:     global $_timings, $cfg;
1432: 
1433:     if ($cfg['debug']['functiontiming'] == false) {
1434:         return;
1435:     }
1436: 
1437:     $_timings[$uuid]['end'] = getmicrotime();
1438: 
1439:     $timeSpent = $_timings[$uuid]['end'] - $_timings[$uuid]['start'];
1440: 
1441:     $myparams = array();
1442: 
1443:     // Build nice representation of the function
1444:     foreach ($_timings[$uuid]['parameters'] as $parameter) {
1445:         switch (gettype($parameter)) {
1446:             case 'string':
1447:                 $myparams[] = '"' . $parameter . '"';
1448:                 break;
1449:             case 'boolean':
1450:                 if ($parameter == true) {
1451:                     $myparams[] = 'true';
1452:                 } else {
1453:                     $myparams[] = 'false';
1454:                 }
1455:                 break;
1456:             default:
1457:                 if ($parameter == '') {
1458:                     $myparams[] = '"' . $parameter . '"';
1459:                 } else {
1460:                     $myparams[] = $parameter;
1461:                 }
1462:         }
1463:     }
1464: 
1465:     $parameterString = implode(', ', $myparams);
1466: 
1467:     cDebug::out('calling function ' . $_timings[$uuid]['function'] . '(' . $parameterString . ') took ' . $timeSpent . ' seconds');
1468: }
1469: 
1470: /**
1471:  * Function checks current language and client settings by HTTP-Params and DB
1472:  * settings.
1473:  * Based on this informations it will send an HTTP header for right encoding.
1474:  *
1475:  * @param cDb $db NO MORE NEEDED
1476:  * @param array $cfg Global cfg-array
1477:  * @param int $lang Global language id
1478:  * @param string $contentType Mime type
1479:  */
1480: function sendEncodingHeader($db, $cfg, $lang, $contentType = 'text/html') {
1481:     if (isset($_GET['use_encoding'])) {
1482:         $use_encoding = trim(strip_tags($_GET['use_encoding']));
1483:     } elseif (isset($_POST['use_encoding'])) {
1484:         $use_encoding = trim(strip_tags($_POST['use_encoding']));
1485:     } else {
1486:         $use_encoding = true;
1487:     }
1488: 
1489:     if (is_string($use_encoding)) {
1490:         $use_encoding = ($use_encoding == 'false')? false : true;
1491:     }
1492: 
1493:     if ($use_encoding != false) {
1494:         $aLanguageEncodings = array();
1495: 
1496:         $oLangColl = new cApiLanguageCollection();
1497:         $oLangColl->select();
1498:         while (($oItem = $oLangColl->next()) !== false) {
1499:             $aLanguageEncodings[$oItem->get('idlang')] = $oItem->get('encoding');
1500:         }
1501: 
1502:         $charset = 'ISO-8859-1';
1503:         if (isset($aLanguageEncodings[$lang])) {
1504:             if (in_array($aLanguageEncodings[$lang], $cfg['AvailableCharsets'])) {
1505:                 $charset = $aLanguageEncodings[$lang];
1506:             }
1507:         }
1508:         header('Content-Type: ' . $contentType . '; charset=' . $charset);
1509:     }
1510: }
1511: 
1512: /**
1513:  * IP match
1514:  *
1515:  * @param string $network
1516:  * @param string $mask
1517:  * @param string $ip
1518:  * @return boolean
1519:  */
1520: function ipMatch($network, $mask, $ip) {
1521:     bcscale(3);
1522:     $ip_long = ip2long($ip);
1523:     $mask_long = ip2long($network);
1524: 
1525:     // Convert mask to divider
1526:     if (preg_match('/^[0-9]+$/', $mask)) {
1527:         // / 212.50.13.0/27 style mask (Cisco style)
1528:         $divider = bcpow(2, (32 - $mask));
1529:     } else {
1530:         // / 212.50.13.0/255.255.255.0 style mask
1531:         $xmask = ip2long($mask);
1532:         if ($xmask < 0) {
1533:             $xmask = bcadd(bcpow(2, 32), $xmask);
1534:         }
1535:         $divider = bcsub(bcpow(2, 32), $xmask);
1536:     }
1537:     // Test is IP within specified mask
1538:     if (floor(bcdiv($ip_long, $divider)) == floor(bcdiv($mask_long, $divider))) {
1539:         // match - this IP is within specified mask
1540:         return true;
1541:     } else {
1542:         // fail - this IP is NOT within specified mask
1543:         return false;
1544:     }
1545: }
1546: 
1547: /**
1548:  * Checks if the straing haystack ends with needle
1549:  *
1550:  * @param string $haystack the string to check
1551:  * @param string $needle the string with which it should end
1552:  * @return boolean
1553:  */
1554: function endsWith($haystack, $needle) {
1555:     $length = strlen($needle);
1556:     if ($length == 0) {
1557:         return true;
1558:     }
1559: 
1560:     return (substr($haystack, -$length) === $needle);
1561: }
1562: 
1563: /**
1564:  * Generates category article breadcrumb for backend
1565:  *
1566:  * @param string $syncoptions syncstate of backend
1567:  * @param string $showArticle show also current article or categories only (optional)
1568:  * @return null
1569:  */
1570: function renderBackendBreadcrumb($syncoptions, $showArticle = true, $return = false) {
1571:     $tplBread = new cTemplate();
1572:     $tplBread->set('s', 'LABEL', i18n("You are here"));
1573:     $syncoptions = (int) $syncoptions;
1574: 
1575:     $helper = cCategoryHelper::getInstance();
1576:     $categories = $helper->getCategoryPath(cRegistry::getCategoryId(), 1);
1577:     $catCount = count($categories);
1578:     $tplCfg = new cApiTemplateConfiguration();
1579:     $sess = cRegistry::getSession();
1580:     $cfg = cRegistry::getConfig();
1581:     $lang = cRegistry::getLanguageId();
1582:     $idart = cRegistry::getArticleId();
1583: 
1584: 
1585:     for ($i = 0; $i<$catCount; $i++) {
1586:         $idcat_tpl = 0;
1587:         $idcat_bread = $categories[$i]->getField('idcat');
1588:         $idcat_name = $categories[$i]->getField('name');
1589:         $idcat_tplcfg = $categories[$i]->getField('idtplcfg');
1590:         if ((int) $idcat_tplcfg > 0) {
1591:             $tplCfg->loadByPrimaryKey($idcat_tplcfg);
1592:             if ($tplCfg->isLoaded()) {
1593:                 $idcat_tpl = $tplCfg->getField('idtpl');
1594:             }
1595:         }
1596: 
1597:         $linkUrl = $sess->url(cRegistry::getBackendUrl() . "main.php?area=con&frame=4&idcat=$idcat_bread&idtpl=$idcat_tpl&syncoptions=$syncoptions&contenido=1");
1598:         $tplBread->set('d', 'LINK', $linkUrl);
1599:         $tplBread->set('d', 'NAME', $idcat_name);
1600: 
1601:         $sepArrow = '';
1602:         if ($i < $catCount-1) {
1603:             $sepArrow  = ' > ';
1604:         } else {
1605:             if ((int) $idart > 0 && $showArticle === true) {
1606:                 $art = new cApiArticleLanguage();
1607:                 $art->loadByArticleAndLanguageId($idart, $lang);
1608:                 if ($art->isLoaded()) {
1609:                     $name = $art->getField('title');
1610:                     $sepArrow  = ' > ' . $name;
1611:                 }
1612:             }
1613:         }
1614:         $tplBread->set('d', 'SEP_ARROW', $sepArrow);
1615: 
1616:         $tplBread->next();
1617:     }
1618: 
1619:     return $tplBread->generate($cfg['path']['templates'] . $cfg['templates']['breadcrumb'], $return);
1620: }
1621: 
1622: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0