Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • 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
  • conMakeInlineScript
  • 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
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • 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
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • 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
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the CONTENIDO path resolver functions.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       Backend
  8:  * @version          SVN Revision $Rev:$
  9:  *
 10:  * @author           Timo Hummel
 11:  * @copyright        four for business AG <www.4fb.de>
 12:  * @license          http://www.contenido.org/license/LIZENZ.txt
 13:  * @link             http://www.4fb.de
 14:  * @link             http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: /**
 20:  * Resolves a path using some fuzzy logic.
 21:  *
 22:  * Warning: If you use this function, try to pass a 'good' path. This function
 23:  *          doesn't guarantee that the matches are logically best-matches.
 24:  *
 25:  * This function operates on the category aliases. It compares the given path with the
 26:  * urlpaths generated by function prCreateURLNameLocationString() based on category aliases.
 27:  *
 28:  * @param string $path
 29:  *         Path to resolve
 30:  * @return int
 31:  *         Closest matching category ID (idcat)
 32:  */
 33: function prResolvePathViaURLNames($path) {
 34:     global $cfg, $lang, $client;
 35: 
 36:     $handle = startTiming('prResolvePathViaURLNames', array($path));
 37: 
 38:     // Initialize variables
 39:     $db = cRegistry::getDb();
 40:     $categories = array();
 41:     $results = array();
 42: 
 43:     // Pre-process path
 44:     $path = strtolower(str_replace(' ', '', $path));
 45: 
 46:     // Delete outdated entry in heapcache table, if enabled.
 47:     if ($cfg['pathresolve_heapcache'] == true) {
 48:         $oPathresolveCacheColl = new cApiPathresolveCacheCollection();
 49:         $oPathresolveCache = $oPathresolveCacheColl->fetchLatestByPathAndLanguage($path, $lang);
 50:         if (is_object($oPathresolveCache)) {
 51:             if ($oPathresolveCache->isCacheTimeExpired()) {
 52:                 $cacheIdcat = $oPathresolveCache->get('idcat');
 53:                 $oPathresolveCacheColl->delete($oPathresolveCache->get('idpathresolvecache'));
 54:                 return $cacheIdcat;
 55:             }
 56:         }
 57:     }
 58: 
 59:     // Fetch all category names, build path strings
 60:     // @todo change the where statement for get all languages
 61:     $sql = "SELECT * FROM " . $cfg["tab"]["cat_tree"] . " AS A, " . $cfg["tab"]["cat"] . " AS B, " . $cfg["tab"]["cat_lang"] . " AS C WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND C.idlang=" . (int) $lang . "
 62:             AND C.visible = 1 AND B.idclient=" . (int) $client . " ORDER BY A.idtree";
 63:     $db->query($sql);
 64: 
 65:     $catpath = array();
 66:     while ($db->nextRecord()) {
 67:         $cat_str = '';
 68:         prCreateURLNameLocationString($db->f('idcat'), '/', $cat_str, false, '', 0, 0, true, true);
 69: 
 70:         // Store path
 71:         $catpath[$db->f('idcat')] = $cat_str;
 72:         $catnames[$db->f('idcat')] = $db->f('name');
 73:         $catlevels[$db->f('idcat')] = $db->f('level');
 74:     }
 75: 
 76:     // Compare strings using the similar_text algorythm
 77:     $percent = 0;
 78:     foreach ($catpath as $key => $value) {
 79:         $value = strtolower(str_replace(' ', '', $value));
 80: 
 81:         similar_text($value, $path, $percent);
 82: 
 83:         $firstpath = strpos($value, '/');
 84: 
 85:         if ($firstpath !== 0) {
 86:             $xpath = substr($value, $firstpath);
 87:             $ypath = substr($path, 0, strlen($path) - 1);
 88:             if ($xpath == $ypath) {
 89:                 $results[$key] = 100;
 90:             } else {
 91:                 $results[$key] = $percent;
 92:             }
 93:         } else {
 94:             $results[$key] = $percent;
 95:         }
 96:     }
 97: 
 98:     arsort($results, SORT_NUMERIC);
 99:     reset($results);
100: 
101:     endAndLogTiming($handle);
102: 
103:     if ($cfg['pathresolve_heapcache'] == true) {
104:         $oPathresolveCacheColl = new cApiPathresolveCacheCollection();
105:         $oPathresolveCache = $oPathresolveCacheColl->create($path, key($results), $lang, time());
106:     }
107: 
108:     return (int) key($results);
109: }
110: 
111: /**
112:  * Resolves a path using some fuzzy logic.
113:  *
114:  * Warning: If you use this function, try to pass a 'good' path. This function
115:  *          doesn't guarantee that the matches are logically best-matches.
116:  *
117:  * This function operates on the actual category names.
118:  *
119:  * @param string $path
120:  *         Path to resolve
121:  * @param string $iLangCheck
122:  * @return int
123:  *         Closest matching category ID (idcat)
124:  */
125: function prResolvePathViaCategoryNames($path, &$iLangCheck) {
126:     global $cfg, $lang, $client;
127: 
128:     $handle = startTiming('prResolvePathViaCategoryNames', array($path));
129: 
130:     // Initialize variables
131:     $db = cRegistry::getDb();
132:     $categories = array();
133:     $results = array();
134:     $iLangCheckOrg = $iLangCheck;
135: 
136:     // To take only path body
137:     if (preg_match('/^\/(.*)\/$/', $path, $aResults)) {
138:         $aResult = explode('/', $aResults[1]);
139:     } elseif (preg_match('/^\/(.*)$/', $path, $aResults)) {
140:         $aResult = explode('/', $aResults[1]);
141:     } else {
142:         $aResults[1] = $path;
143:     }
144: 
145:     $aResults[1] = strtolower(preg_replace('/-/', ' ', $aResults[1]));
146: 
147:     // Init to Compare, save path in array
148:     $aPathsToCompare = explode('/', $aResults[1]);
149:     $iCountPath = count($aPathsToCompare);
150: 
151:     // init lang id
152:     $iLangCheck = 0;
153: 
154:     // Pre-process path
155:     $path = strtolower(str_replace(' ', '', $path));
156: 
157:     // Fetch all category names, build path strings
158:     // @todo change the where statement for get all languages
159:     $sql = "SELECT * FROM " . $cfg["tab"]["cat_tree"] . " AS A, " . $cfg["tab"]["cat"] . " AS B, " . $cfg["tab"]["cat_lang"] . " AS C WHERE A.idcat=B.idcat AND B.idcat=C.idcat
160:             AND C.visible = 1 AND B.idclient= " . (int) $client . " ORDER BY A.idtree";
161:     $db->query($sql);
162: 
163:     $catpath = array();
164:     $arrLangMatches = array();
165: 
166:     while ($db->nextRecord()) {
167:         $cat_str = '';
168:         $aTemp = '';
169:         $iFor = 0;
170:         $bLang = false;
171: 
172:         // $level is changeless 0!!!
173:         conCreateLocationString($db->f('idcat'), '/', $cat_str, false, '', 0, $db->f('idlang'));
174:         // Store path
175:         $catpath[$db->f('idcat')] = $cat_str;
176:         $catnames[$db->f('idcat')] = $db->f('name');
177:         $catlevels[$db->f('idcat')] = $db->f('level');
178: 
179:         // Init variables for take a language id
180:         $aTemp = strtolower($cat_str);
181:         $aDBToCompare = explode('/', $aTemp);
182:         $iCountDB = count($aDBToCompare);
183:         $iCountDBFor = $iCountDB - 1;
184:         // take min. count of two arrays
185:         ($iCountDB > $iCountPath) ? $iFor = $iCountPath : $iFor = $iCountDB;
186:         $iCountM = $iFor - 1;
187: 
188:         for ($i = 0; $i < $iFor; $i++) {
189:             if ($aPathsToCompare[$iCountM] == $aDBToCompare[$iCountDBFor]) {
190:                 $bLang = true;
191:             } else {
192:                 $bLang = false;
193:             }
194:             $iCountM--;
195:             $iCountDBFor--;
196:             // compare, only if current element is lastone and we are in true path
197:             if ($i == $iFor - 1 && $bLang) {
198:                 $iLangCheck = $db->f('idlang');
199:                 $arrLangMatches[] = $iLangCheck;
200:             }
201:         }
202:     }
203: 
204:     // Suppress wrongly language change if url name can be found in current language
205:     if ($iLangCheckOrg == 0) {
206:         if (in_array($lang, $arrLangMatches)) {
207:             $iLangCheck = $lang;
208:         }
209:     }
210: 
211:     // Compare strings using the similar_text algorythm
212:     $percent = 0;
213:     foreach ($catpath as $key => $value) {
214:         $value = strtolower(str_replace(' ', '', $value));
215:         similar_text($value, $path, $percent);
216:         $results[$key] = $percent;
217:     }
218: 
219:     foreach ($catnames as $key => $value) {
220:         $value = strtolower(str_replace(' ', '', $value));
221:         similar_text($value, $path, $percent);
222: 
223:         // Apply weight
224:         $percent = $percent * $catlevels[$key];
225: 
226:         if ($results[$key] > $percent) {
227:             $results[$key] = $percent;
228:         }
229:     }
230: 
231:     arsort($results, SORT_NUMERIC);
232:     reset($results);
233: 
234:     endAndLogTiming($handle);
235:     return (int) key($results);
236: }
237: 
238: /**
239:  * Recursive function to create an URL name location string.
240:  *
241:  * @param int $idcat
242:  *         ID of the starting category
243:  * @param string $seperator
244:  *         Seperation string
245:  * @param string $cat_str
246:  *         Category location string (by reference)
247:  * @param bool $makeLink
248:  *         create location string with links
249:  * @param string $linkClass
250:  *         stylesheet class for the links
251:  * @param int $firstTreeElementToUse
252:  *         first navigation level location string should be printed out (first level = 0!!)
253:  * @param unknown_type $uselang
254:  * @param unknown_type $final
255:  * @param unknown_type $usecache
256:  * @return string
257:  *         location string
258:  */
259: function prCreateURLNameLocationString($idcat, $seperator, & $cat_str, $makeLink = false, $linkClass = '', $firstTreeElementToUse = 0, $uselang = 0, $final = true, $usecache = false) {
260:     global $cfg, $client, $cfgClient, $lang, $sess, $_URLlocationStringCache;
261: 
262:     if ($final == true) {
263:         $cat_str = '';
264:     }
265: 
266:     if ($idcat == 0) {
267:         $cat_str = i18n("Lost and found");
268:         return;
269:     }
270: 
271:     if ($uselang == 0) {
272:         $uselang = $lang;
273:     }
274: 
275:     if ($final == true && $usecache == true) {
276:         if (!is_array($_URLlocationStringCache)) {
277:             $_URLlocationStringCache = prGetCacheFileContent($client, $uselang);
278:         }
279: 
280:         if (array_key_exists($idcat, $_URLlocationStringCache)) {
281:             if ($_URLlocationStringCache[$idcat]['expires'] > time()) {
282:                 $cat_str = $_URLlocationStringCache[$idcat]['name'];
283:                 return;
284:             }
285:         }
286:     }
287: 
288:     $db = cRegistry::getDb();
289: 
290:     $sql = "SELECT
291:                 a.urlname AS urlname,
292:                 a.name    AS name,
293:                 a.idcat AS idcat,
294:                 b.parentid AS parentid,
295:                 c.level as level,
296:                 d.idtpl as idtpl
297:             FROM
298:                 " . $cfg["tab"]["cat_lang"] . " AS a
299:                 LEFT JOIN " . $cfg["tab"]["tpl_conf"] . " AS d on a.idtplcfg  = d.idtplcfg,
300:                 " . $cfg["tab"]["cat"] . " AS b,
301:                 " . $cfg["tab"]["cat_tree"] . " AS c
302:             WHERE
303:                 a.idlang    = " . (int) $uselang . " AND
304:                 b.idclient  = " . (int) $client . " AND
305:                 b.idcat     = " . (int) $idcat . " AND
306:                 a.idcat     = b.idcat AND
307:                 c.idcat     = b.idcat";
308: 
309:     $db->query($sql);
310:     $db->nextRecord();
311: 
312:     if ($db->f('level') >= $firstTreeElementToUse) {
313:         $name = $db->f('urlname');
314: 
315:         if (trim($name) == '') {
316:             $name = $db->f('name');
317:         }
318: 
319:         $parentid = $db->f('parentid');
320:         $idtpl = (int) $db->f('idtpl');
321: 
322:         //create link
323: 
324:         if ($makeLink == true) {
325:             $linkUrl = $sess->url("front_content.php?idcat=$idcat&idtpl=$idtpl");
326:             $name = '<a href="' . $linkUrl . '" class="' . $linkClass . '">' . $name . '</a>';
327:         }
328: 
329:         $tmp_cat_str = $name . $seperator . $cat_str;
330:         $cat_str = $tmp_cat_str;
331:     }
332: 
333:     if ($parentid != 0) {
334:         prCreateURLNameLocationString($parentid, $seperator, $cat_str, $makeLink, $linkClass, $firstTreeElementToUse, $uselang, false, $usecache);
335:     } else {
336:         $sep_length = strlen($seperator);
337:         $str_length = strlen($cat_str);
338:         $tmp_length = $str_length - $sep_length;
339:         $cat_str = substr($cat_str, 0, $tmp_length);
340:     }
341: 
342:     if ($final == true && $usecache == true) {
343:         $_URLlocationStringCache[$idcat]['name'] = $cat_str;
344:         $_URLlocationStringCache[$idcat]['expires'] = time() + 3600;
345: 
346:         prWriteCacheFileContent($_URLlocationStringCache, $client, $uselang);
347:     }
348: }
349: 
350: /**
351:  * Writes path location string cache data file.
352:  *
353:  * @global array $cfgClient
354:  * @param array $data
355:  * @param int $client
356:  * @param int $lang
357:  * @return bool
358:  */
359: function prWriteCacheFileContent($data, $client, $lang) {
360:     global $cfgClient;
361: 
362:     $path = $cfgClient[$client]['cache']['path'];
363:     $filename = "locationstring-url-cache-$lang.txt";
364: 
365:     $res = false;
366:     if (is_writable($path)) {
367:         $res = cFileHandler::write($path . $filename, serialize($data));
368:     }
369: 
370:     return ($res) ? true : false;
371: }
372: 
373: /**
374:  * Get path location string cache data file content.
375:  *
376:  * @global array $cfgClient
377:  * @param int $client
378:  * @param int $lang
379:  * @return array $data
380:  */
381: function prGetCacheFileContent($client, $lang) {
382:     global $cfgClient;
383: 
384:     $path = $cfgClient[$client]['cache']['path'];
385:     $filename = "locationstring-url-cache-$lang.txt";
386: 
387:     if (cFileHandler::exists($path . $filename)) {
388:         $data = unserialize(cFileHandler::read($path . $filename));
389:     } else {
390:         $data = array();
391:     }
392: 
393:     return (is_array($data)) ? $data : array();
394: }
395: 
396: /**
397:  * Deletes path location string cache data file.
398:  *
399:  * @global array $cfgClient
400:  * @param int $client
401:  * @param int $lang
402:  * @return bool
403:  */
404: function prDeleteCacheFileContent($client, $lang) {
405:     global $cfgClient;
406: 
407:     $path = $cfgClient[$client]['cache']['path'];
408:     $filename = "locationstring-url-cache-$lang.txt";
409: 
410:     $res = false;
411:     if (is_writable($path . $filename)) {
412:         $res = @unlink($path . $filename);
413:     }
414: 
415:     return ($res) ? true : false;
416: }
417: 
CMS CONTENIDO 4.9.8 API documentation generated by ApiGen 2.8.0