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
    • 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
  • generateJs
  • getAktuellType
  • 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
  • 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
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • stripslashes_deep
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • xmlFileToArray
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the system configuration backend page.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       Backend
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Timo Trautmann, Simon Sprankel
 10:  * @copyright        four for business AG <www.4fb.de>
 11:  * @license          http://www.contenido.org/license/LIZENZ.txt
 12:  * @link             http://www.4fb.de
 13:  * @link             http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * Renders a select element with a label.
 20:  * If there are only two possible values which are called true/false,
 21:  * enabled/disabled or 0/1, a checkbox is rendered.
 22:  * Returns an associative array with the label and the input field.
 23:  *
 24:  * @param string $name the name of the form element
 25:  * @param array $possibleValues the possible values
 26:  * @param string $value the value which should be selected
 27:  * @param string $label the label text which should be rendered
 28:  * @return array associative array with the label and the input field
 29:  */
 30: function renderSelectProperty($name, $possibleValues, $value, $label) {
 31:     global $auth;
 32: 
 33:     if (count($possibleValues) === 2 && (in_array('true', $possibleValues) && in_array('false', $possibleValues) || in_array('enabled', $possibleValues) && in_array('disabled', $possibleValues) || in_array('0', $possibleValues) && in_array('1', $possibleValues))) {
 34:         // render a checkbox if there are only the values true and false
 35:         $checked = $value == 'true' || $value == '1' || $value == 'enabled';
 36:         $html = new cHTMLCheckbox($name, $possibleValues[0], $name, $checked);
 37:         $html->setLabelText($label);
 38:     } else {
 39:         // otherwise render a select box with the possible values
 40:         $html = new cHTMLSelectElement('');
 41:         foreach ($possibleValues as $possibleValue) {
 42:             $element = new cHTMLOptionElement($possibleValue, $possibleValue);
 43:             if ($possibleValue == $value) {
 44:                 $element->setSelected(true);
 45:             }
 46:             $html->appendOptionElement($element);
 47:         }
 48:     }
 49: 
 50:     // disable the HTML element if user is not a sysadmin
 51:     if (strpos($auth->auth['perm'], 'sysadmin') === false) {
 52:         $html->updateAttribute('disabled', 'true');
 53:     }
 54: 
 55:     $return = array();
 56:     $return['input'] = $html->render();
 57:     $return['label'] = '';
 58: 
 59:     return $return;
 60: }
 61: 
 62: /**
 63:  * Renders a cHTMLLabel.
 64:  *
 65:  * @param string $text the label text
 66:  * @param string $name the name of the corresponding input element
 67:  * @param string $width the width in pixel
 68:  * @param string $seperator the seperator which is written at the end of the
 69:  *            label
 70:  * @return string the rendered cHTMLLabel element
 71:  */
 72: function renderLabel($text, $name, $width = 250, $seperator = ':') {
 73:     $label = new cHTMLLabel($text . $seperator, $name);
 74:     $label->setStyle('padding:3px;display:block;float:left;width:' . $width . 'px;');
 75: 
 76:     return $label->render();
 77: }
 78: 
 79: /**
 80:  * Renders a cHTMLTextbox.
 81:  * Returns an associative array with the label and the input field.
 82:  *
 83:  * @param string $name the name of the form element
 84:  * @param string $value the value of the text field
 85:  * @param string $label the label text
 86:  * @return array associative array with the label and the input field
 87:  */
 88: function renderTextProperty($name, $value, $label) {
 89:     global $auth;
 90: 
 91:     $textbox = new cHTMLTextbox($name, $value, '50', '96');
 92:     // disable the textbox if user is not a sysadmin
 93:     if (strpos($auth->auth['perm'], 'sysadmin') === false) {
 94:         $textbox->updateAttribute('disabled', 'true');
 95:     }
 96:     $return = array();
 97:     $return['input'] = $textbox->render();
 98:     $return['label'] = renderLabel($label, $name);
 99: 
100:     return $return;
101: }
102: 
103: $page = new cGuiPage('system_configuration', '', '1');
104: 
105: // read the properties from the XML file
106: $propertyTypes = cXmlReader::xmlStringToArray(cFileHandler::read($cfg['path']['xml'] . 'system.xml'));
107: $propertyTypes = $propertyTypes['properties'];
108: 
109: // get the stored settings
110: $settings = getSystemProperties();
111: 
112: $reloadHeader = false;
113: // store the system properties
114: if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) {
115:     if (strpos($auth->auth['perm'], 'sysadmin') === false) {
116:         $page->displayError(i18n('You don\'t have the permission to make changes here.'));
117:     } else {
118:         $stored = false;
119:         foreach ($propertyTypes as $type => $properties) {
120:             foreach ($properties as $name => $infos) {
121:                 // get the posted value
122:                 $fieldName = $type . '{_}' . $name;
123:                 if (isset($_POST[$fieldName])) {
124:                     $value = $_POST[$fieldName];
125:                 } else {
126:                     $value = (isset($infos['values'][1])) ? $infos['values'][1] : 'false';
127:                 }
128: 
129:                 $storedValue = $settings[$type][$name];
130:                 if ($storedValue != $value && (is_array($infos['values']) && $value != '' || !is_array($infos['values']))) {
131:                     if ($type == 'update' && $name == 'check_period' && $value < 60) {
132:                         $page->displayError(i18n('Update check period must be at least 60 minutes.'));
133:                         $stored = false;
134:                         // break out of both loops
135:                         break 2;
136:                     } else {
137:                         setSystemProperty($type, $name, $value);
138:                         // also update the settings array because it is used below
139:                         $settings[$type][$name] = $value;
140:                         $stored = true;
141: 
142:                         if (($type == 'debug' && $name == 'debug_to_screen') || ($type == 'system' && $name == 'clickmenu')) {
143:                             $reloadHeader = true;
144:                         }
145:                     }
146:                 }
147:             }
148:         }
149:         if ($stored) {
150:             $page->displayInfo(i18n('Changes saved'));
151:         }
152:     }
153: }
154: 
155: // generate the table for changing the system properties
156: $form = new cGuiTableForm('system_configuration');
157: $form->addHeader(i18n('System configuration'));
158: $form->setVar('area', $area);
159: $form->setVar('frame', $frame);
160: $form->setVar('action', 'edit_sysconf');
161: 
162: // show a disabled OK button if user is not a sysadmin
163: if (strpos($auth->auth['perm'], 'sysadmin') === false) {
164:     $form->setActionButton('submit', cRegistry::getBackendUrl() . 'images/but_ok_off.gif', i18n("You are not sysadmin. You can't change these settings."), 's');
165: }
166: 
167: $groups = array();
168: $currentGroup = '';
169: $leftContent = '';
170: // iterate over all property types
171: foreach ($propertyTypes as $type => $properties) {
172:     foreach ($properties as $name => $infos) {
173:         // $infos is an array with the keys 'values', 'label' and 'group'
174:         // extend the groups array if it is a new group
175:         if (!isset($groups[$infos['group']])) {
176:             $groups[$infos['group']] = '';
177:         }
178: 
179:         // get the currently stored value
180:         if (isset($settings[$type][$name])) {
181:             $value = $settings[$type][$name];
182:         } else {
183:             $value = '';
184:         }
185: 
186:         // render the HTML and add it to the groups array
187:         $fieldName = $type . '{_}' . $name;
188:         if (is_array($infos['values'])) {
189:             $htmlElement = renderSelectProperty($fieldName, $infos['values'], $value, i18n($infos['label']));
190:         } else {
191:             $htmlElement = renderTextProperty($fieldName, $value, i18n($infos['label']));
192:         }
193: 
194:         $groups[$infos['group']] .= new cHTMLDiv($htmlElement['label'] . $htmlElement['input'], 'systemSetting');
195:     }
196: }
197: 
198: // render the group names and the corresponding settings
199: foreach ($groups as $groupName => $groupSettings) {
200:     $groupName = i18n($groupName);
201:     $form->add(renderLabel($groupName, '', 150, ''), $groupSettings);
202: }
203: 
204: // show error if user is not allowed to see the page
205: if ($perm->have_perm_area_action($area, 'edit_sysconf')) {
206:     $page->set('s', 'RELOAD_HEADER', ($reloadHeader) ? 'true' : 'false');
207:     $page->set('s', 'FORM', $form->render());
208: } else {
209:     $page->displayCriticalError(i18n('Access denied'));
210: }
211: 
212: $page->render();
213: 
214: 
CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0