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 compresses the TinyMCE JavaScript using GZip and
  5:  * enables the browser to do two requests instead of one for each .js file.
  6:  * Notice: This script defaults the button_tile_map option to true for extra performance.
  7:  *
  8:  * @package    Core
  9:  * @subpackage Backend
 10:  * @author     Martin Horwath <horwath@dayside.net>
 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: if (!defined('CON_FRAMEWORK')) {
 18:     define('CON_FRAMEWORK', true);
 19: }
 20: 
 21: // CONTENIDO startup process
 22: include_once('../../../../../includes/startup.php');
 23: 
 24: $backendPath = cRegistry::getBackendPath();
 25: 
 26: $cfg['debug']['backend_exectime']['fullstart'] = getmicrotime();
 27: 
 28: cInclude('includes', 'functions.api.php');
 29: 
 30: cRegistry::bootstrap(array(
 31:     'sess' => 'cSession',
 32:     'auth' => 'cAuthHandlerBackend',
 33:     'perm' => 'cPermission'
 34: ));
 35: 
 36: i18nInit($cfg['path']['contenido_locale'], $belang);
 37: 
 38: require_once($backendPath . $cfg['path']['includes'] . 'functions.includePluginConf.php');
 39: 
 40: require_once($cfg['path']['contenido_config'] . 'cfg_actions.inc.php');
 41: 
 42: // Set the error reporting to minimal.
 43: @error_reporting(E_ERROR | E_WARNING | E_PARSE);
 44: 
 45: // Get input
 46: $plugins = explode(',', getParam("plugins", ""));
 47: $languages = explode(',', getParam("languages", ""));
 48: $themes = explode(',', getParam("themes", ""));
 49: $diskCache = getParam("diskcache", "") == "true";
 50: $isJS = getParam("js", "") == "true";
 51: $compress = getParam("compress", "true") == "true";
 52: $core = getParam("core", "true") == "true";
 53: $suffix = getParam("suffix", "_src") == "_src" ? "_src" : "";
 54: $cachePath = realpath("."); // Cache path, this is where the .gz files will be stored
 55: $expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
 56: $content = "";
 57: $encodings = array();
 58: $supportsGzip = false;
 59: $enc = "";
 60: $cacheKey = "";
 61: 
 62: // Custom extra javascripts to pack
 63: $custom = array(/*
 64:     "some custom .js file",
 65:     "some custom .js file"
 66: */);
 67: 
 68: // Headers
 69: header("Content-type: text/javascript");
 70: header("Vary: Accept-Encoding");  // Handle proxies
 71: header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
 72: 
 73: // Is called directly then auto init with default settings
 74: if (!$isJS) {
 75:     echo getFileContents("tiny_mce_gzip.js");
 76:     echo "tinyMCE_GZ.init({});";
 77:     die();
 78: }
 79: 
 80: // Setup cache info
 81: if ($diskCache) {
 82:     if (!$cachePath) {
 83:         die("alert('Real path failed.');");
 84:     }
 85: 
 86:     $cacheKey = getParam("plugins", "") . getParam("languages", "") . getParam("themes", "") . $suffix;
 87: 
 88:     foreach ($custom as $file) {
 89:         $cacheKey .= $file;
 90:     }
 91: 
 92:     $cacheKey = md5($cacheKey);
 93: 
 94:     if ($compress) {
 95:         $cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".gz";
 96:     } else {
 97:         $cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".js";
 98:     }
 99: }
100: 
101: // Check if it supports gzip
102: if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
103:     $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
104: 
105: if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
106:     $enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
107:     $supportsGzip = true;
108: }
109: 
110: // Use cached file disk cache
111: if ($diskCache && $supportsGzip && file_exists($cacheFile)) {
112:     if ($compress) {
113:         header("Content-Encoding: " . $enc);
114:     }
115: 
116:     echo getFileContents($cacheFile);
117:     die();
118: }
119: 
120: // Add core
121: if ($core == "true") {
122:     $content .= getFileContents("tiny_mce" . $suffix . ".js");
123: 
124:     // Patch loading functions
125:     $content .= "tinyMCE_GZ.start();";
126: }
127: 
128: // Add core languages
129: foreach ($languages as $lang) {
130:     $content .= getFileContents("langs/" . $lang . ".js");
131: }
132: 
133: // Add themes
134: foreach ($themes as $theme) {
135:     $content .= getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js");
136: 
137:     foreach ($languages as $lang) {
138:         $content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js");
139:     }
140: }
141: 
142: // Add plugins
143: foreach ($plugins as $plugin) {
144:     $content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
145: 
146:     foreach ($languages as $lang) {
147:         $content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js");
148:     }
149: }
150: 
151: // Add custom files
152: foreach ($custom as $file) {
153:     $content .= getFileContents($file);
154: }
155: 
156: // Restore loading functions
157: if ($core == "true")
158:     $content .= "tinyMCE_GZ.end();";
159: 
160: // Generate GZIP'd content
161: if ($supportsGzip) {
162:     if ($compress) {
163:         header("Content-Encoding: " . $enc);
164:         $cacheData = gzencode($content, 9, FORCE_GZIP);
165:     } else
166:         $cacheData = $content;
167: 
168:     // Write gz file
169:     if ($diskCache && $cacheKey != "") {
170:         putFileContents($cacheFile, $cacheData);
171:     }
172: 
173:     // Stream to client
174:     echo $cacheData;
175: } else {
176:     // Stream uncompressed content
177:     echo $content;
178: }
179: 
180: /**
181:  *
182:  * @param string $name
183:  * @param mixed $def
184:  * @return mixed
185:  */
186: function getParam($name, $def = false) {
187: 
188:     if (!isset($_GET[$name])) {
189:         return $def;
190:     }
191: 
192:     // Remove anything but 0-9,a-z,-_
193:     return preg_replace("/[^0-9a-z\-_,]+/i", "", $_GET[$name]);
194: 
195: }
196: 
197: /**
198:  *
199:  * @param string $path
200:  * @return string
201:  */
202: function getFileContents($path) {
203: 
204:     $path = realpath($path);
205: 
206:     if (!$path || !@is_file($path)) {
207:         return "";
208:     }
209: 
210:     if (function_exists("file_get_contents")) {
211:         return @file_get_contents($path);
212:     }
213: 
214:     $content = "";
215:     $fp = @fopen($path, "r");
216:     if (!$fp) {
217:         return "";
218:     }
219: 
220:     while (!feof($fp)) {
221:         $content .= fgets($fp);
222:     }
223: 
224:     fclose($fp);
225: 
226:     return $content;
227: 
228: }
229: 
230: /**
231:  *
232:  * @param string $path
233:  * @param string $content
234:  * @return int
235:  *         the number of bytes that were written to the file,
236:  *         or false on failure, nothing if file_put_contents is not available
237:  */
238: function putFileContents($path, $content) {
239: 
240:     if (function_exists("file_put_contents")) {
241:         return @file_put_contents($path, $content);
242:     }
243: 
244:     $fp = @fopen($path, "wb");
245:     if ($fp) {
246:         fwrite($fp, $content);
247:         fclose($fp);
248:     }
249: 
250: }
251: 
252: ?>
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0