diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..8f7e8058a2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +tab_width = 4 + +[**.js] +tab_width = 4 + +[**.coffee] +tab_width = 4 + +[**.cson] +tab_width = 4 + +[**.json] +tab_width = 4 + +[**rc] +tab_width = 4 + +[**php] +tab_width = 4 diff --git a/.gitattributes b/.gitattributes index 4f0804b9c7..2973ea8b63 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ .gitattributes export-ignore .gitignore export-ignore .tx export-ignore +.github export-ignore diff --git a/.gitignore b/.gitignore index 4731792192..5b5bf7a220 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ !/assets/cache/.htaccess !/assets/cache/index.html !/assets/cache/siteManager.php +!/assets/cache/sitePublishing.idx.php !/assets/cache/images/index.html !/assets/cache/rss/index.html !/assets/cache/updater/index.html diff --git a/assets/.thumbs/.htaccess b/assets/.thumbs/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/.thumbs/.htaccess +++ b/assets/.thumbs/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/backup/.htaccess b/assets/backup/.htaccess index ff2beb844b..0fc81655e2 100755 --- a/assets/backup/.htaccess +++ b/assets/backup/.htaccess @@ -1,2 +1,8 @@ -order deny,allow -deny from all + + Require all denied + + + order deny,allow + deny from all + + diff --git a/assets/cache/.htaccess b/assets/cache/.htaccess new file mode 100644 index 0000000000..de8d8a9d42 --- /dev/null +++ b/assets/cache/.htaccess @@ -0,0 +1,7 @@ + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/cache/images/.htaccess b/assets/cache/images/.htaccess index 83c6d382fb..fbed16a20c 100755 --- a/assets/cache/images/.htaccess +++ b/assets/cache/images/.htaccess @@ -1,2 +1,7 @@ -order deny,allow -allow from all + + Require all granted + + + order deny,allow + allow from all + diff --git a/assets/cache/images/ht.access b/assets/cache/images/ht.access index 8f91d28b69..fbed16a20c 100755 --- a/assets/cache/images/ht.access +++ b/assets/cache/images/ht.access @@ -1,2 +1,7 @@ -order deny,allow -allow from all \ No newline at end of file + + Require all granted + + + order deny,allow + allow from all + diff --git a/assets/cache/sitePublishing.idx.php b/assets/cache/sitePublishing.idx.php new file mode 100644 index 0000000000..745481c3e2 --- /dev/null +++ b/assets/cache/sitePublishing.idx.php @@ -0,0 +1 @@ + diff --git a/assets/export/.htaccess b/assets/export/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/export/.htaccess +++ b/assets/export/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/files/.htaccess b/assets/files/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/files/.htaccess +++ b/assets/files/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/images/.htaccess b/assets/images/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/images/.htaccess +++ b/assets/images/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/import/.htaccess b/assets/import/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/import/.htaccess +++ b/assets/import/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/js/.htaccess b/assets/js/.htaccess index 6c1cc6e2da..ea72815e30 100644 --- a/assets/js/.htaccess +++ b/assets/js/.htaccess @@ -1,5 +1,11 @@ + IndexIgnore */* - Order Deny,Allow - Deny from all - + + Require all denied + + + order deny,allow + deny from all + + \ No newline at end of file diff --git a/assets/js/euiuploader/css/euiuploader.css b/assets/js/euiuploader/css/euiuploader.css index 3e1dc30ba8..611ca43193 100644 --- a/assets/js/euiuploader/css/euiuploader.css +++ b/assets/js/euiuploader/css/euiuploader.css @@ -29,6 +29,10 @@ } #euiUploadState .sgrow3 { text-align: center; + overflow: visible; + display: block; + background: none; + height: auto; } #euiUploadState .progress .complete { color:green; diff --git a/assets/lib/.htaccess b/assets/lib/.htaccess index 6c1cc6e2da..ea72815e30 100644 --- a/assets/lib/.htaccess +++ b/assets/lib/.htaccess @@ -1,5 +1,11 @@ + IndexIgnore */* - Order Deny,Allow - Deny from all - + + Require all denied + + + order deny,allow + deny from all + + \ No newline at end of file diff --git a/assets/lib/Helpers/Collection.php b/assets/lib/Helpers/Collection.php index fbae59571c..cad5f3414f 100644 --- a/assets/lib/Helpers/Collection.php +++ b/assets/lib/Helpers/Collection.php @@ -33,6 +33,7 @@ public function create(array $data = array()) /** * @return \ArrayIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->data); @@ -149,6 +150,7 @@ public function add($data, $id = null) /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return count($this->data); @@ -259,6 +261,7 @@ public function removeElement($element) * @param mixed $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->containsKey($offset); @@ -268,6 +271,7 @@ public function offsetExists($offset) * @param mixed $offset * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->get($offset); @@ -278,6 +282,7 @@ public function offsetGet($offset) * @param mixed $value * @return Collection */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if ($offset !== null) { @@ -293,6 +298,7 @@ public function offsetSet($offset, $value) * @param mixed $offset * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { return $this->remove($offset); diff --git a/assets/lib/Helpers/Mailer.php b/assets/lib/Helpers/Mailer.php index c4ab8c7630..e3455b56b1 100644 --- a/assets/lib/Helpers/Mailer.php +++ b/assets/lib/Helpers/Mailer.php @@ -252,4 +252,12 @@ public function getCFGDef($param, $default = null) { return \APIhelpers::getkey($this->config, $param, $default); } + + /** + * @return MODxMailer + */ + public function getMailProcessor() + { + return $this->mail; + } } diff --git a/assets/lib/Helpers/PHPThumb.php b/assets/lib/Helpers/PHPThumb.php index f40bd50d49..a755893ef6 100644 --- a/assets/lib/Helpers/PHPThumb.php +++ b/assets/lib/Helpers/PHPThumb.php @@ -26,6 +26,10 @@ class PHPThumb public function __construct() { $this->thumb = new \phpthumb(); + $defaultCacheFolder = 'assets/cache'; + $this->thumb->config_cache_directory = MODX_BASE_PATH . $defaultCacheFolder; + $this->thumb->config_temp_directory = $defaultCacheFolder; + $this->thumb->config_document_root = MODX_BASE_PATH; $this->fs = FS::getInstance(); } diff --git a/assets/lib/MODxAPI/modResource.php b/assets/lib/MODxAPI/modResource.php index 26c5cf7f4e..ecc9b7b329 100644 --- a/assets/lib/MODxAPI/modResource.php +++ b/assets/lib/MODxAPI/modResource.php @@ -525,13 +525,14 @@ public function save($fire_events = false, $clearCache = false) } $this->set('alias', $this->getAlias()); - + $data = $this->toArray(null, null, null, false); $this->invokeEvent('OnBeforeDocFormSave', array( 'mode' => $this->newDoc ? "new" : "upd", 'id' => isset($this->id) ? $this->id : '', - 'doc' => $this->toArray(), + 'doc' => &$data, 'docObj' => $this ), $fire_events); + $this->fromArray($data); $fld = $this->encodeFields()->toArray(null, null, null, false); foreach ($this->default_field as $key => $value) { @@ -632,7 +633,7 @@ public function save($fire_events = false, $clearCache = false) $this->invokeEvent('OnDocFormSave', array( 'mode' => $this->mode, 'id' => isset($this->id) ? $this->id : '', - 'doc' => $this->toArray(), + 'doc' => $this->toArray(null, null, null, false), 'docObj' => $this ), $fire_events); diff --git a/assets/lib/SimpleTab/plugin.class.php b/assets/lib/SimpleTab/plugin.class.php index cd75d07323..32f20605ff 100644 --- a/assets/lib/SimpleTab/plugin.class.php +++ b/assets/lib/SimpleTab/plugin.class.php @@ -87,7 +87,7 @@ public function __construct($modx, $lang_attribute = 'en') * @param array $ids * @param $folder */ - public function clearFolders($ids = array(), $folder) + public function clearFolders(array $ids, $folder) { foreach ($ids as $id) { $this->fs->rmDir($folder . $id . '/'); diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index c805ed9e06..7c0bfa809c 100755 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -51,8 +51,8 @@ public function __construct($editorKey = NULL, $bridgeConfig = array(), $tvOptio $this->initLang($basePath); // Get modxRTEbridge-config from child-class - $this->bridgeParams = isset($bridgeConfig['bridgeParams']) ? $bridgeConfig['bridgeParams'] : array(); - $this->gSettingsCustom = isset($bridgeConfig['gSettingsCustom']) ? $bridgeConfig['gSettingsCustom'] : array(); + $this->bridgeParams = isset($bridgeConfig['bridgeParams']) ? $bridgeConfig['bridgeParams'] : array(); + $this->gSettingsCustom = isset($bridgeConfig['gSettingsCustom']) ? $bridgeConfig['gSettingsCustom'] : array(); $this->gSettingsDefaultValues = isset($bridgeConfig['gSettingsDefaultValues']) ? $bridgeConfig['gSettingsDefaultValues'] : array(); // Determine settings from Modx @@ -149,17 +149,17 @@ public function __construct($editorKey = NULL, $bridgeConfig = array(), $tvOptio $this->tvOptions = $tvOptions; // Set pluginParams - $this->editorKey = $editorKey; - $this->theme = $this->modxParams['theme'] ?? 'base'; - $this->pluginParams = $modx->event->params ?? array(); - $this->pluginParams['pluginName'] = $modx->event->activePlugin; - $this->pluginParams['editorLabel'] = $bridgeConfig['editorLabel'] ?? 'No editorLabel set for "' . $editorKey . '"'; - $this->pluginParams['editorVersion'] = $bridgeConfig['editorVersion'] ?? 'No editorVersion set'; - $this->pluginParams['editorLogo'] = $bridgeConfig['editorLogo'] ?? ''; + $this->editorKey = $editorKey; + $this->theme = $this->modxParams['theme'] ?? 'base'; + $this->pluginParams = $modx->event->params ?? array(); + $this->pluginParams['pluginName'] = $modx->event->activePlugin; + $this->pluginParams['editorLabel'] = $bridgeConfig['editorLabel'] ?? 'No editorLabel set for "' . $editorKey . '"'; + $this->pluginParams['editorVersion'] = $bridgeConfig['editorVersion'] ?? 'No editorVersion set'; + $this->pluginParams['editorLogo'] = $bridgeConfig['editorLogo'] ?? ''; $this->pluginParams['skinsDirectory'] = isset($bridgeConfig['skinsDirectory']) && !empty($bridgeConfig['skinsDirectory']) ? trim($bridgeConfig['skinsDirectory'], "/") . "/" : ''; $this->pluginParams['skinthemeDirectory'] = isset($bridgeConfig['skinthemeDirectory']) && !empty($bridgeConfig['skinthemeDirectory']) ? trim($bridgeConfig['skinthemeDirectory'], "/") . "/" : ''; - $this->pluginParams['base_path'] = $basePath; - $this->pluginParams['base_url'] = $baseUrl; + $this->pluginParams['base_path'] = $basePath; + $this->pluginParams['base_url'] = $baseUrl; } // Function to set editor-parameters @@ -170,12 +170,10 @@ public function set($key, $value, $type = false, $emptyAllowed = false) $this->themeConfig[$key] = NULL; // Delete Parameter completely from JS-initialization } else { if (!isset($this->themeConfig[$key])) $this->themeConfig[$key] = array(); - $this->themeConfig[$key]['value'] = $value; - $this->themeConfig[$key]['default'] = !isset($this->themeConfig[$key]['default']) - ? $value - : $this->themeConfig[$key]['default']; - $this->themeConfig[$key]['type'] = $type == false ? 'string' : $type; - $this->themeConfig[$key]['empty'] = $emptyAllowed; + $this->themeConfig[$key]['value'] = $value; + $this->themeConfig[$key]['default'] = !isset($this->themeConfig[$key]['default']) ? $value : $this->themeConfig[$key]['default']; + $this->themeConfig[$key]['type'] = $type == false ? 'string' : $type; + $this->themeConfig[$key]['empty'] = $emptyAllowed; } } @@ -798,7 +796,7 @@ public function getModxSettings() public function parsePlaceholders($content, $ph) { foreach ($ph as $key => $value) { - $content = str_replace('[+' . $key . '+]', $value, $content); + $content = str_replace('[+' . $key . '+]', $value ?? '', $content); } return $content; } diff --git a/assets/modules/docmanager/lang/belarusian.inc.php b/assets/modules/docmanager/lang/belarusian.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/belarusian.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/docmanager/lang/bulgarian.inc.php b/assets/modules/docmanager/lang/bulgarian.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/bulgarian.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/docmanager/lang/czech.inc.php b/assets/modules/docmanager/lang/czech.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/czech.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/docmanager/lang/hebrew.inc.php b/assets/modules/docmanager/lang/hebrew.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/hebrew.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/docmanager/lang/norwegian.inc.php b/assets/modules/docmanager/lang/norwegian.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/norwegian.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/docmanager/lang/ukrainian.inc.php b/assets/modules/docmanager/lang/ukrainian.inc.php new file mode 100644 index 0000000000..d3132d4105 --- /dev/null +++ b/assets/modules/docmanager/lang/ukrainian.inc.php @@ -0,0 +1,146 @@ +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] = 'View and select documents using the Document Tree'; + +// process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +// manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] = 'Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu'] = 'Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish'] = 'Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu'] = 'Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search'] = 'Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache'] = 'Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext'] = 'Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete'] = 'Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates'] = 'Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors'] = 'Document Manager: Documents Author settings changed.'; +?> diff --git a/assets/modules/store/core.php b/assets/modules/store/core.php index 30f6fb69a0..52369e9309 100644 --- a/assets/modules/store/core.php +++ b/assets/modules/store/core.php @@ -22,13 +22,13 @@ case 'install': case 'install_file': if (is_dir(MODX_BASE_PATH . 'assets/cache/store/')) $Store->removeFolder(MODX_BASE_PATH . 'assets/cache/store/'); - $id = (int) $_REQUEST['cid']; + $id = (int)($_REQUEST['cid'] ?? 0); @mkdir("../assets/cache/store", 0777); @mkdir("../assets/cache/store/tmp_install", 0777); @mkdir("../assets/cache/store/install", 0777); if($action == 'install') { - $file = $_POST['file']==''? $_GET['file'] : $_POST['file']; + $file = empty($_POST['file']) ? ($_GET['file'] ?? '') : $_POST['file']; if ($file!='%url%' && $file!='' && $file!=' '){ $url = $file; } else { @@ -200,8 +200,6 @@ public function downloadFile ($url, $path) { } } - - public function removeFolder($path){ $dir = realpath($path); if ( !is_dir($dir)) return; @@ -220,9 +218,11 @@ public function removeFolder($path){ } rmdir($dir); } + public static function copyFolder($src, $dest) { - $path = realpath($src); + $path = realpath($src); $dest = realpath($dest); + if (!is_dir($path) || !is_dir($dest)) return; $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST); foreach($objects as $name => $object) { diff --git a/assets/modules/store/css/style.css b/assets/modules/store/css/style.css index 51ee15ad75..2b42409ccb 100644 --- a/assets/modules/store/css/style.css +++ b/assets/modules/store/css/style.css @@ -92,6 +92,7 @@ body { } .informer { + z-index: 1; position: absolute; top: 0; left: 0; diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php index d5a6462046..9e356779e6 100755 --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -19,14 +19,14 @@ $_SESSION['test'] = 1; install_sessionCheck(); $moduleName = "MODX"; +include MODX_MANAGER_PATH . 'includes/version.inc.php'; $moduleVersion = $modx_branch.' '.$modx_version; $moduleRelease = $modx_release_date; $moduleSQLBaseFile = "setup.sql"; $moduleSQLDataFile = "setup.data.sql"; - +$installPath = MODX_BASE_PATH .'assets/cache/store/install'; if (is_file($installPath.'/'.$moduleSQLBaseFile)){ $moduleSQLDataFile = $moduleSQLBaseFile; } - $moduleChunks = array (); // chunks - array : name, description, type - 0:file or 1:content, file or content $moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content $moduleSnippets = array (); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties @@ -98,7 +98,7 @@ function parseProperties($propertyString) { $setupPath = $modulePath; include "{$setupPath}/setup.info.php"; include "sqlParser.class.php"; -$sqlParser = new SqlParser($adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, $database_connection_method, $auto_template_logic); +$sqlParser = new SqlParser(); $sqlParser->mode = "upd"; $sqlParser->ignoreDuplicateErrors = true; @@ -295,8 +295,8 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - - $module = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $module = end($tmp); // remove installer docblock $module = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $module, 1); $module = $modx->db->escape($module); @@ -325,7 +325,6 @@ function parseProperties($propertyString) { // Install Plugins if (count($modulePlugins )>0) { echo "

" . $_lang['plugins'] . ":

"; - $selPlugs = $_POST['plugin']; foreach ($modulePlugins as $k=>$modulePlugin) { $installSample = in_array('sample', $modulePlugin[8]) && $installData == 1; // if(in_array($k, $selPlugs) || $installSample) { @@ -354,8 +353,8 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - - $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $plugin = end($tmp); // remove installer docblock $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); $plugin = $modx->db->escape($plugin); @@ -436,7 +435,7 @@ function parseProperties($propertyString) { $selSnips = $_POST['snippet']; foreach ($moduleSnippets as $k=>$moduleSnippet) { - $installSample = in_array('sample', $moduleSnippet[5]) && $installData == 1; + $installSample = in_array('sample', $moduleSnippet[5] ?? []) && $installData == 1; //if(in_array($k, $selSnips) || $installSample) { $name = $modx->db->escape($moduleSnippet[0]); $desc = $modx->db->escape($moduleSnippet[1]); @@ -449,8 +448,8 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - - $snippet = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent))); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $snippet = end($tmp); // remove installer docblock $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); $snippet = $modx->db->escape($snippet); diff --git a/assets/modules/store/installer/instprocessor.php b/assets/modules/store/installer/instprocessor.php index 4261f483aa..21301d7804 100755 --- a/assets/modules/store/installer/instprocessor.php +++ b/assets/modules/store/installer/instprocessor.php @@ -258,8 +258,8 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - - $module = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $module = end($tmp); // remove installer docblock $module = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $module, 1); $module = $modx->db->escape($module); @@ -317,8 +317,8 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - - $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $plugin = end($tmp); // remove installer docblock $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); $plugin = $modx->db->escape($plugin); @@ -411,7 +411,7 @@ function parseProperties($propertyString) { // Create the category if it does not already exist $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent)); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); $snippet = end($tmp); // remove installer docblock $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); diff --git a/assets/modules/store/installer/setup.info.php b/assets/modules/store/installer/setup.info.php index a07d55856c..ab5883122e 100755 --- a/assets/modules/store/installer/setup.info.php +++ b/assets/modules/store/installer/setup.info.php @@ -10,6 +10,7 @@ $installPath = MODX_BASE_PATH .'assets/cache/store/install'; $moduleName = "MODX"; +include MODX_MANAGER_PATH . 'includes/version.inc.php'; $moduleVersion = $modx_branch.' '.$modx_version; $moduleRelease = $modx_release_date; $moduleSQLBaseFile = "setup.sql"; @@ -41,7 +42,7 @@ "$templatePath/{$params['filename']}", $params['modx_category'], $params['lock_template'], - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [] ); } } @@ -70,7 +71,7 @@ $params['template_assignments'], /* comma-separated list of template names */ $params['modx_category'], $params['lock_tv'], /* value should be 1 or 0 */ - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [] ); } } @@ -94,7 +95,7 @@ "$chunkPath/{$params['filename']}", $params['modx_category'], array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [] ); } } @@ -119,9 +120,9 @@ $params['name'], $description, "$snippetPath/{$params['filename']}", - $params['properties'], + $params['properties'] ?? '', $params['modx_category'], - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [] ); } } @@ -143,13 +144,13 @@ $params['name'], $description, "$pluginPath/{$params['filename']}", - $params['properties'], + $params['properties'] ?? '', $params['events'], - $params['guid'], + $params['guid'] ?? '', $params['modx_category'], - $params['legacy_names'], - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, - (int)$params['disabled'] + $params['legacy_names'] ?? '', + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [], + (int)($params['disabled'] ?? 0) ); } } @@ -171,11 +172,11 @@ $params['name'], $description, "$modulePath/{$params['filename']}", - $params['properties'], + $params['properties'] ?? '', $params['guid'], (int)$params['shareparams'], $params['modx_category'], - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : [] ); } } diff --git a/assets/modules/store/js/store.js b/assets/modules/store/js/store.js index badfe88b13..8bf1217517 100755 --- a/assets/modules/store/js/store.js +++ b/assets/modules/store/js/store.js @@ -370,4 +370,4 @@ store = { $(function(){ store.init(); -}) \ No newline at end of file +}) diff --git a/assets/plugins/codemirror/codemirror.plugin.php b/assets/plugins/codemirror/codemirror.plugin.php index e2464a3460..fb7c9e8e0c 100755 --- a/assets/plugins/codemirror/codemirror.plugin.php +++ b/assets/plugins/codemirror/codemirror.plugin.php @@ -50,7 +50,7 @@ */ $prte = (isset($_POST['which_editor']) ? $_POST['which_editor'] : ''); $srte = ($modx->config['use_editor'] ? $modx->config['which_editor'] : 'none'); -$xrte = $content['richtext']; +$xrte = $content['richtext'] ?? 0; $tvMode = false; $limitedHeight = false; /* @@ -58,7 +58,7 @@ */ switch($modx->Event->name) { case 'OnTempFormRender' : - $object_name = $content['templatename']; + $object_name = $content['templatename'] ?? ''; $rte = ($prte ? $prte : 'none'); break; case 'OnChunkFormRender' : @@ -98,13 +98,13 @@ } break; case 'OnDocFormRender' : - if($content['type'] == 'reference') { + if(isset($content['type']) && $content['type'] == 'reference') { return; } $textarea_name = 'ta'; - $object_name = $content['pagetitle']; + $object_name = $content['pagetitle'] ?? ''; $xrte = (('htmlmixed' == $mode) ? $xrte : 0); - $rte = ($prte ? $prte : ($content['id'] ? ($xrte ? $srte : 'none') : $srte)); + $rte = ($prte ? $prte : (!empty($content['id']) ? ($xrte ? $srte : 'none') : $srte)); $contentType = $content['contentType']; /* * Switch contentType for doc @@ -168,7 +168,7 @@ {$emmet}{$search} - + - - '; - - // Page output: TV form - if ($save == 0) { - $output .= ' - - '; - - // Document is locked message - if ($locked) { - $output .= ' -

'.$_lang['locked'].'

-
'.$_lang['lock_msg'].'
- '; - } - - // Normal form - else { - // Image preview - if ($tv['type'] === 'image') { - $imagePreview = ' -
- - '; - } - $amp = ($this->modx->config['friendly_urls'] == 1) ? '?' : '&'; - $output .= ' -
- - - -
- - -
- -

'.$tv['caption'].'

- -
'.$tv['description'].'
- -
- '.$tvHtml.' -
- - '.$imagePreview.' - -
- '.$editorHtml.' - '; - } - } - - // Page output: close modal box and refresh parent frame - else $output .= ''; - - // Page output: footer - $output .= ' - - - '; - } else { - $output = 'Error: Access denied.'; - } - } elseif(isset($_SESSION['mgrValidated']) && $_REQUEST['z'] !== 'manprev') { - // QM+ with toolbar - // Add ID - $controls = '
  • ID: '.$docID.'
  • '; - // Go to Manager button - if ($this->managerbutton == 'true') { - $managerButton = sprintf(' -
  • - - - %s - -
  • - ', $_lang['manager'], $this->modx->config['site_manager_url'], $_lang['manager']); - $controls .= $managerButton; - } - // Edit button - - $editButton = sprintf(' -
  • - - - %s - -
  • - ', - $_lang['edit_resource'], - $this->modx->config['site_manager_url'], - $docID, - $_lang['edit_resource'] - ); - - // Check if user has manager access to current document - $access = $this->checkAccess(); - - // Does user have permissions to edit document - if($access) { - $controls .= $editButton; - } - - if ($this->addbutton == 'true' && $access) { - // Add button - $addButton = sprintf(' -
  • - - - %s - -
  • - ', $this->modx->config['site_manager_url'], $docID, $_lang['create_resource_here']); - - // Does user have permissions to add document - if($this->modx->hasPermission('new_document')) { - $controls .= $addButton; - } - } - - // Custom add buttons if not empty and enough permissions - if ($this->custombutton != '') { - - // Replace [*id*] with current doc id - $this->custombutton = str_replace("[*id*]", $docID, $this->custombutton); - - // Handle [~id~] links - $this->custombutton = $this->modx->rewriteUrls($this->custombutton); - - $buttons = explode("||", $this->custombutton); // Buttons are divided by "||" - - // Custom buttons class index - $i = 0; - - // Parse buttons - foreach($buttons as $field) { - $i++; - - $field = substr($field, 1, -1); // Trim "'" from beginning and from end - $buttonParams = explode("','", $field); // Button params are divided by "','" - - $buttonTitle = $buttonParams[0]; - $buttonAction = $buttonParams[1]; // Contains URL if this is not add button - $buttonParentId = $buttonParams[2]; // Is empty is this is not add button - $buttonTplId = $buttonParams[3]; - - // Button visible for all - if ($buttonParams[4] == '') { - $showButton = TRUE; - } else { - $showButton = FALSE; - - // Get user roles the button is visible for - $buttonRoles = explode(",", $buttonParams[4]); // Roles are divided by ',' - - // Check if user role is found - foreach($buttonRoles as $role) { - if ($role == $_SESSION['mgrRole']) { - $showButton = TRUE; - } - } - } - $buttonIcon = $buttonParams[5]; - // Show custom button - if ($showButton) { - switch ($buttonAction) - { - case 'new': - $customButton = ' -
  • - '.$buttonTitle.' -
  • - '; - break; - - case 'link': - $customButton = ' -
  • - '.$buttonTitle.' -
  • - '; - break; - - case 'modal': - $customButton = ' -
  • - '.$buttonTitle.' -
  • - '; - break; - } - $controls .= $customButton; - } - } - } - - // Logout button - $logout = $this->modx->config['site_manager_url'].'index.php?a=8&quickmanager=logout&logoutid='.$docID; - $logoutButton = ' -
  • - '.$_lang['logout'].' -
  • - '; - - $controls .= $logoutButton; - - $username = $_SESSION['mgrShortname']; - // Add action buttons - $editor = ' -
    - -
    - - -
    '; - - $MGR_DIR = $this->modx->getManagerPath( ); - $css = ' - '; - - $css .= ' - - '; - - // font-awesome - if ($this->loadfa == 'true') { - $css .= ' - - '; - } - // Buttons Styles - if ($this->buttonStyle === 'actionButtons') { - $css .= ' - - '; - } elseif ($this->buttonStyle === 'navButtons') { - $css .= ' - - '; - } - // Top toolbar Autohide false - if (($this->autohide == 'false') && ($this->position === 'top')) { - $css .= ' - - '; - } - else - // Top toolbar Autohide true - if (($this->autohide == 'true') && ($this->position === 'top')) { - $css .= ' - - '; - } else - if ($this->position === 'before') { - // Top toolbar Relative - $css .= ' - - '; - } elseif (($this->autohide == 'true') && ($this->position === 'bottom')) { - $css .= ' - - '; - } elseif (($this->autohide == 'false') && ($this->position === 'bottom')) { - $css .= ' - - '; - } - // Left toolbar Autohide true - if ($this->autohide == 'true' && $this->position === 'left') { - $css .= ' - - '; - } elseif ($this->autohide == 'false' && $this->position === 'left') { - $css .= ' - - '; - } - // Right toolbar Autohide true - if (($this->autohide == 'true') && ($this->position == 'right')) { - $css .= ' - - '; - } elseif (($this->autohide == 'false') && ($this->position == 'right')) { - $css .= ' - - '; - } - // Remove background - if (($this->removeBg === 'yes') && ($this->buttonStyle === 'actionButtons')) { - $css .= ' - - '; - } elseif (($this->removeBg === 'yes') && ($this->buttonStyle === 'navButtons')) { - $css .= ' - - '; - } - // Insert jQuery and ColorBox in head if needed - $head = ''; - if ($this->loadfrontendjq == 'true') { - $head .= ''; - } - if ($this->loadtb == 'true') { - $head .= ' - - - - - - '; - } - - // Insert ColorBox jQuery definitions for QuickManager+ - $head .= ' - - '; - - $head .= " - - "; - - // Insert QM+ css in head - $head .= $css; - - // Place QM+ head information in head, just before tag - $output = preg_replace('~()~i', $head . '\1', $output); - - // Insert editor toolbar right after tag - $output = preg_replace('~(]*>)~i', '\1' . $editor, $output); - - // Search and create edit buttons in to the content - if ($this->editbuttons == 'true' && $access) { - $output = preg_replace('//', '$2', $output); - } - - // Search and create new document buttons in to the content - if ($this->newbuttons == 'true' && $access) { - $output = preg_replace('//', '$3', $output); - } - - // Search and create new document buttons in to the content - if ($this->tvbuttons == 'true' && $access) { - // Set and get user doc groups for TV permissions - $this->docGroup = ''; - $mrgDocGroups = $_SESSION['mgrDocgroups']; - if (!empty($mrgDocGroups)) $this->docGroup = implode(",", $mrgDocGroups); - - // Create TV buttons and check TV permissions - $output = preg_replace_callback('//', array(&$this, 'createTvButtons'), $output); - } - } - - break; - - // Edit document in ThickBox frame (MODX manager frame) - case 'OnDocFormPrerender': - - // If there is Qm call, add control buttons and modify to edit document page - if ((int)$_REQUEST['quickmanager'] == 1) { - - global $content, $_style; - - // Set template for new document, action = 4 - if((int)$_GET['a'] == 4) { - - // Custom add button - if (isset($_GET['customaddtplid'])) { - // Set template - $content['template'] = (int)$_GET['customaddtplid']; - } - - // Normal add button - else { - switch ($this->tpltype) { - // Template type is parent - case 'parent': - // Get parent document id - $pid = $content['parent'] ?: (int)$_REQUEST['pid']; - - // Get parent document - $parent = $this->modx->getDocument($pid); - - // Set parent template - $content['template'] = $parent['template']; - - break; - - // Template is specific id - case 'id': - $content['template'] = $this->tplid; - - break; - - // Template is inherited by Inherit Selected Template plugin - case 'selected': // Template is inherited by Inherit Selected Template plugin - case 'sibling': - // Get parent document id - $pid = $content['parent'] ?: (int)$_REQUEST['pid']; - - if ($this->modx->config['auto_template_logic'] === 'sibling') { - // Eoler: template_autologic in Evolution 1.0.5+ - // http://tracker.modx.com/issues/9586 - $tv = array(); - $sibl = $this->modx->getDocumentChildren($pid, 1, 0, 'template', '', 'menuindex', 'ASC', 1); - if(empty($sibl)) { - $sibl = $this->modx->getDocumentChildren($pid, 0, 0, 'template', '', 'menuindex', 'ASC', 1); - } - if(!empty($sibl)) { - $tv['value'] = $sibl[0]['template']; - } else { - $tv['value'] = ''; - } // Added by yama - } else { - // Get "inheritTpl" TV - $tv = $this->modx->getTemplateVar('inheritTpl', '', $pid); - } - - // Set template to inherit - if ($tv['value'] != '') { - $content['template'] = $tv['value']; - } else { - $content['template'] = $this->modx->config['default_template']; - } - break; - } - } - } - - // Manager control class - $mc = new Mcc(); - - // Hide default manager action buttons - $mc->addLine('$("#actions").hide();'); - - if (isset($_REQUEST['qmrefresh'])) { - $doc_id = (int)$_REQUEST['qmrefresh']; - } else { - $doc_id = (int)$_REQUEST['id']; - } - - // Get jQuery conflict mode - if ($this->noconflictjq == 'true') { - $jq_mode = '$j'; - } else { - $jq_mode = '$'; - } - - // Add action buttons - $url = $this->modx->makeUrl($doc_id,'','','full'); - $mc->addLine('var controls = "
    '.$_lang['save'].' '.$_lang['cancel'].'
    ";'); - - // Modify head - $mc->head = ''; - if ($this->loadmanagerjq == 'true') $mc->head .= ''; - - // Add control button - $mc->addLine('$("body").prepend(controls);'); - - // Hide fields to from front-end editors - if ($this->hidefields != '') { - $hideFields = explode(",", $this->hidefields); - - foreach($hideFields as $key => $field) { - $mc->hideField($field); - } - } - - // Hide tabs to from front-end editors - if ($this->hidetabs != '') { - $hideTabs = explode(",", $this->hidetabs); - - foreach($hideTabs as $key => $field) { - $mc->hideTab($field); - } - } - - // Hide sections from front-end editors - if ($this->hidesections != '') { - $hideSections = explode(",", $this->hidesections); - - foreach($hideSections as $key => $field) { - $mc->hideSection($field); - } - } - - // Hidden field to verify that QM+ call exists - $hiddenFields = ''; - - // Different doc to be refreshed? - if (isset($_REQUEST['qmrefresh'])) { - $hiddenFields .= ''; - } - - // Output - $e->output($mc->Output().$hiddenFields); - } - - break; - - // Where to logout - case 'OnManagerLogout': - // Only if cancel editing the document and QuickManager is in use - if ($_REQUEST['quickmanager'] === 'logout') { - // Redirect to document id - if ($this->logout !== 'manager') { - $this->modx->sendRedirect($this->modx->makeUrl($_REQUEST['logoutid']), 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); - } - } - - break; - } - } - - // Check if user has manager access permissions to current document - //_______________________________________________________ - function checkAccess() { - if ($_SESSION['mgrRole'] == 1) { - return TRUE; - } - - $docID = $this->modx->documentIdentifier; - - // Database table - $table= $this->modx->getFullTableName("document_groups"); - - // Check if current document is assigned to one or more doc groups - $result = $this->modx->db->select('count(id)', $table, "document='{$docID}'"); - $rowCount= $this->modx->db->getValue($result); - - // If document is assigned to one or more doc groups, check access - if ($rowCount < 1) { - return TRUE; - } - $mrgDocGroups = $_SESSION['mgrDocgroups']; - if (empty($mrgDocGroups)) { - return FALSE; - } - - $docGroup = implode(",", $mrgDocGroups); - - // Check if user has access to current document - $rowCount = $this->modx->db->getValue( - $this->modx->db->select('count(id)', $table, "document = '{$docID}' AND document_group IN ({$docGroup})") - ); - - if ($rowCount >= 1) { - return TRUE; - } - - return FALSE; - } - - // Function from: processors/cache_sync.class.processor.php - //_____________________________________________________ - function getParents($id, $path = '') { // modx:returns child's parent - if(empty($this->aliases)) { - $qh = $this->modx->db->select("id, IF(alias='', id, alias) AS alias, parent", $this->modx->getFullTableName('site_content')); - while ($row = $this->modx->db->getRow($qh)) { - $this->aliases[$row['id']] = $row['alias']; - $this->parents[$row['id']] = $row['parent']; - } - } - if (isset($this->aliases[$id])) { - $path = $this->aliases[$id] . ($path != '' ? '/' : '') . $path; - return $this->getParents($this->parents[$id], $path); - } - return $path; - } - - // Create TV buttons if user has permissions to TV - //_____________________________________________________ - function createTvButtons($matches) { - - $docID = $this->modx->documentIdentifier; - - // Get TV caption for button title - $tv = $this->modx->getTemplateVar($matches[1]); - $caption = $tv['caption']; - - // If caption is empty this must be a "build-in-tv-field" like pagetitle etc. - if ($caption == '') { - - // Allowed for all - $access = TRUE; - - // Resolve caption - $caption = $this->getDefaultTvCaption($matches[1]); - } else { - $access = $this->checkTvAccess($tv['id']); - } - - // Return TV button link if access - if (!$access || $caption == '') { - return null; - } - $amp = ($this->modx->config['friendly_urls'] == 1) ? '?' : '&'; - return sprintf( - '%s', - $this->tvbclass, - $this->modx->makeUrl($docID), - $amp, - $matches[1], - $caption - ); - } - - // Check user access to TV - //_____________________________________________________ - function checkTvAccess($tvId) { - $access = FALSE; - $table = $this->modx->getFullTableName('site_tmplvar_access'); - - // If user is admin (role = 1) - if ($_SESSION['mgrRole'] == 1 && !$access) { $access = TRUE; } - - // Check permission to TV, is TV in document group? - if (!$access) { - $result = $this->modx->db->select('count(id)', $table, "tmplvarid = '{$tvId}'"); - $rowCount = $this->modx->db->getValue($result); - // TV is not in any document group - if ($rowCount == 0) { $access = TRUE; } - } - - // Check permission to TV, TV is in document group - if (!$access && $this->docGroup != '') { - $result = $this->modx->db->select('count(id)', $table, "tmplvarid = '{$tvId}' AND documentgroup IN ({$this->docGroup})"); - $rowCount = $this->modx->db->getValue($result); - if ($rowCount >= 1) { - $access = TRUE; - } - } - - return $access; - } - - // Get default TV ("build-in" TVs) captions - //_____________________________________________________ - function getDefaultTvCaption($name) { - - global $_lang; - $caption = ''; - - switch ($name) { - case 'pagetitle' : $caption = $_lang['resource_title']; break; - case 'longtitle' : $caption = $_lang['long_title']; break; - case 'description' : $caption = $_lang['resource_description']; break; - case 'content' : $caption = $_lang['resource_content']; break; - case 'menutitle' : $caption = $_lang['resource_opt_menu_title']; break; - case 'introtext' : $caption = $_lang['resource_summary']; break; - } - - return $caption; - } - - // Check that a document isn't locked for editing - //_____________________________________________________ - function checkLocked() { - - $pageId = $this->modx->documentIdentifier; - if ($this->modx->elementIsLocked(7, $pageId) === NULL) { - return FALSE; - } - - return TRUE; - } - - // Set document locked on/off - //_____________________________________________________ - function setLocked($locked) { - - $pageId = $this->modx->documentIdentifier; - - // Set document locked - if ($locked == 1) { - $this->modx->lockElement(7, $pageId); - } else { - $this->modx->unlockElement(7, $pageId); - } - } - - // Save TV - //_____________________________________________________ - function saveTv($tvName) { - - $tmplvarContentValuesTable = $this->modx->getFullTableName('site_tmplvar_contentvalues'); - $siteContentTable = $this->modx->getFullTableName('site_content'); - $pageId = $this->modx->documentIdentifier; - $time = time(); - $user = $_SESSION['mgrInternalKey']; - $tvId = isset($_POST['tvid']) ? (int)$_POST['tvid'] : ''; - $tvContent = $_POST['tv' . $tvName] ?? ''; - $tvContentTemp = ''; - - // Escape TV content - $tvContent = $this->modx->db->escape($tvContent); - - // Invoke OnBeforeDocFormSave event - $this->modx->invokeEvent('OnBeforeDocFormSave', array('mode'=>'upd', 'id'=>$pageId)); - - // Handle checkboxes and other arrays, TV to be saved must be e.g. value1||value2||value3 - if (is_array($tvContent)) { - $tvContent = implode("||", $tvContent); - } - - // Save TV - if ($tvId != '') { - $fields = array( - 'tmplvarid' => $tvId, - 'contentid' => $pageId, - 'value' => $tvContent, - ); - $result = $this->modx->db->select( - 'count(id)', - $tmplvarContentValuesTable, - sprintf("tmplvarid='%s' AND contentid='%s'", $fields['tmplvarid'], $fields['contentid']) - ); - - // TV exists, update TV - if($this->modx->db->getValue($result)) { - $this->modx->db->update( - $fields, - $tmplvarContentValuesTable, - sprintf("tmplvarid='%s' AND contentid='%s'", $fields['tmplvarid'], $fields['contentid']) - ); - } else { - $this->modx->db->insert($fields, $tmplvarContentValuesTable); - } - - // Page edited by - $this->modx->db->update( - array( - 'editedon' => $time, - 'editedby' => $user - ), - $siteContentTable, - "id = '{$pageId}'" - ); - } else { - $this->modx->db->update( - array( - $tvName => $tvContent, - 'editedon' => $time, - 'editedby' => $user - ), - $siteContentTable, - "id = '{$pageId}'" - ); - } - - // Invoke OnDocFormSave event - $this->modx->invokeEvent('OnDocFormSave', array('mode'=>'upd', 'id'=>$pageId)); - - // Clear cache - $this->modx->clearCache('full'); - } -} -} +modx = $modx; + + // Get plugin parameters + $this->jqpath = $jqpath; + $this->loadmanagerjq = $loadmanagerjq; + $this->loadfrontendjq = $loadfrontendjq; + $this->noconflictjq = $noconflictjq; + $this->loadfa = $loadfa; + $this->loadtb = $loadtb; + $this->tbwidth = $tbwidth; + $this->tbheight = $tbheight; + $this->usemm = null; + $this->hidefields = $hidefields; + $this->hidetabs = $hidetabs; + $this->hidesections = $hidesections; + $this->addbutton = $addbutton; + $this->tpltype = $tpltype; + $this->tplid = $tplid; + $this->custombutton = $custombutton; + $this->managerbutton = $managerbutton; + $this->logout = $logout; + $this->autohide = $autohide; + $this->position = $position; + $this->editbuttons = $editbuttons; + $this->editbclass = $editbclass; + $this->newbuttons = $newbuttons; + $this->newbclass = $newbclass; + $this->tvbuttons = $tvbuttons; + $this->tvbclass = $tvbclass; + $this->buttonStyle = $buttonStyle; + $this->removeBg = $removeBg; + + // Includes + include_once($this->modx->config['base_path'].'assets/plugins/qm/mcc.class.php'); + + // Run plugin + $this->Run(); + } + + //_______________________________________________________ + function Run() { + + // Include MODX manager language file + global $_lang; + + // Get manager language + $manager_language = $this->modx->config['manager_language']; + + // Individual user language setting (if set) + if (isset($_SESSION['mgrUsrConfigSet']['manager_language'])) { + $manager_language = $_SESSION['mgrUsrConfigSet']['manager_language']; + } + + // Include_once the language file + if(!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { + $manager_language = "english"; // if not set, get the english language file. + } + // Include default language + include_once MODX_MANAGER_PATH."includes/lang/english.inc.php"; + + // Include user language + if($manager_language !== 'english' && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { + include_once MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php"; + } + + // Get event + $e = &$this->modx->Event; + + // Run plugin based on event + switch ($e->name) { + + // Save document + case 'OnDocFormSave': + + // Saving process for Qm only + if(isset($_REQUEST['quickmanager']) && intval($_REQUEST['quickmanager']) == 1) { + + $id = $e->params['id']; + $key = $id; + + // Normal saving document procedure stops to redirect => Before redirecting secure documents and clear cache + + // Secure web documents - flag as private (code from: processors/save_content.processor.php) + include $this->modx->config['site_manager_path']."includes/secure_web_documents.inc.php"; + secureWebDocument($key); + + // Secure manager documents - flag as private (code from: processors/save_content.processor.php) + include $this->modx->config['site_manager_path']."includes/secure_mgr_documents.inc.php"; + secureMgrDocument($key); + + // Clear cache + $this->modx->clearCache('full'); + + // Different doc to be refreshed than the one we are editing? + if (isset($_POST['qmrefresh'])) { + $id = (int)$_POST['qmrefresh']; + } + + // Redirect to clearer page which refreshes parent window and closes modal box frame + $this->modx->sendRedirect( + $this->modx->makeUrl($id,null,'quickmanagerclose=1'), null, 'REDIRECT_JS' + ); + } + + break; + + // Display page in front-end + case 'OnWebPagePrerender': + + // Get document id + $docID = $this->modx->documentIdentifier; + + // Get page output + $output = &$this->modx->documentOutput; + + // Close modal box after saving (previously close.php) + if (isset($_GET['quickmanagerclose'])) { + + // Set url to refresh + $url = $this->modx->makeUrl($docID, '', '', 'full'); + + $output = ' + + + + + + + + + +'; + break; + } + + // QM+ TV edit + if(isset($_GET['quickmanagertv']) && intval($_GET['quickmanagertv'] == 1) && $_GET['tvname'] != '' && $this->tvbuttons == 'true') { + + $tvName = ''; + $locked = FALSE; + $access = FALSE; + $save = 0; + $imagePreview = ''; + + // Includes + include_once(MODX_MANAGER_PATH.'includes/tmplvars.inc.php'); + include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); + include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php'); + + // Get save status + if (isset($_POST['save'])) $save = (int)$_POST['save']; + + // Get TV name + if (preg_match('/^([^"\'()<>!?]+)/i', $_GET['tvname'])) $tvName = $_GET['tvname']; + + // Get TV array + $tv = $this->modx->getTemplateVar($tvName, '*', $docID); + + // Handle default TVs + switch ($tvName) { + case 'longtitle': + case 'description': + case 'menutitle': + case 'pagetitle' : + $tv['type'] = 'text'; + $tv['caption'] = $this->getDefaultTvCaption($tvName); + $access = TRUE; + break; + case 'content' : + $tv['type'] = 'richtext'; + $tv['caption'] = $this->getDefaultTvCaption($tvName); + $access = TRUE; + break; + case 'introtext' : + $tv['type'] = 'textarea'; + $tv['caption'] = $this->getDefaultTvCaption($tvName); + $access = TRUE; + break; + } + + // Check TV access + if (!$access) { + $access = $this->checkTvAccess($tv['id']); + } + + // User can access TV + if ($access) { + + // Show TV form + if ($save == 0) { + + // Check is document locked? Someone else is editing the document... //$_lang['lock_msg'] + if ($this->checkLocked()) { + $locked = TRUE; + } else { + $this->setLocked(1); + } + + // Handle RTE + if($tv['type'] === 'richtext') { + // Invoke OnRichTextEditorInit event + $eventOutput = $this->modx->invokeEvent("OnRichTextEditorInit", array('editor'=>$this->modx->config['which_editor'], 'elements'=>array('tv'.$tvName))); + + if(is_array($eventOutput)) { + $editorHtml = implode("",$eventOutput); + } + } + + // Render TV html + $tvHtml = renderFormElement($tv['type'], $tv['name'], $tv['default_text'], $tv['elements'], $tv['value']); + + // Get jQuery conflict mode + if ($this->noconflictjq == 'true') { + $jq_mode = '$j'; + } else { + $jq_mode = '$'; + } + } else { + // Remove document locked + $this->setLocked(0); + + // Save TV + $this->saveTv($tvName); + } + + // Page output: header + $output = ' + + + + + + + + + + '; + + // Page output: TV form + if ($save == 0) { + $output .= ' + + '; + + // Document is locked message + if ($locked) { + $output .= ' +

    '.$_lang['locked'].'

    +
    '.$_lang['lock_msg'].'
    + '; + } + + // Normal form + else { + // Image preview + if ($tv['type'] === 'image') { + $imagePreview = ' +
    + + '; + } + $amp = ($this->modx->config['friendly_urls'] == 1) ? '?' : '&'; + $output .= ' +
    + + + + + +

    '.$tv['caption'].'

    + +
    '.$tv['description'].'
    + +
    + '.$tvHtml.' +
    + + '.$imagePreview.' + +
    + '.$editorHtml.' + '; + } + } + + // Page output: close modal box and refresh parent frame + else $output .= ''; + + // Page output: footer + $output .= ' + + + '; + } else { + $output = 'Error: Access denied.'; + } + } elseif(isset($_SESSION['mgrValidated']) && (!(isset($_REQUEST['z']) && $_REQUEST['z'] == 'manprev')) ) { + // QM+ with toolbar + // Add ID + $controls = '
  • ID: '.$docID.'
  • '; + // Go to Manager button + if ($this->managerbutton == 'true') { + $managerButton = sprintf(' +
  • + + + %s + +
  • + ', $_lang['manager'], $this->modx->config['site_manager_url'], $_lang['manager']); + $controls .= $managerButton; + } + // Edit button + + $editButton = sprintf(' +
  • + + + %s + +
  • + ', + $_lang['edit_resource'], + $this->modx->config['site_manager_url'], + $docID, + $_lang['edit_resource'] + ); + + // Check if user has manager access to current document + $access = $this->checkAccess(); + + // Does user have permissions to edit document + if($access) { + $controls .= $editButton; + } + + if ($this->addbutton == 'true' && $access) { + // Add button + $addButton = sprintf(' +
  • + + + %s + +
  • + ', $this->modx->config['site_manager_url'], $docID, $_lang['create_resource_here']); + + // Does user have permissions to add document + if($this->modx->hasPermission('new_document')) { + $controls .= $addButton; + } + } + + // Custom add buttons if not empty and enough permissions + if ($this->custombutton != '') { + + // Replace [*id*] with current doc id + $this->custombutton = str_replace("[*id*]", $docID, $this->custombutton); + + // Handle [~id~] links + $this->custombutton = $this->modx->rewriteUrls($this->custombutton); + + $buttons = explode("||", $this->custombutton); // Buttons are divided by "||" + + // Custom buttons class index + $i = 0; + + // Parse buttons + foreach($buttons as $field) { + $i++; + + $field = substr($field, 1, -1); // Trim "'" from beginning and from end + $buttonParams = explode("','", $field); // Button params are divided by "','" + + $buttonTitle = $buttonParams[0]; + $buttonAction = $buttonParams[1]; // Contains URL if this is not add button + $buttonParentId = $buttonParams[2]; // Is empty is this is not add button + $buttonTplId = $buttonParams[3]; + + // Button visible for all + if ($buttonParams[4] == '') { + $showButton = TRUE; + } else { + $showButton = FALSE; + + // Get user roles the button is visible for + $buttonRoles = explode(",", $buttonParams[4]); // Roles are divided by ',' + + // Check if user role is found + foreach($buttonRoles as $role) { + if ($role == $_SESSION['mgrRole']) { + $showButton = TRUE; + } + } + } + $buttonIcon = $buttonParams[5]; + // Show custom button + if ($showButton) { + switch ($buttonAction) + { + case 'new': + $customButton = ' +
  • + '.$buttonTitle.' +
  • + '; + break; + + case 'link': + $customButton = ' +
  • + '.$buttonTitle.' +
  • + '; + break; + + case 'modal': + $customButton = ' +
  • + '.$buttonTitle.' +
  • + '; + break; + } + $controls .= $customButton; + } + } + } + + // Logout button + $logout = $this->modx->config['site_manager_url'].'index.php?a=8&quickmanager=logout&logoutid='.$docID; + $logoutButton = ' +
  • + '.$_lang['logout'].' +
  • + '; + + $controls .= $logoutButton; + + $username = $_SESSION['mgrShortname']; + // Add action buttons + $editor = ' +
    + +
    + + +
    '; + + $MGR_DIR = $this->modx->getManagerPath( ); + $css = ' + '; + + $css .= ' + + '; + + // font-awesome + if ($this->loadfa == 'true') { + $css .= ' + + '; + } + // Buttons Styles + if ($this->buttonStyle === 'actionButtons') { + $css .= ' + + '; + } elseif ($this->buttonStyle === 'navButtons') { + $css .= ' + + '; + } + // Top toolbar Autohide false + if (($this->autohide == 'false') && ($this->position === 'top')) { + $css .= ' + + '; + } + else + // Top toolbar Autohide true + if (($this->autohide == 'true') && ($this->position === 'top')) { + $css .= ' + + '; + } else + if ($this->position === 'before') { + // Top toolbar Relative + $css .= ' + + '; + } elseif (($this->autohide == 'true') && ($this->position === 'bottom')) { + $css .= ' + + '; + } elseif (($this->autohide == 'false') && ($this->position === 'bottom')) { + $css .= ' + + '; + } + // Left toolbar Autohide true + if ($this->autohide == 'true' && $this->position === 'left') { + $css .= ' + + '; + } elseif ($this->autohide == 'false' && $this->position === 'left') { + $css .= ' + + '; + } + // Right toolbar Autohide true + if (($this->autohide == 'true') && ($this->position == 'right')) { + $css .= ' + + '; + } elseif (($this->autohide == 'false') && ($this->position == 'right')) { + $css .= ' + + '; + } + // Remove background + if (($this->removeBg === 'yes') && ($this->buttonStyle === 'actionButtons')) { + $css .= ' + + '; + } elseif (($this->removeBg === 'yes') && ($this->buttonStyle === 'navButtons')) { + $css .= ' + + '; + } + // Insert jQuery and ColorBox in head if needed + $head = ''; + if ($this->loadfrontendjq == 'true') { + $head .= ''; + } + if ($this->loadtb == 'true') { + $head .= ' + + + + + + '; + } + + // Insert ColorBox jQuery definitions for QuickManager+ + $head .= ' + + '; + + $head .= " + + "; + + // Insert QM+ css in head + $head .= $css; + + // Place QM+ head information in head, just before tag + $output = preg_replace('~()~i', $head . '\1', $output); + + // Insert editor toolbar right after tag + $output = preg_replace('~(]*>)~i', '\1' . $editor, $output); + + // Search and create edit buttons in to the content + if ($this->editbuttons == 'true' && $access) { + $output = preg_replace('//', '$2', $output); + } + + // Search and create new document buttons in to the content + if ($this->newbuttons == 'true' && $access) { + $output = preg_replace('//', '$3', $output); + } + + // Search and create new document buttons in to the content + if ($this->tvbuttons == 'true' && $access) { + // Set and get user doc groups for TV permissions + $this->docGroup = ''; + $mrgDocGroups = $_SESSION['mgrDocgroups']; + if (!empty($mrgDocGroups)) $this->docGroup = implode(",", $mrgDocGroups); + + // Create TV buttons and check TV permissions + $output = preg_replace_callback('//', array(&$this, 'createTvButtons'), $output); + } + } + + break; + + // Edit document in ThickBox frame (MODX manager frame) + case 'OnDocFormPrerender': + + // If there is Qm call, add control buttons and modify to edit document page + if (isset($_REQUEST['quickmanager']) && intval($_REQUEST['quickmanager']) == 1) { + + global $content, $_style; + + // Set template for new document, action = 4 + if((int)$_GET['a'] == 4) { + + // Custom add button + if (isset($_GET['customaddtplid'])) { + // Set template + $content['template'] = (int)$_GET['customaddtplid']; + } + + // Normal add button + else { + switch ($this->tpltype) { + // Template type is parent + case 'parent': + // Get parent document id + $pid = $content['parent'] ?: (int)$_REQUEST['pid']; + + // Get parent document + $parent = $this->modx->getDocument($pid); + + // Set parent template + $content['template'] = $parent['template']; + + break; + + // Template is specific id + case 'id': + $content['template'] = $this->tplid; + + break; + + // Template is inherited by Inherit Selected Template plugin + case 'selected': // Template is inherited by Inherit Selected Template plugin + case 'sibling': + // Get parent document id + $pid = $content['parent'] ?: (int)$_REQUEST['pid']; + + if ($this->modx->config['auto_template_logic'] === 'sibling') { + // Eoler: template_autologic in Evolution 1.0.5+ + // http://tracker.modx.com/issues/9586 + $tv = array(); + $sibl = $this->modx->getDocumentChildren($pid, 1, 0, 'template', '', 'menuindex', 'ASC', 1); + if(empty($sibl)) { + $sibl = $this->modx->getDocumentChildren($pid, 0, 0, 'template', '', 'menuindex', 'ASC', 1); + } + if(!empty($sibl)) { + $tv['value'] = $sibl[0]['template']; + } else { + $tv['value'] = ''; + } // Added by yama + } else { + // Get "inheritTpl" TV + $tv = $this->modx->getTemplateVar('inheritTpl', '', $pid); + } + + // Set template to inherit + if ($tv['value'] != '') { + $content['template'] = $tv['value']; + } else { + $content['template'] = $this->modx->config['default_template']; + } + break; + } + } + } + + // Manager control class + $mc = new Mcc(); + + // Hide default manager action buttons + $mc->addLine('$("#actions").hide();'); + + if (isset($_REQUEST['qmrefresh'])) { + $doc_id = (int)$_REQUEST['qmrefresh']; + } else { + $doc_id = (int)$_REQUEST['id']; + } + + // Get jQuery conflict mode + if ($this->noconflictjq == 'true') { + $jq_mode = '$j'; + } else { + $jq_mode = '$'; + } + + // Add action buttons + $url = $this->modx->makeUrl($doc_id,'','','full'); + $mc->addLine('var controls = "";'); + + // Modify head + $mc->head = ''; + if ($this->loadmanagerjq == 'true') $mc->head .= ''; + + // Add control button + $mc->addLine('$("body").prepend(controls);'); + + // Hide fields to from front-end editors + if (!empty($this->hidefields)) { + $hideFields = explode(",", $this->hidefields); + + foreach($hideFields as $key => $field) { + $mc->hideField($field); + } + } + + // Hide tabs to from front-end editors + if (!empty($this->hidetabs)) { + $hideTabs = explode(",", $this->hidetabs); + + foreach($hideTabs as $key => $field) { + $mc->hideTab($field); + } + } + + // Hide sections from front-end editors + if (!empty($this->hidesections)) { + $hideSections = explode(",", $this->hidesections); + + foreach($hideSections as $key => $field) { + $mc->hideSection($field); + } + } + + // Hidden field to verify that QM+ call exists + $hiddenFields = ''; + + // Different doc to be refreshed? + if (isset($_REQUEST['qmrefresh'])) { + $hiddenFields .= ''; + } + + // Output + $e->output($mc->Output().$hiddenFields); + } + + break; + + // Where to logout + case 'OnManagerLogout': + // Only if cancel editing the document and QuickManager is in use + if (isset($_REQUEST['quickmanager']) && $_REQUEST['quickmanager'] == 'logout') { + // Redirect to document id + if ($this->logout !== 'manager') { + $this->modx->sendRedirect($this->modx->makeUrl($_REQUEST['logoutid']), 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); + } + } + + break; + } + } + + // Check if user has manager access permissions to current document + //_______________________________________________________ + function checkAccess() { + if ($_SESSION['mgrRole'] == 1) { + return TRUE; + } + + $docID = $this->modx->documentIdentifier; + + // Database table + $table= $this->modx->getFullTableName("document_groups"); + + // Check if current document is assigned to one or more doc groups + $result = $this->modx->db->select('count(id)', $table, "document='{$docID}'"); + $rowCount= $this->modx->db->getValue($result); + + // If document is assigned to one or more doc groups, check access + if ($rowCount < 1) { + return TRUE; + } + $mrgDocGroups = $_SESSION['mgrDocgroups']; + if (empty($mrgDocGroups)) { + return FALSE; + } + + $docGroup = implode(",", $mrgDocGroups); + + // Check if user has access to current document + $rowCount = $this->modx->db->getValue( + $this->modx->db->select('count(id)', $table, "document = '{$docID}' AND document_group IN ({$docGroup})") + ); + + if ($rowCount >= 1) { + return TRUE; + } + + return FALSE; + } + + // Function from: processors/cache_sync.class.processor.php + //_____________________________________________________ + function getParents($id, $path = '') { // modx:returns child's parent + if(empty($this->aliases)) { + $qh = $this->modx->db->select("id, IF(alias='', id, alias) AS alias, parent", $this->modx->getFullTableName('site_content')); + while ($row = $this->modx->db->getRow($qh)) { + $this->aliases[$row['id']] = $row['alias']; + $this->parents[$row['id']] = $row['parent']; + } + } + if (isset($this->aliases[$id])) { + $path = $this->aliases[$id] . ($path != '' ? '/' : '') . $path; + return $this->getParents($this->parents[$id], $path); + } + return $path; + } + + // Create TV buttons if user has permissions to TV + //_____________________________________________________ + function createTvButtons($matches) { + + $docID = $this->modx->documentIdentifier; + + // Get TV caption for button title + $tv = $this->modx->getTemplateVar($matches[1]); + $caption = $tv['caption']; + + // If caption is empty this must be a "build-in-tv-field" like pagetitle etc. + if ($caption == '') { + + // Allowed for all + $access = TRUE; + + // Resolve caption + $caption = $this->getDefaultTvCaption($matches[1]); + } else { + $access = $this->checkTvAccess($tv['id']); + } + + // Return TV button link if access + if (!$access || $caption == '') { + return null; + } + $amp = ($this->modx->config['friendly_urls'] == 1) ? '?' : '&'; + return sprintf( + '%s', + $this->tvbclass, + $this->modx->makeUrl($docID), + $amp, + $matches[1], + $caption + ); + } + + // Check user access to TV + //_____________________________________________________ + function checkTvAccess($tvId) { + $access = FALSE; + $table = $this->modx->getFullTableName('site_tmplvar_access'); + + // If user is admin (role = 1) + if ($_SESSION['mgrRole'] == 1 && !$access) { $access = TRUE; } + + // Check permission to TV, is TV in document group? + if (!$access) { + $result = $this->modx->db->select('count(id)', $table, "tmplvarid = '{$tvId}'"); + $rowCount = $this->modx->db->getValue($result); + // TV is not in any document group + if ($rowCount == 0) { $access = TRUE; } + } + + // Check permission to TV, TV is in document group + if (!$access && $this->docGroup != '') { + $result = $this->modx->db->select('count(id)', $table, "tmplvarid = '{$tvId}' AND documentgroup IN ({$this->docGroup})"); + $rowCount = $this->modx->db->getValue($result); + if ($rowCount >= 1) { + $access = TRUE; + } + } + + return $access; + } + + // Get default TV ("build-in" TVs) captions + //_____________________________________________________ + function getDefaultTvCaption($name) { + + global $_lang; + $caption = ''; + + switch ($name) { + case 'pagetitle' : $caption = $_lang['resource_title']; break; + case 'longtitle' : $caption = $_lang['long_title']; break; + case 'description' : $caption = $_lang['resource_description']; break; + case 'content' : $caption = $_lang['resource_content']; break; + case 'menutitle' : $caption = $_lang['resource_opt_menu_title']; break; + case 'introtext' : $caption = $_lang['resource_summary']; break; + } + + return $caption; + } + + // Check that a document isn't locked for editing + //_____________________________________________________ + function checkLocked() { + + $pageId = $this->modx->documentIdentifier; + if ($this->modx->elementIsLocked(7, $pageId) === NULL) { + return FALSE; + } + + return TRUE; + } + + // Set document locked on/off + //_____________________________________________________ + function setLocked($locked) { + + $pageId = $this->modx->documentIdentifier; + + // Set document locked + if ($locked == 1) { + $this->modx->lockElement(7, $pageId); + } else { + $this->modx->unlockElement(7, $pageId); + } + } + + // Save TV + //_____________________________________________________ + function saveTv($tvName) { + + $tmplvarContentValuesTable = $this->modx->getFullTableName('site_tmplvar_contentvalues'); + $siteContentTable = $this->modx->getFullTableName('site_content'); + $pageId = $this->modx->documentIdentifier; + $time = time(); + $user = $_SESSION['mgrInternalKey']; + $tvId = isset($_POST['tvid']) ? (int)$_POST['tvid'] : ''; + $tvContent = $_POST['tv' . $tvName] ?? ''; + $tvContentTemp = ''; + + // Escape TV content + $tvContent = $this->modx->db->escape($tvContent); + + // Invoke OnBeforeDocFormSave event + $this->modx->invokeEvent('OnBeforeDocFormSave', array('mode'=>'upd', 'id'=>$pageId)); + + // Handle checkboxes and other arrays, TV to be saved must be e.g. value1||value2||value3 + if (is_array($tvContent)) { + $tvContent = implode("||", $tvContent); + } + + // Save TV + if ($tvId != '') { + $fields = array( + 'tmplvarid' => $tvId, + 'contentid' => $pageId, + 'value' => $tvContent, + ); + $result = $this->modx->db->select( + 'count(id)', + $tmplvarContentValuesTable, + sprintf("tmplvarid='%s' AND contentid='%s'", $fields['tmplvarid'], $fields['contentid']) + ); + + // TV exists, update TV + if($this->modx->db->getValue($result)) { + $this->modx->db->update( + $fields, + $tmplvarContentValuesTable, + sprintf("tmplvarid='%s' AND contentid='%s'", $fields['tmplvarid'], $fields['contentid']) + ); + } else { + $this->modx->db->insert($fields, $tmplvarContentValuesTable); + } + + // Page edited by + $this->modx->db->update( + array( + 'editedon' => $time, + 'editedby' => $user + ), + $siteContentTable, + "id = '{$pageId}'" + ); + } else { + $this->modx->db->update( + array( + $tvName => $tvContent, + 'editedon' => $time, + 'editedby' => $user + ), + $siteContentTable, + "id = '{$pageId}'" + ); + } + + // Invoke OnDocFormSave event + $this->modx->invokeEvent('OnDocFormSave', array('mode'=>'upd', 'id'=>$pageId)); + + // Clear cache + $this->modx->clearCache('full'); + } +} +} diff --git a/assets/plugins/tinymce4/bridge.tinymce4.inc.php b/assets/plugins/tinymce4/bridge.tinymce4.inc.php index d762d61f5e..662755b278 100755 --- a/assets/plugins/tinymce4/bridge.tinymce4.inc.php +++ b/assets/plugins/tinymce4/bridge.tinymce4.inc.php @@ -322,7 +322,9 @@ public function bridge_selector($selector) { $key .= (!empty($key) ? ',' : '') . $prefix . $el; } $sortElArr[$theme] = $key; - $sortOptArr[$key] = $this->tvOptions[$el]; + if (isset($this->tvOptions[$el])) { + $sortOptArr[$key] = $this->tvOptions[$el]; + } } $this->pluginParams['elements'] = $sortElArr; $this->tvOptions = $sortOptArr; diff --git a/assets/plugins/tinymce4/class.modxRTEbridge.php b/assets/plugins/tinymce4/class.modxRTEbridge.php index ed599b6fe7..c6e1e2b13a 100755 --- a/assets/plugins/tinymce4/class.modxRTEbridge.php +++ b/assets/plugins/tinymce4/class.modxRTEbridge.php @@ -785,7 +785,7 @@ public function getModxSettings () public function parsePlaceholders ($content, $ph) { foreach ($ph as $key => $value) { - $content = str_replace('[+' . $key . '+]', $value, $content); + $content = str_replace('[+' . $key . '+]', $value ?? '', $content); } return $content; diff --git a/assets/plugins/tinymce4/lang/custom/belarusian.inc.php b/assets/plugins/tinymce4/lang/custom/belarusian.inc.php new file mode 100644 index 0000000000..2b08f03c3a --- /dev/null +++ b/assets/plugins/tinymce4/lang/custom/belarusian.inc.php @@ -0,0 +1,12 @@ +db->select("id,pagetitle,alias", $modx->getFullTableName('site_content'), $where, '', 10); $a = array(); +$output = ''; while( $row = $modx->db->getRow( $result ) ) { $output .= $row['pagetitle'] . ' (' . $row['id'] . ')|'. $row['id'] . "\n"; $a[] = array( @@ -33,4 +34,4 @@ } -exit(json_encode($a)); \ No newline at end of file +exit(json_encode($a)); diff --git a/assets/plugins/updater/plugin.updater.php b/assets/plugins/updater/plugin.updater.php index df539632d9..01b792d96b 100755 --- a/assets/plugins/updater/plugin.updater.php +++ b/assets/plugins/updater/plugin.updater.php @@ -13,7 +13,7 @@ return; } // get manager role -$internalKey = $modx->getLoginUserID(); +$internalKey = $modx->getLoginUserID('mgr'); $sid = $modx->sid; $role = isset($_SESSION['mgrRole']) ? $_SESSION['mgrRole'] : ''; $user = isset($_SESSION['mgrShortname']) ? $_SESSION['mgrShortname'] : ''; @@ -24,28 +24,27 @@ $type = isset($type) ? $type : 'tags'; $showButton = isset($showButton) ? $showButton : 'AdminOnly'; $result = ''; +$feedCache = MODX_BASE_PATH . 'assets/cache/updater/'; +if (!is_dir($feedCache)) { + @mkdir($feedCache, intval($modx->getConfig('new_folder_permissions'), 8), true); +} if ($role != 1 && $wdgVisibility == 'AdminOnly') { - -} else if ($role == 1 && $wdgVisibility == 'AdminExcluded') { - -} else if ($role != $ThisRole && $wdgVisibility == 'ThisRoleOnly') { - -} else if ($user != $ThisUser && $wdgVisibility == 'ThisUserOnly') { - +} elseif ($role == 1 && $wdgVisibility == 'AdminExcluded') { +} elseif ($role != $ThisRole && $wdgVisibility == 'ThisRoleOnly') { +} elseif ($user != $ThisUser && $wdgVisibility == 'ThisUserOnly') { } else { - //lang - $_lang = array(); + $_lang = []; $plugin_path = MODX_BASE_PATH . "assets/plugins/updater/"; include($plugin_path . 'lang/english.php'); - if (file_exists($plugin_path . 'lang/' . $modx->config['manager_language'] . '.php')) { - include($plugin_path . 'lang/' . $modx->config['manager_language'] . '.php'); + if (file_exists($plugin_path . 'lang/' . $modx->getConfig('manager_language') . '.php')) { + include($plugin_path . 'lang/' . $modx->getConfig('manager_language') . '.php'); } - $e = &$modx->Event; + $e = $modx->event; if ($e->name == 'OnSiteRefresh') { - array_map("unlink", glob(MODX_BASE_PATH . 'assets/cache/updater/*.json')); + array_map("unlink", glob($feedCache . '*.*')); } if ($e->name == 'OnManagerWelcomeHome') { @@ -74,52 +73,55 @@ $output = '
    ' . $errorsMessage . '
    '; - $widgets['updater'] = array( + $widgets['updater'] = [ 'menuindex' => '1', - 'id' => 'updater', - 'cols' => 'col-sm-12', - 'icon' => 'fa-exclamation-triangle', - 'title' => $_lang['system_update'], - 'body' => $output - ); - $e->output(serialize($widgets)); + 'id' => 'updater', + 'cols' => 'col-sm-12', + 'icon' => 'fa-exclamation-triangle', + 'title' => $_lang['system_update'], + 'body' => $output + ]; + $e->addOutput(serialize($widgets)); return; } $_SESSION['updatelink'] = md5(time()); - // if a GitHub commit feed if ($type == 'commits') { - - // include MagPieRSS - require_once('media/rss/rss_fetch.inc'); - $branchPath = 'https://github.com/'.$version.'/'.$type.'/'.$branch; - $url = $branchPath.'.atom'; - + if (!class_exists('SimplePie\SimplePie')) { + include_once MODX_MANAGER_PATH . 'media/rss/vendor/autoload.php'; + } + $feed = new \SimplePie\SimplePie(); + $feed->set_cache_location($feedCache); + $branchPath = 'https://github.com/' . $version . '/' . $type . '/' . $branch; + $url = $branchPath . '.atom'; // create Feed + $updateButton = ''; - $rss = @fetch_rss($url); - if (!$rss){ - $errorsMessage .= '-'.$_lang['error_failedtogetfeed'].':'.$url.'
    '; - $errors += 1; - } - $updateButton .= '
    '; - $updateButton .= ''; + $feed->set_feed_url($url); + $feed->init(); + $items = $feed->get_items(0, $commitCount ?? 20); + if (empty($items)) { + $items = []; + $errorsMessage .= '-' . $_lang['error_failedtogetfeed'] . ':' . $url . '
    '; + $errors += 1; + } + $updateButton .= '
    '.$_lang['table_commitdate'].''.$_lang['table_titleauthor'].'
    '; + $updateButton .= ''; - $items = array_slice($rss->items, 0, $commitCount); foreach ($items as $item) { - $commitid = $item['id']; + $commitid = $item->get_id(); $commit = substr($commitid, strpos($commitid, "Commit/") + 7); - $href = $item['link']; - $title = $item['title']; - $pubdate = $item['updated']; + $href = $item->get_link(); + $title = $item->get_title(); + $pubdate = $item->get_updated_date(); $pubdate = $modx->toDateFormat(strtotime($pubdate)); - $author = $item['author_name']; + $author = $item->get_author(); $updateButton .= ''; - if (($role != 1) AND ($showButton == 'AdminOnly') OR ($showButton == 'hide') OR ($errors > 0)) { + if (($role != 1) and ($showButton == 'AdminOnly') or ($showButton == 'hide') or ($errors > 0)) { $updateButton .= ''; - } else { - $updateButton .= ''; + } else { + $updateButton .= ''; } } @@ -129,24 +131,19 @@ ' . $_lang['bkp_before_msg'] . '
    ' . $errorsMessage . '' . $updateButton; - // Add widget to end as is always displayed for commits - $widgets['updater'] = array( - 'menuindex' =>'1000', - 'id' => 'updater', - 'cols' => 'col-sm-12', - 'icon' => 'fa-exclamation-triangle', - 'title' => $_lang['system_update'], - 'body' => $output - ); - $e->output(serialize($widgets)); + // Add widget to end as is always displayed for commits + $widgets['updater'] = [ + 'menuindex' => '1000', + 'id' => 'updater', + 'cols' => 'col-sm-12', + 'icon' => 'fa-exclamation-triangle', + 'title' => $_lang['system_update'], + 'body' => $output + ]; + $e->addOutput(serialize($widgets)); } else { - // Create directory 'assets/cache/updater' - if (!file_exists(MODX_BASE_PATH . 'assets/cache/updater')) { - mkdir(MODX_BASE_PATH . 'assets/cache/updater', intval($modx->config['new_folder_permissions'], 8), true); - } - $output = ''; - + $currentVersion = $modx->getVersionData(); $currentMajorVersion = explode('.', $currentVersion['version']); $currentMajorVersion = array_shift($currentMajorVersion); @@ -160,58 +157,60 @@ curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('User-Agent: updateNotify widget')); + curl_setopt($ch, CURLOPT_HTTPHEADER, ['User-Agent: updateNotify widget']); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); - curl_setopt($ch, CURLOPT_TIMEOUT, 4); //timeout in 4 seconds + curl_setopt($ch, CURLOPT_TIMEOUT, 4); //timeout in 4 seconds $info = curl_exec($ch); curl_close($ch); if (substr($info, 0, 1) != '[') { return; } $info = json_decode($info, true); - - foreach($info as $key => $val ) { + if (!is_array($info)) { + $info = []; + } + foreach ($info as $key => $val) { $names = explode('.', $val['name']); - if( $currentMajorVersion == array_shift($names) ){ - + if ($currentMajorVersion == array_shift($names)) { + $git['version'] = $val['name']; - - if(strpos($val['name'], 'alpha')) { + + if (strpos($val['name'], 'alpha')) { $git['alpha'] = $val['name']; continue; - } - elseif(strpos($val['name'], 'beta')) { + } elseif (strpos($val['name'], 'beta')) { $git['beta'] = $val['name']; continue; - } - else { + } else { $git['stable'] = $val['name']; break; } } - } + } - file_put_contents(MODX_BASE_PATH . 'assets/cache/updater/check_' . date("d") . '.json', json_encode($git)); + file_put_contents(MODX_BASE_PATH . 'assets/cache/updater/check_' . date("d") . '.json', + json_encode($git)); } else { $git = file_get_contents(MODX_BASE_PATH . 'assets/cache/updater/check_' . date("d") . '.json'); $git = json_decode($git, true); } - if($stableOnly == 'true') { - if(version_compare($git['version'], $git['stable'], '!=')) { + if ($stableOnly == 'true') { + if (version_compare($git['version'], $git['stable'], '!=')) { $git['version'] = $git['stable']; } } $_SESSION['updateversion'] = $git['version']; - if (version_compare($git['version'], $currentVersion['version'], '>') && $git['version'] != '') { + if (version_compare($git['version'], $currentVersion['version'], + '>') && $git['version'] != '') { // get manager role $role = $_SESSION['mgrRole']; - if (($role != 1) AND ($showButton == 'AdminOnly') OR ($showButton == 'hide') OR ($errors > 0)) { + if (($role != 1) and ($showButton == 'AdminOnly') or ($showButton == 'hide') or ($errors > 0)) { $updateButton = ''; } else { - $updateButton = '' . $_lang['updateButton_txt'] . ' ' . $git['version'] . '

    '; + $updateButton = '' . $_lang['updateButton_txt'] . ' ' . $git['version'] . '

    '; } $output = '
    ' . $_lang['cms_outdated_msg'] . ' ' . $git['version'] . '

    @@ -219,22 +218,22 @@ ' . $_lang['bkp_before_msg'] . ' ' . $errorsMessage . '
    '; - $widgets['updater'] = array( + $widgets['updater'] = [ 'menuindex' => '1', - 'id' => 'updater', - 'cols' => 'col-sm-12', - 'icon' => 'fa-exclamation-triangle', - 'title' => $_lang['system_update'], - 'body' => $output - ); - - $e->output(serialize($widgets)); + 'id' => 'updater', + 'cols' => 'col-sm-12', + 'icon' => 'fa-exclamation-triangle', + 'title' => $_lang['system_update'], + 'body' => $output + ]; + + $e->addOutput(serialize($widgets)); } } } if ($e->name == 'OnPageNotFound' && isset($_GET['q'])) { - if (empty($_SESSION['mgrInternalKey']) || empty($_SESSION['updatelink']) ) { + if (empty($_SESSION['mgrInternalKey']) || empty($_SESSION['updatelink'])) { return; } switch ($_GET['q']) { @@ -382,26 +381,26 @@ function mmkDir( unlink(__DIR__ . "/evo.zip"); unlink(__DIR__ . "/update.php"); header("Location: ' . constant('MODX_SITE_URL') . 'install/index.php?action=mode");'); - if ($result === false){ - echo 'Update failed: cannot write to ' . MODX_BASE_PATH . 'update.php'; - } else { - if ($type == 'commits') { - $versionGet = $commit; - $versionText = $version . '/' . $type . '/' . $branch . '/' . $commit; + if ($result === false) { + echo 'Update failed: cannot write to ' . MODX_BASE_PATH . 'update.php'; } else { - $versionGet = $_SESSION['updateversion']; - $versionText = $_SESSION['updateversion']; - } - echo '

    Evolution Updater

    + if ($type == 'commits') { + $versionGet = $commit; + $versionText = $version . '/' . $type . '/' . $branch . '/' . $commit; + } else { + $versionGet = $_SESSION['updateversion']; + $versionText = $_SESSION['updateversion']; + } + echo '

    Evolution Updater

    Downloading version: ' . $versionText . '.

    You will be redirected to the update wizard shortly.

    Please wait...

    '; + } } - } - die(); - break; + die(); + break; } } } diff --git a/assets/site/.htaccess b/assets/site/.htaccess index 6c1cc6e2da..c23333c05f 100644 --- a/assets/site/.htaccess +++ b/assets/site/.htaccess @@ -1,5 +1,10 @@ IndexIgnore */* - Order Deny,Allow - Deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/assets/snippets/DocLister/config/core/sitemap.json b/assets/snippets/DocLister/config/core/sitemap.json index a4f8b2b482..a050cbecd1 100644 --- a/assets/snippets/DocLister/config/core/sitemap.json +++ b/assets/snippets/DocLister/config/core/sitemap.json @@ -4,9 +4,8 @@ "addWhereList": "c.published = 1 AND c.deleted=0 AND c.searchable=1 AND c.type='document'", "selectFields": "c.id,c.editedon,c.createdon,c.type", "dateSource":"", - "tpl": "@CODE:\n\n\t[+e.url+]\n\t[+date+]\n\t[+update+]\n\t[+priority+]\n", + "tpl": "@CODE:\n\n\t[+url+]\n\t[+date+]\n\t[+update+]\n\t[+priority+]\n", "tvList": "sitemap_changefreq,sitemap_priority", "ownerTPL": "@CODE:[+dl.wrap+]", - "urlScheme": "full", - "e":"url" + "urlScheme": "full" } diff --git a/assets/snippets/DocLister/core/DocLister.abstract.php b/assets/snippets/DocLister/core/DocLister.abstract.php index 0f0f560887..752ff01049 100644 --- a/assets/snippets/DocLister/core/DocLister.abstract.php +++ b/assets/snippets/DocLister/core/DocLister.abstract.php @@ -31,14 +31,14 @@ abstract class DocLister * @var array * @access protected */ - protected $_docs = array(); + protected $_docs = []; /** * Массив документов self::$_docs собранный в виде дерева * @var array * @access protected */ - protected $_tree = array(); + protected $_tree = []; /** * @var @@ -65,21 +65,21 @@ abstract class DocLister * @var array * @access protected */ - protected $extender = array(); + protected $extender = []; /** * Массив плейсхолдеров доступных в шаблоне * @var array * @access protected */ - protected $_plh = array(); + protected $_plh = []; /** * Список таблиц уже с префиксами MODX * @var array * @access private */ - private $_table = array(); + private $_table = []; /** * PrimaryKey основной таблицы @@ -100,14 +100,14 @@ abstract class DocLister * @var array * @access protected */ - protected $_filters = array('where' => '', 'join' => ''); + protected $_filters = ['where' => '', 'join' => '']; /** * Список доступных логических операторов для фильтрации * @var array * @access protected */ - protected $_logic_ops = array('AND' => ' AND ', 'OR' => ' OR '); // logic operators currently supported + protected $_logic_ops = ['AND' => ' AND ', 'OR' => ' OR ']; // logic operators currently supported /** * Режим отладки @@ -128,7 +128,7 @@ abstract class DocLister * Массив дополнительно подключаемых таблиц с псевдонимами * @var array */ - public $AddTable = array(); + public $AddTable = []; /** * Время запуска сниппета @@ -180,12 +180,12 @@ abstract class DocLister /** * Конструктор контроллеров DocLister * - * @param DocumentParser $modx объект DocumentParser - основной класс MODX - * @param mixed $cfg массив параметров сниппета - * @param int $startTime время запуска сниппета + * @param DocumentParser $modx объект DocumentParser - основной класс MODX + * @param mixed $cfg массив параметров сниппета + * @param int $startTime время запуска сниппета * @throws Exception */ - public function __construct($modx, $cfg = array(), $startTime = null) + public function __construct($modx, $cfg = [], $startTime = null) { $this->setTimeStart($startTime); @@ -199,7 +199,7 @@ public function __construct($modx, $cfg = array(), $startTime = null) $this->modx = $modx; $this->setDebug(1); - if (! is_array($cfg) || empty($cfg)) { + if (!is_array($cfg) || empty($cfg)) { $cfg = $this->modx->Event->params; } } else { @@ -222,11 +222,11 @@ public function __construct($modx, $cfg = array(), $startTime = null) 'handler' => $this->getCFGDef('lexiconHandler', '\\Helpers\\Lexicon\\EvoBabelLexiconHandler') ]); - $this->loadLang(array('core', 'json')); + $this->loadLang(['core', 'json']); $this->setDebug($this->getCFGDef('debug', 0)); if ($this->checkDL()) { - $cfg = array(); + $cfg = []; $idType = $this->getCFGDef('idType', ''); if (empty($idType) && $this->getCFGDef('documents', '') != '') { $idType = 'documents'; @@ -255,14 +255,14 @@ public function __construct($modx, $cfg = array(), $startTime = null) ) : $this->table, $this->alias); $this->idField = $this->getCFGDef('idField', $this->idField); - $this->parentField = $this->getCFGDef('parentField', $this->parentField); + $this->parentField = $this->getCFGDef('parentField', $this->parentField); $this->extCache = $this->getExtender('cache', true); - $this->extCache->init($this, array( + $this->extCache->init($this, [ 'cache' => $this->getCFGDef('cache', 1), 'cacheKey' => $this->getCFGDef('cacheKey'), 'cacheLifetime' => $this->getCFGDef('cacheLifetime', 0), 'cacheStrategy' => $this->getCFGDef('cacheStrategy') - )); + ]); $this->setIDs($IDs); } @@ -284,17 +284,17 @@ public function __construct($modx, $cfg = array(), $startTime = null) if ($ext = $this->getCFGDef('templateExtension')) { $DLTemplate->setTemplateExtension($ext); } - $this->DLTemplate = $DLTemplate->setTemplateData(array('DocLister' => $this)); + $this->DLTemplate = $DLTemplate->setTemplateData(['DocLister' => $this]); } /** * Разбиение фильтра на субфильтры с учётом вложенности - * @param string $str строка с фильтром + * @param string $str строка с фильтром * @return array массив субфильтров */ public function smartSplit($str) { - $res = array(); + $res = []; $cur = ''; $open = 0; $strlen = mb_strlen($str, 'UTF-8'); @@ -349,7 +349,7 @@ public function __toString() /** * Установить время запуска сниппета - * @param float|null $time + * @param float|null $time */ public function setTimeStart($time = null) { @@ -368,11 +368,11 @@ public function getTimeStart() /** * Установка режима отладки - * @param int $flag режим отладки + * @param int $flag режим отладки */ public function setDebug($flag = 0) { - $flag = abs((int)$flag); + $flag = abs((int) $flag); if ($this->_debugMode != $flag) { $this->_debugMode = $flag; $this->debug = null; @@ -408,8 +408,8 @@ public function getDebug() /** * Генерация имени таблицы с префиксом и алиасом * - * @param string $name имя таблицы - * @param string $alias желаемый алиас таблицы + * @param string $name имя таблицы + * @param string $alias желаемый алиас таблицы * @return string имя таблицы с префиксом и алиасом */ public function getTable($name, $alias = '') @@ -418,7 +418,7 @@ public function getTable($name, $alias = '') $this->_table[$name] = $this->modx->getFullTableName($name); } $table = $this->_table[$name]; - if (! empty($alias) && is_scalar($alias)) { + if (!empty($alias) && is_scalar($alias)) { $table .= " as `" . $alias . "`"; } @@ -454,11 +454,11 @@ public function checkTableAlias($name, $table) * Разбор JSON строки при помощи json_decode * * @param $json string строка c JSON - * @param array $config ассоциативный массив с настройками для json_decode - * @param bool $nop создавать ли пустой объект запрашиваемого типа + * @param array $config ассоциативный массив с настройками для json_decode + * @param bool $nop создавать ли пустой объект запрашиваемого типа * @return array|mixed|xNop */ - public function jsonDecode($json, $config = array(), $nop = false) + public function jsonDecode($json, $config = [], $nop = false) { $this->debug->debug( 'Decode JSON: ' . $this->debug->dumpData($json) . "\r\nwith config: " . $this->debug->dumpData($config), @@ -481,7 +481,7 @@ public function jsonDecode($json, $config = array(), $nop = false) public function isErrorJSON($json) { $error = jsonHelper::json_last_error_msg(); - if (!in_array($error, array('error_none', 'other'))) { + if (!in_array($error, ['error_none', 'other'])) { $this->debug->error($this->getMsg('json.' . $error) . ": " . $this->debug->dumpData($json, 'code'), 'JSON'); $error = true; } @@ -511,7 +511,7 @@ public function checkDL() throw new Exception('Error load summary extender'); } - if ((int)$this->getCFGDef('display', 0) > 0 && ( //OR paginate in extender's parameter + if ((int) $this->getCFGDef('display', 0) > 0 && ( //OR paginate in extender's parameter in_array('paginate', $extenders) || $this->getCFGDef('paginate', '') != '' || $this->getCFGDef('TplPrevP', '') != '' || $this->getCFGDef('TplPage', '') != '' || $this->getCFGDef('TplCurrentPage', '') != '' || $this->getCFGDef('TplWrapPaginate', '') != '' || @@ -521,7 +521,7 @@ public function checkDL() ) { throw new Exception('Error load paginate extender'); } else { - if ((int)$this->getCFGDef('display', 0) == 0) { + if ((int) $this->getCFGDef('display', 0) == 0) { $extenders = $this->unsetArrayVal($extenders, 'paginate'); } } @@ -530,7 +530,7 @@ public function checkDL() $this->_loadExtender('prepare'); } - $this->config->setConfig(array('extender' => implode(",", $extenders))); + $this->config->setConfig(['extender' => implode(",", $extenders)]); $this->debug->debugEnd("checkDL"); return $flag; @@ -539,13 +539,13 @@ public function checkDL() /** * Удаление определенных данных из массива * - * @param array $data массив с данными - * @param mixed $val значение которые необходимо удалить из массива + * @param array $data массив с данными + * @param mixed $val значение которые необходимо удалить из массива * @return array отчищеный массив с данными */ private function unsetArrayVal($data, $val) { - $out = array(); + $out = []; if (is_array($data)) { foreach ($data as $item) { if ($item != $val) { @@ -562,12 +562,12 @@ private function unsetArrayVal($data, $val) /** * Генерация URL страницы * - * @param int $id уникальный идентификатор страницы + * @param int $id уникальный идентификатор страницы * @return string URL страницы */ public function getUrl($id = 0) { - $id = ((int)$id > 0) ? (int)$id : $this->getCurrentMODXPageID(); + $id = ((int) $id > 0) ? (int) $id : $this->getCurrentMODXPageID(); $link = $this->checkExtender('request') ? $this->extender['request']->getLink() : $this->getRequest(); if ($id == $this->modx->config['site_start']) { @@ -581,7 +581,7 @@ public function getUrl($id = 0) /** * Получение массива документов из базы - * @param mixed $tvlist дополнительные параметры выборки + * @param mixed $tvlist дополнительные параметры выборки * @return array Массив документов выбранных из базы */ abstract public function getDocs($tvlist = ''); @@ -589,7 +589,7 @@ abstract public function getDocs($tvlist = ''); /** * Подготовка результатов к отображению. * - * @param string $tpl шаблон + * @param string $tpl шаблон * @return mixed подготовленный к отображению результат выборки */ abstract public function _render($tpl = ''); @@ -597,7 +597,7 @@ abstract public function _render($tpl = ''); /** * Подготовка результатов к отображению в соответствии с настройками * - * @param string $tpl шаблон + * @param string $tpl шаблон * @return string */ public function render($tpl = '') @@ -606,7 +606,7 @@ public function render($tpl = '') $this->toPlaceholders(count($this->_docs), 1, 'count'); } - $this->debug->debug(array('Render data with template ' => $tpl), 'render', 2, array('html')); + $this->debug->debug(['Render data with template ' => $tpl], 'render', 2, ['html']); $out = ''; if (1 == $this->getCFGDef('tree', '0')) { foreach ($this->_tree as $item) { @@ -626,12 +626,12 @@ public function render($tpl = '') } /** - * @param string $out + * @param string $out * @return string */ public function parseSource($out = '') { - if($this->getCFGDef('parseDocumentSource', 1)) { + if ($this->getCFGDef('parseDocumentSource', 1)) { $out = DLTemplate::getInstance($this->modx)->parseDocumentSource($out); } @@ -649,8 +649,8 @@ public function parseSource($out = '') */ public function getCurrentMODXPageID() { - $id = isset($this->modx->documentIdentifier) ? (int)$this->modx->documentIdentifier : 0; - $docData = isset($this->modx->documentObject) ? $this->modx->documentObject : array(); + $id = isset($this->modx->documentIdentifier) ? (int) $this->modx->documentIdentifier : 0; + $docData = isset($this->modx->documentObject) ? $this->modx->documentObject : []; return empty($id) ? \APIHelpers::getkey($docData, 'id', 0) : $id; } @@ -658,11 +658,11 @@ public function getCurrentMODXPageID() /** * Display and save error information * - * @param string $message error message - * @param integer $code error number - * @param string $file error on file - * @param integer $line error on line - * @param array $trace stack trace + * @param string $message error message + * @param integer $code error number + * @param string $file error on file + * @param integer $line error on line + * @param array $trace stack trace */ public function ErrorLogger($message, $code, $file, $line, $trace) { @@ -691,7 +691,7 @@ public function getMODX() /** * load extenders * - * @param string $ext name extender separated by , + * @param string $ext name extender separated by , * @return boolean status load extenders * @throws Exception */ @@ -713,21 +713,35 @@ public function loadExtender($ext = '') /** * Получение информации из конфига * - * @param string $name имя параметра в конфиге - * @param mixed $def значение по умолчанию, если в конфиге нет искомого параметра + * @param string $name имя параметра в конфиге + * @param mixed $def значение по умолчанию, если в конфиге нет искомого параметра * @return mixed значение из конфига */ public function getCFGDef($name, $def = null) { - return $this->config->getCFGDef($name, $def); + $out = $this->config->getCFGDef($name, $def); + if ($name == 'dateFormat' && !empty($out) && is_scalar($out) && strpos($out, '%') !== false) { + $replace = [ + '%d' => 'd', '%a' => 'D', '%e' => 'j', '%A' => 'l', '%u' => 'N', '%w' => 'w', '%j' => 'z', + '%V' => 'W', + '%B' => 'F', '%m' => 'm', '%b' => 'M', + '%G' => 'o', '%Y' => 'Y', '%y' => 'y', + '%P' => 'a', '%p' => 'A', '%l' => 'g', '%I' => 'h', '%H' => 'H', '%M' => 'i', '%S' => 's', + '%z' => 'O', '%Z' => 'T', + '%s' => 'U' + ]; + $out = strtr($out, $replace); + } + + return $out; } /** * Сохранение данных в массив плейсхолдеров * - * @param mixed $data данные - * @param int $set устанавливать ли глобальнй плейсхолдер MODX - * @param string $key ключ локального плейсхолдера + * @param mixed $data данные + * @param int $set устанавливать ли глобальнй плейсхолдер MODX + * @param string $key ключ локального плейсхолдера * @return string */ public function toPlaceholders($data, $set = 0, $key = 'contentPlaceholder') @@ -745,8 +759,8 @@ public function toPlaceholders($data, $set = 0, $key = 'contentPlaceholder') $this->debug->debugEnd( "toPlaceholders", - array($key . " placeholder" => $data), - array('html') + [$key . " placeholder" => $data], + ['html'] ); return $out; @@ -757,9 +771,9 @@ public function toPlaceholders($data, $set = 0, $key = 'contentPlaceholder') * Если данные в виде строки, то происходит попытка сформировать массив из этой строки по разделителю $sep * Точно по тому, по которому потом данные будут собраны обратно * - * @param integer|string|array $data данные для обработки - * @param string $sep разделитель - * @param boolean $quote заключать ли данные на выходе в кавычки + * @param integer|string|array $data данные для обработки + * @param string $sep разделитель + * @param boolean $quote заключать ли данные на выходе в кавычки * @return string обработанная строка */ public function sanitarIn($data, $sep = ',', $quote = true) @@ -775,7 +789,7 @@ public function sanitarIn($data, $sep = ',', $quote = true) * - core.bla-bla * - paginate.next * - * @param string $lang имя языкового пакета + * @param string $lang имя языкового пакета * @return array */ public function getCustomLang($lang = '') @@ -788,8 +802,8 @@ public function getCustomLang($lang = '') /** * Загрузка языкового пакета * - * @param array|string $name ключ языкового пакета - * @param string $lang имя языкового пакета + * @param array|string $name ключ языкового пакета + * @param string $lang имя языкового пакета * @return array массив с лексиконом */ public function loadLang($name = 'core', $lang = '') @@ -807,8 +821,8 @@ public function loadLang($name = 'core', $lang = '') /** * Получение строки из языкового пакета * - * @param string $name имя записи в языковом пакете - * @param string $def Строка по умолчанию, если запись в языковом пакете не будет обнаружена + * @param string $name имя записи в языковом пакете + * @param string $def Строка по умолчанию, если запись в языковом пакете не будет обнаружена * @return string строка в соответствии с текущими языковыми настройками */ public function getMsg($name, $def = '') @@ -819,10 +833,10 @@ public function getMsg($name, $def = '') /** * Переменовывание элементов массива * - * @param array $data массив с данными - * @param string $prefix префикс ключей - * @param string $suffix суффикс ключей - * @param string $sep разделитель суффиксов, префиксов и ключей массива + * @param array $data массив с данными + * @param string $prefix префикс ключей + * @param string $suffix суффикс ключей + * @param string $sep разделитель суффиксов, префиксов и ключей массива * @return array массив с переименованными ключами */ public function renameKeyArr($data, $prefix = '', $suffix = '', $sep = '.') @@ -833,7 +847,7 @@ public function renameKeyArr($data, $prefix = '', $suffix = '', $sep = '.') /** * Установка локали * - * @param string $locale локаль + * @param string $locale локаль * @return string имя установленной локали */ public function setLocate($locale = '') @@ -852,7 +866,7 @@ public function setLocate($locale = '') * Шаблонизация дерева. * Перевод из массива в HTML в соответствии с указанным шаблоном * - * @param array $data массив сформированный как дерево + * @param array $data массив сформированный как дерево * @return string строка для отображения пользователю */ protected function renderTree($data) @@ -873,12 +887,12 @@ protected function renderTree($data) /** * refactor $modx->getChunk(); * - * @param string $name Template: chunk name || @CODE: template || @FILE: file with template + * @param string $name Template: chunk name || @CODE: template || @FILE: file with template * @return string html template with placeholders without data */ private function _getChunk($name) { - $this->debug->debug(array('Get chunk by name' => $name), "getChunk", 2, array('html')); + $this->debug->debug(['Get chunk by name' => $name], "getChunk", 2, ['html']); //without trim $tpl = DLTemplate::getInstance($this->getMODX())->getChunk($name); $tpl = $this->parseLang($tpl); @@ -891,12 +905,12 @@ private function _getChunk($name) /** * Замена в шаблоне фраз из лексикона * - * @param string $tpl HTML шаблон + * @param string $tpl HTML шаблон * @return string */ public function parseLang($tpl) { - $this->debug->debug(array("parseLang" => $tpl), "parseLang", 2, array('html')); + $this->debug->debug(["parseLang" => $tpl], "parseLang", 2, ['html']); $tpl = $this->lexicon->parse($tpl); $this->debug->debugEnd("parseLang"); @@ -906,21 +920,21 @@ public function parseLang($tpl) /** * refactor $modx->parseChunk(); * - * @param string $name Template: chunk name || @CODE: template || @FILE: file with template - * @param array $data paceholder - * @param bool $parseDocumentSource render html template via DocumentParser::parseDocumentSource() + * @param string $name Template: chunk name || @CODE: template || @FILE: file with template + * @param array $data paceholder + * @param bool $parseDocumentSource render html template via DocumentParser::parseDocumentSource() * @return string html template with data without placeholders */ - public function parseChunk($name, $data = array(), $parseDocumentSource = false) + public function parseChunk($name, $data = [], $parseDocumentSource = false) { $this->debug->debug( - array("parseChunk" => $name, "With data" => print_r($data, 1)), + ["parseChunk" => $name, "With data" => print_r($data, 1)], "parseChunk", 2, - array('html', null) + ['html', null] ); $disablePHx = $this->getCFGDef('disablePHx', 0); - $out = $this->DLTemplate->parseChunk($name, $data, $parseDocumentSource, (bool)$disablePHx); + $out = $this->DLTemplate->parseChunk($name, $data, $parseDocumentSource, (bool) $disablePHx); $out = $this->parseLang($out); if (empty($out)) { $this->debug->debug("Empty chunk: " . $this->debug->dumpData($name), '', 2); @@ -933,8 +947,8 @@ public function parseChunk($name, $data = array(), $parseDocumentSource = false) /** * Get full template from parameter name * - * @param string $name param name - * @param string $val default value + * @param string $name param name + * @param string $val default value * * @return string html template from parameter */ @@ -949,7 +963,7 @@ public function getChunkByParam($name, $val = '') /** * Помещение html кода в какой-то блок обертку * - * @param string $data html код который нужно обернуть в ownerTPL + * @param string $data html код который нужно обернуть в ownerTPL * @return string результатирующий html код */ public function renderWrap($data) @@ -957,23 +971,24 @@ public function renderWrap($data) $out = $data; $docs = count($this->_docs) - $this->skippedDocs; $wrap = $this->getCFGDef('prepareWrap'); - if ((($this->getCFGDef("noneWrapOuter", "1") && $docs == 0) || $docs > 0) && !empty($this->ownerTPL) || !empty($wrap)) { + if ((($this->getCFGDef("noneWrapOuter", + "1") && $docs == 0) || $docs > 0) && !empty($this->ownerTPL) || !empty($wrap)) { $this->debug->debug("", "renderWrapTPL", 2); $parse = true; - $plh = array($this->getCFGDef("sysKey", "dl") . ".wrap" => $data); + $plh = [$this->getCFGDef("sysKey", "dl") . ".wrap" => $data]; /** * @var $extPrepare prepare_DL_Extender */ $extPrepare = $this->getExtender('prepare'); if ($extPrepare) { - $params = $extPrepare->init($this, array( - 'data' => array( + $params = $extPrepare->init($this, [ + 'data' => [ 'docs' => $this->_docs, 'placeholders' => $plh - ), + ], 'nameParam' => 'prepareWrap', 'return' => 'placeholders' - )); + ]); if ($params === false) { $out = $data; $parse = false; @@ -982,9 +997,9 @@ public function renderWrap($data) } if ($parse && !empty($this->ownerTPL)) { $this->debug->updateMessage( - array("render ownerTPL" => $this->ownerTPL, "With data" => print_r($plh, 1)), + ["render ownerTPL" => $this->ownerTPL, "With data" => print_r($plh, 1)], "renderWrapTPL", - array('html', null) + ['html', null] ); $out = $this->parseChunk($this->ownerTPL, $plh); } @@ -1000,13 +1015,13 @@ public function renderWrap($data) /** * Единые обработки массива с данными о документе для всех контроллеров * - * @param array $data массив с данными о текущем документе - * @param int $i номер итерации в цикле + * @param array $data массив с данными о текущем документе + * @param int $i номер итерации в цикле * @return array массив с данными которые можно использовать в цикле render метода */ protected function uniformPrepare(&$data, $i = 0) { - $class = array(); + $class = []; $iterationName = ($i % 2 == 1) ? 'Odd' : 'Even'; $tmp = strtolower($iterationName); @@ -1021,20 +1036,20 @@ protected function uniformPrepare(&$data, $i = 0) 'reversePagination', 0 ) && $this->extPaginate->currentPage() > 1 ? $this->extPaginate->totalPage() * $this->getCFGDef( - 'display', - 0 - ) - $this->extPaginate->totalDocs() : 0; + 'display', + 0 + ) - $this->extPaginate->totalDocs() : 0; if ($this->getCFGDef('maxDocs', 0) && !$this->getCFGDef( - 'reversePagination', - 0 - ) && $this->extPaginate->currentPage() == $this->extPaginate->totalPage() + 'reversePagination', + 0 + ) && $this->extPaginate->currentPage() == $this->extPaginate->totalPage() ) { $iteration += $this->getCFGDef('display', 0); } $iteration += $this->getCFGDef( - 'display', - 0 - ) * ($this->extPaginate->currentPage() - 1) - $offset; + 'display', + 0 + ) * ($this->extPaginate->currentPage() - 1) - $offset; } $data[$this->getCFGDef( @@ -1088,17 +1103,17 @@ protected function uniformPrepare(&$data, $i = 0) /** * Формирование JSON ответа * - * @param array $data массив данных которые подготавливаются к выводу в JSON - * @param mixed $fields список полей учавствующих в JSON ответе. может быть либо массив, либо строка с разделителем , (запятая) - * @param array $array данные которые необходимо примешать к ответу на каждой записи $data + * @param array $data массив данных которые подготавливаются к выводу в JSON + * @param mixed $fields список полей учавствующих в JSON ответе. может быть либо массив, либо строка с разделителем , (запятая) + * @param array $array данные которые необходимо примешать к ответу на каждой записи $data * @return string JSON строка */ - public function getJSON($data, $fields, $array = array()) + public function getJSON($data, $fields, $array = []) { - $out = array(); + $out = []; $fields = is_array($fields) ? $fields : explode(",", $fields); if (is_array($array) && count($array) > 0) { - $tmp = array(); + $tmp = []; foreach ($data as $i => $v) { //array_merge not valid work with integer index key $tmp[$i] = (isset($array[$i]) ? array_merge($v, $array[$i]) : $v); } @@ -1106,7 +1121,7 @@ public function getJSON($data, $fields, $array = array()) } foreach ($data as $num => $doc) { - $tmp = array(); + $tmp = []; foreach ($doc as $name => $value) { if (in_array($name, $fields) || (isset($fields[0]) && $fields[0] == '1')) { $tmp[str_replace(".", "_", $name)] = $value; //JSON element name without dot @@ -1126,7 +1141,7 @@ public function getJSON($data, $fields, $array = array()) break; default: $return = $out; - break; + break; } $this->outData = json_encode($return); $this->isErrorJSON($return); @@ -1135,13 +1150,13 @@ public function getJSON($data, $fields, $array = array()) } /** - * @param array $item - * @param null $extSummary - * @param string $introField - * @param string $contentField + * @param array $item + * @param null $extSummary + * @param string $introField + * @param string $contentField * @return mixed|string */ - protected function getSummary(array $item = array(), $extSummary = null, $introField = '', $contentField = '') + protected function getSummary(array $item = [], $extSummary = null, $introField = '', $contentField = '') { $out = ''; @@ -1158,13 +1173,13 @@ protected function getSummary(array $item = array(), $extSummary = null, $introF $out = $item[$introField]; } else { if (!empty($contentField) && !empty($item[$contentField]) && mb_strlen($item[$contentField], 'UTF-8') > 0) { - $out = $extSummary->init($this, array( + $out = $extSummary->init($this, [ "content" => $item[$contentField], "action" => $this->getCFGDef("summary", ""), "cutSummary" => $this->getCFGDef('cutSummary'), "dotSummary" => $this->getCFGDef('dotSummary'), 'breakSummary' => $this->getCFGDef('breakSummary') - )); + ]); } } @@ -1172,7 +1187,7 @@ protected function getSummary(array $item = array(), $extSummary = null, $introF } /** - * @param string $name extender name + * @param string $name extender name * @return boolean status extender load */ public function checkExtender($name) @@ -1192,9 +1207,9 @@ public function setExtender($name, $obj) /** * Вытащить экземпляр класса экстендера из общего массива экстендеров * - * @param string $name имя экстендера - * @param bool $autoload Если экстендер не загружен, то пытаться ли его загрузить - * @param bool $nop если экстендер не загружен, то загружать ли xNop + * @param string $name имя экстендера + * @param bool $autoload Если экстендер не загружен, то пытаться ли его загрузить + * @param bool $nop если экстендер не загружен, то загружать ли xNop * @return null|xNop */ public function getExtender($name, $autoload = false, $nop = false) @@ -1213,7 +1228,7 @@ public function getExtender($name, $autoload = false, $nop = false) /** * load extender * - * @param string $name name extender + * @param string $name name extender * @return boolean $flag status load extender */ protected function _loadExtender($name) @@ -1250,7 +1265,7 @@ protected function _loadExtender($name) /** * Очистка массива $IDs по которому потом будет производиться выборка документов * - * @param mixed $IDs список id документов по которым необходима выборка + * @param mixed $IDs список id документов по которым необходима выборка * @return array очищенный массив */ public function setIDs($IDs) @@ -1290,8 +1305,8 @@ public function getIDs() /** * Очистка данных и уникализация списка цифр. * Если был $IDs был передан как строка, то эта строка будет преобразована в массив по разделителю $sep - * @param mixed $IDs данные для обработки - * @param string $sep разделитель + * @param mixed $IDs данные для обработки + * @param string $sep разделитель * @return array очищенный массив с данными */ public function cleanIDs($IDs, $sep = ',') @@ -1301,14 +1316,14 @@ public function cleanIDs($IDs, $sep = ',') 'cleanIDs', 2 ); - $out = array(); + $out = []; if (!is_array($IDs)) { - $IDs = explode($sep, $IDs); + $IDs = explode($sep, $IDs ?? ''); } foreach ($IDs as $item) { $item = trim($item); - if (is_numeric($item) && (int)$item >= 0) { //Fix 0xfffffffff - $out[] = (int)$item; + if (is_numeric($item) && (int) $item >= 0) { //Fix 0xfffffffff + $out[] = (int) $item; } } $out = array_unique($out); @@ -1329,14 +1344,14 @@ protected function checkIDs() /** * Get all field values from array documents * - * @param string $userField field name - * @param boolean $uniq Only unique values - * @global array $_docs all documents + * @param string $userField field name + * @param boolean $uniq Only unique values * @return array all field values + * @global array $_docs all documents */ public function getOneField($userField, $uniq = false) { - $out = array(); + $out = []; foreach ($this->_docs as $doc => $val) { if (isset($val[$userField]) && (($uniq && !in_array($val[$userField], $out)) || !$uniq)) { $out[$doc] = $val[$userField]; @@ -1369,13 +1384,13 @@ abstract public function getChildrenCount(); * Выборка документов которые являются дочерними относительно $id документа и в тоже время * являются родителями для каких-нибудь других документов * - * @param string|array $id значение PrimaryKey родителя + * @param string|array $id значение PrimaryKey родителя * @return array массив документов */ abstract public function getChildrenFolder($id); /** - * @param string $group + * @param string $group * @return string */ protected function getGroupSQL($group = '') @@ -1391,14 +1406,14 @@ protected function getGroupSQL($group = '') /** * Sorting method in SQL queries * + * @param string $sortName default sort field + * @param string $orderDef default order (ASC|DESC) + * + * @return string Order by for SQL * @global string $order * @global string $orderBy * @global string $sortBy * - * @param string $sortName default sort field - * @param string $orderDef default order (ASC|DESC) - * - * @return string Order by for SQL */ protected function SortOrderSQL($sortName, $orderDef = 'DESC') { @@ -1410,12 +1425,12 @@ protected function SortOrderSQL($sortName, $orderDef = 'DESC') break; case 'doclist': $idList = $this->sanitarIn($this->IDs, ',', false); - $out = array('orderBy' => "FIND_IN_SET({$this->getCFGDef('sortBy', $this->getPK())}, '{$idList}')"); + $out = ['orderBy' => "FIND_IN_SET({$this->getCFGDef('sortBy', $this->getPK())}, '{$idList}')"]; $this->config->setConfig($out); //reload config; $sort = "ORDER BY " . $out['orderBy']; break; default: - $out = array('orderBy' => '', 'order' => '', 'sortBy' => ''); + $out = ['orderBy' => '', 'order' => '', 'sortBy' => '']; if (($tmp = $this->getCFGDef('orderBy', '')) != '') { $out['orderBy'] = $tmp; } else { @@ -1427,7 +1442,7 @@ protected function SortOrderSQL($sortName, $orderDef = 'DESC') $out['order'] = $tmp; // no break } - if ('' == $out['order'] || !in_array(strtoupper($out['order']), array('ASC', 'DESC'))) { + if ('' == $out['order'] || !in_array(strtoupper($out['order']), ['ASC', 'DESC'])) { $out['order'] = $orderDef; //Default } @@ -1469,14 +1484,14 @@ protected function LimitSQL($limit = 0, $offset = 0) } if ($limit != 0) { - $ret = "LIMIT " . (int)$offset . "," . (int)$limit; + $ret = "LIMIT " . (int) $offset . "," . (int) $limit; } else { if ($offset != 0) { /** * To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter * @see http://dev.mysql.com/doc/refman/5.0/en/select.html */ - $ret = "LIMIT " . (int)$offset . ",18446744073709551615"; + $ret = "LIMIT " . (int) $offset . ",18446744073709551615"; } } $this->debug->debugEnd("limitSQL", "Get limit for SQL: " . $this->debug->dumpData($ret)); @@ -1487,8 +1502,8 @@ protected function LimitSQL($limit = 0, $offset = 0) /** * Clean up the modx and html tags * - * @param string $data String for cleaning - * @param string $charset + * @param string $data String for cleaning + * @param string $charset * @return string Clear string */ public function sanitarData($data, $charset = 'UTF-8') @@ -1499,8 +1514,8 @@ public function sanitarData($data, $charset = 'UTF-8') /** * run tree build * - * @param string $idField default name id field - * @param string $parentField default name parent field + * @param string $idField default name id field + * @param string $parentField default name parent field * @return array */ public function treeBuild($idField = 'id', $parentField = 'parent') @@ -1515,28 +1530,28 @@ public function treeBuild($idField = 'id', $parentField = 'parent') /** * @see: https://github.com/DmitryKoterov/DbSimple/blob/master/lib/DbSimple/Generic.php#L986 * - * @param array $data Associative data array - * @param string $idName name ID field in associative data array - * @param string $pidName name parent field in associative data array + * @param array $data Associative data array + * @param string $idName name ID field in associative data array + * @param string $pidName name parent field in associative data array * @return array */ private function _treeBuild($data, $idName, $pidName) { - $children = array(); // children of each ID - $ids = array(); + $children = []; // children of each ID + $ids = []; foreach ($data as $i => $r) { $row =& $data[$i]; $id = $row[$idName]; $pid = $row[$pidName]; $children[$pid][$id] =& $row; if (!isset($children[$id])) { - $children[$id] = array(); + $children[$id] = []; } $row['#childNodes'] =& $children[$id]; $ids[$row[$idName]] = true; } // Root elements are elements with non-found PIDs. - $this->_tree = array(); + $this->_tree = []; foreach ($data as $i => $r) { $row =& $data[$i]; if (!isset($ids[$row[$pidName]])) { @@ -1550,12 +1565,12 @@ private function _treeBuild($data, $idName, $pidName) /** * Получение PrimaryKey основной таблицы. * По умолчанию это id. Переопределить можно в контроллере присвоив другое значение переменной idField - * @param bool $full если true то возвращается значение для подстановки в запрос + * @param bool $full если true то возвращается значение для подстановки в запрос * @return string PrimaryKey основной таблицы */ public function getPK($full = true) { - $idField = isset($this->idField) ? $this->idField: 'id'; + $idField = isset($this->idField) ? $this->idField : 'id'; if ($full) { $idField = '`' . $idField . '`'; if (!empty($this->alias)) { @@ -1569,7 +1584,7 @@ public function getPK($full = true) /** * Получение Parent key * По умолчанию это parent. Переопределить можно в контроллере присвоив другое значение переменной parentField - * @param bool $full если true то возвращается значение для подстановки в запрос + * @param bool $full если true то возвращается значение для подстановки в запрос * @return string Parent Key основной таблицы */ public function getParentField($full = true) @@ -1589,7 +1604,7 @@ public function getParentField($full = true) * Разбор фильтров * OR(AND(filter:field:operator:value;filter2:field:oerpator:value);(...)), etc. * - * @param string $filter_string строка со всеми фильтрами + * @param string $filter_string строка со всеми фильтрами * @return mixed результат разбора фильтров */ protected function getFilters($filter_string) @@ -1597,12 +1612,12 @@ protected function getFilters($filter_string) $this->debug->debug("getFilters: " . $this->debug->dumpData($filter_string), 'getFilter', 1); // the filter parameter tells us, which filters can be used in this query $filter_string = ltrim(trim($filter_string, ';')); - $output = array('join' => '', 'where' => ''); + $output = ['join' => '', 'where' => '']; if (!$filter_string) { return $output; } $logic_op_found = false; - $joins = $wheres = array(); + $joins = $wheres = []; foreach ($this->_logic_ops as $op => $sql) { if (strpos($filter_string, $op) === 0) { $logic_op_found = true; @@ -1667,7 +1682,7 @@ public function filtersJoin() } /** - * @param string $join + * @param string $join * @return $this */ public function setFiltersJoin($join = '') @@ -1716,7 +1731,7 @@ public function changeSortType($field, $type) /** * Загрузка фильтра - * @param string $filter срока с параметрами фильтрации + * @param string $filter срока с параметрами фильтрации * @return bool */ protected function loadFilter($filter) @@ -1726,8 +1741,8 @@ protected function loadFilter($filter) $fltr_params = explode(':', $filter, 2); $fltr = APIHelpers::getkey($fltr_params, 0, null); /** - * @var tv_DL_filter|content_DL_filter $fltr_class - */ + * @var tv_DL_filter|content_DL_filter $fltr_class + */ $fltr_class = $fltr . '_DL_filter'; // check if the filter is implemented if (!is_null($fltr)) { @@ -1759,12 +1774,12 @@ protected function loadFilter($filter) */ public function getCountFilters() { - return (int)$this->totalFilters; + return (int) $this->totalFilters; } /** * Выполнить SQL запрос - * @param string $q SQL запрос + * @param string $q SQL запрос */ public function dbQuery($q) { @@ -1779,10 +1794,10 @@ public function dbQuery($q) * Экранирование строки в SQL запросе LIKE * @see: http://stackoverflow.com/a/3683868/2323306 * - * @param string $field поле по которому осуществляется поиск - * @param string $value искомое значение - * @param string $escape экранирующий символ - * @param string $tpl шаблон подстановки значения в SQL запрос + * @param string $field поле по которому осуществляется поиск + * @param string $value искомое значение + * @param string $escape экранирующий символ + * @param string $tpl шаблон подстановки значения в SQL запрос * @return string строка для подстановки в SQL запрос */ public function LikeEscape($field, $value, $escape = '=', $tpl = '%[+value+]%') @@ -1796,9 +1811,9 @@ public function LikeEscape($field, $value, $escape = '=', $tpl = '%[+value+]%') */ public function getRequest() { - $URL = null; - parse_str(parse_url(MODX_SITE_URL . $_SERVER['REQUEST_URI'], PHP_URL_QUERY), $URL); + $query = parse_url(MODX_SITE_URL . $_SERVER['REQUEST_URI'], PHP_URL_QUERY) ?? ''; + parse_str($query, $url); - return http_build_query(array_merge($URL, array(DocLister::AliasRequest => null))); + return http_build_query(array_merge($url, [DocLister::AliasRequest => null])); } } diff --git a/assets/snippets/DocLister/core/controller/onetable.php b/assets/snippets/DocLister/core/controller/onetable.php index b8443904f4..f46076924c 100644 --- a/assets/snippets/DocLister/core/controller/onetable.php +++ b/assets/snippets/DocLister/core/controller/onetable.php @@ -60,6 +60,15 @@ public function getDocs($tvlist = '') $type = $this->getCFGDef('idType', 'parents'); $this->_docs = ($type == 'parents') ? $this->getChildrenList() : $this->getDocList(); + /** + * @var $extUser user_DL_Extender + */ + if ($extUser = $this->getExtender('user')) { + $extUser->init($this, array('fields' => $this->getCFGDef("userFields", ""))); + foreach ($this->_docs as &$item) + $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+].... + } + return $this->_docs; } @@ -100,13 +109,6 @@ public function _render($tpl = '') if (count($this->_docs) == 0 && $noneTPL != '') { $out = $this->parseChunk($noneTPL, $sysPlh); } else { - /** - * @var $extUser user_DL_Extender - */ - if ($extUser = $this->getExtender('user')) { - $extUser->init($this, array('fields' => $this->getCFGDef("userFields", ""))); - } - /** * @var $extSummary summary_DL_Extender */ @@ -119,10 +121,7 @@ public function _render($tpl = '') $this->skippedDocs = 0; foreach ($this->_docs as $item) { $this->renderTPL = $tpl; - if ($extUser) { - $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+].... - } - + $item[$this->getCFGDef("sysKey", "dl") . '.summary'] = $extSummary ? $this->getSummary( $item, $extSummary @@ -142,9 +141,9 @@ public function _render($tpl = '') $_date = is_numeric($item[$date]) && $item[$date] == (int)$item[$date] ? $item[$date] : strtotime($item[$date]); if ($_date !== false) { $_date = $_date + $this->modx->config['server_offset_time']; - $dateFormat = $this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'); + $dateFormat = $this->getCFGDef('dateFormat', 'd.m.Y H:i'); if ($dateFormat) { - $item['date'] = strftime($dateFormat, $_date); + $item['date'] = date($dateFormat, $_date); } } } @@ -223,9 +222,9 @@ public function getJSON($data, $fields, $array = array()) $_date = is_numeric($row[$date]) && $row[$date] == (int)$row[$date] ? $row[$date] : strtotime($row[$date]); if ($_date !== false) { $_date = $_date + $this->modx->config['server_offset_time']; - $dateFormat = $this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'); + $dateFormat = $this->getCFGDef('dateFormat', 'd.m.Y H:i'); if ($dateFormat) { - $row['date'] = strftime($dateFormat, $_date); + $row['date'] = date($dateFormat, $_date); } } } diff --git a/assets/snippets/DocLister/core/controller/site_content.php b/assets/snippets/DocLister/core/controller/site_content.php index 0b178a4b04..bae251ccd7 100644 --- a/assets/snippets/DocLister/core/controller/site_content.php +++ b/assets/snippets/DocLister/core/controller/site_content.php @@ -98,6 +98,14 @@ public function getDocs($tvlist = '') } } } + /** + * @var $extUser user_DL_Extender + */ + if ($extUser = $this->getExtender('user')) { + $extUser->init($this, array('fields' => $this->getCFGDef("userFields", ""))); + foreach ($this->_docs as &$item) + $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+].... + } if (1 == $this->getCFGDef('tree', '0')) { $this->treeBuild('id', 'parent'); } @@ -122,13 +130,6 @@ public function _render($tpl = '') $i = 1; $sysPlh = $this->renameKeyArr($this->_plh, $this->getCFGDef("sysKey", "dl")); if (count($this->_docs) > 0) { - /** - * @var $extUser user_DL_Extender - */ - if ($extUser = $this->getExtender('user')) { - $extUser->init($this, array('fields' => $this->getCFGDef("userFields", ""))); - } - /** * @var $extSummary summary_DL_Extender */ @@ -142,10 +143,6 @@ public function _render($tpl = '') $this->skippedDocs = 0; foreach ($this->_docs as $item) { $this->renderTPL = $tpl; - if ($extUser) { - $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+].... - } - $item['summary'] = $extSummary ? $this->getSummary($item, $extSummary, 'introtext', 'content') : ''; $item = array_merge( @@ -180,9 +177,9 @@ public function _render($tpl = '') $_date = is_numeric($item[$date]) && $item[$date] == (int)$item[$date] ? $item[$date] : strtotime($item[$date]); if ($_date !== false) { $_date = $_date + $this->modx->config['server_offset_time']; - $dateFormat = $this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'); + $dateFormat = $this->getCFGDef('dateFormat', 'd.m.Y H:i'); if ($dateFormat) { - $item['date'] = strftime($dateFormat, $_date); + $item['date'] = date($dateFormat, $_date); } } } @@ -268,9 +265,9 @@ public function getJSON($data, $fields, $array = array()) $_date = is_numeric($row[$date]) && $row[$date] == (int)$row[$date] ? $row[$date] : strtotime($row[$date]); if ($_date !== false) { $_date = $_date + $this->modx->config['server_offset_time']; - $dateFormat = $this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'); + $dateFormat = $this->getCFGDef('dateFormat', 'd.m.Y H:i'); if ($dateFormat) { - $row['date'] = strftime($dateFormat, $_date); + $row['date'] = date($dateFormat, $_date); } } } diff --git a/assets/snippets/DocLister/core/extender/paginate.extender.inc b/assets/snippets/DocLister/core/extender/paginate.extender.inc index 317f9ee0f2..a97a795137 100644 --- a/assets/snippets/DocLister/core/extender/paginate.extender.inc +++ b/assets/snippets/DocLister/core/extender/paginate.extender.inc @@ -266,7 +266,7 @@ class paginate_DL_Extender extends extDocLister public function getUrl($requestName = '') { $url = $this->DocLister->getUrl(); - $params = parse_url($url, PHP_URL_QUERY); + $params = parse_url($url, PHP_URL_QUERY) ?? ''; parse_str(html_entity_decode($params), $params); if ($requestName == '') { switch ($this->DocLister->getCFGDef('paginate', '')) { diff --git a/assets/snippets/DocLister/core/extender/tv.extender.inc b/assets/snippets/DocLister/core/extender/tv.extender.inc index 89d166c4a0..6c8d81ff7a 100644 --- a/assets/snippets/DocLister/core/extender/tv.extender.inc +++ b/assets/snippets/DocLister/core/extender/tv.extender.inc @@ -275,8 +275,8 @@ class tv_DL_Extender extends extDocLister $TVnames = array(); } $matches = explode(",", $match[1]); - $sortType = explode(",", $this->DocLister->getCFGDef('tvSortType')); - $withDefault = explode(",", $this->DocLister->getCFGDef('tvSortWithDefault')); + $sortType = explode(",", $this->DocLister->getCFGDef('tvSortType', '')); + $withDefault = explode(",", $this->DocLister->getCFGDef('tvSortWithDefault', '')); foreach ($matches as $i => &$item) { $item = explode(" ", trim($item), 2); if (isset($TVnames[$item[0]])) { diff --git a/assets/snippets/DocLister/core/extender/user.extender.inc b/assets/snippets/DocLister/core/extender/user.extender.inc index 4ec4baae6c..9e2680b54c 100644 --- a/assets/snippets/DocLister/core/extender/user.extender.inc +++ b/assets/snippets/DocLister/core/extender/user.extender.inc @@ -167,12 +167,40 @@ class user_DL_Extender extends extDocLister } if (!empty($out)) { $this->getUserGroups($out); + $type = $this->DocLister->getCFGDef('usertype', 'web'); + if ($type === 'users') { + $this->getUserTvs($out); + } } } return $out; } + /** + * @param array $data + */ + private function getUserTvs(&$data) + { + $users = array_keys($data); + $tvlist = $this->DocLister->getCFGDef('userTvList', ''); + if ($users && $tvlist) { + $tvExt = $this->DocLister->getExtender('utv', true); + $tvExt->getAllTV_Name(); + $tv = $tvExt->getTVList($users, $tvlist); + if (!is_array($tv)) { + $tv = array(); + } + foreach ($tv as $userID => $TVitem) { + if (isset($data[$userID]) && is_array($data[$userID])) { + $data[$userID] = array_merge($data[$userID], $TVitem); + } else { + unset($data[$userID]); + } + } + } + } + /** * @param array $data */ diff --git a/assets/snippets/DocLister/core/extender/utv.extender.inc b/assets/snippets/DocLister/core/extender/utv.extender.inc new file mode 100644 index 0000000000..454501f8a0 --- /dev/null +++ b/assets/snippets/DocLister/core/extender/utv.extender.inc @@ -0,0 +1,83 @@ + + * + * Предзагрузка данных о TV параметрах + * Обработка TV параметров перед выводом + * + */ +class utv_DL_Extender extends tv_DL_Extender +{ + /** + * @var mixed|string + */ + protected $tvValuesTable = 'user_values'; + protected $tvContentTableField = 'userid'; + + /** + * tv_DL_Extender constructor. + * @param DocLister $DocLister + * @param $name + */ + public function __construct($DocLister, $name) + { + extDocLister::__construct($DocLister, $name); + if (!isset($this->modx->_TVnames)) { + $this->modx->_TVnames = array(); + } + $this->_TVprefix = $this->getTVprefix(); + $this->cache = isset($this->modx->cache) && $this->modx->cache instanceof Cache; + } + + /** + * @return bool + */ + protected function run() + { + return true; + } + + /** + * @return mixed|string + */ + public function getTVprefix() + { + $tvPrefix = $this->DocLister->getCFGDef('userTvPrefix', 'tv'); + if (!empty($tvPrefix)) { + $tvPrefix .= '.'; + } + + return $tvPrefix; + } + + /** + * @return array|mixed + */ + public function getListRenderTV() + { + $tmp = $this->DocLister->getCFGDef('renderUserTV', ''); + if ($tmp != '' && $tmp != '*') { + $tmp = explode(",", $tmp); + if (in_array("*", $tmp)) { + $tmp = array("*"); + } else { + $out = array_unique($tmp); + $tmp = array(); + foreach ($out as $item) { + $tmp[] = $this->_TVprefix . $item; + } + } + } else { + $tmp = array($tmp); + } + + return $tmp; + } +} diff --git a/assets/snippets/DocLister/lib/DLTemplate.class.php b/assets/snippets/DocLister/lib/DLTemplate.class.php index ca2b9e084a..6d06218ba2 100644 --- a/assets/snippets/DocLister/lib/DLTemplate.class.php +++ b/assets/snippets/DocLister/lib/DLTemplate.class.php @@ -95,7 +95,7 @@ public function getTemplatePath() */ public function setTemplatePath($path, $supRoot = false) { - $path = trim($path); + $path = trim($path ?? ''); if ($supRoot === false) { $path = $this->cleanPath($path); } @@ -137,7 +137,7 @@ public function getTemplateExtension() */ public function setTemplateExtension($ext) { - $ext = $this->cleanPath(trim($ext, ". \t\n\r\0\x0B")); + $ext = $this->cleanPath(trim($ext ?? '', ". \t\n\r\0\x0B")); if (!empty($ext)) { $this->templateExtension = $ext; @@ -332,7 +332,7 @@ public function getChunk($name) protected function getBaseChunk($name) { if (empty($name)) { - return null; + return ''; } if (isset ($this->modx->chunkCache[$name])) { @@ -346,7 +346,7 @@ protected function getBaseChunk($name) $row = $this->modx->db->getRow($query); $tpl = $row['snippet']; } else { - $tpl = null; + $tpl = ''; } } diff --git a/assets/snippets/DocLister/lib/DLphx.class.php b/assets/snippets/DocLister/lib/DLphx.class.php index 1a0b96c11c..ee631380e9 100644 --- a/assets/snippets/DocLister/lib/DLphx.class.php +++ b/assets/snippets/DocLister/lib/DLphx.class.php @@ -431,7 +431,7 @@ public function Filter($input, $modifiers) $output = nl2br($output); break; case "date": - $output = strftime($modifier_value[$i], (int)$output); + $output = date($modifier_value[$i], (int)$output); break; case "set": $c = $i + 1; @@ -448,6 +448,12 @@ public function Filter($input, $modifiers) case "md5": $output = md5($output); break; + case 'inarray': + case 'in_array': + case 'in': + $modifier_value[$i] = explode(',', $modifier_value[$i]); + $condition[] = (int)(in_array($output, $modifier_value[$i]) !== false); + break; case "userinfo": if ($output == "&_PHX_INTERNAL_&") { $output = $this->user["id"]; @@ -566,8 +572,8 @@ public function Log($string) { if ($this->debug) { $this->debugLog = true; - $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( - "%H:%M:%S", + $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . date( + "H:i:S", time() ) . "] " . $this->LogClean($string); } @@ -582,8 +588,8 @@ public function LogSnippet($string) { if ($this->debug) { $this->debugLog = true; - $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( - "%H:%M:%S", + $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . date( + "H:i:S", time() ) . "] " . " |--- Returns:
    " . $this->LogClean($string) . "
    "; } diff --git a/assets/snippets/DocLister/snippet.DLSitemap.php b/assets/snippets/DocLister/snippet.DLSitemap.php index 1318b609ca..65262cb9e0 100644 --- a/assets/snippets/DocLister/snippet.DLSitemap.php +++ b/assets/snippets/DocLister/snippet.DLSitemap.php @@ -28,12 +28,8 @@ public static function prepare(array $data, DocumentParser $modx, $_DocLister) $data['priority'] = '0.25'; $data['update'] = 'monthly'; } - $dateFormat = $_DocLister->getCFGDef('dateFormat'); - if ($dateFormat) { - $data['date'] = strftime($dateFormat, $data['date']); - } else { - $data['date'] = date('c', $data['date']); - } + $dateFormat = $_DocLister->getCFGDef('dateFormat', 'c'); + $data['date'] = date($dateFormat, $data['date']); $priorityField = $_DocLister->getCFGDef('priority', 'tv.sitemap_priority'); $changefreqField = $_DocLister->getCFGDef('changefreq', 'tv.sitemap_changefreq'); if (!empty($data[$priorityField])) { diff --git a/assets/snippets/FormLister/core/FormLister.abstract.php b/assets/snippets/FormLister/core/FormLister.abstract.php index 42879cc332..7cd62db2d7 100644 --- a/assets/snippets/FormLister/core/FormLister.abstract.php +++ b/assets/snippets/FormLister/core/FormLister.abstract.php @@ -275,6 +275,18 @@ public function setExternalFields($sources = 'array', $arrayParam = 'defaults') } break; } + //Значения из $_GET + case 'get': + { + if (!empty($_source[1])) { + $keys = explode(',', $_source[1]); + $fields = $this->getDefaultsSourceValues($_GET, $keys); + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + } //Массив значений указывается в параметре сессии case 'session': if (!empty($_source[1])) { diff --git a/assets/snippets/FormLister/core/controller/Activate.php b/assets/snippets/FormLister/core/controller/Activate.php index 8d259f85db..e2117ce9b9 100644 --- a/assets/snippets/FormLister/core/controller/Activate.php +++ b/assets/snippets/FormLister/core/controller/Activate.php @@ -115,20 +115,8 @@ public function process() case "hash": $uid = $this->getField($this->userField); $password = $this->getField('password'); - if ( - ($hash = $this->getUserHash($uid)) - && ( - empty($password) - || ($this->user->get('password') == $this->user->getPassword($password)) - ) - ) { + if ($hash = $this->getUserHash($uid)){ $this->setFields($this->user->toArray()); - if (empty($password)) { - $password = APIhelpers::genPass($this->getCFGDef('passwordLength', 6)); - $this->user->set('password', $password)->save(true); - $this->setField('user.password', $password); - $hash = $this->getUserHash($uid); - } $url = $this->getCFGDef('activateTo', isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier > 0 ? $this->modx->documentIdentifier : $this->config['site_start']); $uidName = $this->getCFGDef('uidName', $this->user->fieldPKName()); $this->setField('activate.url', $this->modx->makeUrl($url, "", diff --git a/assets/snippets/FormLister/core/controller/Form.php b/assets/snippets/FormLister/core/controller/Form.php index 3799d906ed..01f4d15bb9 100644 --- a/assets/snippets/FormLister/core/controller/Form.php +++ b/assets/snippets/FormLister/core/controller/Form.php @@ -51,7 +51,7 @@ public function __construct (DocumentParser $modx, array $cfg = []) */ public function renderReport ($tplParam = 'reportTpl') { - $tpl = $this->getCFGDef($tplParam); + $tpl = $this->getCFGDef($tplParam, ''); $skipPrerender = $this->getCFGDef('skipPrerender', 0); if (empty($tpl) && $tplParam == 'reportTpl') { $tpl = '@CODE:'; diff --git a/assets/snippets/FormLister/docs/history.md b/assets/snippets/FormLister/docs/history.md index 1dea94cc27..cfcdb939cb 100644 --- a/assets/snippets/FormLister/docs/history.md +++ b/assets/snippets/FormLister/docs/history.md @@ -1,4 +1,20 @@ ## History +### 1.19.5 +* [Fix] Ошибка в PHP 8.1 (Form). + +### 1.19.4 +* [Fix] Ошибка при формировании ссылки для активации аккаунта (Activate). + +### 1.19.3 +* [Fix] Работа автологина при редактировании профиля (UserHelper) + +### 1.19.2 +* [Fix] Ошибка в PHP 8.1 (modxCaptcha). +* [Enhancement] Recaptcha v.3 (ReCaptcha). + +### 1.19.1 +* [Enhancement] Внешний источник $_GET (Core). + ### 1.19.0 * [Fix] Не работал параметр redirectTo, если значение - ссылка (Core). * [Fix] Не работал редирект для авторизованных пользователей (Login). @@ -36,7 +52,7 @@ * [Refactor] Классы для работы с лексиконами перемещены в DocLister. ### 1.14.0 -* [Refactor] Загрузка данных из источников session, cookie, plh происходит с учетом того, что значение может быть массивом. Для cookie массив можно задать в виде json (Core). Вместо источника aplh теперь следует использовать plh. +* [Refactor] Загрузка данных из источников session, cookie, plh происходит с учетом того, что значение может быть массивом. Для cookie массив можно задать в виде json (Core). Вместо источника aplh теперь следует использовать plh. * [Fix] Отправка письма при успешном восстановлении пароля (Reminder). * [Fix] Отправка письма при активации учетной записи (Activate). @@ -47,13 +63,13 @@ ### 1.12.0 * [Enhancement] Параметр fieldAliases - псевдонимы полей (Core). -* [Refactor] В функции between, minLength, maxLength, lengthBetween, minCount, maxCount, countBetween добавлен параметр определяющий строгость сравнения (по умолчанию - нестрогое) (Validator). +* [Refactor] В функции between, minLength, maxLength, lengthBetween, minCount, maxCount, countBetween добавлен параметр определяющий строгость сравнения (по умолчанию - нестрогое) (Validator). * [Refactor] В функции maxSize, minSize, sizeBetween, minCount, maxCount, countBetween добавлен параметр определяющий строгость сравнения (по умолчанию - нестрогое, совместимость нарушена) (FileValidator). ### 1.11.3 * [Fix] Некорректная обработка параметра uidName (Reminder). * [Refactor] Правило валидации файлов "optional" объявлено устаревшим. Необязательные файловые поля следует задавать по общему правилу (Core). -* [Refactor] Удалены свойства rules и fileRules из Core. +* [Refactor] Удалены свойства rules и fileRules из Core. * [Refactor] Из валидатора файлов убрана проверка ошибки 4 (FileValidator). ### 1.11.2 @@ -105,9 +121,9 @@ * [Enhancement] Подключение сторонних обработчиков для лексиконов (Lexicon). * [Refactor] Работа с настройками через Helpers\Config (Lexicon). * [Refactor] Методы loadLang, getMsg, parseLang объявлены устаревшими, вместо него следует использовать fromFile, get, parse (Lexicon). -* [Enhancement] Методы setLexicon и getLexicon (Lexicon). -* [Enhancement] Метод getErrorType для получения нарушенных правил валидации для поля (Core). -* [Enhancement] Плейсхолдер капчи доступен в api-режимах, через ключ captcha (Core). +* [Enhancement] Методы setLexicon и getLexicon (Lexicon). +* [Enhancement] Метод getErrorType для получения нарушенных правил валидации для поля (Core). +* [Enhancement] Плейсхолдер капчи доступен в api-режимах, через ключ captcha (Core). * [Refactor] Получение строк из лексикона заменено на вызов метода translate. * [Refactor] Загрузка основных правил валидации перенесена в метод initForm, после выполнения prepare. * [Refactor] Обход Gpc вынесен в отдельный класс Helpers\Gpc. @@ -164,7 +180,7 @@ ### 1.7.18 * [Enhancement] Dutch, Polish, English-Britain, German lexicons. -* [Refactor] Экранирование значений массива до преобразования массива в строку в методе fieldsToPlaceholders +* [Refactor] Экранирование значений массива до преобразования массива в строку в методе fieldsToPlaceholders ### 1.7.17 * [Refactor] Мультибайтовые функции. @@ -195,11 +211,11 @@ * [Refactor] Имя пользователя и E-mail принудительно приводятся в нижний регистр (Login, Register, Profile). * [Fix] Неверное значение по умолчанию параметра resetTo (Reminder). * [Fix] Неверное значение по умолчанию параметра activateTo (Activate). -* [Fix] Ошибка при расчете хэша для активации учетной записи (Register, Activate). - +* [Fix] Ошибка при расчете хэша для активации учетной записи (Register, Activate). + ### 1.7.11 * [Fix] Предупреждения в PHP 7 (Core). -* [Enhancement] Вывод сообщений в лог при проблемах с параметрами rules, fileRules и contentFields (Core, Content). +* [Enhancement] Вывод сообщений в лог при проблемах с параметрами rules, fileRules и contentFields (Core, Content). * [Refactor] Обработка языковых плейсхолдеров в сообщениях (Core). * [Enhancement] Из prepare-сниппетов можно возвращать массив значений полей, который будет передан в метод setFields (Core). @@ -251,11 +267,11 @@ * [Fix] Создание записей анонимными пользователями если &onlyUsers=`0` (Content). * [Refactor] Убраны include/require, для загрузки классов подключается файл assets/snippets/FormLister/__autoload.php. Модели MODxAPI загружаются этим же загрузчиком. * [Refactor] Создание записи в логе, если не удалось сохранить данные (Content). -* [Refactor] Изменена обработка поля для запоминания авторизации: теперь время для автологина задается в параметре cookieLifetime (по умолчанию 5 лет, в секундах), а не значением поля (Login). +* [Refactor] Изменена обработка поля для запоминания авторизации: теперь время для автологина задается в параметре cookieLifetime (по умолчанию 5 лет, в секундах), а не значением поля (Login). * [Refactor] Имя куки для автологина можно задать с помощью параметра cookieName, по умолчанию WebLoginPE (Login). * [Refactor] В контроллере Login сначала проверяется, активирована ли учетная запись, а потом уже возможность авторизации (Login). -* [Enhancement] Блокировка пользователей после определенного числа неудачных попыток авторизации в плагине userHelper. - +* [Enhancement] Блокировка пользователей после определенного числа неудачных попыток авторизации в плагине userHelper. + ### 1.6.2 * [Fix] Неверное объявление метода в классах капчи. @@ -265,7 +281,7 @@ ### 1.6.0 * [Enhancement] Параметр rewriteUrls для обработки ссылок в шаблонах. Игнорируется, если задан параметр parseDocumentSource (Core). * [Enhancement] Если страница с вызовом контроллера Login указана в конфигурации, как страница "Доступ запрещен", то после успешной авторизации будет произведен редирект на запрашиваемую страницу (Login). -* [Enhancement] Новый параметр ignoreMailerResult (Form). +* [Enhancement] Новый параметр ignoreMailerResult (Form). * [Fix] Неправильная проверка уникальности username в контроллере Profile. * [Refactor] Для добавления пользователей в группы используется метод из modUsers (Register). * [Refactor] Введенный пользователем пароль сохраняется в поле user.password (Register). @@ -283,19 +299,19 @@ * [Refactor] Можно не задавать параметр contentFields, в этом случае в модель будут переданы поля формы (Content). * [Refactor] Корректная обработка полей lastlogin и thislogin в плагине userHelper. * [Fix] Неверно выбирался шаблон при восстановлении паролей (Reminder). -* [Enhancement] Дополнительная обработка чанков парсером MODX c помощью параметра parseDocumentSource (Core). +* [Enhancement] Дополнительная обработка чанков парсером MODX c помощью параметра parseDocumentSource (Core). * [Enhancement] Возможность вырезать необработанные плейсхолдеры из чанков с помощью параметра removeEmptyPlaceholders (Core). * [Enhancement] Параметр removeEmptyPlaceholders для удаления необработанных плейсхолдеров из чанков (возможные значения 0,1; по умолчанию - 0) (Core). * [Fix] Из-за неправильной обработки параметра defaultsSources не загружались поля в контроллере Profile (Core). -* [Fix] Метод filterFields не учитывал значение параметра allowEmptyFields (Core). +* [Fix] Метод filterFields не учитывал значение параметра allowEmptyFields (Core). ### 1.5.1 Исправления ошибок. ###1.5.0 * [Refactor] Переделана загрузка внешних параметров с учетом того, что не все источники могут содержать массив: добавлен источник aplh для загрузки массива значений из плейсхолдера MODX, в источнике cookie можно указать несколько имен кук через запятую. Добавлен источник user для загрузки данных авторизованного веб-пользователя (user:web) или менеджера (user:mgr) (Core). Добавлен источник document для загрузки данных текущего или указанного документа. -* [Refactor] Валидация капчи вынесена в класс капчи (Core). -* [Refactor] Параметры капчи задаются массивом, там же указываются сообщения об ошибках (Core). +* [Refactor] Валидация капчи вынесена в класс капчи (Core). +* [Refactor] Параметры капчи задаются массивом, там же указываются сообщения об ошибках (Core). * [Refactor] Валидация капчи происходит в классе капчи. (Core). * [Enhancement] reCaptcha2. * [Enhancement] smsCaptcha. @@ -315,17 +331,17 @@ * [Refactor] Изменен алгоритм загрузки пользовательских лексиконов. Теперь в параметре lexicon можно указывать как имя файла, так и сразу массив c языковыми записями (Core, Lexicon). * [Refactor] Загрузка полей отправленной формы происходит не из $_REQUEST, а согласно параметру formMethod (значение по умолчанию - 'post') (Core). * [Enhancement] Метод loadArray можно использовать для обработки строк с разделителем (по умолчанию - ',') (Config). -* [Enhancement] Если значение параметра submitLimit меньше 60, то оно не пересчитывается в минуты (Form). +* [Enhancement] Если значение параметра submitLimit меньше 60, то оно не пересчитывается в минуты (Form). ### 1.3.0 * [Enhancement] Поддержка события OnBeforeWebLogin. В плагине можно реализовать процедуру авторизации независимую от модели; установку полей и шаблона сообщения об успешной авторизации нужно также производить в плагине. Плагин должен вернуть true в случае успешной авторизации, иначе будет выполнена авторизация методами модели (Login). - + ### 1.2.1 * [Refactor] Метод isArray теперь protected (FileValidator). ### 1.2.0 * [Refactor] Переделан пропуск полей при преобразовании в плейсхолдеры. Теперь плейсхолдеры отделены от полей формы, для работы с ними следует использовать методы setPlaceholder и getPlaceholder. Выводятся через [+placeholder+]. -* [Bug] Сниппеты, указанные в prepareProcess, выполнялись независимо от результатов валидации. +* [Bug] Сниппеты, указанные в prepareProcess, выполнялись независимо от результатов валидации. * [Refactor] Изменена логика обработки правил валидации. Теперь все правила, которых нет в валидаторе, обрабатываются как custom. Это позволяет применять сразу несколько таких правил. * [Enhancement] Возможность применять правила валидации только для заполненных полей. * [Refactor] Информация о файлах размещается в массиве formData c помощью метода setFiles (Core, Form). @@ -335,8 +351,8 @@ ### 1.1.0 * [Refactor] Метод filesToArray перемещен в Core. * [Enhancement] Возможность загрузки произвольных моделей в контроллерах, которые используют MODxAPI. Новые параметры - model и modelPath. -* [Refactor] Метод для загрузки моделей MODxAPI. -* [Enhancement] Возможность загружать произвольные модели MODxAPI в контроллерах. +* [Refactor] Метод для загрузки моделей MODxAPI. +* [Enhancement] Возможность загружать произвольные модели MODxAPI в контроллерах. * [Enhancement] Новое правило валидации - date, проверяет является ли значение поля датой в указанном формате (Validator). * [Enhancement] Возможность пропускать поля при преобразовании в плейсхолдеры (Core). diff --git a/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php b/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php index e2c79eb655..3e9e6bc4bc 100644 --- a/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php +++ b/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php @@ -137,8 +137,8 @@ private function drawText() $im_text, $data['size'], $data['angle'], - $text_x, - $text_y, + (int)$text_x, + (int)$text_y, $text_color, $text_font, $chars[$index]); diff --git a/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php index 5e5845906d..df92a1675b 100644 --- a/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php +++ b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php @@ -43,6 +43,9 @@ public function init() public function getPlaceholder() { $siteKey = \APIhelpers::getkey($this->cfg, 'siteKey'); + $reCAPTCHAversion = \APIhelpers::getkey($this->cfg, 'reCAPTCHAversion', "2"); + $classButton = \APIhelpers::getkey($this->cfg, 'classButton', "g-recaptcha"); + $textButton = \APIhelpers::getkey($this->cfg, 'textButton', "Submit"); $type = \APIhelpers::getkey($this->cfg, 'type', 'image'); $size = \APIhelpers::getkey($this->cfg, 'size', 'normal'); $tabindex = \APIhelpers::getkey($this->cfg, 'tabindex', 0); @@ -54,7 +57,15 @@ public function getPlaceholder() $expcallback = \APIhelpers::getkey($this->cfg, 'expired_callback', ''); $out = ''; if (!empty($siteKey)) { - $out = "
    "; + switch($reCAPTCHAversion) { + case "3": + $callback = \APIhelpers::getkey($this->cfg, 'callback', 'onSubmit'); + $out = ""; + break; + default: + $out = "
    "; + break; + } } return $out; diff --git a/assets/snippets/FormLister/plugin.userHelper.php b/assets/snippets/FormLister/plugin.userHelper.php index fcbc3d7805..e10f2763d4 100644 --- a/assets/snippets/FormLister/plugin.userHelper.php +++ b/assets/snippets/FormLister/plugin.userHelper.php @@ -37,6 +37,16 @@ $userObj->setAutoLoginCookie($cookieName, $cookieLifetime); } } +//Updating session_id in cookie, if user is login and just saved +if ($e->name == 'OnWebSaveUser' && isset($userObj)) { + if( (int)$modx->getLoginUserID('web') == (int)$id && isset($_COOKIE[$cookieName]) ) { //checking, if current logined user was saved + $cookieParts = explode("|", $_COOKIE[$cookieName], 4); + if(isset($cookieParts[2]) && ($userObj->get('sessionid') != $cookieParts[2])) { //checking, if session ids in cookie and in user object became not equals + $userObj->setAutoLoginCookie($cookieName, $cookieLifetime); + } + } +} + if ($e->name == 'OnWebPageInit' || $e->name == 'OnPageNotFound') { $model = isset($params['model']) && class_exists($params['model']) ? $params['model'] : '\\modUsers'; $user = new $model($modx); @@ -64,3 +74,4 @@ $user->AutoLogin($cookieLifetime, $cookieName, true); } } + diff --git a/assets/snippets/if/snippet.if.php b/assets/snippets/if/snippet.if.php index dfee284d1a..43a4b0ad21 100755 --- a/assets/snippets/if/snippet.if.php +++ b/assets/snippets/if/snippet.if.php @@ -17,15 +17,16 @@ */ if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');} -$s = isset($separator) ? $separator: ':'; -$math = isset($math) ? $math : 'off'; -$lp = 0; -$opers=explode($s,$is); -$subject=$opers[0]; -$eq=true; -$and=false; -$or = false; -$else = isset($else) ? $else : ''; +$s = isset($separator) ? $separator : ':'; +$is = $is ?? ''; +$math = isset($math) ? $math : 'off'; +$lp = 0; +$opers = explode($s,$is); +$subject = $opers[0]; +$eq = true; +$and = false; +$or = false; +$else = isset($else) ? $else : ''; // Prepare custom conditions $customConditions = array(); if(!empty($custom)) { diff --git a/assets/snippets/phpthumb/composer.lock b/assets/snippets/phpthumb/composer.lock index 22e901fa1e..49702bbbc7 100644 --- a/assets/snippets/phpthumb/composer.lock +++ b/assets/snippets/phpthumb/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "james-heinrich/phpthumb", - "version": "v1.7.16", + "version": "v1.7.17", "source": { "type": "git", "url": "https://github.com/JamesHeinrich/phpThumb.git", - "reference": "79aa5b21ee7277f67b863560bccc2490c4f0b82a" + "reference": "1ef2db62e8d4a4e391159653b200144a37462de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JamesHeinrich/phpThumb/zipball/79aa5b21ee7277f67b863560bccc2490c4f0b82a", - "reference": "79aa5b21ee7277f67b863560bccc2490c4f0b82a", + "url": "https://api.github.com/repos/JamesHeinrich/phpThumb/zipball/1ef2db62e8d4a4e391159653b200144a37462de3", + "reference": "1ef2db62e8d4a4e391159653b200144a37462de3", "shasum": "" }, "require": { @@ -59,9 +59,9 @@ ], "support": { "issues": "https://github.com/JamesHeinrich/phpThumb/issues", - "source": "https://github.com/JamesHeinrich/phpThumb/tree/v1.7.16" + "source": "https://github.com/JamesHeinrich/phpThumb/tree/v1.7.17" }, - "time": "2021-02-06T16:34:15+00:00" + "time": "2021-09-22T15:40:00+00:00" } ], "packages-dev": [], @@ -72,5 +72,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } diff --git a/assets/snippets/phpthumb/phpthumb.class.php b/assets/snippets/phpthumb/phpthumb.class.php index 3845eef319..e0fbc7574f 100644 --- a/assets/snippets/phpthumb/phpthumb.class.php +++ b/assets/snippets/phpthumb/phpthumb.class.php @@ -1,2 +1,4 @@ \nRequire all granted\n\n\norder deny,allow\nallow from all\n\n"); } $path_parts = pathinfo($input); diff --git a/assets/snippets/phpthumb/vendor/autoload.php b/assets/snippets/phpthumb/vendor/autoload.php index fbdf83a3b6..bb2abe7688 100644 --- a/assets/snippets/phpthumb/vendor/autoload.php +++ b/assets/snippets/phpthumb/vendor/autoload.php @@ -2,6 +2,11 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + exit(1); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit59b4f21b3db48af42f3ca10324cc4c65::getLoader(); diff --git a/assets/snippets/phpthumb/vendor/composer/ClassLoader.php b/assets/snippets/phpthumb/vendor/composer/ClassLoader.php index 1a58957d25..afef3fa2ad 100644 --- a/assets/snippets/phpthumb/vendor/composer/ClassLoader.php +++ b/assets/snippets/phpthumb/vendor/composer/ClassLoader.php @@ -42,21 +42,75 @@ */ class ClassLoader { + /** @var ?string */ + private $vendorDir; + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -66,28 +120,47 @@ public function getPrefixes() return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,9 +175,11 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -147,11 +222,13 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -195,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +290,12 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +339,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +361,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,25 +383,44 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -323,6 +429,8 @@ public function loadClass($class) return true; } + + return null; } /** @@ -367,6 +475,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/assets/snippets/phpthumb/vendor/composer/InstalledVersions.php b/assets/snippets/phpthumb/vendor/composer/InstalledVersions.php index c7fefa3406..41bc143c11 100644 --- a/assets/snippets/phpthumb/vendor/composer/InstalledVersions.php +++ b/assets/snippets/phpthumb/vendor/composer/InstalledVersions.php @@ -1,218 +1,352 @@ + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Composer; +use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; - - - - - +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ class InstalledVersions { -private static $installed = array ( - 'root' => - array ( - 'pretty_version' => 'No version set (parsed as 1.0.0)', - 'version' => '1.0.0.0', - 'aliases' => - array ( - ), - 'reference' => NULL, - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'No version set (parsed as 1.0.0)', - 'version' => '1.0.0.0', - 'aliases' => - array ( - ), - 'reference' => NULL, - ), - 'james-heinrich/phpthumb' => - array ( - 'pretty_version' => 'v1.7.16', - 'version' => '1.7.16.0', - 'aliases' => - array ( - ), - 'reference' => '79aa5b21ee7277f67b863560bccc2490c4f0b82a', - ), - ), -); - - - - - - - -public static function getInstalledPackages() -{ -return array_keys(self::$installed['versions']); -} - - - - - - - - - -public static function isInstalled($packageName) -{ -return isset(self::$installed['versions'][$packageName]); -} - - - - - - - - - - - - - - -public static function satisfies(VersionParser $parser, $packageName, $constraint) -{ -$constraint = $parser->parseConstraints($constraint); -$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - -return $provided->matches($constraint); -} - - - - - - - - - - -public static function getVersionRanges($packageName) -{ -if (!isset(self::$installed['versions'][$packageName])) { -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - -$ranges = array(); -if (isset(self::$installed['versions'][$packageName]['pretty_version'])) { -$ranges[] = self::$installed['versions'][$packageName]['pretty_version']; -} -if (array_key_exists('aliases', self::$installed['versions'][$packageName])) { -$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']); -} -if (array_key_exists('replaced', self::$installed['versions'][$packageName])) { -$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']); -} -if (array_key_exists('provided', self::$installed['versions'][$packageName])) { -$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']); -} - -return implode(' || ', $ranges); -} - - - - - -public static function getVersion($packageName) -{ -if (!isset(self::$installed['versions'][$packageName])) { -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - -if (!isset(self::$installed['versions'][$packageName]['version'])) { -return null; -} - -return self::$installed['versions'][$packageName]['version']; -} - - - - - -public static function getPrettyVersion($packageName) -{ -if (!isset(self::$installed['versions'][$packageName])) { -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - -if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) { -return null; -} - -return self::$installed['versions'][$packageName]['pretty_version']; -} - - - - - -public static function getReference($packageName) -{ -if (!isset(self::$installed['versions'][$packageName])) { -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - -if (!isset(self::$installed['versions'][$packageName]['reference'])) { -return null; -} - -return self::$installed['versions'][$packageName]['reference']; -} - - - - - -public static function getRootPackage() -{ -return self::$installed['root']; -} - - - - - - - -public static function getRawData() -{ -return self::$installed; -} - - - - - - - - - - - - - - - - - - - -public static function reload($data) -{ -self::$installed = $data; -} + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } } diff --git a/assets/snippets/phpthumb/vendor/composer/autoload_classmap.php b/assets/snippets/phpthumb/vendor/composer/autoload_classmap.php index b26f1b13b1..0fb0a2c194 100644 --- a/assets/snippets/phpthumb/vendor/composer/autoload_classmap.php +++ b/assets/snippets/phpthumb/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/assets/snippets/phpthumb/vendor/composer/autoload_files.php b/assets/snippets/phpthumb/vendor/composer/autoload_files.php index a6abe2551e..0e09b6a74e 100644 --- a/assets/snippets/phpthumb/vendor/composer/autoload_files.php +++ b/assets/snippets/phpthumb/vendor/composer/autoload_files.php @@ -2,7 +2,7 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/assets/snippets/phpthumb/vendor/composer/autoload_namespaces.php b/assets/snippets/phpthumb/vendor/composer/autoload_namespaces.php index b7fc0125db..15a2ff3ad6 100644 --- a/assets/snippets/phpthumb/vendor/composer/autoload_namespaces.php +++ b/assets/snippets/phpthumb/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/assets/snippets/phpthumb/vendor/composer/autoload_psr4.php b/assets/snippets/phpthumb/vendor/composer/autoload_psr4.php index b265c64a22..3890ddc240 100644 --- a/assets/snippets/phpthumb/vendor/composer/autoload_psr4.php +++ b/assets/snippets/phpthumb/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/assets/snippets/phpthumb/vendor/composer/autoload_real.php b/assets/snippets/phpthumb/vendor/composer/autoload_real.php index 86c9f166a7..08db08693c 100644 --- a/assets/snippets/phpthumb/vendor/composer/autoload_real.php +++ b/assets/snippets/phpthumb/vendor/composer/autoload_real.php @@ -25,38 +25,15 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit59b4f21b3db48af42f3ca10324cc4c65', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit59b4f21b3db48af42f3ca10324cc4c65', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit59b4f21b3db48af42f3ca10324cc4c65::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit59b4f21b3db48af42f3ca10324cc4c65::getInitializer($loader)); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit59b4f21b3db48af42f3ca10324cc4c65::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit59b4f21b3db48af42f3ca10324cc4c65::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire59b4f21b3db48af42f3ca10324cc4c65($fileIdentifier, $file); } @@ -65,11 +42,16 @@ public static function getLoader() } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire59b4f21b3db48af42f3ca10324cc4c65($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/assets/snippets/phpthumb/vendor/composer/installed.json b/assets/snippets/phpthumb/vendor/composer/installed.json index 36e42b4be1..5b8404ff5f 100644 --- a/assets/snippets/phpthumb/vendor/composer/installed.json +++ b/assets/snippets/phpthumb/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "james-heinrich/phpthumb", - "version": "v1.7.16", - "version_normalized": "1.7.16.0", + "version": "v1.7.17", + "version_normalized": "1.7.17.0", "source": { "type": "git", "url": "https://github.com/JamesHeinrich/phpThumb.git", - "reference": "79aa5b21ee7277f67b863560bccc2490c4f0b82a" + "reference": "1ef2db62e8d4a4e391159653b200144a37462de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JamesHeinrich/phpThumb/zipball/79aa5b21ee7277f67b863560bccc2490c4f0b82a", - "reference": "79aa5b21ee7277f67b863560bccc2490c4f0b82a", + "url": "https://api.github.com/repos/JamesHeinrich/phpThumb/zipball/1ef2db62e8d4a4e391159653b200144a37462de3", + "reference": "1ef2db62e8d4a4e391159653b200144a37462de3", "shasum": "" }, "require": { @@ -22,7 +22,7 @@ "ext-gd": "PHP GD library", "ext-imagick": "PHP ImageMagick" }, - "time": "2021-02-06T16:34:15+00:00", + "time": "2021-09-22T15:40:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -56,10 +56,11 @@ ], "support": { "issues": "https://github.com/JamesHeinrich/phpThumb/issues", - "source": "https://github.com/JamesHeinrich/phpThumb/tree/v1.7.16" + "source": "https://github.com/JamesHeinrich/phpThumb/tree/v1.7.17" }, "install-path": "../james-heinrich/phpthumb" } ], - "dev": true + "dev": true, + "dev-package-names": [] } diff --git a/assets/snippets/phpthumb/vendor/composer/installed.php b/assets/snippets/phpthumb/vendor/composer/installed.php index 1e41d37546..808de6565f 100644 --- a/assets/snippets/phpthumb/vendor/composer/installed.php +++ b/assets/snippets/phpthumb/vendor/composer/installed.php @@ -1,33 +1,32 @@ - - array ( - 'pretty_version' => 'No version set (parsed as 1.0.0)', - 'version' => '1.0.0.0', - 'aliases' => - array ( + array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '2df5ab4d64904f33813d269992414ad1cbc3d27f', + 'name' => '__root__', + 'dev' => true, ), - 'reference' => NULL, - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'No version set (parsed as 1.0.0)', - 'version' => '1.0.0.0', - 'aliases' => - array ( - ), - 'reference' => NULL, + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '2df5ab4d64904f33813d269992414ad1cbc3d27f', + 'dev_requirement' => false, + ), + 'james-heinrich/phpthumb' => array( + 'pretty_version' => 'v1.7.17', + 'version' => '1.7.17.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../james-heinrich/phpthumb', + 'aliases' => array(), + 'reference' => '1ef2db62e8d4a4e391159653b200144a37462de3', + 'dev_requirement' => false, + ), ), - 'james-heinrich/phpthumb' => - array ( - 'pretty_version' => 'v1.7.16', - 'version' => '1.7.16.0', - 'aliases' => - array ( - ), - 'reference' => '79aa5b21ee7277f67b863560bccc2490c4f0b82a', - ), - ), ); diff --git a/assets/snippets/phpthumb/vendor/composer/platform_check.php b/assets/snippets/phpthumb/vendor/composer/platform_check.php index 9997ec3c0a..7621d4ff97 100644 --- a/assets/snippets/phpthumb/vendor/composer/platform_check.php +++ b/assets/snippets/phpthumb/vendor/composer/platform_check.php @@ -5,10 +5,22 @@ $issues = array(); if (!(PHP_VERSION_ID >= 50300)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.'; + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues); - exit(104); + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); } diff --git a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/docs/phpthumb.changelog.txt b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/docs/phpthumb.changelog.txt index 4ae862471d..01c6f47931 100644 --- a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/docs/phpthumb.changelog.txt +++ b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/docs/phpthumb.changelog.txt @@ -7,6 +7,12 @@ ¤ = structure change or important new feature * = less important new feature or change +v1.7.17-202109221111 + * [bugfix: G171] problem with class_exists and autoloading + * [bugfix: G173] file_get_contents instead of readfile + * [bugfix: G178] missing quality parameter in webp + * [bugfix: G181] missing webp in ImageCreateFromFilename + v1.7.16-202012161640 ¤ PHP 8.0 compatibility * [bugfix: G168] bad call to $this inside static function diff --git a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.config.php.default b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.config.php.default index 9f5668a58c..2f26aed3dc 100644 --- a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.config.php.default +++ b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.config.php.default @@ -13,7 +13,7 @@ define('phpThumbConfigFileVersion', '1.7.16'); ob_start(); -if (!class_exists('phpthumb_functions')) { // normally include_once should take care of this, but see https://github.com/JamesHeinrich/phpThumb/issues/94 +if (!class_exists('phpthumb_functions', false)) { // normally include_once should take care of this, but see https://github.com/JamesHeinrich/phpThumb/issues/94 if (!file_exists( __DIR__ .'/phpthumb.functions.php') || !include_once( __DIR__ .'/phpthumb.functions.php')) { ob_end_flush(); die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath( __DIR__ .'/phpthumb.functions.php').'"'); diff --git a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.php b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.php index 672cf6ded6..8e02199542 100644 --- a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.php +++ b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpThumb.php @@ -75,7 +75,7 @@ function RedirectToCachedFile() { if (preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) { $phpThumb->DebugMessage('* Would have sent headers (3): Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])), __FILE__, __LINE__); } else { - $phpThumb->DebugMessage('* Would have sent data: readfile('.$phpThumb->cache_filename.')', __FILE__, __LINE__); + $phpThumb->DebugMessage('* Would have sent data: file_get_contents('.$phpThumb->cache_filename.')', __FILE__, __LINE__); } } else { @@ -106,7 +106,7 @@ function RedirectToCachedFile() { if (empty($phpThumb->config_cache_force_passthru) && preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) { header('Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1]))); } else { - @readfile($phpThumb->cache_filename); + echo file_get_contents($phpThumb->cache_filename); } exit; @@ -551,7 +551,7 @@ function RedirectToCachedFile() { if ($contentType = phpthumb_functions::ImageTypeToMIMEtype(@$phpThumb->getimagesizeinfo[2])) { header('Content-Type: '.$contentType); } - @readfile($SourceFilename); + echo file_get_contents($SourceFilename); exit; } else { diff --git a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpthumb.class.php b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpthumb.class.php index 37e93a6f14..119d82d3a2 100644 --- a/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpthumb.class.php +++ b/assets/snippets/phpthumb/vendor/james-heinrich/phpthumb/phpthumb.class.php @@ -9,7 +9,7 @@ // /// ////////////////////////////////////////////////////////////// -if (!class_exists('phpthumb_functions')) +if (!class_exists('phpthumb_functions', false)) { ob_start(); if(!include_once __DIR__ . '/phpthumb.functions.php') @@ -220,7 +220,7 @@ class phpthumb { public $issafemode = null; public $php_memory_limit = null; - public $phpthumb_version = '1.7.16-202012161640'; + public $phpthumb_version = '1.7.17-202109221111'; ////////////////////////////////////////////////////////////////////// @@ -553,7 +553,7 @@ public function RenderOutput() { ob_end_clean(); return false; } - imagewebp($this->gdimg_output); + imagewebp($this->gdimg_output, null, $this->thumbnailQuality); $this->outputImageData = ob_get_contents(); break; @@ -669,14 +669,9 @@ public function OutputThumbnail() { $this->DebugMessage('imageinterlace($this->gdimg_output, '. (int) $this->config_output_interlace .')', __FILE__, __LINE__); imageinterlace($this->gdimg_output, (int) $this->config_output_interlace); switch ($this->thumbnailFormat) { + case 'gif': case 'jpeg': - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - $ImageOutFunction = 'image'.$this->thumbnailFormat; - @$ImageOutFunction($this->gdimg_output, null, $this->thumbnailQuality); - break; - case 'png': - case 'gif': case 'webp': $ImageOutFunction = 'image'.$this->thumbnailFormat; if (!function_exists($ImageOutFunction)) { @@ -684,7 +679,11 @@ public function OutputThumbnail() { return false; } header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - @$ImageOutFunction($this->gdimg_output); + if ($this->thumbnailFormat == 'gif') { + @$ImageOutFunction($this->gdimg_output); + } else { + @$ImageOutFunction($this->gdimg_output, null, $this->thumbnailQuality); + } break; case 'bmp': @@ -1907,8 +1906,8 @@ public function ImageMagickThumbnailToGD() { } else { - $this->w = (($this->aoe && $this->w) ? $this->w : ($this->w ? phpthumb_functions::nonempty_min($this->w, $getimagesize[0]) : '')); - $this->h = (($this->aoe && $this->h) ? $this->h : ($this->h ? phpthumb_functions::nonempty_min($this->h, $getimagesize[1]) : '')); + $this->w = (($this->aoe && $this->w) ? $this->w : ($this->w ? phpthumb_functions::nonempty_min($this->w, $getimagesize[0]) : null)); + $this->h = (($this->aoe && $this->h) ? $this->h : ($this->h ? phpthumb_functions::nonempty_min($this->h, $getimagesize[1]) : null)); if ($this->w || $this->h) { if ($IMuseExplicitImageOutputDimensions) { if ($this->w && !$this->h) { @@ -3701,6 +3700,7 @@ public function ImageCreateFromFilename($filename) { 2 => 'imagecreatefromjpeg', 3 => 'imagecreatefrompng', 15 => 'imagecreatefromwbmp', + 18 => 'imagecreatefromwebp', ); $this->DebugMessage('ImageCreateFromFilename found ($getimagesizeinfo[2]=='.@$getimagesizeinfo[2].')', __FILE__, __LINE__); switch (@$getimagesizeinfo[2]) { @@ -3708,6 +3708,7 @@ public function ImageCreateFromFilename($filename) { case 2: // JPEG case 3: // PNG case 15: // WBMP + case 18: // WEBP $ImageCreateFromFunctionName = $ImageCreateFromFunction[$getimagesizeinfo[2]]; if (function_exists($ImageCreateFromFunctionName)) { $this->DebugMessage('Calling '.$ImageCreateFromFunctionName.'('.$filename.')', __FILE__, __LINE__); diff --git a/assets/vendor/.htaccess b/assets/vendor/.htaccess index ff2beb844b..de8d8a9d42 100755 --- a/assets/vendor/.htaccess +++ b/assets/vendor/.htaccess @@ -1,2 +1,7 @@ -order deny,allow -deny from all + + Require all denied + + + order deny,allow + deny from all + diff --git a/index.php b/index.php index 25edb910c6..eef9c15fad 100644 --- a/index.php +++ b/index.php @@ -100,7 +100,8 @@ $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); // Be sure config.inc.php is there and that it contains some important values if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { - readfile('install/not_installed.tpl'); + header("HTTP/1.1 302 Moved Temporarily"); + header("Location: /install"); exit; } } diff --git a/install/actions/action_connection.php b/install/actions/action_connection.php index e97479c3bb..2716735402 100755 --- a/install/actions/action_connection.php +++ b/install/actions/action_connection.php @@ -17,9 +17,18 @@ if ($dbase) { $database_name = trim($dbase, '`'); $host = explode(':', $database_server, 2); - if (!$conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) + try { + $conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null); + try { + $result = mysqli_select_db($conn, trim($dbase, '`')); + } catch (Exception $e) { + $result = false; + } + } catch (Exception $e) { + $conn = false; + $result = false; + } + if (!$conn || !$result) $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; else $upgradeable = 1; diff --git a/install/actions/action_summary.php b/install/actions/action_summary.php index f72b874f4e..9d942ff592 100755 --- a/install/actions/action_summary.php +++ b/install/actions/action_summary.php @@ -238,7 +238,7 @@ function f_owc($path, $data, $mode = null){ // check table prefix if ($conn && $installMode == 0) { echo '

    ' . $_lang['checking_table_prefix'] . $table_prefix . '`: '; - if ($rs= mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { + if ($rs= checkIssetTable($conn, "$dbase.`" . $table_prefix . "site_content`")) { echo '' . $_lang['failed'] . '' . $_lang['table_prefix_already_inuse'] . '

    '; $errors++; echo "

    " . $_lang['table_prefix_already_inuse_note'] . '

    '; @@ -247,7 +247,7 @@ function f_owc($path, $data, $mode = null){ } } elseif ($conn && $installMode == 2) { echo '

    ' . $_lang['checking_table_prefix'] . $table_prefix . '`: '; - if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { + if (!$rs = checkIssetTable($conn, "$dbase.`" . $table_prefix . "site_content`")) { echo '' . $_lang['failed'] . '' . $_lang['table_prefix_not_exist'] . '

    '; $errors++; echo '

    ' . $_lang['table_prefix_not_exist_note'] . '

    '; diff --git a/install/actions/tpl_connection.html b/install/actions/tpl_connection.html index d5fd520e2d..29c24d173a 100755 --- a/install/actions/tpl_connection.html +++ b/install/actions/tpl_connection.html @@ -105,7 +105,7 @@

    [%default_language%]

    - + \n\n `\n &successTpl=`@CODE:\n

    Signup completed successfully!
    \n Your account was created. A copy of your signup information was sent to your email address.

    \n `\n &subject=`New registration, [(site_name)]`\n &ccSender=`1`\n &ccSenderTpl=`@CODE:\n

    [+fullname.value+], signup completed successfully!

    \n Login: [+email.value+]
    \n Password: [+user.password+]
    \n `\n !]','0','4','1','0','1','1','1144904400','1','1515584252','0','0','0','0','0','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('5','document','text/html','Request an Account','Sign Up for Full Site Privileges','','request-an-account','','1','0','0','4','0','',' [!FormLister?\n &formid=`registerForm`\n &controller=`Register`\n &requiredClass=`has-warning`\n &errorClass=`has-error`\n &errorTpl=`@CODE:[+message+]`\n &allowedFields=`email,username,fullname,country`\n &rules=`{\n \"username\":{\n \"required\":\"Enter your username\",\n \"alphaNumeric\":\"Only letters and numbers\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueUsername\",\n \"message\":\"Name already taken\"\n }\n },\n \"email\":{\n \"required\":\"Enter email\",\n \"email\":\"Incorrect email\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueEmail\",\n \"message\":\"This email is already in use by another user\"\n }\n },\n \"password\":{\n \"required\":\"Enter password\"\n },\n \"repeatPassword\":{\n \"required\":\"Retype password\",\n \"equals\":{\n \"message\":\"Passwords do not match\"\n }\n }\n }`\n &captcha=`modxCaptcha`\n &formTpl=`@CODE: \n\n
    \n \n

    User Details

    \n
    \n \n Items marked by * are required\n
    \n \n
    \n \n \n [+username.error+]\n
    \n \n
    \n \n \n [+fullname.error+]\n
    \n \n
    \n \n \n [+email.error+]\n
    \n\n
    \n

    Password

    \n \n \n [+password.error+]\n
    \n
    \n \n \n [+repeatPassword.error+]\n
    \n \n
    \n

    Optional Account Profile Info

    \n \n \n [+country.error+]\n
    \n \n
    \n

    Bot-Patrol

    \n

    Enter the word/number combination shown in the image below.

    \n \n

    \"If

    \n \n [+vericode.error+]\n
    \n \n
    \n \n
    \n\n\n\n\n\n `\n &successTpl=`@CODE:\n

    Signup completed successfully!
    \n Your account was created. A copy of your signup information was sent to your email address.

    \n `\n &subject=`New registration, [(site_name)]`\n &ccSender=`1`\n &ccSenderTpl=`@CODE:\n

    [+fullname.value+], signup completed successfully!

    \n Login: [+email.value+]
    \n Password: [+user.password+]
    \n `\n !]','0','4','1','0','1','1','1144904400','1','1515584252','0','0','0','0','0','','0','0','0','0','1','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('6','document','text/html','Contact Us','Contact [(site_name)]','','contact-us','','1','0','0','0','0','','\n\n\n
    \n {{ContactForm}}\n
    \n','0','4','5','1','1','1','1144904400','1','1507815490','0','0','0','0','0','Contact us','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('6','document','text/html','Contact Us','Contact [(site_name)]','','contact-us','','1','0','0','0','0','','\n\n\n
    \n {{ContactForm}}\n
    \n','0','4','5','1','1','1','1144904400','1','1507815490','0','0','0','0','0','Contact us','0','0','0','0','0','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('7','document','text/html','404 - Document Not Found','Uh oh ... it\'s a 404! (Page Not Found)','','doc-not-found','','1','0','0','0','0','','

    Looks like you tried to go somewhere that does not exist... perhaps you need to login or you\'d like one of the following pages instead:

    \n

    [[DLMenu? &parents=`0`]]

    \n

    Want to find it the old fashioned way? Use the site search at the top of this site to find what you seek.

    ','1','4','10','0','1','1','1144904400','1','1507728168','0','0','0','0','0','','0','0','0','0','1','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('8','document','text/html','Search Results','Your Search Results','','search-results','','1','0','0','0','0','','[!AjaxSearch? &showInputForm=`0` &ajaxSearch=`0`!]','0','4','8','0','1','1','1144904400','1','1507728119','0','0','0','0','0','','1','0','0','0','1','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('9','document','text/html','Mini-Blog HOWTO','How to Start Posting with EVO Mini-Blogs','','article-1126081344','','1','0','0','2','0','','

    Setting up a mini-blog is relatively simple. Here\'s what you need to do to get started with making new posts:

    \n
      \n
    1. Login to the EVO Control Panel.
    2. \n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the \"Create Resource here\" menu option. To edit an existing blog article, right click the entry and choose the \"Edit Resource\" menu option.
    6. \n\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \n
    9. Everything else is automatic; you\'re done!
    10. \n
    ','1','4','0','1','1','-1','1144904400','1','1509818890','0','0','0','0','0','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('9','document','text/html','Mini-Blog HOWTO','How to Start Posting with EVO Mini-Blogs','','article-1126081344','','1','0','0','2','0','','

    Setting up a mini-blog is relatively simple. Here\'s what you need to do to get started with making new posts:

    \n
      \n
    1. Login to the EVO Control Panel.
    2. \n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the \"Create Resource here\" menu option. To edit an existing blog article, right click the entry and choose the \"Edit Resource\" menu option.
    6. \n\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \n
    9. Everything else is automatic; you\'re done!
    10. \n
    ','1','4','0','1','1','1','1144904400','1','1509818890','0','0','0','0','0','','0','0','0','0','1','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('11','document','application/rss+xml','RSS Feed','[(site_name)] RSS Feed','','feed.rss','','1','0','0','0','0','','\n\n\n [(site_name)]\n [(site_url)]\n Evolution CMS demo site Feed\n [[DocLister? \n &parents=`2` \n &display=`20`\n &summary=`notags,len:350` \n &tpl=`@CODE:\n [+e.title+]\n [(site_url)][~[+id+]~]\n \n [+date+]\n [(site_url)][~[+id+]~]\n [+author+]\n `\n ]]\n\n','0','0','9','0','1','1','1144904400','1','1507728107','0','0','0','0','0','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('11','document','application/rss+xml','RSS Feed','[(site_name)] RSS Feed','','feed.rss','','1','0','0','0','0','','\n\n\n [(site_name)]\n [(site_url)]\n Evolution CMS demo site Feed\n [[DocLister? \n &parents=`2` \n &display=`20`\n &summary=`notags,len:350` \n &urlScheme=`full` \n &tpl=`@CODE:\n [+e.title+]\n [+url+]\n \n [+date+]\n [+url+]\n [+author+]\n `\n ]]\n\n','0','0','9','0','1','1','1144904400','1','1507728107','0','0','0','0','0','','0','0','0','0','1','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('14','document','text/html','Content Management','Ways to manage content','','cms','','1','0','0','15','0','','

    Manage your content in the backend

    \n

    The Manager is a skinnable feature-packed tool for admin users. You can add extra users and limit what functions they can access. EVO\'s Manager makes creating content and managing templates and reusable elements easy. Modules can be added to work with other datasets or make management tasks easier.

    \n

    Manage your content in the frontend

    \n

    The QuickEdit bar lets manager users edit content whilst browsing the site. Most content fields and template variables can be edited quickly and easily.

    \n

    Enable web users to add content

    \n

    Custom data entry is easy to code using the EVO API - so you can design forms and collect whatever information you need.

    ','1','4','3','1','1','1','1144904400','1','1378086298','0','0','0','1378086298','1','Manage Content','0','0','0','0','0','1'); @@ -38,9 +38,9 @@ REPLACE INTO `{PREFIX}site_content` VALUES ('15','document','text/html','EVO Fea REPLACE INTO `{PREFIX}site_content` VALUES ('16','document','text/html','Ajax','Ajax and Web 2.0 ready','','ajax','','1','1159264800','0','15','0','','

    Ajax ready out-of-the-box

    \n

    EVO empowers users to build engaging sites today, with its pre-integrated jQuery javascript library.

    \n

    Check out the Ajax-powered search in this example site. The libraries are also used with QuickEdit, our front-end editing tool.

    \n

    Smart integration means the scripts are only included in the document head when needed - no unnecessary bloat on simple pages!

    \n

    Web 2.0 today

    \n

    EVO makes child\'s play of building content managed sites with validating, accessible CSS layouts - so web standards compliance is easy. (You can create a site with excessively nested tables too, if you really want to).

    ','1','4','1','1','1','1','1144904400','1','1507726420','0','0','0','1159264800','1','Ajax','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('18','document','text/html','Just a pretend, older post','This post should in fact be archived','','article-1128398162','','1','0','0','2','0','','

    Not so exciting, after all, eh?

    ','1','4','2','1','1','-1','1144904400','1','1509818884','0','0','0','0','0','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('18','document','text/html','Just a pretend, older post','This post should in fact be archived','','article-1128398162','','1','0','0','2','0','','

    Not so exciting, after all, eh?

    ','1','4','2','1','1','1','1144904400','1','1509818884','0','0','0','0','0','','0','0','0','0','1','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('22','document','text/html','Menus and Lists','Flexible Menus and Lists','','menus','','1','1159178400','0','15','0','','

    Your documents - listed how you want them

    \n

    EVO\'s document data structure has been designed to allow many different routines to redisplay the information in ways that suit your needs, such as a dynamic menu in your template.

    \n

    Since the last release of EVO, the community has produced many great snippets - reusable functions that you can call in your content or template. Two of the most widely useful are Ditto and Wayfinder.

    \n

    Wayfinder - the menu builder

    \n

    Allows you to template every part of the menu. On this site, Wayfinder is being used to generate the drop-down menus, but many types of menus and sitemaps are possible.

    \n

    Ditto - the document lister

    \n

    Uses include listing the most recent blog posts, producing a site map, listing related documents (using a TV filter) and generating an RSS feed. You could even write a menu with it. On this site, Ditto is being used for the blog posts list on the Blog page, and the list on the right of some templates.

    \n

    Unlimited Customization

    \n

    If you can\'t quite get your desired effect using templating and the many options of Ditto and Wayfinder, you can write your own routine, or look for other snippets in the EVO repository. EVO\'s fields for Menu Title, summaries, menu position etc can be used via the API to produce anything you can imagine.

    ','1','4','2','1','1','1','1144904400','1','1160148522','0','0','0','0','0','Menus and Lists','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('22','document','text/html','Menus and Lists','Flexible Menus and Lists','','menus','','1','1159178400','0','15','0','','

    Your documents - listed how you want them

    \n

    EVO\'s document data structure has been designed to allow many different routines to redisplay the information in ways that suit your needs, such as a dynamic menu in your template.

    \n

    Since the last release of EVO, the community has produced many great snippets - reusable functions that you can call in your content or template. Two of the most widely useful are Ditto and Wayfinder.

    \n

    Wayfinder - the menu builder

    \n

    Allows you to template every part of the menu. On this site, Wayfinder is being used to generate the drop-down menus, but many types of menus and sitemaps are possible.

    \n

    Ditto - the document lister

    \n

    Uses include listing the most recent blog posts, producing a site map, listing related documents (using a TV filter) and generating an RSS feed. You could even write a menu with it. On this site, Ditto is being used for the blog posts list on the Blog page, and the list on the right of some templates.

    \n

    Unlimited Customization

    \n

    If you can\'t quite get your desired effect using templating and the many options of DocLister, you can write your own routine, or look for other snippets in the EVO repository. EVO\'s fields for Menu Title, summaries, menu position etc can be used via the API to produce anything you can imagine.

    ','1','4','2','1','1','1','1144904400','1','1160148522','0','0','0','0','0','Menus and Lists','0','0','0','0','0','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('24','document','text/html','Extendable by design','Extendable by design','','extendable','','1','1159092732','0','15','0','','

    The EVO community has created many add-ons which can be found in the Repository, from image galleries and e-commerce to smaller utilities.

    \n

    Template Variables with Bindings

    \n

    TVs - Template Variables - are powerful extra fields that you can use with your documents. As an example of an advanced template element that returns a different thing dependent on code or data, we created an @BINDING for the name of the Login menu item. This changes the menu name from Login to Logout based on your logged in state. The @BINDING as follows was placed in the default value as: @EVAL if ($modx->getLoginUserID()) return \'Logout\'; else return \'Login\';

    \n

    Using jQuery-effects

    \n

    We used some simple effects to highlight various things on the front/home page to demonstrate how easy it is to create a useful way to draw attention to things. To see them in action on the home page, click the Integrated Site Search, Related Links or Newest Documents headers.

    \n

    Custom Forms

    \n

    To demonstrate how to link to custom forms, we customized the calls to the Webuser Registration system and the Login system.

    \n

    And more

    \n

    Rich Text Editor for blog entries. To make it easier to format blog posts with simple text formatting, we modified the blog to use a custom RTE-enabled Template Variable (TV).

    \n

    Smart-Summary logic. When splitting the full blog/news posts you simply insert a \"<!-- splitter -->\" where you want the break to occur. In addition, if that leaves any important tags open, it will try to match them and close them so it doesn\'t mess up your site layout with unclosed OL, UL or DIV tags.

    ','1','4','4','1','1','2','1144904400','1','1159309971','0','0','0','0','0','Extendability','0','0','0','0','0','1'); @@ -48,34 +48,34 @@ REPLACE INTO `{PREFIX}site_content` VALUES ('32','document','text/html','Design' REPLACE INTO `{PREFIX}site_content` VALUES ('33','document','text/html','Getting Help','Getting Help with EVO','','getting-help','','1','0','0','0','0','','

    The team behind EVO strives to constantly add to and refine the documentation to help you get up to speed with EVO:

    \n
      \n
    • For basic instructions on integrating custom templates into EVO, please see the Designer\'s Guide.
    • \n
    • For an introduction to working in EVO from the content editors perspectve, see the Content Editor\'s Guide.
    • \n
    • For a detailed overview of the backend \"manager\" and setting up Users and Groups, please peruse the Administration Guide.
    • \n
    • For developers, architecture and API documentation can be found in the Developer\'s Guide.
    • \n
    • And if someone has installed this site for you, but you\'re curious as to the steps they went through, please see the Getting Started Guide.
    • \n
    \n

    And don\'t forget, you can always learn and ask questions at the EVO forums.

    ','1','4','3','1','1','2','1144904400','1','1507728208','0','0','0','0','0','Getting Help','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('37','document','text/html','Forgot Password','','','forgot-password','','1','0','0','4','0','','[!FormLister?\n&controller=`Reminder`\n&formid=`remind`\n&rules=`{\n \"email\":{\n \"required\":\"Be sure to enter email\",\n \"email\":\"Enter email correctly\"\n }\n}`\n&resetRules=`{\n \"password\":{\n \"required\":\"Be sure to enter the password\",\n \"minLength\":{\n \"params\":6,\n \"message\":\"Password must be longer than 6 characters\"\n }\n },\n \"repeatPassword\":{\n \"required\":\"Repeat password\",\n \"equals\":{\n \"message\":\"Passwords do not match\"\n }\n }\n}`\n&formTpl=`@CODE:\n\n
    \n [+form.messages+]\n \n
    \n \n
    \n \n [+email.error+]\n
    \n\n
    \n \n
    \n \n
    `\n\n&resetTpl=`@CODE:\n
    \n [+form.messages+]\n \n
    \n \n
    \n \n [+password.error+]\n \n [+repeatPassword.error+]\n
    \n
    \n \n
    \n \n
    \n`\n&messagesOuterTpl=`@CODE:
    [+messages+]
    `\n&successTpl=`@CODE:\n
    \n
    An email with the instructions has been sent to the email you specified when registering!
    \n
    `\n\n&subject=`Password recovery, [(site_name)]`\n&reportTpl=`@CODE:

    To recover your password, click on the link [+reset.url+]

    `\n&resetReportTpl=`@CODE:

    Hello, [+fullname.value+]!

    Your new password: [+newpassword+]

    `\n&resetTo=`37`\n&redirectTo=`4`\n&errorTpl=`@CODE:[+message+]`\n!]','0','4','2','0','1','1','1144904400','1','1509806093','0','0','0','0','0','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('37','document','text/html','Forgot Password','','','forgot-password','','1','0','0','4','0','','[!FormLister?\n&controller=`Reminder`\n&formid=`remind`\n&rules=`{\n \"email\":{\n \"required\":\"Be sure to enter email\",\n \"email\":\"Enter email correctly\"\n }\n}`\n&resetRules=`{\n \"password\":{\n \"required\":\"Be sure to enter the password\",\n \"minLength\":{\n \"params\":6,\n \"message\":\"Password must be longer than 6 characters\"\n }\n },\n \"repeatPassword\":{\n \"required\":\"Repeat password\",\n \"equals\":{\n \"message\":\"Passwords do not match\"\n }\n }\n}`\n&formTpl=`@CODE:\n\n
    \n [+form.messages+]\n \n
    \n \n
    \n \n [+email.error+]\n
    \n\n
    \n \n
    \n \n
    `\n\n&resetTpl=`@CODE:\n
    \n [+form.messages+]\n \n
    \n \n
    \n \n [+password.error+]\n \n [+repeatPassword.error+]\n
    \n
    \n \n
    \n \n
    \n`\n&messagesOuterTpl=`@CODE:
    [+messages+]
    `\n&successTpl=`@CODE:\n
    \n
    An email with the instructions has been sent to the email you specified when registering!
    \n
    `\n\n&subject=`Password recovery, [(site_name)]`\n&reportTpl=`@CODE:

    To recover your password, click on the link [+reset.url+]

    `\n&resetReportTpl=`@CODE:

    Hello, [+fullname.value+]!

    Your new password: [+newpassword+]

    `\n&resetTo=`37`\n&redirectTo=`4`\n&errorTpl=`@CODE:[+message+]`\n!]','0','4','2','0','1','1','1144904400','1','1509806093','0','0','0','0','0','','0','0','0','0','1','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('47','document','text/html','New documentation site: docs.evo.im','Multilingual documentation for Evolution CMS ','','new-documentation-site-docs.evo.im','','1','0','0','2','0','You can get documentation here: http://docs.evo.im','

    You can get documentation here: http://docs.evo.im

    \n

    Evolution CMS Docs

    \n

    Evolution is a professional website development tool that allows you to manage content (and the site itself) absolutely 100%! This system is open source, and therefore free. Unlike most free CMS (English Content Management System) - on EVO you can build a site of any complexity, with almost any set of functions, and the system will not in any way influence your html code.

    \n

    How to contribute

    \n
      \n
    1. First of all, you must have an account on GitHub, if not - then it\'s very simple.
    2. \n
    3. Make a fork https://github.com/evolution-cms/docs/ to yourself by clicking the \"Fork\" button on the top right.
    4. \n
    5. Clone the repository to your disk and work with it locally, like everyone else (if you are a developer)
    6. \n
    7. If you are not a developer, you can simply edit the * .md files directly on GitHub.
    8. \n
    9. When you have done everything, you should make a \"Pull Request\" and send it by sending changes to this repository.
    10. \n
    ','1','4','2','1','1','1','1507724288','1','1509818879','0','0','0','1507724288','1','','0','0','0','0','1','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('48','document','text/xml','sitemap.xml','','','sitemap.xml','','1','0','0','0','0','','[[DLSitemap]]','0','0','11','1','1','1','1507726985','1','1507727020','0','0','0','1507726985','1','','0','0','0','0','1','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('49','document','text/html','Edit profile','User profile','','editprofile','','1','0','0','4','0','',' Logout\n [!FormLister?\n &formid=`registerForm`\n &controller=`Profile`\n &requiredClass=`has-warning`\n &errorClass=`has-error`\n &errorTpl=`@CODE:[+message+]`\n &allowedFields=`email,username,fullname,country`\n &rules=`{\n \"username\":{\n \"required\":\"Enter your username\",\n \"alphaNumeric\":\"Only letters and numbers\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueUsername\",\n \"message\":\"Name already taken\"\n }\n },\n \"email\":{\n \"required\":\"Enter email\",\n \"email\":\"Incorrect email\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueEmail\",\n \"message\":\"This email is already in use by another user\"\n }\n },\n \"password\":{\n \"required\":\"Enter password\"\n },\n \"repeatPassword\":{\n \"required\":\"Retype password\",\n \"equals\":{\n \"message\":\"Passwords do not match\"\n }\n }\n }`\n &formTpl=`@CODE: \n\n
    \n \n

    User Details

    \n \n
    \n \n \n [+username.error+]\n
    \n \n
    \n \n \n [+fullname.error+]\n
    \n \n
    \n \n \n [+email.error+]\n
    \n\n
    \n

    Password

    \n \n \n [+password.error+]\n
    \n
    \n \n \n [+repeatPassword.error+]\n
    \n \n
    \n

    Optional Account Profile Info

    \n \n \n [+country.error+]\n
    \n \n
    \n \n
    \n\n\n\n\n\n `!]\n','0','4','0','1','1','1','1509808504','1','1509817993','0','0','0','1509808504','1','','0','0','0','0','1','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('49','document','text/html','Edit profile','User profile','','editprofile','','1','0','0','4','0','',' Logout\n [!FormLister?\n &formid=`registerForm`\n &controller=`Profile`\n &requiredClass=`has-warning`\n &errorClass=`has-error`\n &errorTpl=`@CODE:[+message+]`\n &allowedFields=`email,username,fullname,country`\n &rules=`{\n \"username\":{\n \"required\":\"Enter your username\",\n \"alphaNumeric\":\"Only letters and numbers\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueUsername\",\n \"message\":\"Name already taken\"\n }\n },\n \"email\":{\n \"required\":\"Enter email\",\n \"email\":\"Incorrect email\",\n \"custom\":{\n \"function\":\"\\\\FormLister\\\\Register::uniqueEmail\",\n \"message\":\"This email is already in use by another user\"\n }\n },\n \"password\":{\n \"required\":\"Enter password\"\n },\n \"repeatPassword\":{\n \"required\":\"Retype password\",\n \"equals\":{\n \"message\":\"Passwords do not match\"\n }\n }\n }`\n &formTpl=`@CODE: \n\n
    \n \n

    User Details

    \n \n
    \n \n \n [+username.error+]\n
    \n \n
    \n \n \n [+fullname.error+]\n
    \n \n
    \n \n \n [+email.error+]\n
    \n\n
    \n

    Password

    \n \n \n [+password.error+]\n
    \n
    \n \n \n [+repeatPassword.error+]\n
    \n \n
    \n

    Optional Account Profile Info

    \n \n \n [+country.error+]\n
    \n \n
    \n \n
    \n\n\n\n\n\n `!]\n','0','4','0','1','1','1','1509808504','1','1509817993','0','0','0','1509808504','1','','0','0','0','0','1','1'); # # Dumping data for table `site_htmlsnippets` # -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('1','Comments_tplComments','Comments (Jot) Form-Template','0','none','1','0','\n
    \n
    [+comment.title:limit:esc+]\n [+phx:userinfo=`lastlogin`:ifempty=`9999999999`:lt=`[+comment.createdon+]`:then=`\n \n `:else=`\n \n `:strip+]\n \n
    \n
    \n
    \n
    \n [+comment.createdby:isnt=`0`:then=``+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+]\n [+comment.createdby:isnt=`0`:then=``+]\n
    Posts: [+comment.userpostcount+]\n
    \n
    \n
    \n [+jot.moderation.enabled:is=`1`:then=`\n \n [+comment.published:is=`0`:then=`\n \n `+]\n [+comment.published:is=`1`:then=`\n \n `+]\n `:strip+]\n [+jot.user.canedit:is=`1`:and:if=`[+comment.createdby+]`:is=`[+jot.user.id+]`:or:if=`[+jot.moderation.enabled+]`:is=`1`:then=`\n \n `:strip+]\n
    \n Reply #[+comment.postnumber+] on : [+comment.createdon:date=`%a %B %d, %Y, %H:%M:%S`+]\n
    \n
    [+comment.content:wordwrap:esc:nl2br+]
    \n
    \n [+comment.editedon:isnt=`0`:then=`\n Last Edit: [+comment.editedon:date=`%B %d, %Y, %H:%M:%S`+] by [+comment.editedby:userinfo=`username`:ifempty=` * `+]\n  `+] [+jot.moderation.enabled:is=`1`:then=`[+comment.secip+]`+]\n
    \n
    \n
    \n
    \n
    ','0','0','0','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('1','Comments_tplComments','Comments (Jot) Form-Template','0','none','1','0','\n
    \n
    [+comment.title:limit:esc+]\n [+phx:userinfo=`lastlogin`:ifempty=`9999999999`:lt=`[+comment.createdon+]`:then=`\n \n `:else=`\n \n `:strip+]\n \n
    \n
    \n
    \n
    \n [+comment.createdby:isnt=`0`:then=``+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+]\n [+comment.createdby:isnt=`0`:then=``+]\n
    Posts: [+comment.userpostcount+]\n
    \n
    \n
    \n [+jot.moderation.enabled:is=`1`:then=`\n \n [+comment.published:is=`0`:then=`\n \n `+]\n [+comment.published:is=`1`:then=`\n \n `+]\n `:strip+]\n [+jot.user.canedit:is=`1`:and:if=`[+comment.createdby+]`:is=`[+jot.user.id+]`:or:if=`[+jot.moderation.enabled+]`:is=`1`:then=`\n \n `:strip+]\n
    \n Reply #[+comment.postnumber+] on : [+comment.createdon:date=`%a %B %d, %Y, %H:%M:%S`+]\n
    \n
    [+comment.content:wordwrap:esc:nl2br+]
    \n
    \n [+comment.editedon:isnt=`0`:then=`\n Last Edit: [+comment.editedon:date=`%B %d, %Y, %H:%M:%S`+] by [+comment.editedby:userinfo=`username`:ifempty=` * `+]\n  `+] [+jot.moderation.enabled:is=`1`:then=`[+comment.secip+]`+]\n
    \n
    \n
    \n
    \n
    ','0','0','0','0'); -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('3','AjaxSearch_tplInput','Input-Form for AjaxSearch','0','none','1','0','[+as.showInputForm:is=`1`:then=`\n
    \n [+as.showAsId:is=`1`:then=``+]\n \n
    \n \n [+as.liveSearch:is=`0`:then=`\n \n \n \n `:else=`\n
    \n `+] \n
    \n\n`+]\n[+as.showIntro:is=`1`:then=`\n

    [+as.introMessage+]

    \n`+]','0','0','0','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('3','AjaxSearch_tplInput','Input-Form for AjaxSearch','0','none','1','0','[+as.showInputForm:is=`1`:then=`\n
    \n [+as.showAsId:is=`1`:then=``+]\n \n
    \n \n [+as.liveSearch:is=`0`:then=`\n \n \n \n `:else=`\n
    \n `+] \n
    \n\n`+]\n[+as.showIntro:is=`1`:then=`\n

    [+as.introMessage+]

    \n`+]','0','0','0','0'); INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('4','AjaxSearch_tplAjaxResult','Result Tpl for AjaxSearch','0','none','1','0','
    \n [+as.pagetitle+]\n[+as.descriptionShow:is=`1`:then=`\n [+as.description+]\n`+]\n[+as.extractShow:is=`1`:then=`\n

    [+as.extract+]

    \n`+]\n[+as.breadcrumbsShow:is=`1`:then=`\n [+as.breadcrumbs+]\n`+]\n
    ','0','0','0','0'); INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('6','AjaxSearch_tplAjaxGrpResult','Grp Result Tpl for AjaxSearch','0','none','1','0','[+as.grpResultsDef:is=`1`:then=`\n
    \n[+as.headerGrpResult+]\n[+as.listResults+]\n[+as.footerGrpResult+]\n
    \n`:else=`\n
    [+as.grpResultNameShow:is=`1`:then=`[+as.grpResultName+]`+]\n[+as.grpResultsDisplayedText+]
    \n`+]','0','0','0','0'); -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('8','AjaxSearch_tplAjaxResults','Results Tpl for AjaxSearch','0','none','1','0','
    \n
    \n
    \n
    \n \n

    Search Results

    \n
    \n
    \n [+as.noResults:is=`1`:then=`\n
    \n [+as.noResultText+]\n
    \n `:else=`\n

    [+as.resultsFoundText+][+as.resultsDisplayedText+]

    \n [+as.listGrpResults+]\n `+]\n [+as.moreResults:is=`1`:then=`\n \n `+]\n [+as.showCmt:is=`1`:then=`\n [+as.comment+]\n `+]\n
    \n
    \n \n
    \n
    \n
    \n
    \n','0','0','0','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('8','AjaxSearch_tplAjaxResults','Results Tpl for AjaxSearch','0','none','1','0','
    \n
    \n
    \n
    \n \n

    Search Results

    \n
    \n
    \n [+as.noResults:is=`1`:then=`\n
    \n [+as.noResultText+]\n
    \n `:else=`\n

    [+as.resultsFoundText+][+as.resultsDisplayedText+]

    \n [+as.listGrpResults+]\n `+]\n [+as.moreResults:is=`1`:then=`\n \n `+]\n [+as.showCmt:is=`1`:then=`\n [+as.comment+]\n `+]\n
    \n
    \n \n
    \n
    \n
    \n
    \n','0','0','0','0'); -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('9','Comments_tplForm','Comments (Jot) Form-Template','0','none','1','0','\n

    [+form.edit:is=`1`:then=`Edit comment`:else=`Write a comment`+]

    \n
    \n
      \n
    • Required fields are marked with *.
    • \n
    \n
    \n[+form.error:isnt=`0`:then=`\n
    \n[+form.error:select=`\n&-3=You are trying to re-submit the same post. You have probably clicked the submit button more than once.\n&-2=Your comment has been rejected.\n&-1=Your comment has been saved, it will first be reviewed before it is published.\n&1=You are trying to re-submit the same post. You have probably clicked the submit button more than once.\n&2=The security code you entered was incorrect.\n&3=You can only post once each [+jot.postdelay+] seconds.\n&4=Your comment has been rejected.\n&5=[+form.errormsg:ifempty=`You didn\'t enter all the required fields`+]\n`+]\n
    \n`:strip+]\n[+form.confirm:isnt=`0`:then=`\n
    \n[+form.confirm:select=`\n&1=Your comment has been published.\n&2=Your comment has been saved, it will first be reviewed before it is published.\n&3=Comment saved.\n`+]\n
    \n`:strip+]\n
    \n
    \n \n \n \n \n [+form.moderation:is=`1`:then=`\n
    \n Created on: [+form.field.createdon:date=`%a %B %d, %Y at %H:%M`+]
    \n Created by: [+form.field.createdby:userinfo=`username`:ifempty=`[+jot.guestname+]`+]
    \n IP address: [+form.field.secip+]
    \n Published: [+form.field.published:select=`0=No&1=Yes`+]
    \n [+form.field.publishedon:gt=`0`:then=`\n Published on: [+form.field.publishedon:date=`%a %B %d, %Y at %H:%M`+]
    \n Published by: [+form.field.publishedby:userinfo=`username`:ifempty=` - `+]
    \n `+]\n [+form.field.editedon:gt=`0`:then=`\n Edited on: [+form.field.editedon:date=`%a %B %d, %Y at %H:%M`+]
    \n Edited by: [+form.field.editedby:userinfo=`username`:ifempty=` -`+]
    \n `+]\n
    \n `:strip+]\n \n [+form.guest:is=`1`:then=`\n
    \n \n \n
    \n
    \n \n \n
    \n `:strip+]\n
    \n \n \n
    \n
    \n \n \n
    \n \n[+jot.captcha:is=`1`:then=`\n
    \n \n \"If\n \n
    \n
    \n \n \n
    \n`:strip+]\n\n \n [+form.edit:is=`1`:then=`\n \n `+] \n
    \n','0','0','0','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('9','Comments_tplForm','Comments (Jot) Form-Template','0','none','1','0','\n

    [+form.edit:is=`1`:then=`Edit comment`:else=`Write a comment`+]

    \n
    \n
      \n
    • Required fields are marked with *.
    • \n
    \n
    \n[+form.error:isnt=`0`:then=`\n
    \n[+form.error:select=`\n&-3=You are trying to re-submit the same post. You have probably clicked the submit button more than once.\n&-2=Your comment has been rejected.\n&-1=Your comment has been saved, it will first be reviewed before it is published.\n&1=You are trying to re-submit the same post. You have probably clicked the submit button more than once.\n&2=The security code you entered was incorrect.\n&3=You can only post once each [+jot.postdelay+] seconds.\n&4=Your comment has been rejected.\n&5=[+form.errormsg:ifempty=`You didn\'t enter all the required fields`+]\n`+]\n
    \n`:strip+]\n[+form.confirm:isnt=`0`:then=`\n
    \n[+form.confirm:select=`\n&1=Your comment has been published.\n&2=Your comment has been saved, it will first be reviewed before it is published.\n&3=Comment saved.\n`+]\n
    \n`:strip+]\n
    \n
    \n \n \n \n \n [+form.moderation:is=`1`:then=`\n
    \n Created on: [+form.field.createdon:date=`%a %B %d, %Y at %H:%M`+]
    \n Created by: [+form.field.createdby:userinfo=`username`:ifempty=`[+jot.guestname+]`+]
    \n IP address: [+form.field.secip+]
    \n Published: [+form.field.published:select=`0=No&1=Yes`+]
    \n [+form.field.publishedon:gt=`0`:then=`\n Published on: [+form.field.publishedon:date=`%a %B %d, %Y at %H:%M`+]
    \n Published by: [+form.field.publishedby:userinfo=`username`:ifempty=` - `+]
    \n `+]\n [+form.field.editedon:gt=`0`:then=`\n Edited on: [+form.field.editedon:date=`%a %B %d, %Y at %H:%M`+]
    \n Edited by: [+form.field.editedby:userinfo=`username`:ifempty=` -`+]
    \n `+]\n
    \n `:strip+]\n \n [+form.guest:is=`1`:then=`\n
    \n \n \n
    \n
    \n \n \n
    \n `:strip+]\n
    \n \n \n
    \n
    \n \n \n
    \n \n[+jot.captcha:is=`1`:then=`\n
    \n \n \"If\n \n
    \n
    \n \n \n
    \n`:strip+]\n\n \n [+form.edit:is=`1`:then=`\n \n `+] \n
    \n','0','0','0','0'); -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('13','Comments','Comments (JotX) showing beneath a blog entry.','2','none','1','0','
    \n[[ifsnippet? &name=`JotX`]] \n[!JotX? &customfields=`name,email` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` &tplForm=`Comments_tplForm` &tplComments=`Comments_tplComments`!]\n
    ','0','1507723259','1509825745','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('13','Comments','Comments (JotX) showing beneath a blog entry.','2','none','1','0','
    \n[[ifsnippet? &name=`JotX`]] \n[!JotX? &customfields=`name,email` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` &tplForm=`Comments_tplForm` &tplComments=`Comments_tplComments`!]\n
    ','0','1507723259','1509825745','0'); -INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('14','ContactForm','eForm-template for showing contact-form','2','none','1','0','
    \n \n

    [+form.messages+]

    \n
    \n \n \n
    [+name.error+]
    \n
    \n
    \n \n \n
    [+email.error+]
    \n
    \n \n
    \n \n \n
    [+subject.error+]
    \n
    \n \n
    \n \n \n
    [+message.error+]
    \n
    \n \n
    \n \n
    \n\n','0','1507723259','1507816800','0'); +INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('14','ContactForm','eForm-template for showing contact-form','2','none','1','0','
    \n \n

    [+form.messages+]

    \n
    \n \n \n
    [+name.error+]
    \n
    \n
    \n \n \n
    [+email.error+]
    \n
    \n \n
    \n \n \n
    [+subject.error+]
    \n
    \n \n
    \n \n \n
    [+message.error+]
    \n
    \n \n
    \n \n
    \n\n','0','1507723259','1507816800','0'); INSERT INTO `{PREFIX}site_htmlsnippets` VALUES ('15','ContactFormReport','eForm-template for sending form-data by mail','0','none','1','0','

    This is a response sent by [+name+] using the feedback form on the website. The details of the message follow below:

    \n\n\n

    Name: [+name+]

    \n

    Email: [+email+]

    \n

    Regarding: [+subject+]

    \n

    comments:
    [+message+]

    \n\n

    You can use this link to reply: [+email+]

    \n','0','1507723259','0','0'); @@ -93,21 +93,21 @@ REPLACE INTO `{PREFIX}site_tmplvar_contentvalues` VALUES ('3','8','9','assets/im # Table structure for table `site_snippets` # -REPLACE INTO `{PREFIX}site_snippets` VALUES ('24','ifsnippet','','0','1','0','\nif (!isset($modx->snippetCache[$name])) {\n return \'

    For work \'.$name.\' in demo site you need install \'.$name.\' from Extras module

    \';\n}','0','{}',' ','1509819147','1509826185','0'); +REPLACE INTO `{PREFIX}site_snippets` VALUES ('24','ifsnippet','','0','1','0','\nif (!isset($modx->snippetCache[$name])) {\n return \'

    For work \'.$name.\' in demo site you need install \'.$name.\' from Extras module

    \';\n}','0','{}',' ','1509819147','1509826185','0'); -REPLACE INTO `{PREFIX}site_snippets` VALUES ('23','prepareBlog','','0','1','0','\nif ($data[\'image\'] != \'\'){\n $data[\'blog-image\'] = \'runSnippet(\'phpthumb\', array(\'input\'=>$data[\'image\'], \'options\'=>\'w=600,h=280,zc=1\')).\'\" alt=\"\'.$data[\'pagetitle\'].\'\">\';\n}else{\n $data[\'blog-image\'] = \'\';\n}\nreturn $data;','0','{}',' ','1507723822','1509819933','0'); +REPLACE INTO `{PREFIX}site_snippets` VALUES ('23','prepareBlog','','0','1','0','\nif (!empty($data[\'image\'])){\n $data[\'blog-image\'] = \'runSnippet(\'phpthumb\', array(\'input\'=>$data[\'image\'], \'options\'=>\'w=600,h=280,zc=1\')).\'\" alt=\"\'.$data[\'pagetitle\'].\'\">\';\n}else{\n $data[\'blog-image\'] = \'\';\n}\nreturn $data;','0','{}',' ','1507723822','1509819933','0'); # # Dumping data for table `site_templates` # -REPLACE INTO `{PREFIX}site_templates` VALUES ('4','EVO startup - Bootstrap','','1.0 Sample template in Bootstrap','0','1','','0','\n\n \n \n [*titl*]\n [*noIndex*]\n \n \n \n\n \n \n\n \n \n \n \n\n \n\n \n \n \n
    \n
    \n
    \n
    \n\n \n \"[(site_name)]\"\n \n\n
    \n\n \n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n\n
    \n
    \n
    \n [[if? &is=`[*id*]:!=:[(site_start)]` &then=`\n [[DLCrumbs? &showCurrent=`1`]]\n `]]\n
    \n
    \n
    \n\n
    \n\n
    \n

    [*#longtitle*]

    \n [*#content*]\n \n [[if? &is=`[*parent*]:=:2` &then=`@TPL:Comments`]]\n
    \n\n \n
    \n
    \n\n
    \n\n
    \n
    \n
    \n
    \n EVO Starter-Template ©2006-[[$_SERVER[\'REQUEST_TIME\']:dateFormat=`Y` ]]\n
    \n
    \n Built with Bootstrap framework.\n
    \n
    \n
    \n
    \n\n
    \n Memory: [^m^], MySQL: [^qt^], [^q^] request(s), PHP: [^p^], total: [^t^], document retrieved from [^s^]. \n
    \n\n \n\n \n \n\n \n','0','1','0','1509819347'); +REPLACE INTO `{PREFIX}site_templates` VALUES ('4','EVO startup - Bootstrap','','1.0 Sample template in Bootstrap','0','1','','0','\n\n \n \n [*titl*]\n [*noIndex*]\n \n \n \n\n \n \n\n \n \n \n \n\n \n\n \n \n \n
    \n
    \n
    \n
    \n\n \n \"[(site_name)]\"\n \n\n
    \n\n \n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n\n
    \n
    \n
    \n [[if? &is=`[*id*]:!=:[(site_start)]` &then=`\n [[DLCrumbs? &showCurrent=`1`]]\n `]]\n
    \n
    \n
    \n\n
    \n\n
    \n

    [*#longtitle*]

    \n [*#content*]\n \n [[if? &is=`[*parent*]:=:2` &then=`@TPL:Comments`]]\n
    \n\n \n
    \n
    \n\n
    \n\n
    \n
    \n
    \n
    \n EVO Starter-Template ©2006-[[$_SERVER[\'REQUEST_TIME\']:dateFormat=`Y` ]]\n
    \n
    \n Built with Bootstrap framework.\n
    \n
    \n
    \n
    \n\n
    \n Memory: [^m^], MySQL: [^qt^], [^q^] request(s), PHP: [^p^], total: [^t^], document retrieved from [^s^]. \n
    \n\n \n\n \n \n\n \n','0','1','0','1509819347'); # # Dumping data for table `evo_site_plugins` # -REPLACE INTO `{PREFIX}site_plugins` VALUES ('12','evoAjax','','0','1','0','switch($_GET[\'q\']){ \n case \'feedbackajaxform\':\n echo $modx->runSnippet(\'FormLister\', array(\n \'formid\' => \'ContactForm\',\n \'to\' => $modx->config[\'emailsender\'],\n \'parseMailerParams\'=> \'1\',\n \'replyTo\'=> \'@CODE:[+user.email.value+]\',\n \'subjectTpl\' => \'@CODE:[+subject.value+], from: \' . $modx->config[\'site_name\'] ,\n \'ccSender\'=>\'1\',\n \'errorClass\'=> \' has-error\',\n \'requiredClass\'=> \' has-warning\',\n \'rules\'=> \'{\n \"name\":{\n \"required\":\"Enter your Name\"\n },\n \"email\":{\n \"required\":\"Enter email\",\n \"email\":\"Incorrect email\"\n },\n \"message\":{\n \"required\":\"Enter message\"\n }\n }\',\n \'formControls\'=>\'subject\',\n \'messagesTpl\' => \'@CODE:
    [+required+]
    [+errors+]
    \',\n \'errorTpl\'=>\'@CODE: [+message+]\',\n \'successTpl\'=> \'@CODE: \n
    \n

    Thanks!

    \n

    your message has been sent.

    \n
    \',\n \'formTpl\' => \'ContactForm\', \n \'reportTpl\'=>\'ContactFormReport\',\n \'ccSenderTpl\'=>\'ContactFormReport\', \n ));\n die();\n break;\n}\n','0','{}','0',' ','1507815395','1507816656'); +REPLACE INTO `{PREFIX}site_plugins` VALUES ('12','evoAjax','','0','1','0','switch($_GET[\'q\']){ \n case \'feedbackajaxform\':\n echo $modx->runSnippet(\'FormLister\', array(\n \'formid\' => \'ContactForm\',\n \'to\' => $modx->config[\'emailsender\'],\n \'parseMailerParams\'=> \'1\',\n \'replyTo\'=> \'@CODE:[+user.email.value+]\',\n \'subjectTpl\' => \'@CODE:[+subject.value+], from: \' . $modx->config[\'site_name\'] ,\n \'ccSender\'=>\'1\',\n \'errorClass\'=> \' has-error\',\n \'requiredClass\'=> \' has-warning\',\n \'rules\'=> \'{\n \"name\":{\n \"required\":\"Enter your Name\"\n },\n \"email\":{\n \"required\":\"Enter email\",\n \"email\":\"Incorrect email\"\n },\n \"message\":{\n \"required\":\"Enter message\"\n }\n }\',\n \'formControls\'=>\'subject\',\n \'messagesTpl\' => \'@CODE:
    [+required+]
    [+errors+]
    \',\n \'errorTpl\'=>\'@CODE: [+message+]\',\n \'successTpl\'=> \'@CODE: \n
    \n

    Thanks!

    \n

    your message has been sent.

    \n
    \',\n \'formTpl\' => \'ContactForm\', \n \'reportTpl\'=>\'ContactFormReport\',\n \'ccSenderTpl\'=>\'ContactFormReport\', \n ));\n die();\n break;\n}\n','0','{}','0',' ','1507815395','1507816656'); REPLACE INTO `{PREFIX}site_plugin_events` VALUES ('12','1000','1'); @@ -205,4 +205,3 @@ REPLACE INTO `{PREFIX}jot_content` VALUES ('15','I\'m untrusted','','0','9','0', CREATE TABLE IF NOT EXISTS `{PREFIX}jot_subscriptions` (`id` mediumint(10) NOT NULL auto_increment, `uparent` mediumint(10) NOT NULL default '0', `tagid` varchar(50) NOT NULL default '', `userid` mediumint(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `uparent` (`uparent`), KEY `tagid` (`tagid`), KEY `userid` (`userid`)) ENGINE=MyISAM {TABLEENCODING}; - diff --git a/install/setup.info.php b/install/setup.info.php index 89b06f11af..f79ec6f13c 100755 --- a/install/setup.info.php +++ b/install/setup.info.php @@ -57,10 +57,10 @@ $params['caption'], $description, $params['input_type'], - $params['input_options'], - $params['input_default'], - $params['output_widget'], - $params['output_widget_params'], + $params['input_options'] ?? null, + $params['input_default'] ?? null, + $params['output_widget'] ?? null, + $params['output_widget_params'] ?? null, "$templatePath/{$params['filename']}", /* not currently used */ $params['template_assignments']!="*"?$params['template_assignments']:implode(",",array_map(function($value){return isset($value[0]) && is_scalar($value[0]);},$mt)), /* comma-separated list of template names */ $params['modx_category'], @@ -110,7 +110,7 @@ $params['name'], $description, "$snippetPath/{$params['filename']}", - $params['properties'], + $params['properties'] ?? null, $params['modx_category'], array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false ); @@ -134,13 +134,13 @@ $params['name'], $description, "$pluginPath/{$params['filename']}", - $params['properties'], + $params['properties'] ?? null, $params['events'], - $params['guid'], + $params['guid'] ?? null, $params['modx_category'], - $params['legacy_names'], + $params['legacy_names'] ?? null, array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, - (int)$params['disabled'] + (int)($params['disabled'] ?? 0) ); } } @@ -163,8 +163,8 @@ $params['name'], $description, "$modulePath/{$params['filename']}", - $params['properties'], - $params['guid'], + $params['properties'] ?? null, + $params['guid'] ?? null, (int)$params['shareparams'], $params['modx_category'], array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false @@ -275,6 +275,7 @@ function clean_up($sqlParser) { echo "An error occurred while executing a query: ".mysqli_error($sqlParser->conn); } else { + $ids = []; while($r = mysqli_fetch_assoc($ds)) $ids[]=$r["id"]; if(count($ids)>0) { mysqli_query($sqlParser->conn,"UPDATE `".$sqlParser->prefix."site_content` SET privatemgr = 1 WHERE id IN (".implode(", ",$ids).")"); diff --git a/install/setup.sql b/install/setup.sql index 47a1a455e8..ceb42b87e3 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -1,1187 +1,1188 @@ -# EVO Database Script for New/Upgrade Installations -# EVO was created By Raymond Irving - Nov 2004 -# -# Each sql command is separated by double lines \n\n - - -DROP TABLE IF EXISTS `{PREFIX}active_users`; - -CREATE TABLE `{PREFIX}active_users` ( - `sid` varchar(32) NOT NULL default '', - `internalKey` int(9) NOT NULL default '0', - `username` varchar(50) NOT NULL default '', - `lasthit` int(20) NOT NULL default '0', - `action` varchar(10) NOT NULL default '', - `id` int(10) default NULL, - PRIMARY KEY (`sid`, `username`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about last user action.'; - -DROP TABLE IF EXISTS `{PREFIX}active_user_locks`; - -CREATE TABLE `{PREFIX}active_user_locks` ( - `id` int(10) NOT NULL AUTO_INCREMENT, - `sid` varchar(32) NOT NULL default '', - `internalKey` int(9) NOT NULL default '0', - `elementType` int(1) NOT NULL default '0', - `elementId` int(10) NOT NULL default '0', - `lasthit` int(20) NOT NULL default '0', - PRIMARY KEY(`id`), - UNIQUE INDEX ix_element_id (`elementType`,`elementId`,`sid`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about locked elements.'; - -DROP TABLE IF EXISTS `{PREFIX}active_user_sessions`; - -CREATE TABLE `{PREFIX}active_user_sessions` ( - `sid` varchar(32) NOT NULL default '', - `internalKey` int(9) NOT NULL default '0', - `lasthit` int(20) NOT NULL default '0', - `ip` varchar(50) NOT NULL default '', - PRIMARY KEY(`sid`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about valid user sessions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}categories` ( - `id` integer NOT NULL AUTO_INCREMENT, - `category` varchar(45) NOT NULL DEFAULT '', - `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY(`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Categories to be used snippets,tv,chunks, etc'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}document_groups` ( - `id` int(10) NOT NULL auto_increment, - `document_group` int(10) NOT NULL default '0', - `document` int(10) NOT NULL default '0', - PRIMARY KEY (`id`), - KEY `document` (`document`), - KEY `document_group` (`document_group`), - UNIQUE INDEX `ix_dg_id` (`document_group`,`document`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}documentgroup_names` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(245) NOT NULL default '', - `private_memgroup` tinyint DEFAULT 0 COMMENT 'determine whether the document group is private to manager users', - `private_webgroup` tinyint DEFAULT 0 COMMENT 'determines whether the document is private to web users', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}event_log` ( - `id` integer NOT NULL AUTO_INCREMENT, - `eventid` integer DEFAULT 0, - `createdon` integer NOT NULL DEFAULT 0, - `type` tinyint NOT NULL DEFAULT 1 COMMENT '1- information, 2 - warning, 3- error', - `user` integer NOT NULL DEFAULT 0 COMMENT 'link to user table', - `usertype` tinyint NOT NULL DEFAULT 0 COMMENT '0 - manager, 1 - web', - `source` varchar(50) NOT NULL DEFAULT '', - `description` text, - PRIMARY KEY(`id`), - KEY `user`(`user`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Stores event and error logs'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}manager_log` ( - `id` int(10) NOT NULL auto_increment, - `timestamp` int(20) NOT NULL default '0', - `internalKey` int(10) NOT NULL default '0', - `username` varchar(255) default NULL, - `action` int(10) NOT NULL default '0', - `itemid` varchar(10) default '0', - `itemname` varchar(255) default NULL, - `message` varchar(255) NOT NULL default '', - `ip` varchar(46), - `useragent` varchar(255), - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains a record of user interaction.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}manager_users` ( - `id` int(10) NOT NULL auto_increment, - `username` varchar(100) NOT NULL default '', - `password` varchar(100) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains login information for backend users.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}member_groups` ( - `id` int(10) NOT NULL auto_increment, - `user_group` int(10) NOT NULL default '0', - `member` int(10) NOT NULL default '0', - PRIMARY KEY (`id`), - UNIQUE INDEX `ix_group_member` (`user_group`,`member`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}membergroup_access` ( - `id` int(10) NOT NULL auto_increment, - `membergroup` int(10) NOT NULL default '0', - `documentgroup` int(10) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}membergroup_names` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(245) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_content` ( - `id` int(10) NOT NULL auto_increment, - `type` varchar(20) NOT NULL default 'document', - `contentType` varchar(50) NOT NULL default 'text/html', - `pagetitle` varchar(255) NOT NULL default '', - `longtitle` varchar(255) NOT NULL default '', - `description` varchar(255) NOT NULL default '', - `alias` varchar(245) default '', - `link_attributes` varchar(255) NOT NULL default '' COMMENT 'Link attriubtes', - `published` int(1) NOT NULL default '0', - `pub_date` int(20) NOT NULL default '0', - `unpub_date` int(20) NOT NULL default '0', - `parent` int(10) NOT NULL default '0', - `isfolder` int(1) NOT NULL default '0', - `introtext` text COMMENT 'Used to provide quick summary of the document', - `content` mediumtext, - `richtext` tinyint(1) NOT NULL default '1', - `template` int(10) NOT NULL default '0', - `menuindex` int(10) NOT NULL default '0', - `searchable` int(1) NOT NULL default '1', - `cacheable` int(1) NOT NULL default '1', - `createdby` int(10) NOT NULL default '0', - `createdon` int(20) NOT NULL default '0', - `editedby` int(10) NOT NULL default '0', - `editedon` int(20) NOT NULL default '0', - `deleted` int(1) NOT NULL default '0', - `deletedon` int(20) NOT NULL default '0', - `deletedby` int(10) NOT NULL default '0', - `publishedon` int(20) NOT NULL default '0' COMMENT 'Date the document was published', - `publishedby` int(10) NOT NULL default '0' COMMENT 'ID of user who published the document', - `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title', - `donthit` tinyint(1) NOT NULL default '0' COMMENT 'Disable page hit count', - `privateweb` tinyint(1) NOT NULL default '0' COMMENT 'Private web document', - `privatemgr` tinyint(1) NOT NULL default '0' COMMENT 'Private manager document', - `content_dispo` tinyint(1) NOT NULL default '0' COMMENT '0-inline, 1-attachment', - `hidemenu` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Hide document from menu', - `alias_visible` INT(2) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `id` (`id`), - KEY `parent` (`parent`), - KEY aliasidx (`alias`), - KEY typeidx (`type`), - FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site document tree.'; - - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_htmlsnippets` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - `description` varchar(255) NOT NULL default 'Chunk', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `editor_name` VARCHAR(50) NOT NULL DEFAULT 'none', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `cache_type` tinyint(1) NOT NULL default '0' COMMENT 'Cache option', - `snippet` mediumtext, - `locked` tinyint(4) NOT NULL default '0', - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the snippet', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site chunks.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_modules` ( - `id` integer NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL DEFAULT '', - `description` varchar(255) NOT NULL DEFAULT '0', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `disabled` tinyint NOT NULL DEFAULT '0', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `wrap` tinyint NOT NULL DEFAULT '0', - `locked` tinyint NOT NULL default '0', - `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon', - `enable_resource` tinyint NOT NULL DEFAULT '0' COMMENT 'enables the resource file feature', - `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file', - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier', - `enable_sharedparams` tinyint NOT NULL DEFAULT '0', - `properties` text, - `modulecode` mediumtext COMMENT 'module boot up code', - PRIMARY KEY(`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Modules'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_module_depobj` ( - `id` integer NOT NULL AUTO_INCREMENT, - `module` integer NOT NULL DEFAULT 0, - `resource` integer NOT NULL DEFAULT 0, - `type` integer(2) NOT NULL DEFAULT 0 COMMENT '10-chunks, 20-docs, 30-plugins, 40-snips, 50-tpls, 60-tvs', - PRIMARY KEY(`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Module Dependencies'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_module_access` ( - `id` integer UNSIGNED NOT NULL AUTO_INCREMENT, - `module` integer NOT NULL DEFAULT 0, - `usergroup` integer NOT NULL DEFAULT 0, - PRIMARY KEY(`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Module users group access permission'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugins` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(50) NOT NULL default '', - `description` varchar(255) NOT NULL default 'Plugin', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `cache_type` tinyint(1) NOT NULL default '0' COMMENT 'Cache option', - `plugincode` mediumtext, - `locked` tinyint(4) NOT NULL default '0', - `properties` text COMMENT 'Default Properties', - `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the plugin', - `moduleguid` varchar(32) NOT NULL default '' COMMENT 'GUID of module from which to import shared parameters', - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site plugins.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugin_events` ( - `pluginid` INT(10) NOT NULL, - `evtid` INT(10) NOT NULL default 0, - `priority` INT(10) NOT NULL default 0 COMMENT 'determines plugin run order', - PRIMARY KEY ( `pluginid` , `evtid` ) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Links to system events'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_snippets` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(50) NOT NULL default '', - `description` varchar(255) NOT NULL default 'Snippet', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Cache option', - `snippet` mediumtext, - `locked` tinyint(4) NOT NULL default '0', - `properties` text COMMENT 'Default Properties', - `moduleguid` varchar(32) NOT NULL default '' COMMENT 'GUID of module from which to import shared parameters', - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the snippet', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site snippets.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_templates` ( - `id` int(10) NOT NULL auto_increment, - `templatename` varchar(100) NOT NULL default '', - `description` varchar(255) NOT NULL default 'Template', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file', - `template_type` integer NOT NULL DEFAULT '0' COMMENT '0-page,1-content', - `content` mediumtext, - `locked` tinyint(4) NOT NULL default '0', - `selectable` tinyint(4) NOT NULL default '1', - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site templates.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}system_eventnames` ( - `id` INT(10) NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL default '', - `service` tinyint NOT NULL default '0' COMMENT 'System Service number', - `groupname` varchar(20) NOT NULL default '', - PRIMARY KEY(`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='System Event Names.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}system_settings` ( - `setting_name` varchar(50) NOT NULL default '', - `setting_value` text, - PRIMARY KEY (`setting_name`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains Content Manager settings.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_access` ( - `id` int(10) NOT NULL auto_increment, - `tmplvarid` int(10) NOT NULL default '0', - `documentgroup` int(10) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for template variable access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_contentvalues` ( - `id` int(11) NOT NULL auto_increment, - `tmplvarid` int(10) NOT NULL default '0' COMMENT 'Template Variable id', - `contentid` int(10) NOT NULL default '0' COMMENT 'Site Content Id', - `value` mediumtext, - PRIMARY KEY (id), - KEY idx_tmplvarid (tmplvarid), - KEY idx_id (contentid), - FULLTEXT KEY `value_ft_idx` (`value`), - UNIQUE INDEX `ix_tvid_contentid` (`tmplvarid`,`contentid`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables Content Values Link Table'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_templates` ( - `tmplvarid` int(10) NOT NULL default '0' COMMENT 'Template Variable id', - `templateid` int(11) NOT NULL default '0', - `rank` int(11) NOT NULL default '0', - PRIMARY KEY (`tmplvarid`, `templateid`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables Templates Link Table'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvars` ( - `id` INT(11) NOT NULL auto_increment, - `type` varchar(50) NOT NULL default '', - `name` varchar(100) NOT NULL default '', - `caption` varchar(80) NOT NULL default '', - `description` varchar(255) NOT NULL default '', - `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', - `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', - `locked` tinyint(4) NOT NULL default '0', - `elements` text, - `rank` int(11) NOT NULL default '0', - `display` varchar(20) NOT NULL default '' COMMENT 'Display Control', - `display_params` text COMMENT 'Display Control Properties', - `default_text` text, - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - PRIMARY KEY (id), - KEY `indx_rank`(`rank`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}user_attributes` ( - `id` int(10) NOT NULL auto_increment, - `internalKey` int(10) NOT NULL default '0', - `fullname` varchar(100) NOT NULL default '', - `role` int(10) NOT NULL default '0', - `email` varchar(100) NOT NULL default '', - `phone` varchar(100) NOT NULL default '', - `mobilephone` varchar(100) NOT NULL default '', - `blocked` int(1) NOT NULL default '0', - `blockeduntil` int(11) NOT NULL default '0', - `blockedafter` int(11) NOT NULL default '0', - `logincount` int(11) NOT NULL default '0', - `lastlogin` int(11) NOT NULL default '0', - `thislogin` int(11) NOT NULL default '0', - `failedlogincount` int(10) NOT NULL default '0', - `sessionid` varchar(100) NOT NULL default '', - `dob` int(10) NOT NULL DEFAULT '0', - `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female', - `country` varchar(5) NOT NULL default '', - `street` varchar(255) NOT NULL DEFAULT '', - `city` varchar(255) NOT NULL DEFAULT '', - `state` varchar(25) NOT NULL default '', - `zip` varchar(25) NOT NULL default '', - `fax` varchar(100) NOT NULL default '', - `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', - `comment` text, - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `userid` (`internalKey`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information about the backend users.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}user_messages` ( - `id` int(10) NOT NULL auto_increment, - `type` varchar(15) NOT NULL default '', - `subject` varchar(60) NOT NULL default '', - `message` text, - `sender` int(10) NOT NULL default '0', - `recipient` int(10) NOT NULL default '0', - `private` tinyint(4) NOT NULL default '0', - `postdate` int(20) NOT NULL default '0', - `messageread` tinyint(1) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains messages for the Content Manager messaging system.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}user_roles` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(50) NOT NULL default '', - `description` varchar(255) NOT NULL default '', - `frames` int(1) NOT NULL default '0', - `home` int(1) NOT NULL default '0', - `view_document` int(1) NOT NULL default '0', - `new_document` int(1) NOT NULL default '0', - `save_document` int(1) NOT NULL default '0', - `publish_document` int(1) NOT NULL default '0', - `delete_document` int(1) NOT NULL default '0', - `empty_trash` int(1) NOT NULL default '0', - `action_ok` int(1) NOT NULL default '0', - `logout` int(1) NOT NULL default '0', - `help` int(1) NOT NULL default '0', - `messages` int(1) NOT NULL default '0', - `new_user` int(1) NOT NULL default '0', - `edit_user` int(1) NOT NULL default '0', - `logs` int(1) NOT NULL default '0', - `edit_parser` int(1) NOT NULL default '0', - `save_parser` int(1) NOT NULL default '0', - `edit_template` int(1) NOT NULL default '0', - `settings` int(1) NOT NULL default '0', - `credits` int(1) NOT NULL default '0', - `new_template` int(1) NOT NULL default '0', - `save_template` int(1) NOT NULL default '0', - `delete_template` int(1) NOT NULL default '0', - `edit_snippet` int(1) NOT NULL default '0', - `new_snippet` int(1) NOT NULL default '0', - `save_snippet` int(1) NOT NULL default '0', - `delete_snippet` int(1) NOT NULL default '0', - `edit_chunk` int(1) NOT NULL default '0', - `new_chunk` int(1) NOT NULL default '0', - `save_chunk` int(1) NOT NULL default '0', - `delete_chunk` int(1) NOT NULL default '0', - `empty_cache` int(1) NOT NULL default '0', - `edit_document` int(1) NOT NULL default '0', - `change_password` int(1) NOT NULL default '0', - `error_dialog` int(1) NOT NULL default '0', - `about` int(1) NOT NULL default '0', - `category_manager` int(1) NOT NULL default '0', - `file_manager` int(1) NOT NULL default '0', - `assets_files` int(1) NOT NULL default '0', - `assets_images` int(1) NOT NULL default '0', - `save_user` int(1) NOT NULL default '0', - `delete_user` int(1) NOT NULL default '0', - `save_password` int(11) NOT NULL default '0', - `edit_role` int(1) NOT NULL default '0', - `save_role` int(1) NOT NULL default '0', - `delete_role` int(1) NOT NULL default '0', - `new_role` int(1) NOT NULL default '0', - `access_permissions` int(1) NOT NULL default '0', - `bk_manager` int(1) NOT NULL DEFAULT 0, - `new_plugin` int(1) NOT NULL DEFAULT 0, - `edit_plugin` int(1) NOT NULL DEFAULT 0, - `save_plugin` int(1) NOT NULL DEFAULT 0, - `delete_plugin` int(1) NOT NULL DEFAULT 0, - `new_module` int(1) NOT NULL DEFAULT 0, - `edit_module` int(1) NOT NULL DEFAULT 0, - `save_module` int(1) NOT NULL DEFAULT 0, - `delete_module` int(1) NOT NULL DEFAULT 0, - `exec_module` int(1) NOT NULL DEFAULT 0, - `view_eventlog` int(1) NOT NULL DEFAULT 0, - `delete_eventlog` int(1) NOT NULL DEFAULT 0, - `new_web_user` int(1) NOT NULL default '0', - `edit_web_user` int(1) NOT NULL default '0', - `save_web_user` int(1) NOT NULL default '0', - `delete_web_user` int(1) NOT NULL default '0', - `web_access_permissions` int(1) NOT NULL default '0', - `view_unpublished` int(1) NOT NULL default '0', - `import_static` int(1) NOT NULL default '0', - `export_static` int(1) NOT NULL default '0', - `remove_locks` int(1) NOT NULL default '0', - `display_locks` int(1) NOT NULL default '0', - `change_resourcetype` int(1) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information describing the user roles.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}user_settings` ( - `user` integer NOT NULL, - `setting_name` varchar(50) NOT NULL default '', - `setting_value` text, - PRIMARY KEY ( `user` , `setting_name` ), - KEY `setting_name` (`setting_name`), - KEY `user` (`user`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains backend user settings.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}web_groups` ( - `id` int(10) NOT NULL auto_increment, - `webgroup` int(10) NOT NULL default '0', - `webuser` int(10) NOT NULL default '0', - PRIMARY KEY (`id`), - UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}webgroup_access` ( - `id` int(10) NOT NULL auto_increment, - `webgroup` int(10) NOT NULL default '0', - `documentgroup` int(10) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}webgroup_names` ( - `id` int(10) NOT NULL auto_increment, - `name` varchar(245) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_attributes` ( - `id` int(10) NOT NULL auto_increment, - `internalKey` int(10) NOT NULL default '0', - `fullname` varchar(100) NOT NULL default '', - `role` int(10) NOT NULL default '0', - `email` varchar(100) NOT NULL default '', - `phone` varchar(100) NOT NULL default '', - `mobilephone` varchar(100) NOT NULL default '', - `blocked` int(1) NOT NULL default '0', - `blockeduntil` int(11) NOT NULL default '0', - `blockedafter` int(11) NOT NULL default '0', - `logincount` int(11) NOT NULL default '0', - `lastlogin` int(11) NOT NULL default '0', - `thislogin` int(11) NOT NULL default '0', - `failedlogincount` int(10) NOT NULL default '0', - `sessionid` varchar(100) NOT NULL default '', - `dob` int(10) NOT NULL DEFAULT '0', - `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female', - `country` varchar(25) NOT NULL default '', - `street` varchar(255) NOT NULL DEFAULT '', - `city` varchar(255) NOT NULL DEFAULT '', - `state` varchar(25) NOT NULL default '', - `zip` varchar(25) NOT NULL default '', - `fax` varchar(100) NOT NULL default '', - `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', - `comment` text, - `createdon` integer NOT NULL DEFAULT '0', - `editedon` integer NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `userid` (`internalKey`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information for web users.'; - -CREATE TABLE IF NOT EXISTS `{PREFIX}web_users` ( - `id` int(10) NOT NULL auto_increment, - `username` varchar(100) NOT NULL default '', - `password` varchar(100) NOT NULL default '', - `cachepwd` varchar(100) NOT NULL default '' COMMENT 'Store new unconfirmed password', - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=MyISAM {TABLEENCODING}; - -CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_settings` ( - `webuser` integer NOT NULL, - `setting_name` varchar(50) NOT NULL default '', - `setting_value` text, - PRIMARY KEY ( `webuser` , `setting_name` ), - KEY `setting_name` (`setting_name`), - KEY `webuserid` (`webuser`) -) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains web user settings.'; - - -# upgrade-able[[ - This block of code will be executed during upgrades - -# For backward compatibilty with early versions -#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -ALTER TABLE `{PREFIX}site_content` - ADD COLUMN `publishedon` int(20) NOT NULL DEFAULT '0' COMMENT 'Date the document was published' AFTER `deletedby`; - -ALTER TABLE `{PREFIX}site_content` - ADD COLUMN `publishedby` int(10) NOT NULL DEFAULT '0' COMMENT 'ID of user who published the document' AFTER `publishedon`; - -ALTER TABLE `{PREFIX}site_content` - ADD COLUMN `link_attributes` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link attriubtes' AFTER `alias`; - -ALTER TABLE `{PREFIX}site_content` - ADD COLUMN `alias_visible` INT(2) NOT NULL DEFAULT '1' COMMENT 'Hide document from alias path'; - -ALTER TABLE `{PREFIX}site_htmlsnippets` - ADD COLUMN `editor_name` VARCHAR(50) NOT NULL DEFAULT 'none' AFTER `editor_type`; - -ALTER TABLE `{PREFIX}site_htmlsnippets` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_htmlsnippets` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_htmlsnippets` - ADD COLUMN `disabled` tinyint NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_plugin_events` - ADD COLUMN `priority` INT(10) NOT NULL default '0' COMMENT 'determines the run order of the plugin' AFTER `evtid`; - -ALTER TABLE `{PREFIX}site_templates` - ADD COLUMN `selectable` TINYINT(4) NOT NULL DEFAULT '1' AFTER `locked`; - -ALTER TABLE `{PREFIX}site_templates` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_templates` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` - ADD COLUMN `rank` integer(11) NOT NULL DEFAULT '0' AFTER `templateid`; - -ALTER TABLE `{PREFIX}site_tmplvars` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_tmplvars` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`; - -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; - -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `verified` int(1) NOT NULL DEFAULT 1; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `edit_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `delete_snippet`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `new_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `edit_chunk`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `save_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `new_chunk`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `delete_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `save_chunk`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `empty_trash` INT(1) NOT NULL DEFAULT '0' AFTER `delete_document`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `view_unpublished` INT(1) NOT NULL DEFAULT '0' AFTER `web_access_permissions`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `import_static` INT(1) NOT NULL DEFAULT '0' AFTER `view_unpublished`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `export_static` INT(1) NOT NULL DEFAULT '0' AFTER `import_static`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `remove_locks` INT(1) NOT NULL DEFAULT '0' AFTER `export_static`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `display_locks` INT(1) NOT NULL DEFAULT '0' AFTER `remove_locks`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `publish_document` INT(1) NOT NULL DEFAULT '0' AFTER `save_document`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `change_resourcetype` INT(1) NOT NULL DEFAULT '0' AFTER `remove_locks`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `assets_images` INT(1) NOT NULL DEFAULT '1' AFTER `file_manager`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `assets_files` INT(1) NOT NULL DEFAULT '1' AFTER `assets_images`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `category_manager` INT(1) NOT NULL DEFAULT '0' AFTER `about`; - -ALTER TABLE `{PREFIX}categories` - ADD COLUMN `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `category`; - -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`; - -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; - -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `verified` int(1) NOT NULL DEFAULT 0; - -ALTER TABLE `{PREFIX}site_snippets` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_snippets` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_snippets` - ADD COLUMN `disabled` tinyint NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_plugins` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_plugins` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_templates` - ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_templates` - ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; - -# Set the private manager group flag - -UPDATE {PREFIX}documentgroup_names AS dgn - LEFT JOIN {PREFIX}membergroup_access AS mga ON mga.documentgroup = dgn.id - LEFT JOIN {PREFIX}webgroup_access AS wga ON wga.documentgroup = dgn.id - SET dgn.private_memgroup = (mga.membergroup IS NOT NULL), - dgn.private_webgroup = (wga.webgroup IS NOT NULL); - - -UPDATE `{PREFIX}site_plugins` SET `disabled`='1' WHERE `name` IN ('Bottom Button Bar'); - -UPDATE `{PREFIX}site_plugins` SET `disabled`='1' WHERE `name` IN ('Inherit Parent Template'); - -UPDATE `{PREFIX}system_settings` SET `setting_value` = '0' WHERE `setting_name` = 'validate_referer' AND `setting_value` = '00'; - -# start related to #EVO-1321 - -UPDATE `{PREFIX}site_content` SET `type`='reference', `contentType`='text/html' WHERE `type`='' AND `content` REGEXP '^https?://([-\w\.]+)+(:\d+)?/?'; - -UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/xml' WHERE `type`='' AND `alias` REGEXP '\.(rss|xml)$'; - -UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/javascript' WHERE `type`='' AND `alias` REGEXP '\.js$'; - -UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/css' WHERE `type`='' AND `alias` REGEXP '\.css$'; - -UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/html' WHERE `type`=''; - -ALTER TABLE `{PREFIX}documentgroup_names` - MODIFY COLUMN `name` varchar(245) NOT NULL default ''; - -ALTER TABLE `{PREFIX}event_log` - MODIFY COLUMN `source` varchar(50) NOT NULL DEFAULT '', - MODIFY COLUMN `description` text; - -ALTER TABLE `{PREFIX}categories` - MODIFY COLUMN `category` varchar(45) NOT NULL DEFAULT ''; - -ALTER TABLE `{PREFIX}manager_users` - MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT ''; - -ALTER TABLE `{PREFIX}membergroup_names` - MODIFY COLUMN `name` varchar(245) NOT NULL default ''; - -ALTER TABLE `{PREFIX}site_content` - MODIFY COLUMN `pagetitle` varchar(255) NOT NULL default '', - MODIFY COLUMN `alias` varchar(245) default '', - MODIFY COLUMN `introtext` text COMMENT 'Used to provide quick summary of the document', - MODIFY COLUMN `content` mediumtext, - MODIFY COLUMN `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title', - MODIFY COLUMN `template` int(10) NOT NULL default '0'; - -ALTER TABLE `{PREFIX}site_htmlsnippets` - MODIFY COLUMN `snippet` mediumtext; - -ALTER TABLE `{PREFIX}site_module_access` - MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', - MODIFY COLUMN `usergroup` int(11) NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_module_depobj` - MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', - MODIFY COLUMN `resource` int(11) NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_modules` - MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', - MODIFY COLUMN `disabled` tinyint(4) NOT NULL DEFAULT '0', - MODIFY COLUMN `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon', - MODIFY COLUMN `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file', - MODIFY COLUMN `createdon` int(11) NOT NULL DEFAULT '0', - MODIFY COLUMN `editedon` int(11) NOT NULL DEFAULT '0', - MODIFY COLUMN `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier', - MODIFY COLUMN `properties` text, - MODIFY COLUMN `modulecode` mediumtext COMMENT 'module boot up code'; - -ALTER TABLE `{PREFIX}site_plugin_events` - MODIFY COLUMN `evtid` int(10) NOT NULL DEFAULT '0'; - -ALTER TABLE `{PREFIX}site_plugins` - MODIFY COLUMN `properties` text COMMENT 'Default Properties', - MODIFY COLUMN `plugincode` mediumtext, - MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; - -ALTER TABLE `{PREFIX}site_snippets` - MODIFY COLUMN `properties` text COMMENT 'Default Properties', - MODIFY COLUMN `snippet` mediumtext, - MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; - -ALTER TABLE `{PREFIX}site_templates` - MODIFY COLUMN `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file', - MODIFY COLUMN `content` mediumtext; - -ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` - MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id', - MODIFY COLUMN `value` mediumtext; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` - MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id'; - -ALTER TABLE `{PREFIX}site_tmplvars` - MODIFY COLUMN `name` varchar(50) NOT NULL default '', - MODIFY COLUMN `type` varchar(50) NOT NULL default '', - MODIFY COLUMN `elements` text, - MODIFY COLUMN `display` varchar(20) NOT NULL DEFAULT '' COMMENT 'Display Control', - MODIFY COLUMN `display_params` text COMMENT 'Display Control Properties', - MODIFY COLUMN `default_text` text; - -ALTER TABLE `{PREFIX}system_eventnames` DROP INDEX `name`; - -ALTER TABLE `{PREFIX}system_eventnames` - MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', - MODIFY COLUMN `service` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'System Service number'; - -DELETE FROM `{PREFIX}system_eventnames` USING `{PREFIX}system_eventnames`, `{PREFIX}system_eventnames` `e1` WHERE `{PREFIX}system_eventnames`.`id` > `e1`.`id` AND `{PREFIX}system_eventnames`.`name` = `e1`.`name`; - -ALTER TABLE `{PREFIX}system_settings` MODIFY COLUMN `setting_value` text; - -ALTER TABLE `{PREFIX}user_attributes` - MODIFY COLUMN `country` varchar(5) NOT NULL DEFAULT '', - MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', - MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', - MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', - MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo', - MODIFY COLUMN `comment` text; - -ALTER TABLE `{PREFIX}user_messages` MODIFY COLUMN `message` text; - -ALTER TABLE `{PREFIX}user_settings` MODIFY COLUMN `setting_value` text; - -ALTER TABLE `{PREFIX}web_users` - MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT '', - MODIFY COLUMN `cachepwd` varchar(100) NOT NULL DEFAULT '' COMMENT 'Store new unconfirmed password' AFTER `password`; - -ALTER TABLE `{PREFIX}web_user_settings` MODIFY COLUMN `setting_value` text; - -ALTER TABLE `{PREFIX}web_user_attributes` - MODIFY COLUMN `country` varchar(25) NOT NULL DEFAULT '', - MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', - MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', - MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', - MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo', - MODIFY COLUMN `comment` text; - -ALTER TABLE `{PREFIX}webgroup_names` - MODIFY COLUMN `name` varchar(245) NOT NULL default ''; - -ALTER TABLE `{PREFIX}site_content` ADD INDEX `typeidx` (`type`); - -ALTER TABLE `{PREFIX}system_settings` DROP PRIMARY KEY; - -ALTER TABLE `{PREFIX}system_settings` DROP INDEX `setting_name`; - -ALTER TABLE `{PREFIX}system_settings` ADD PRIMARY KEY (`setting_name`); - -ALTER TABLE `{PREFIX}system_eventnames` ADD UNIQUE INDEX `name` (`name`); - -ALTER TABLE `{PREFIX}user_settings` DROP PRIMARY KEY; - -ALTER TABLE `{PREFIX}user_settings` ADD PRIMARY KEY (`user`, `setting_name`); - -ALTER TABLE `{PREFIX}web_user_settings` DROP PRIMARY KEY; - -ALTER TABLE `{PREFIX}web_user_settings` ADD PRIMARY KEY (`webuser`, `setting_name`); - -ALTER TABLE `{PREFIX}site_plugin_events` DROP PRIMARY KEY; - -ALTER TABLE `{PREFIX}site_plugin_events` ADD PRIMARY KEY (`pluginid`, `evtid`); - -ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` ADD FULLTEXT `value_ft_idx` (`value`); - -ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` ADD UNIQUE INDEX `ix_tvid_contentid` (`tmplvarid`,`contentid`); - -ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP INDEX `idx_tmplvarid`; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP INDEX `idx_templateid`; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP PRIMARY KEY; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` ADD PRIMARY KEY (`tmplvarid`, `templateid`); - -ALTER TABLE `{PREFIX}member_groups` ADD UNIQUE INDEX `ix_group_member` (`user_group`,`member`); - -ALTER TABLE `{PREFIX}web_groups` ADD UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`); - -ALTER TABLE `{PREFIX}document_groups` ADD UNIQUE INDEX `ix_dg_id` (`document_group`,`document`); - -ALTER TABLE `{PREFIX}manager_log` - ADD COLUMN `ip` varchar(46); - -ALTER TABLE `{PREFIX}manager_log` - ADD COLUMN `useragent` varchar(255); - -ALTER TABLE `{PREFIX}manager_log` - CHANGE COLUMN `ip` `ip` VARCHAR(46) NULL DEFAULT NULL AFTER `message`; - -ALTER TABLE `{PREFIX}site_templates` ADD COLUMN `templatealias` VARCHAR(255) NULL DEFAULT NULL AFTER `templatename`; -# ]]upgrade-able - - -# Insert / Replace system records -#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - - -# non-upgrade-able[[ - This block of code will not be executed during upgrades - - -# Default Site Template - - -REPLACE INTO `{PREFIX}site_templates` -(id, templatename, description, editor_type, category, icon, template_type, content, locked, selectable) VALUES ('3','Minimal Template','Default minimal empty template (content returned only)','0','0','','0','[*content*]','0','1'); - - -# Default Site Documents - - -REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','Evolution CMS Install Success','Welcome to the EVO Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed Evolution CMS.

    \r\n\r\n

    Getting Help

    \r\n

    The EVO Community provides a great starting point to learn all things Evolution CMS, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to EVO!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,1); - - -REPLACE INTO `{PREFIX}manager_users` -(id, username, password)VALUES -(1, '{ADMIN}', MD5('{ADMINPASS}')); - -REPLACE INTO `{PREFIX}user_attributes` -(id, internalKey, fullname, role, email, phone, mobilephone, blocked, blockeduntil, blockedafter, logincount, lastlogin, thislogin, failedlogincount, sessionid, dob, gender, country, street, city, state, zip, fax, photo, comment, verified) VALUES -(1, 1, 'Admin', 1, '{ADMINEMAIL}', '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '', '', '', '', 1); - - -REPLACE INTO `{PREFIX}user_roles` -(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES -(2,'Editor','Limited to managing content',1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0), -(3,'Publisher','Editor with expanded permissions including manage users\, update Elements and site settings',1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,0); - - -# ]]non-upgrade-able - - -# Default Site Settings - - -INSERT IGNORE INTO `{PREFIX}system_settings` -(setting_name, setting_value) VALUES -('settings_version',''), -('manager_theme','default'), -('server_offset_time','0'), -('manager_language','{MANAGERLANGUAGE}'), -('modx_charset','UTF-8'), -('site_name','My Evolution Site'), -('site_start','1'), -('error_page','1'), -('unauthorized_page','1'), -('site_status','1'), -('auto_template_logic','{AUTOTEMPLATELOGIC}'), -('default_template','3'), -('old_template',''), -('publish_default','1'), -('friendly_urls','1'), -('friendly_alias_urls','1'), -('use_alias_path','1'), -('cache_type','2'), -('failed_login_attempts','3'), -('blocked_minutes','60'), -('use_captcha','0'), -('emailsender','{ADMINEMAIL}'), -('use_editor','1'), -('use_browser','1'), -('fe_editor_lang','{MANAGERLANGUAGE}'), -('fck_editor_toolbar','standard'), -('fck_editor_autolang','0'), -('editor_css_path',''), -('editor_css_selectors',''), -('upload_maxsize','10485760'), -('manager_layout','4'), -('auto_menuindex','1'), -('session.cookie.lifetime','604800'), -('mail_check_timeperiod','600'), -('manager_direction','ltr'), -('xhtml_urls','0'), -('automatic_alias','1'), -('datetime_format','dd-mm-YYYY'), -('warning_visibility', '0'), -('remember_last_tab', '1'), -('enable_bindings', '1'), -('seostrict', '1'), -('number_of_results','30'), -('theme_refresher',''), -('show_picker', '0'), -('show_newresource_btn', '0'), -('show_fullscreen_btn', '0'); - -REPLACE INTO `{PREFIX}user_roles` -(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES -(1, 'Administrator', 'Site administrators have full access to all functions',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); - - -# 1 - "Parser Service Events", 2 - "Manager Access Events", 3 - "Web Access Service Events", 4 - "Cache Service Events", 5 - "Template Service Events", 6 - Custom Events - -INSERT IGNORE INTO `{PREFIX}system_eventnames` -(name,service,groupname) VALUES -('OnDocPublished','5',''), -('OnDocUnPublished','5',''), -('OnWebPagePrerender','5',''), -('OnWebLogin','3',''), -('OnBeforeWebLogout','3',''), -('OnWebLogout','3',''), -('OnWebSaveUser','3',''), -('OnWebDeleteUser','3',''), -('OnWebChangePassword','3',''), -('OnWebCreateGroup','3',''), -('OnManagerLogin','2',''), -('OnBeforeManagerLogout','2',''), -('OnManagerLogout','2',''), -('OnManagerSaveUser','2',''), -('OnManagerDeleteUser','2',''), -('OnManagerChangePassword','2',''), -('OnManagerCreateGroup','2',''), -('OnBeforeCacheUpdate','4',''), -('OnCacheUpdate','4',''), -('OnMakePageCacheKey','4',''), -('OnLoadWebPageCache','4',''), -('OnBeforeSaveWebPageCache','4',''), -('OnChunkFormPrerender','1','Chunks'), -('OnChunkFormRender','1','Chunks'), -('OnBeforeChunkFormSave','1','Chunks'), -('OnChunkFormSave','1','Chunks'), -('OnBeforeChunkFormDelete','1','Chunks'), -('OnChunkFormDelete','1','Chunks'), -('OnDocFormPrerender','1','Documents'), -('OnDocFormRender','1','Documents'), -('OnBeforeDocFormSave','1','Documents'), -('OnDocFormSave','1','Documents'), -('OnBeforeDocFormDelete','1','Documents'), -('OnDocFormDelete','1','Documents'), -('OnDocFormUnDelete','1','Documents'), -('onBeforeMoveDocument','1','Documents'), -('onAfterMoveDocument','1','Documents'), -('OnPluginFormPrerender','1','Plugins'), -('OnPluginFormRender','1','Plugins'), -('OnBeforePluginFormSave','1','Plugins'), -('OnPluginFormSave','1','Plugins'), -('OnBeforePluginFormDelete','1','Plugins'), -('OnPluginFormDelete','1','Plugins'), -('OnSnipFormPrerender','1','Snippets'), -('OnSnipFormRender','1','Snippets'), -('OnBeforeSnipFormSave','1','Snippets'), -('OnSnipFormSave','1','Snippets'), -('OnBeforeSnipFormDelete','1','Snippets'), -('OnSnipFormDelete','1','Snippets'), -('OnTempFormPrerender','1','Templates'), -('OnTempFormRender','1','Templates'), -('OnBeforeTempFormSave','1','Templates'), -('OnTempFormSave','1','Templates'), -('OnBeforeTempFormDelete','1','Templates'), -('OnTempFormDelete','1','Templates'), -('OnTVFormPrerender','1','Template Variables'), -('OnTVFormRender','1','Template Variables'), -('OnBeforeTVFormSave','1','Template Variables'), -('OnTVFormSave','1','Template Variables'), -('OnBeforeTVFormDelete','1','Template Variables'), -('OnTVFormDelete','1','Template Variables'), -('OnUserFormPrerender','1','Users'), -('OnUserFormRender','1','Users'), -('OnBeforeUserFormSave','1','Users'), -('OnUserFormSave','1','Users'), -('OnBeforeUserFormDelete','1','Users'), -('OnUserFormDelete','1','Users'), -('OnWUsrFormPrerender','1','Web Users'), -('OnWUsrFormRender','1','Web Users'), -('OnBeforeWUsrFormSave','1','Web Users'), -('OnWUsrFormSave','1','Web Users'), -('OnBeforeWUsrFormDelete','1','Web Users'), -('OnWUsrFormDelete','1','Web Users'), -('OnSiteRefresh','1',''), -('OnFileManagerUpload','1',''), -('OnModFormPrerender','1','Modules'), -('OnModFormRender','1','Modules'), -('OnBeforeModFormDelete','1','Modules'), -('OnModFormDelete','1','Modules'), -('OnBeforeModFormSave','1','Modules'), -('OnModFormSave','1','Modules'), -('OnBeforeWebLogin','3',''), -('OnWebAuthentication','3',''), -('OnBeforeManagerLogin','2',''), -('OnManagerAuthentication','2',''), -('OnSiteSettingsRender','1','System Settings'), -('OnFriendlyURLSettingsRender','1','System Settings'), -('OnUserSettingsRender','1','System Settings'), -('OnInterfaceSettingsRender','1','System Settings'), -('OnSecuritySettingsRender','1','System Settings'), -('OnFileManagerSettingsRender','1','System Settings'), -('OnMiscSettingsRender','1','System Settings'), -('OnRichTextEditorRegister','1','RichText Editor'), -('OnRichTextEditorInit','1','RichText Editor'), -('OnManagerPageInit','2',''), -('OnWebPageInit','5',''), -('OnLoadDocumentObject','5',''), -('OnBeforeLoadDocumentObject','5',''), -('OnAfterLoadDocumentObject','5',''), -('OnLoadWebDocument','5',''), -('OnParseDocument','5',''), -('OnParseProperties','5',''), -('OnBeforeParseParams','5',''), -('OnManagerLoginFormRender','2',''), -('OnWebPageComplete','5',''), -('OnLogPageHit','5',''), -('OnBeforeManagerPageInit','2',''), -('OnBeforeEmptyTrash','1','Documents'), -('OnEmptyTrash','1','Documents'), -('OnManagerLoginFormPrerender','2',''), -('OnStripAlias','1','Documents'), -('OnMakeDocUrl','5',''), -('OnBeforeLoadExtension','5',''), -('OnCreateDocGroup','1','Documents'), -('OnManagerWelcomePrerender','2',''), -('OnManagerWelcomeHome','2',''), -('OnManagerWelcomeRender','2',''), -('OnBeforeDocDuplicate','1','Documents'), -('OnDocDuplicate','1','Documents'), -('OnManagerMainFrameHeaderHTMLBlock','2',''), -('OnManagerPreFrameLoader','2',''), -('OnManagerFrameLoader','2',''), -('OnManagerTreeInit','2',''), -('OnManagerTreePrerender','2',''), -('OnManagerTreeRender','2',''), -('OnManagerNodePrerender','2',''), -('OnManagerNodeRender','2',''), -('OnManagerMenuPrerender','2',''), -('OnManagerTopPrerender','2',''), -('OnDocFormTemplateRender','1','Documents'), -('OnBeforeMinifyCss', '1', ''), -('OnPageUnauthorized','1',''), -('OnPageNotFound','1',''), -('OnFileBrowserUpload','1','File Browser Events'), -('OnBeforeFileBrowserUpload','1','File Browser Events'), -('OnFileBrowserDelete','1','File Browser Events'), -('OnBeforeFileBrowserDelete','1','File Browser Events'), -('OnFileBrowserInit','1','File Browser Events'), -('OnFileBrowserMove','1','File Browser Events'), -('OnBeforeFileBrowserMove','1','File Browser Events'), -('OnFileBrowserCopy','1','File Browser Events'), -('OnBeforeFileBrowserCopy','1','File Browser Events'), -('OnBeforeFileBrowserRename','1','File Browser Events'), -('OnFileBrowserRename','1','File Browser Events'), -('OnLogEvent','1',''); - -#Update System Tables -#::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -UPDATE `{PREFIX}user_roles` SET - bk_manager=1, - new_plugin=1, - edit_plugin=1, - save_plugin=1, - delete_plugin=1, - new_module=1, - edit_module=1, - save_module=1, - delete_module=1, - exec_module=1, - view_eventlog = 1, - delete_eventlog = 1, - new_web_user = 1, - edit_web_user = 1, - save_web_user = 1, - delete_web_user = 1, - new_chunk = 1, - edit_chunk = 1, - save_chunk = 1, - delete_chunk = 1, - web_access_permissions = 1, - view_unpublished = 1, - publish_document = 1, - import_static = 1, - export_static = 1, - empty_trash = 1, - remove_locks = 1, - display_locks = 1, - assets_images = 1, - assets_files = 1, - change_resourcetype = 1 - WHERE `id`=1; - - -# Update any invalid Manager Themes in User Settings and reset the default theme - - -UPDATE `{PREFIX}user_settings` SET - `setting_value`='default' - WHERE `setting_name`='manager_theme'; - - -REPLACE INTO `{PREFIX}system_settings` (setting_name, setting_value) VALUES ('manager_theme','default'); - -REPLACE INTO `{PREFIX}system_settings` (setting_name, setting_value) VALUES ('email_sender_method','1'); - -UPDATE `{PREFIX}system_settings` set setting_value = if(setting_value REGEXP 'application/json',setting_value,concat_ws(",",setting_value,"application/json")) WHERE setting_name='custom_contenttype'; +# EVO Database Script for New/Upgrade Installations +# EVO was created By Raymond Irving - Nov 2004 +# +# Each sql command is separated by double lines \n\n + + +DROP TABLE IF EXISTS `{PREFIX}active_users`; + +CREATE TABLE `{PREFIX}active_users` ( + `sid` varchar(32) NOT NULL default '', + `internalKey` int(9) NOT NULL default '0', + `username` varchar(50) NOT NULL default '', + `lasthit` int(20) NOT NULL default '0', + `action` varchar(10) NOT NULL default '', + `id` int(10) default NULL, + PRIMARY KEY (`sid`, `username`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about last user action.'; + +DROP TABLE IF EXISTS `{PREFIX}active_user_locks`; + +CREATE TABLE `{PREFIX}active_user_locks` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `sid` varchar(32) NOT NULL default '', + `internalKey` int(9) NOT NULL default '0', + `elementType` int(1) NOT NULL default '0', + `elementId` int(10) NOT NULL default '0', + `lasthit` int(20) NOT NULL default '0', + PRIMARY KEY(`id`), + UNIQUE INDEX ix_element_id (`elementType`,`elementId`,`sid`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about locked elements.'; + +DROP TABLE IF EXISTS `{PREFIX}active_user_sessions`; + +CREATE TABLE `{PREFIX}active_user_sessions` ( + `sid` varchar(32) NOT NULL default '', + `internalKey` int(9) NOT NULL default '0', + `lasthit` int(20) NOT NULL default '0', + `ip` varchar(50) NOT NULL default '', + PRIMARY KEY(`sid`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data about valid user sessions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}categories` ( + `id` integer NOT NULL AUTO_INCREMENT, + `category` varchar(45) NOT NULL DEFAULT '', + `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY(`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Categories to be used snippets,tv,chunks, etc'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}document_groups` ( + `id` int(10) NOT NULL auto_increment, + `document_group` int(10) NOT NULL default '0', + `document` int(10) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `document` (`document`), + KEY `document_group` (`document_group`), + UNIQUE INDEX `ix_dg_id` (`document_group`,`document`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}documentgroup_names` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(245) NOT NULL default '', + `private_memgroup` tinyint DEFAULT 0 COMMENT 'determine whether the document group is private to manager users', + `private_webgroup` tinyint DEFAULT 0 COMMENT 'determines whether the document is private to web users', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}event_log` ( + `id` integer NOT NULL AUTO_INCREMENT, + `eventid` integer DEFAULT 0, + `createdon` integer NOT NULL DEFAULT 0, + `type` tinyint NOT NULL DEFAULT 1 COMMENT '1- information, 2 - warning, 3- error', + `user` integer NOT NULL DEFAULT 0 COMMENT 'link to user table', + `usertype` tinyint NOT NULL DEFAULT 0 COMMENT '0 - manager, 1 - web', + `source` varchar(50) NOT NULL DEFAULT '', + `description` text, + PRIMARY KEY(`id`), + KEY `user`(`user`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Stores event and error logs'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}manager_log` ( + `id` int(10) NOT NULL auto_increment, + `timestamp` int(20) NOT NULL default '0', + `internalKey` int(10) NOT NULL default '0', + `username` varchar(255) default NULL, + `action` int(10) NOT NULL default '0', + `itemid` varchar(10) default '0', + `itemname` varchar(255) default NULL, + `message` varchar(255) NOT NULL default '', + `ip` varchar(46), + `useragent` varchar(255), + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains a record of user interaction.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}manager_users` ( + `id` int(10) NOT NULL auto_increment, + `username` varchar(100) NOT NULL default '', + `password` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains login information for backend users.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}member_groups` ( + `id` int(10) NOT NULL auto_increment, + `user_group` int(10) NOT NULL default '0', + `member` int(10) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE INDEX `ix_group_member` (`user_group`,`member`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}membergroup_access` ( + `id` int(10) NOT NULL auto_increment, + `membergroup` int(10) NOT NULL default '0', + `documentgroup` int(10) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}membergroup_names` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(245) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_content` ( + `id` int(10) NOT NULL auto_increment, + `type` varchar(20) NOT NULL default 'document', + `contentType` varchar(50) NOT NULL default 'text/html', + `pagetitle` varchar(255) NOT NULL default '', + `longtitle` varchar(255) NOT NULL default '', + `description` varchar(255) NOT NULL default '', + `alias` varchar(245) default '', + `link_attributes` varchar(255) NOT NULL default '' COMMENT 'Link attriubtes', + `published` int(1) NOT NULL default '0', + `pub_date` int(20) NOT NULL default '0', + `unpub_date` int(20) NOT NULL default '0', + `parent` int(10) NOT NULL default '0', + `isfolder` int(1) NOT NULL default '0', + `introtext` text COMMENT 'Used to provide quick summary of the document', + `content` mediumtext, + `richtext` tinyint(1) NOT NULL default '1', + `template` int(10) NOT NULL default '0', + `menuindex` int(10) NOT NULL default '0', + `searchable` int(1) NOT NULL default '1', + `cacheable` int(1) NOT NULL default '1', + `createdby` int(10) NOT NULL default '0', + `createdon` int(20) NOT NULL default '0', + `editedby` int(10) NOT NULL default '0', + `editedon` int(20) NOT NULL default '0', + `deleted` int(1) NOT NULL default '0', + `deletedon` int(20) NOT NULL default '0', + `deletedby` int(10) NOT NULL default '0', + `publishedon` int(20) NOT NULL default '0' COMMENT 'Date the document was published', + `publishedby` int(10) NOT NULL default '0' COMMENT 'ID of user who published the document', + `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title', + `donthit` tinyint(1) NOT NULL default '0' COMMENT 'Disable page hit count', + `privateweb` tinyint(1) NOT NULL default '0' COMMENT 'Private web document', + `privatemgr` tinyint(1) NOT NULL default '0' COMMENT 'Private manager document', + `content_dispo` tinyint(1) NOT NULL default '0' COMMENT '0-inline, 1-attachment', + `hidemenu` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Hide document from menu', + `alias_visible` INT(2) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `id` (`id`), + KEY `parent` (`parent`), + KEY aliasidx (`alias`), + KEY typeidx (`type`), + FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site document tree.'; + + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_htmlsnippets` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(100) NOT NULL default '', + `description` varchar(255) NOT NULL default 'Chunk', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `editor_name` VARCHAR(50) NOT NULL DEFAULT 'none', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `cache_type` tinyint(1) NOT NULL default '0' COMMENT 'Cache option', + `snippet` mediumtext, + `locked` tinyint(4) NOT NULL default '0', + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the snippet', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site chunks.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_modules` ( + `id` integer NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '', + `description` varchar(255) NOT NULL DEFAULT '0', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `disabled` tinyint NOT NULL DEFAULT '0', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `wrap` tinyint NOT NULL DEFAULT '0', + `locked` tinyint NOT NULL default '0', + `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon', + `enable_resource` tinyint NOT NULL DEFAULT '0' COMMENT 'enables the resource file feature', + `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file', + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier', + `enable_sharedparams` tinyint NOT NULL DEFAULT '0', + `properties` text, + `modulecode` mediumtext COMMENT 'module boot up code', + PRIMARY KEY(`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Modules'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_module_depobj` ( + `id` integer NOT NULL AUTO_INCREMENT, + `module` integer NOT NULL DEFAULT 0, + `resource` integer NOT NULL DEFAULT 0, + `type` integer(2) NOT NULL DEFAULT 0 COMMENT '10-chunks, 20-docs, 30-plugins, 40-snips, 50-tpls, 60-tvs', + PRIMARY KEY(`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Module Dependencies'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_module_access` ( + `id` integer UNSIGNED NOT NULL AUTO_INCREMENT, + `module` integer NOT NULL DEFAULT 0, + `usergroup` integer NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Module users group access permission'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugins` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `description` varchar(255) NOT NULL default 'Plugin', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `cache_type` tinyint(1) NOT NULL default '0' COMMENT 'Cache option', + `plugincode` mediumtext, + `locked` tinyint(4) NOT NULL default '0', + `properties` text COMMENT 'Default Properties', + `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the plugin', + `moduleguid` varchar(32) NOT NULL default '' COMMENT 'GUID of module from which to import shared parameters', + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site plugins.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugin_events` ( + `pluginid` INT(10) NOT NULL, + `evtid` INT(10) NOT NULL default 0, + `priority` INT(10) NOT NULL default 0 COMMENT 'determines plugin run order', + PRIMARY KEY ( `pluginid` , `evtid` ) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Links to system events'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_snippets` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `description` varchar(255) NOT NULL default 'Snippet', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Cache option', + `snippet` mediumtext, + `locked` tinyint(4) NOT NULL default '0', + `properties` text COMMENT 'Default Properties', + `moduleguid` varchar(32) NOT NULL default '' COMMENT 'GUID of module from which to import shared parameters', + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the snippet', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site snippets.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_templates` ( + `id` int(10) NOT NULL auto_increment, + `templatename` varchar(100) NOT NULL default '', + `description` varchar(255) NOT NULL default 'Template', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file', + `template_type` integer NOT NULL DEFAULT '0' COMMENT '0-page,1-content', + `content` mediumtext, + `locked` tinyint(4) NOT NULL default '0', + `selectable` tinyint(4) NOT NULL default '1', + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains the site templates.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}system_eventnames` ( + `id` INT(10) NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL default '', + `service` tinyint NOT NULL default '0' COMMENT 'System Service number', + `groupname` varchar(20) NOT NULL default '', + PRIMARY KEY(`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='System Event Names.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}system_settings` ( + `setting_name` varchar(50) NOT NULL default '', + `setting_value` text, + PRIMARY KEY (`setting_name`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains Content Manager settings.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_access` ( + `id` int(10) NOT NULL auto_increment, + `tmplvarid` int(10) NOT NULL default '0', + `documentgroup` int(10) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for template variable access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_contentvalues` ( + `id` int(11) NOT NULL auto_increment, + `tmplvarid` int(10) NOT NULL default '0' COMMENT 'Template Variable id', + `contentid` int(10) NOT NULL default '0' COMMENT 'Site Content Id', + `value` mediumtext, + PRIMARY KEY (id), + KEY idx_tmplvarid (tmplvarid), + KEY idx_id (contentid), + FULLTEXT KEY `value_ft_idx` (`value`), + UNIQUE INDEX `ix_tvid_contentid` (`tmplvarid`,`contentid`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables Content Values Link Table'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_templates` ( + `tmplvarid` int(10) NOT NULL default '0' COMMENT 'Template Variable id', + `templateid` int(11) NOT NULL default '0', + `rank` int(11) NOT NULL default '0', + PRIMARY KEY (`tmplvarid`, `templateid`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables Templates Link Table'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvars` ( + `id` INT(11) NOT NULL auto_increment, + `type` varchar(50) NOT NULL default '', + `name` varchar(100) NOT NULL default '', + `caption` varchar(80) NOT NULL default '', + `description` varchar(255) NOT NULL default '', + `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor', + `category` integer NOT NULL DEFAULT '0' COMMENT 'category id', + `locked` tinyint(4) NOT NULL default '0', + `elements` text, + `rank` int(11) NOT NULL default '0', + `display` varchar(20) NOT NULL default '' COMMENT 'Display Control', + `display_params` text COMMENT 'Display Control Properties', + `default_text` text, + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `indx_rank`(`rank`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Site Template Variables'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}user_attributes` ( + `id` int(10) NOT NULL auto_increment, + `internalKey` int(10) NOT NULL default '0', + `fullname` varchar(100) NOT NULL default '', + `role` int(10) NOT NULL default '0', + `email` varchar(100) NOT NULL default '', + `phone` varchar(100) NOT NULL default '', + `mobilephone` varchar(100) NOT NULL default '', + `blocked` int(1) NOT NULL default '0', + `blockeduntil` int(11) NOT NULL default '0', + `blockedafter` int(11) NOT NULL default '0', + `logincount` int(11) NOT NULL default '0', + `lastlogin` int(11) NOT NULL default '0', + `thislogin` int(11) NOT NULL default '0', + `failedlogincount` int(10) NOT NULL default '0', + `sessionid` varchar(100) NOT NULL default '', + `dob` int(10) NOT NULL DEFAULT '0', + `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female', + `country` varchar(5) NOT NULL default '', + `street` varchar(255) NOT NULL DEFAULT '', + `city` varchar(255) NOT NULL DEFAULT '', + `state` varchar(25) NOT NULL default '', + `zip` varchar(25) NOT NULL default '', + `fax` varchar(100) NOT NULL default '', + `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', + `comment` text, + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `userid` (`internalKey`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information about the backend users.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}user_messages` ( + `id` int(10) NOT NULL auto_increment, + `type` varchar(15) NOT NULL default '', + `subject` varchar(60) NOT NULL default '', + `message` text, + `sender` int(10) NOT NULL default '0', + `recipient` int(10) NOT NULL default '0', + `private` tinyint(4) NOT NULL default '0', + `postdate` int(20) NOT NULL default '0', + `messageread` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains messages for the Content Manager messaging system.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}user_roles` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `description` varchar(255) NOT NULL default '', + `frames` int(1) NOT NULL default '0', + `home` int(1) NOT NULL default '0', + `view_document` int(1) NOT NULL default '0', + `new_document` int(1) NOT NULL default '0', + `save_document` int(1) NOT NULL default '0', + `publish_document` int(1) NOT NULL default '0', + `delete_document` int(1) NOT NULL default '0', + `empty_trash` int(1) NOT NULL default '0', + `action_ok` int(1) NOT NULL default '0', + `logout` int(1) NOT NULL default '0', + `help` int(1) NOT NULL default '0', + `messages` int(1) NOT NULL default '0', + `new_user` int(1) NOT NULL default '0', + `edit_user` int(1) NOT NULL default '0', + `logs` int(1) NOT NULL default '0', + `edit_parser` int(1) NOT NULL default '0', + `save_parser` int(1) NOT NULL default '0', + `edit_template` int(1) NOT NULL default '0', + `settings` int(1) NOT NULL default '0', + `credits` int(1) NOT NULL default '0', + `new_template` int(1) NOT NULL default '0', + `save_template` int(1) NOT NULL default '0', + `delete_template` int(1) NOT NULL default '0', + `edit_snippet` int(1) NOT NULL default '0', + `new_snippet` int(1) NOT NULL default '0', + `save_snippet` int(1) NOT NULL default '0', + `delete_snippet` int(1) NOT NULL default '0', + `edit_chunk` int(1) NOT NULL default '0', + `new_chunk` int(1) NOT NULL default '0', + `save_chunk` int(1) NOT NULL default '0', + `delete_chunk` int(1) NOT NULL default '0', + `empty_cache` int(1) NOT NULL default '0', + `edit_document` int(1) NOT NULL default '0', + `change_password` int(1) NOT NULL default '0', + `error_dialog` int(1) NOT NULL default '0', + `about` int(1) NOT NULL default '0', + `category_manager` int(1) NOT NULL default '0', + `file_manager` int(1) NOT NULL default '0', + `assets_files` int(1) NOT NULL default '0', + `assets_images` int(1) NOT NULL default '0', + `save_user` int(1) NOT NULL default '0', + `delete_user` int(1) NOT NULL default '0', + `save_password` int(11) NOT NULL default '0', + `edit_role` int(1) NOT NULL default '0', + `save_role` int(1) NOT NULL default '0', + `delete_role` int(1) NOT NULL default '0', + `new_role` int(1) NOT NULL default '0', + `access_permissions` int(1) NOT NULL default '0', + `bk_manager` int(1) NOT NULL DEFAULT 0, + `new_plugin` int(1) NOT NULL DEFAULT 0, + `edit_plugin` int(1) NOT NULL DEFAULT 0, + `save_plugin` int(1) NOT NULL DEFAULT 0, + `delete_plugin` int(1) NOT NULL DEFAULT 0, + `new_module` int(1) NOT NULL DEFAULT 0, + `edit_module` int(1) NOT NULL DEFAULT 0, + `save_module` int(1) NOT NULL DEFAULT 0, + `delete_module` int(1) NOT NULL DEFAULT 0, + `exec_module` int(1) NOT NULL DEFAULT 0, + `view_eventlog` int(1) NOT NULL DEFAULT 0, + `delete_eventlog` int(1) NOT NULL DEFAULT 0, + `new_web_user` int(1) NOT NULL default '0', + `edit_web_user` int(1) NOT NULL default '0', + `save_web_user` int(1) NOT NULL default '0', + `delete_web_user` int(1) NOT NULL default '0', + `web_access_permissions` int(1) NOT NULL default '0', + `view_unpublished` int(1) NOT NULL default '0', + `import_static` int(1) NOT NULL default '0', + `export_static` int(1) NOT NULL default '0', + `remove_locks` int(1) NOT NULL default '0', + `display_locks` int(1) NOT NULL default '0', + `change_resourcetype` int(1) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information describing the user roles.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}user_settings` ( + `user` integer NOT NULL, + `setting_name` varchar(50) NOT NULL default '', + `setting_value` text, + PRIMARY KEY ( `user` , `setting_name` ), + KEY `setting_name` (`setting_name`), + KEY `user` (`user`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains backend user settings.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}web_groups` ( + `id` int(10) NOT NULL auto_increment, + `webgroup` int(10) NOT NULL default '0', + `webuser` int(10) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}webgroup_access` ( + `id` int(10) NOT NULL auto_increment, + `webgroup` int(10) NOT NULL default '0', + `documentgroup` int(10) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}webgroup_names` ( + `id` int(10) NOT NULL auto_increment, + `name` varchar(245) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains data used for web access permissions.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_attributes` ( + `id` int(10) NOT NULL auto_increment, + `internalKey` int(10) NOT NULL default '0', + `fullname` varchar(100) NOT NULL default '', + `role` int(10) NOT NULL default '0', + `email` varchar(100) NOT NULL default '', + `phone` varchar(100) NOT NULL default '', + `mobilephone` varchar(100) NOT NULL default '', + `blocked` int(1) NOT NULL default '0', + `blockeduntil` int(11) NOT NULL default '0', + `blockedafter` int(11) NOT NULL default '0', + `logincount` int(11) NOT NULL default '0', + `lastlogin` int(11) NOT NULL default '0', + `thislogin` int(11) NOT NULL default '0', + `failedlogincount` int(10) NOT NULL default '0', + `sessionid` varchar(100) NOT NULL default '', + `dob` int(10) NOT NULL DEFAULT '0', + `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female', + `country` varchar(25) NOT NULL default '', + `street` varchar(255) NOT NULL DEFAULT '', + `city` varchar(255) NOT NULL DEFAULT '', + `state` varchar(25) NOT NULL default '', + `zip` varchar(25) NOT NULL default '', + `fax` varchar(100) NOT NULL default '', + `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', + `comment` text, + `createdon` integer NOT NULL DEFAULT '0', + `editedon` integer NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `userid` (`internalKey`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains information for web users.'; + +CREATE TABLE IF NOT EXISTS `{PREFIX}web_users` ( + `id` int(10) NOT NULL auto_increment, + `username` varchar(100) NOT NULL default '', + `password` varchar(100) NOT NULL default '', + `cachepwd` varchar(100) NOT NULL default '' COMMENT 'Store new unconfirmed password', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=MyISAM {TABLEENCODING}; + +CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_settings` ( + `webuser` integer NOT NULL, + `setting_name` varchar(50) NOT NULL default '', + `setting_value` text, + PRIMARY KEY ( `webuser` , `setting_name` ), + KEY `setting_name` (`setting_name`), + KEY `webuserid` (`webuser`) +) ENGINE=MyISAM {TABLEENCODING} COMMENT='Contains web user settings.'; + + +# upgrade-able[[ - This block of code will be executed during upgrades + +# For backward compatibilty with early versions +#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +ALTER TABLE `{PREFIX}site_content` + ADD COLUMN `publishedon` int(20) NOT NULL DEFAULT '0' COMMENT 'Date the document was published' AFTER `deletedby`; + +ALTER TABLE `{PREFIX}site_content` + ADD COLUMN `publishedby` int(10) NOT NULL DEFAULT '0' COMMENT 'ID of user who published the document' AFTER `publishedon`; + +ALTER TABLE `{PREFIX}site_content` + ADD COLUMN `link_attributes` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link attriubtes' AFTER `alias`; + +ALTER TABLE `{PREFIX}site_content` + ADD COLUMN `alias_visible` INT(2) NOT NULL DEFAULT '1' COMMENT 'Hide document from alias path'; + +ALTER TABLE `{PREFIX}site_htmlsnippets` + ADD COLUMN `editor_name` VARCHAR(50) NOT NULL DEFAULT 'none' AFTER `editor_type`; + +ALTER TABLE `{PREFIX}site_htmlsnippets` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_htmlsnippets` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_htmlsnippets` + ADD COLUMN `disabled` tinyint NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_plugin_events` + ADD COLUMN `priority` INT(10) NOT NULL default '0' COMMENT 'determines the run order of the plugin' AFTER `evtid`; + +ALTER TABLE `{PREFIX}site_templates` + ADD COLUMN `selectable` TINYINT(4) NOT NULL DEFAULT '1' AFTER `locked`; + +ALTER TABLE `{PREFIX}site_templates` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_templates` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_tmplvar_templates` + ADD COLUMN `rank` integer(11) NOT NULL DEFAULT '0' AFTER `templateid`; + +ALTER TABLE `{PREFIX}site_tmplvars` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_tmplvars` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}user_attributes` + ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`; + +ALTER TABLE `{PREFIX}user_attributes` + ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; + +ALTER TABLE `{PREFIX}user_attributes` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}user_attributes` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}user_attributes` + ADD COLUMN `verified` int(1) NOT NULL DEFAULT 1; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `edit_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `delete_snippet`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `new_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `edit_chunk`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `save_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `new_chunk`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `delete_chunk` INT(1) NOT NULL DEFAULT '0' AFTER `save_chunk`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `empty_trash` INT(1) NOT NULL DEFAULT '0' AFTER `delete_document`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `view_unpublished` INT(1) NOT NULL DEFAULT '0' AFTER `web_access_permissions`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `import_static` INT(1) NOT NULL DEFAULT '0' AFTER `view_unpublished`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `export_static` INT(1) NOT NULL DEFAULT '0' AFTER `import_static`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `remove_locks` INT(1) NOT NULL DEFAULT '0' AFTER `export_static`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `display_locks` INT(1) NOT NULL DEFAULT '0' AFTER `remove_locks`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `publish_document` INT(1) NOT NULL DEFAULT '0' AFTER `save_document`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `change_resourcetype` INT(1) NOT NULL DEFAULT '0' AFTER `remove_locks`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `assets_images` INT(1) NOT NULL DEFAULT '1' AFTER `file_manager`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `assets_files` INT(1) NOT NULL DEFAULT '1' AFTER `assets_images`; + +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `category_manager` INT(1) NOT NULL DEFAULT '0' AFTER `about`; + +ALTER TABLE `{PREFIX}categories` + ADD COLUMN `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `category`; + +ALTER TABLE `{PREFIX}web_user_attributes` + ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`; + +ALTER TABLE `{PREFIX}web_user_attributes` + ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; + +ALTER TABLE `{PREFIX}web_user_attributes` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}web_user_attributes` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}web_user_attributes` + ADD COLUMN `verified` int(1) NOT NULL DEFAULT 0; + +ALTER TABLE `{PREFIX}site_snippets` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_snippets` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_snippets` + ADD COLUMN `disabled` tinyint NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_plugins` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_plugins` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_templates` + ADD COLUMN `createdon` integer NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_templates` + ADD COLUMN `editedon` integer NOT NULL DEFAULT '0'; + +# Set the private manager group flag + +UPDATE {PREFIX}documentgroup_names AS dgn + LEFT JOIN {PREFIX}membergroup_access AS mga ON mga.documentgroup = dgn.id + LEFT JOIN {PREFIX}webgroup_access AS wga ON wga.documentgroup = dgn.id + SET dgn.private_memgroup = (mga.membergroup IS NOT NULL), + dgn.private_webgroup = (wga.webgroup IS NOT NULL); + + +UPDATE `{PREFIX}site_plugins` SET `disabled`='1' WHERE `name` IN ('Bottom Button Bar'); + +UPDATE `{PREFIX}site_plugins` SET `disabled`='1' WHERE `name` IN ('Inherit Parent Template'); + +UPDATE `{PREFIX}system_settings` SET `setting_value` = '0' WHERE `setting_name` = 'validate_referer' AND `setting_value` = '00'; + +# start related to #EVO-1321 + +UPDATE `{PREFIX}site_content` SET `type`='reference', `contentType`='text/html' WHERE `type`='' AND `content` REGEXP '^https?://([-\w\.]+)+(:\d+)?/?'; + +UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/xml' WHERE `type`='' AND `alias` REGEXP '\.(rss|xml)$'; + +UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/javascript' WHERE `type`='' AND `alias` REGEXP '\.js$'; + +UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/css' WHERE `type`='' AND `alias` REGEXP '\.css$'; + +UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/html' WHERE `type`=''; + +ALTER TABLE `{PREFIX}documentgroup_names` + MODIFY COLUMN `name` varchar(245) NOT NULL default ''; + +ALTER TABLE `{PREFIX}event_log` + MODIFY COLUMN `source` varchar(50) NOT NULL DEFAULT '', + MODIFY COLUMN `description` text; + +ALTER TABLE `{PREFIX}categories` + MODIFY COLUMN `category` varchar(45) NOT NULL DEFAULT ''; + +ALTER TABLE `{PREFIX}manager_users` + MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT ''; + +ALTER TABLE `{PREFIX}membergroup_names` + MODIFY COLUMN `name` varchar(245) NOT NULL default ''; + +ALTER TABLE `{PREFIX}site_content` + MODIFY COLUMN `pagetitle` varchar(255) NOT NULL default '', + MODIFY COLUMN `alias` varchar(245) default '', + MODIFY COLUMN `introtext` text COMMENT 'Used to provide quick summary of the document', + MODIFY COLUMN `content` mediumtext, + MODIFY COLUMN `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title', + MODIFY COLUMN `template` int(10) NOT NULL default '0'; + +ALTER TABLE `{PREFIX}site_htmlsnippets` + MODIFY COLUMN `snippet` mediumtext; + +ALTER TABLE `{PREFIX}site_module_access` + MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `usergroup` int(11) NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_module_depobj` + MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `resource` int(11) NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_modules` + MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', + MODIFY COLUMN `disabled` tinyint(4) NOT NULL DEFAULT '0', + MODIFY COLUMN `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon', + MODIFY COLUMN `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file', + MODIFY COLUMN `createdon` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `editedon` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier', + MODIFY COLUMN `properties` text, + MODIFY COLUMN `modulecode` mediumtext COMMENT 'module boot up code'; + +ALTER TABLE `{PREFIX}site_plugin_events` + MODIFY COLUMN `evtid` int(10) NOT NULL DEFAULT '0'; + +ALTER TABLE `{PREFIX}site_plugins` + MODIFY COLUMN `properties` text COMMENT 'Default Properties', + MODIFY COLUMN `plugincode` mediumtext, + MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; + +ALTER TABLE `{PREFIX}site_snippets` + MODIFY COLUMN `properties` text COMMENT 'Default Properties', + MODIFY COLUMN `snippet` mediumtext, + MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; + +ALTER TABLE `{PREFIX}site_templates` + MODIFY COLUMN `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file', + MODIFY COLUMN `content` mediumtext; + +ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` + MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id', + MODIFY COLUMN `value` mediumtext; + +ALTER TABLE `{PREFIX}site_tmplvar_templates` + MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id'; + +ALTER TABLE `{PREFIX}site_tmplvars` + MODIFY COLUMN `name` varchar(50) NOT NULL default '', + MODIFY COLUMN `type` varchar(50) NOT NULL default '', + MODIFY COLUMN `elements` text, + MODIFY COLUMN `display` varchar(20) NOT NULL DEFAULT '' COMMENT 'Display Control', + MODIFY COLUMN `display_params` text COMMENT 'Display Control Properties', + MODIFY COLUMN `default_text` text; + +ALTER TABLE `{PREFIX}system_eventnames` DROP INDEX `name`; + +ALTER TABLE `{PREFIX}system_eventnames` + MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', + MODIFY COLUMN `service` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'System Service number'; + +DELETE FROM `{PREFIX}system_eventnames` USING `{PREFIX}system_eventnames`, `{PREFIX}system_eventnames` `e1` WHERE `{PREFIX}system_eventnames`.`id` > `e1`.`id` AND `{PREFIX}system_eventnames`.`name` = `e1`.`name`; + +ALTER TABLE `{PREFIX}system_settings` MODIFY COLUMN `setting_value` text; + +ALTER TABLE `{PREFIX}user_attributes` + MODIFY COLUMN `country` varchar(5) NOT NULL DEFAULT '', + MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo', + MODIFY COLUMN `comment` text; + +ALTER TABLE `{PREFIX}user_messages` MODIFY COLUMN `message` text; + +ALTER TABLE `{PREFIX}user_settings` MODIFY COLUMN `setting_value` text; + +ALTER TABLE `{PREFIX}web_users` + MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `cachepwd` varchar(100) NOT NULL DEFAULT '' COMMENT 'Store new unconfirmed password' AFTER `password`; + +ALTER TABLE `{PREFIX}web_user_settings` MODIFY COLUMN `setting_value` text; + +ALTER TABLE `{PREFIX}web_user_attributes` + MODIFY COLUMN `country` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo', + MODIFY COLUMN `comment` text; + +ALTER TABLE `{PREFIX}webgroup_names` + MODIFY COLUMN `name` varchar(245) NOT NULL default ''; + +ALTER TABLE `{PREFIX}site_content` ADD INDEX `typeidx` (`type`); + +ALTER TABLE `{PREFIX}system_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}system_settings` DROP INDEX `setting_name`; + +ALTER TABLE `{PREFIX}system_settings` ADD PRIMARY KEY (`setting_name`); + +ALTER TABLE `{PREFIX}system_eventnames` ADD UNIQUE INDEX `name` (`name`); + +ALTER TABLE `{PREFIX}user_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}user_settings` ADD PRIMARY KEY (`user`, `setting_name`); + +ALTER TABLE `{PREFIX}web_user_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}web_user_settings` ADD PRIMARY KEY (`webuser`, `setting_name`); + +ALTER TABLE `{PREFIX}site_plugin_events` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}site_plugin_events` ADD PRIMARY KEY (`pluginid`, `evtid`); + +ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` ADD FULLTEXT `value_ft_idx` (`value`); + +ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` ADD UNIQUE INDEX `ix_tvid_contentid` (`tmplvarid`,`contentid`); + +ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP INDEX `idx_tmplvarid`; + +ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP INDEX `idx_templateid`; + +ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}site_tmplvar_templates` ADD PRIMARY KEY (`tmplvarid`, `templateid`); + +ALTER TABLE `{PREFIX}member_groups` ADD UNIQUE INDEX `ix_group_member` (`user_group`,`member`); + +ALTER TABLE `{PREFIX}web_groups` ADD UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`); + +ALTER TABLE `{PREFIX}document_groups` ADD UNIQUE INDEX `ix_dg_id` (`document_group`,`document`); + +ALTER TABLE `{PREFIX}manager_log` + ADD COLUMN `ip` varchar(46); + +ALTER TABLE `{PREFIX}manager_log` + ADD COLUMN `useragent` varchar(255); + +ALTER TABLE `{PREFIX}manager_log` + CHANGE COLUMN `ip` `ip` VARCHAR(46) NULL DEFAULT NULL AFTER `message`; + +ALTER TABLE `{PREFIX}site_templates` ADD COLUMN `templatealias` VARCHAR(255) NULL DEFAULT NULL AFTER `templatename`; +# ]]upgrade-able + + +# Insert / Replace system records +#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + + +# non-upgrade-able[[ - This block of code will not be executed during upgrades + + +# Default Site Template + + +REPLACE INTO `{PREFIX}site_templates` +(id, templatename, description, editor_type, category, icon, template_type, content, locked, selectable) VALUES ('3','Minimal Template','Default minimal empty template (content returned only)','0','0','','0','[*content*]','0','1'); + + +# Default Site Documents + + +REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','Evolution CMS Install Success','Welcome to the EVO Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed Evolution CMS.

    \r\n\r\n

    Getting Help

    \r\n

    The EVO Community provides a great starting point to learn all things Evolution CMS, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to EVO!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,1); + + +REPLACE INTO `{PREFIX}manager_users` +(id, username, password)VALUES +(1, '{ADMIN}', MD5('{ADMINPASS}')); + +REPLACE INTO `{PREFIX}user_attributes` +(id, internalKey, fullname, role, email, phone, mobilephone, blocked, blockeduntil, blockedafter, logincount, lastlogin, thislogin, failedlogincount, sessionid, dob, gender, country, street, city, state, zip, fax, photo, comment, verified) VALUES +(1, 1, 'Admin', 1, '{ADMINEMAIL}', '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '', '', '', '', 1); + + +REPLACE INTO `{PREFIX}user_roles` +(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES +(2,'Editor','Limited to managing content',1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0), +(3,'Publisher','Editor with expanded permissions including manage users\, update Elements and site settings',1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,0); + + +# ]]non-upgrade-able + + +# Default Site Settings + + +INSERT IGNORE INTO `{PREFIX}system_settings` +(setting_name, setting_value) VALUES +('settings_version',''), +('manager_theme','default'), +('server_offset_time','0'), +('manager_language','{MANAGERLANGUAGE}'), +('modx_charset','UTF-8'), +('site_name','My Evolution Site'), +('site_start','1'), +('error_page','1'), +('unauthorized_page','1'), +('site_status','1'), +('auto_template_logic','{AUTOTEMPLATELOGIC}'), +('default_template','3'), +('old_template',''), +('publish_default','1'), +('friendly_urls','1'), +('friendly_alias_urls','1'), +('use_alias_path','1'), +('cache_type','2'), +('failed_login_attempts','3'), +('blocked_minutes','60'), +('use_captcha','0'), +('emailsender','{ADMINEMAIL}'), +('use_editor','1'), +('use_browser','1'), +('fe_editor_lang','{MANAGERLANGUAGE}'), +('fck_editor_toolbar','standard'), +('fck_editor_autolang','0'), +('editor_css_path',''), +('editor_css_selectors',''), +('upload_maxsize','10485760'), +('manager_layout','4'), +('auto_menuindex','1'), +('session.cookie.lifetime','604800'), +('mail_check_timeperiod','600'), +('manager_direction','ltr'), +('xhtml_urls','0'), +('automatic_alias','1'), +('datetime_format','dd-mm-YYYY'), +('warning_visibility', '0'), +('remember_last_tab', '1'), +('enable_bindings', '1'), +('seostrict', '1'), +('number_of_results','30'), +('theme_refresher',''), +('show_picker', '0'), +('show_newresource_btn', '0'), +('show_fullscreen_btn', '0'); + +REPLACE INTO `{PREFIX}user_roles` +(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES +(1, 'Administrator', 'Site administrators have full access to all functions',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); + + +# 1 - "Parser Service Events", 2 - "Manager Access Events", 3 - "Web Access Service Events", 4 - "Cache Service Events", 5 - "Template Service Events", 6 - Custom Events + +INSERT IGNORE INTO `{PREFIX}system_eventnames` +(name,service,groupname) VALUES +('OnDocPublished','5',''), +('OnDocUnPublished','5',''), +('OnWebPagePrerender','5',''), +('OnWebLogin','3',''), +('OnBeforeWebLogout','3',''), +('OnWebLogout','3',''), +('OnWebSaveUser','3',''), +('OnWebDeleteUser','3',''), +('OnWebChangePassword','3',''), +('OnWebCreateGroup','3',''), +('OnManagerLogin','2',''), +('OnBeforeManagerLogout','2',''), +('OnManagerLogout','2',''), +('OnManagerSaveUser','2',''), +('OnManagerDeleteUser','2',''), +('OnManagerChangePassword','2',''), +('OnManagerCreateGroup','2',''), +('OnBeforeCacheUpdate','4',''), +('OnCacheUpdate','4',''), +('OnMakePageCacheKey','4',''), +('OnLoadWebPageCache','4',''), +('OnBeforeSaveWebPageCache','4',''), +('OnChunkFormPrerender','1','Chunks'), +('OnChunkFormRender','1','Chunks'), +('OnBeforeChunkFormSave','1','Chunks'), +('OnChunkFormSave','1','Chunks'), +('OnBeforeChunkFormDelete','1','Chunks'), +('OnChunkFormDelete','1','Chunks'), +('OnDocFormPrerender','1','Documents'), +('OnDocFormRender','1','Documents'), +('OnBeforeDocFormSave','1','Documents'), +('OnDocFormSave','1','Documents'), +('OnBeforeDocFormDelete','1','Documents'), +('OnDocFormDelete','1','Documents'), +('OnDocFormUnDelete','1','Documents'), +('onBeforeMoveDocument','1','Documents'), +('onAfterMoveDocument','1','Documents'), +('OnPluginFormPrerender','1','Plugins'), +('OnPluginFormRender','1','Plugins'), +('OnBeforePluginFormSave','1','Plugins'), +('OnPluginFormSave','1','Plugins'), +('OnBeforePluginFormDelete','1','Plugins'), +('OnPluginFormDelete','1','Plugins'), +('OnSnipFormPrerender','1','Snippets'), +('OnSnipFormRender','1','Snippets'), +('OnBeforeSnipFormSave','1','Snippets'), +('OnSnipFormSave','1','Snippets'), +('OnBeforeSnipFormDelete','1','Snippets'), +('OnSnipFormDelete','1','Snippets'), +('OnTempFormPrerender','1','Templates'), +('OnTempFormRender','1','Templates'), +('OnBeforeTempFormSave','1','Templates'), +('OnTempFormSave','1','Templates'), +('OnBeforeTempFormDelete','1','Templates'), +('OnTempFormDelete','1','Templates'), +('OnTVFormPrerender','1','Template Variables'), +('OnTVFormRender','1','Template Variables'), +('OnBeforeTVFormSave','1','Template Variables'), +('OnTVFormSave','1','Template Variables'), +('OnBeforeTVFormDelete','1','Template Variables'), +('OnTVFormDelete','1','Template Variables'), +('OnUserFormPrerender','1','Users'), +('OnUserFormRender','1','Users'), +('OnBeforeUserFormSave','1','Users'), +('OnUserFormSave','1','Users'), +('OnBeforeUserFormDelete','1','Users'), +('OnUserFormDelete','1','Users'), +('OnWUsrFormPrerender','1','Web Users'), +('OnWUsrFormRender','1','Web Users'), +('OnBeforeWUsrFormSave','1','Web Users'), +('OnWUsrFormSave','1','Web Users'), +('OnBeforeWUsrFormDelete','1','Web Users'), +('OnWUsrFormDelete','1','Web Users'), +('OnSiteRefresh','1',''), +('OnFileManagerUpload','1',''), +('OnModFormPrerender','1','Modules'), +('OnModFormRender','1','Modules'), +('OnBeforeModFormDelete','1','Modules'), +('OnModFormDelete','1','Modules'), +('OnBeforeModFormSave','1','Modules'), +('OnModFormSave','1','Modules'), +('OnBeforeWebLogin','3',''), +('OnWebAuthentication','3',''), +('OnBeforeManagerLogin','2',''), +('OnManagerAuthentication','2',''), +('OnLoadSettings','1','System Settings'), +('OnSiteSettingsRender','1','System Settings'), +('OnFriendlyURLSettingsRender','1','System Settings'), +('OnUserSettingsRender','1','System Settings'), +('OnInterfaceSettingsRender','1','System Settings'), +('OnSecuritySettingsRender','1','System Settings'), +('OnFileManagerSettingsRender','1','System Settings'), +('OnMiscSettingsRender','1','System Settings'), +('OnRichTextEditorRegister','1','RichText Editor'), +('OnRichTextEditorInit','1','RichText Editor'), +('OnManagerPageInit','2',''), +('OnWebPageInit','5',''), +('OnLoadDocumentObject','5',''), +('OnBeforeLoadDocumentObject','5',''), +('OnAfterLoadDocumentObject','5',''), +('OnLoadWebDocument','5',''), +('OnParseDocument','5',''), +('OnParseProperties','5',''), +('OnBeforeParseParams','5',''), +('OnManagerLoginFormRender','2',''), +('OnWebPageComplete','5',''), +('OnLogPageHit','5',''), +('OnBeforeManagerPageInit','2',''), +('OnBeforeEmptyTrash','1','Documents'), +('OnEmptyTrash','1','Documents'), +('OnManagerLoginFormPrerender','2',''), +('OnStripAlias','1','Documents'), +('OnMakeDocUrl','5',''), +('OnBeforeLoadExtension','5',''), +('OnCreateDocGroup','1','Documents'), +('OnManagerWelcomePrerender','2',''), +('OnManagerWelcomeHome','2',''), +('OnManagerWelcomeRender','2',''), +('OnBeforeDocDuplicate','1','Documents'), +('OnDocDuplicate','1','Documents'), +('OnManagerMainFrameHeaderHTMLBlock','2',''), +('OnManagerPreFrameLoader','2',''), +('OnManagerFrameLoader','2',''), +('OnManagerTreeInit','2',''), +('OnManagerTreePrerender','2',''), +('OnManagerTreeRender','2',''), +('OnManagerNodePrerender','2',''), +('OnManagerNodeRender','2',''), +('OnManagerMenuPrerender','2',''), +('OnManagerTopPrerender','2',''), +('OnDocFormTemplateRender','1','Documents'), +('OnBeforeMinifyCss', '1', ''), +('OnPageUnauthorized','1',''), +('OnPageNotFound','1',''), +('OnFileBrowserUpload','1','File Browser Events'), +('OnBeforeFileBrowserUpload','1','File Browser Events'), +('OnFileBrowserDelete','1','File Browser Events'), +('OnBeforeFileBrowserDelete','1','File Browser Events'), +('OnFileBrowserInit','1','File Browser Events'), +('OnFileBrowserMove','1','File Browser Events'), +('OnBeforeFileBrowserMove','1','File Browser Events'), +('OnFileBrowserCopy','1','File Browser Events'), +('OnBeforeFileBrowserCopy','1','File Browser Events'), +('OnBeforeFileBrowserRename','1','File Browser Events'), +('OnFileBrowserRename','1','File Browser Events'), +('OnLogEvent','1',''); + +#Update System Tables +#::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +UPDATE `{PREFIX}user_roles` SET + bk_manager=1, + new_plugin=1, + edit_plugin=1, + save_plugin=1, + delete_plugin=1, + new_module=1, + edit_module=1, + save_module=1, + delete_module=1, + exec_module=1, + view_eventlog = 1, + delete_eventlog = 1, + new_web_user = 1, + edit_web_user = 1, + save_web_user = 1, + delete_web_user = 1, + new_chunk = 1, + edit_chunk = 1, + save_chunk = 1, + delete_chunk = 1, + web_access_permissions = 1, + view_unpublished = 1, + publish_document = 1, + import_static = 1, + export_static = 1, + empty_trash = 1, + remove_locks = 1, + display_locks = 1, + assets_images = 1, + assets_files = 1, + change_resourcetype = 1 + WHERE `id`=1; + + +# Update any invalid Manager Themes in User Settings and reset the default theme + + +UPDATE `{PREFIX}user_settings` SET + `setting_value`='default' + WHERE `setting_name`='manager_theme'; + + +REPLACE INTO `{PREFIX}system_settings` (setting_name, setting_value) VALUES ('manager_theme','default'); + +REPLACE INTO `{PREFIX}system_settings` (setting_name, setting_value) VALUES ('email_sender_method','1'); + +UPDATE `{PREFIX}system_settings` set setting_value = if(setting_value REGEXP 'application/json',setting_value,concat_ws(",",setting_value,"application/json")) WHERE setting_name='custom_contenttype'; diff --git a/install/sqlParser.class.php b/install/sqlParser.class.php index f5e7785e64..138490edc6 100755 --- a/install/sqlParser.class.php +++ b/install/sqlParser.class.php @@ -18,9 +18,9 @@ class SqlParser { public $adminpass; public $managerlanguage; public $mode; - public $fileManagerPath; - public $imgPath; - public $imgUrl; + public $fileManagerPath = ''; + public $imgPath = ''; + public $imgUrl = ''; public $dbMODx; public $dbVersion; public $connection_charset; @@ -29,7 +29,7 @@ class SqlParser { public $autoTemplateLogic; public $database_collation; - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { + public function __construct($host = null, $user = null, $password = null, $db = null, $prefix='modx_', $adminname = null, $adminemail = null, $adminpass = null, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { $this->host = $host; $this->dbname = $db; $this->prefix = $prefix; @@ -128,7 +128,13 @@ public function process($filename) { $num = $num + 1; - if ($sql_do) mysqli_query($this->conn, $sql_do); + if ($sql_do) { + try { + mysqli_query($this->conn, $sql_do); + } catch (Exception $exception) { + + } + } if(mysqli_error($this->conn)) { // Ignore duplicate and drop errors - Raymond if ($this->ignoreDuplicateErrors){ diff --git a/install/template.tpl b/install/template.tpl index 60da8a01e4..d0a0bb5b01 100755 --- a/install/template.tpl +++ b/install/template.tpl @@ -20,7 +20,7 @@
    - +
    diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 93cb7d1799..08b99c2361 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -450,18 +450,18 @@ function checked($cond) }; fclose($file); - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; - $tooltip .= "Server version: " . $details["Server version"] . "\n"; - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; - $tooltip .= "Host: " . $details["Host"] . "\n"; + $tooltip = "Generation Time: " . ($details["Generation Time"] ?? '-') . "\n"; + $tooltip .= "Server version: " . ($details["Server version"] ?? '-') . "\n"; + $tooltip .= "PHP Version: " . ($details["PHP Version"] ?? '-') . "\n"; + $tooltip .= "Host: " . ($details["Host"] ?? '-') . "\n"; ?>
    - - - + + + addMessage( sprintf( $cm->txt( 'cm_category_x_saved_at_position_y' ), - $category, + htmlspecialchars($category), $rank ), 'add' @@ -153,7 +153,7 @@ $cm->addMessage( sprintf( $cm->txt('cm_category_x_moved_to_position_y'), - $data['category'], + htmlspecialchars($data['category']), $data['rank'] ), 'sort' @@ -195,7 +195,7 @@ $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_data['origin'] ) + htmlspecialchars(urldecode( $_data['origin'] )) ), 'edit' ); @@ -215,7 +215,7 @@ sprintf( $cm->txt('cm_category_x_renamed_to_y'), urldecode( $_data['origin'] ), - $data['category'] + htmlspecialchars($data['category']) ), 'edit' ); @@ -242,7 +242,7 @@ $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_GET[$cm->get('request_key')]['category'] ) + htmlspecialchars(urldecode( $_GET[$cm->get('request_key')]['category'] )) ), 'edit' ); diff --git a/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml b/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml index 236f8882d5..22ce5882dc 100755 --- a/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml +++ b/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml @@ -1,6 +1,6 @@
    -

    +

    renderView('chunks/categorize/drag_element',$element); ?> diff --git a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml index 455090a34f..34c614518a 100755 --- a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml +++ b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml @@ -6,9 +6,9 @@
      -
    • +
    -
    \ No newline at end of file +
    diff --git a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml index 58eba8adc5..9c5f360f41 100755 --- a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml +++ b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml @@ -15,7 +15,7 @@ @@ -23,4 +23,4 @@ -
    ' . $_lang['table_commitdate'] . '' . $_lang['table_titleauthor'] . '
    ' . $pubdate . '' . $title . ' (' . $author . ')
    '.$_lang['updateButtonCommit_txt'].'
    ' . $_lang['updateButtonCommit_txt'] . '
      -
    • +
    \ No newline at end of file + diff --git a/manager/actions/category_mgr/skin/edit.tpl.phtml b/manager/actions/category_mgr/skin/edit.tpl.phtml index 7be26e7d9b..cbdbc3fd71 100755 --- a/manager/actions/category_mgr/skin/edit.tpl.phtml +++ b/manager/actions/category_mgr/skin/edit.tpl.phtml @@ -37,7 +37,7 @@ - txt('delete'); ?> + txt('delete'); ?> diff --git a/manager/actions/category_mgr/skin/sort.tpl.phtml b/manager/actions/category_mgr/skin/sort.tpl.phtml index 7b2b9c36f0..d6d148d8dc 100755 --- a/manager/actions/category_mgr/skin/sort.tpl.phtml +++ b/manager/actions/category_mgr/skin/sort.tpl.phtml @@ -22,7 +22,7 @@ foreach ($data as $category): ?> - + diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index 4558e7937c..5783514cbe 100755 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -62,159 +62,11 @@ // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; -/** - * "View Children" tab setup - */ -$maxpageSize = $modx->config['number_of_results']; -define('MAX_DISPLAY_RECORDS_NUM', $maxpageSize); - -$modx->loadExtension('makeTable'); - -// Get child document count -$rs = $modx->db->select('count(DISTINCT sc.id)', "{$tbl_site_content} AS sc - LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})"); -$numRecords = $modx->db->getValue($rs); - -$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; -$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'DESC'; - -// Get child documents (with paging) -$rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc - LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})", "{$sort} {$dir}", $modx->table->handlePaging() // add limit clause -); -$filter_sort = ''; -$filter_dir = ''; -$add_path = ''; -if($numRecords > 0) { - $filter_sort = ''; - $filter_dir = ''; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - // $tableClass = 'grid'; - // $rowHeaderClass = 'gridHeader'; - // $rowRegularClass = 'gridItem'; - // $rowAlternateClass = 'gridAltItem'; - $tableClass = 'table data nowrap'; - $columnHeaderClass = array( - 'text-center', - 'text-left', - 'text-center', - 'text-center', - 'text-center', - 'text-center' - ); - - - $modx->table->setTableClass($tableClass); - $modx->table->setColumnHeaderClass($columnHeaderClass); - // $modx->table->setRowHeaderClass($rowHeaderClass); - // $modx->table->setRowRegularClass($rowRegularClass); - // $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array( - '1%', - '', - '1%', - '1%', - '1%', - '1%' - ); - $modx->table->setColumnWidths($tbWidth); - - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; - $add_path = $sd . $sb . $pg; - - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - 'application/rss+xml' => $_style['tree_page_rss'], - 'application/pdf' => $_style['tree_page_pdf'], - 'application/vnd.ms-word' => $_style['tree_page_word'], - 'application/vnd.ms-excel' => $_style['tree_page_excel'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - - $listDocs = array(); - foreach($resource as $k => $children) { - - switch($children['id']) { - case $modx->config['site_start'] : - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page'] : - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page'] : - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page'] : - $icon = $_style['tree_page_info']; - break; - default: - if($children['isfolder']) { - $icon = $_style['tree_folder_new']; - } else { - if(isset($icons[$children['contentType']])) { - $icon = $icons[$children['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - } - - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); - if($modx->hasPermission('edit_document')) { - $title = '' . $icon . '' . '' . html_escape($children['pagetitle'], $modx->config['modx_charset']) . ''; - } else { - $title = '' . $icon . '' . html_escape($children['pagetitle'], $modx->config['modx_charset']) . ''; - } - - $icon_pub_unpub = (!$children['published']) ? '' : ''; - - $icon_del_undel = (!$children['deleted']) ? '' : ''; - - $listDocs[] = array( - 'docid' => '
    ' . $children['id'] . '
    ', - 'title' => $title, - 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', - 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', - 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', - 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? '' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '
    ' - ); - } +$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; +$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; +$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; +$add_path = $sd . $sb . $pg; - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); -} else { - // No Child documents - $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; -} ?> - config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; - $handle = @fopen($filename, "r"); - if(!$handle) { - $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; - } else { - while(!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = '
    \n"; - } - echo $buffer; - ?> -
    - - + INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) @@ -16,14 +16,14 @@ // get and save search string if(isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : (isset($_PAGE['vs']['search']) ? $_PAGE['vs']['search'] : ''); - if(!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : (isset($_PAGE['vs']['search']) ? $_PAGE['vs']['search'] : ''); + if(!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -40,74 +40,74 @@ ?>
    - - + + -

    - -

    +

    + +

    -
    -
    -
    +
    +
    +
    -
    - -
    +
    + +
    -
    -
    - db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el - LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pagerStyle = 'white-space: normal;'; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data eventlog"; // nowrap - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if($listmode == '1') { - $grd->pageSize = 0; - } - if(isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> -
    -
    -
    -
    +
    +
    + db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pagerStyle = 'white-space: normal;'; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data eventlog"; // nowrap + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colWraps = ",,1"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' H:i:s'; + if($listmode == '1') { + $grd->pageSize = 0; + } + if(isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
    +
    +
    +
    diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index fb61c2b499..d56a7c9231 100755 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -90,6 +90,12 @@ function add_dot($array) // end settings +// Prevent php 8 warnings +$_POST['mode'] = $_POST['mode'] ?? ''; +$_GET['mode'] = $_GET['mode'] ?? ''; +$_REQUEST['mode'] = $_REQUEST['mode'] ?? ''; +$_REQUEST['path'] = $_REQUEST['path'] ?? ''; + // get the current work directory if (isset($_REQUEST['path']) && !empty($_REQUEST['path'])) { $_REQUEST['path'] = str_replace('..', '', $_REQUEST['path']); @@ -97,7 +103,7 @@ function add_dot($array) } else { $startpath = $filemanager_path; } -$startpath = rtrim($startpath, '/'); +$startpath = $startpath == '/' ? '/' : rtrim($startpath, '/'); if (!is_readable($startpath)) { $modx->webAlertAndQuit($_lang["not_readable_dir"]); diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index c0b2b944e0..382be68377 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,339 +1,339 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -if (!$modx->hasPermission('logs')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -/** - * @param array $array - * @param string $checkKey - * @return array - */ -function array_unique_multi($array, $checkKey) -{ - // Use the builtin if we're not a multi-dimensional array - if (!is_array(current($array)) || empty($checkKey)) { - return array_unique($array); - } - - $ret = array(); - $checkValues = array(); // contains the unique key Values - foreach ($array as $key => $current) { - if (in_array($current[$checkKey], $checkValues)) { - continue; - } // duplicate - - $checkValues[] = $current[$checkKey]; - $ret[$key] = $current; - } - return $ret; -} - -/** - * @param array $array - * @param string $key - * @return array - */ -function record_sort($array, $key) -{ - $hash = array(); - foreach ($array as $k => $v) { - $hash[$k] = $v[$key]; - } - - natsort($hash); - - $records = array(); - foreach ($hash as $k => $row) { - $records[$k] = $array[$k]; - } - - return $records; -} - -$rs = $modx->db->select('DISTINCT internalKey, username, action, itemid, itemname', $modx->getFullTableName('manager_log')); - -$logs = $modx->db->makeArray($rs); -?> -

    - -

    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - " /> - " title=""> -
    -
    -
    -
    -
    -
    -
    - " /> - " title=""> -
    -
    -
    -
    -
    -
    - -
    -
    - - "> - "> - - " style="display:none;" /> -
    - -
    -
    - - - -
    -
    - -db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } - - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } - - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); - -if ($limit < 1) { - echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; -} else { - echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; - - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; - - // Display the result as you like... - print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; - $paging = (isset($array_paging['first_link']) ? $array_paging['first_link'] : '') . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); - $paging .= (isset($array_paging['previous_link']) ? $array_paging['previous_link'] : '') . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; - $paging .= $array_row_paging[$current_row - 1]; // ." "; - $paging .= $array_row_paging[$current_row]; // ." "; - $paging .= $array_row_paging[$current_row + 1]; // ." "; - $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= (isset($array_paging['next_link']) ? $array_paging['next_link'] : '') . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= (isset($array_paging['last_link']) ? $array_paging['last_link'] : '') . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: - // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> - // Of course you can now play with array_row_paging in order to print - // only the results you would like... - ?> - - - -

    - -
    -
    - - - - - - - - - - - - - - db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '
    -
    '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; - ?> - - - - - - - - - - - -
    IPUSER_AGENT
    ' . $logentry['username'] . '' ?>toDateFormat($logentry['timestamp'] + $server_offset_time) ?>
    -
    -
    - - - -
    -
    - INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +if (!$modx->hasPermission('logs')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +/** + * @param array $array + * @param string $checkKey + * @return array + */ +function array_unique_multi($array, $checkKey) +{ + // Use the builtin if we're not a multi-dimensional array + if (!is_array(current($array)) || empty($checkKey)) { + return array_unique($array); + } + + $ret = array(); + $checkValues = array(); // contains the unique key Values + foreach ($array as $key => $current) { + if (in_array($current[$checkKey], $checkValues)) { + continue; + } // duplicate + + $checkValues[] = $current[$checkKey]; + $ret[$key] = $current; + } + return $ret; +} + +/** + * @param array $array + * @param string $key + * @return array + */ +function record_sort($array, $key) +{ + $hash = array(); + foreach ($array as $k => $v) { + $hash[$k] = $v[$key]; + } + + natsort($hash); + + $records = array(); + foreach ($hash as $k => $row) { + $records[$k] = $array[$k]; + } + + return $records; +} + +$rs = $modx->db->select('DISTINCT internalKey, username, action, itemid, itemname', $modx->getFullTableName('manager_log')); + +$logs = $modx->db->makeArray($rs); +?> +

    + +

    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + " /> + " title=""> +
    +
    +
    +
    +
    +
    +
    + " /> + " title=""> +
    +
    +
    +
    +
    +
    + +
    +
    + + "> + "> + + " style="display:none;" /> +
    + +
    +
    + + + +
    +
    + +db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } + + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } + + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + +if ($limit < 1) { + echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; +} else { + echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; + + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; + + // Display the result as you like... + print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; + $paging = (isset($array_paging['first_link']) ? $array_paging['first_link'] : '') . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= (isset($array_paging['previous_link']) ? $array_paging['previous_link'] : '') . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; + $paging .= $array_row_paging[$current_row - 1]; // ." "; + $paging .= $array_row_paging[$current_row]; // ." "; + $paging .= $array_row_paging[$current_row + 1]; // ." "; + $paging .= $array_row_paging[$current_row + 2]; // ." "; + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= (isset($array_paging['next_link']) ? $array_paging['next_link'] : '') . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= (isset($array_paging['last_link']) ? $array_paging['last_link'] : '') . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: + // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> + // Of course you can now play with array_row_paging in order to print + // only the results you would like... + ?> + + + +

    + +
    +
    + + + + + + + + + + + + + + db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
    -
    '; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $modx->htmlspecialchars($logentry['itemname']) . ''; + } else { + $item = $modx->htmlspecialchars($logentry['itemname']); + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; + ?> + + + + + + + + + + + +
    IPUSER_AGENT
    ' . $modx->htmlspecialchars($logentry['username']) . '' ?>toDateFormat($logentry['timestamp'] + $server_offset_time) ?>htmlspecialchars($logentry['useragent']) ?>
    +
    +
    + + + +
    +
    + getPagingRowArray(); // Display the result as you like... + $pager = ''; $pager .= $_lang['showing'] . " " . $array_paging['lower']; $pager .= " " . $_lang['to'] . " " . $array_paging['upper']; $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")"; - $pager .= "
    " . $array_paging['previous_link'] . "<<" . (isset($array_paging['previous_link']) ? " " : " "); + if (isset($array_paging['previous_link'])) { + $pager .= "
    " . $array_paging['previous_link'] . "<<" . " "; + } for ($i = 0; $i < sizeof($array_row_paging); $i++) { $pager .= $array_row_paging[$i] . " "; } - $pager .= $array_paging['next_link'] . ">>" . (isset($array_paging['next_link']) ? "" : ""); + if (isset($array_paging['next_link'])) { + $pager .= $array_paging['next_link'] . ">>" . ""; + } // The above exemple print somethings like: // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> // Of course you can now play with array_row_paging in order to print // only the results you would like... - $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); + $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID('mgr') . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); $limit = $modx->db->getRecordCount($rs); if ($limit < 1) { echo $_lang['messages_no_messages']; @@ -166,8 +171,8 @@ ?> ' : "" ?> - - + htmlspecialchars($message['subject']) ?> + htmlspecialchars($sendername) ?> toDateFormat($message['postdate'] + $server_offset_time) ?> @@ -188,13 +193,13 @@

    db->select('*', $modx->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'"); + if (isset($_REQUEST['m']) && ($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) { + $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); $message = $modx->db->getRow($rs); if (!$message) { echo "Wrong number of messages returned!"; } else { - if ($message['recipient'] != $modx->getLoginUserID()) { + if ($message['recipient'] != $modx->getLoginUserID('mgr')) { echo $_lang['messages_not_allowed_to_read']; } else { // output message! @@ -206,10 +211,10 @@ $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); $sendername = $modx->db->getValue($rs2); } - $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; + $subjecttext = isset($_REQUEST['m']) && $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; $subjecttext .= $message['subject']; $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message']; - if ($_REQUEST['m'] == 'rp') { + if (isset($_REQUEST['m']) && $_REQUEST['m'] == 'rp') { $recipientindex = $message['sender']; } } @@ -254,7 +259,7 @@ function hideSpans(showSpan) db->getRow($rs)) { ?> - + @@ -269,7 +274,7 @@ function hideSpans(showSpan) db->getRow($rs)) { ?> - + @@ -281,11 +286,11 @@ function hideSpans(showSpan) :
    :
    -
    +
    :
    -
    +
    "> diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 2ba73b4256..9efef64477 100755 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,150 +1,150 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -// initialize page view state - the $_PAGE object -$modx->manager->initPageViewState(); - -// get and save search string -if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; -} else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : (isset($_PAGE['vs']['search']) ? $_PAGE['vs']['search'] : ''); - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; -} - -// get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : (isset($_PAGE['vs']['lm']) ? $_PAGE['vs']['lm'] : ''); -$_PAGE['vs']['lm'] = $listmode; - - -// context menu -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; -$cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0)); -if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { - $cm->addSeparator(); -} -$cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0)); -$cm->addItem($_lang["duplicate"], "js:menuAction(3)", $_style['actions_duplicate'], (!$modx->hasPermission('new_module') ? 1 : 0)); -$cm->addItem($_lang["delete"], "js:menuAction(4)", $_style['actions_delete'], (!$modx->hasPermission('delete_module') ? 1 : 0)); -echo $cm->render(); - -?> - - -

    - -

    - - - -
    -
    -
    - -
    -
    - config['use_udperms'])) { - $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 - ORDER BY sm.name'); - if ($modx->hasPermission('edit_module')) { - $title = "[+value+]"; - } else if ($modx->hasPermission('exec_module')) { - $title = "[+value+]"; - } else { - $title = '[+value+]'; - } - } else { - $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name"); - $title = "[+value+]"; - } - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "icon,name,description,locked,disabled"; - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; - $grd->colWidths = "34,,,60,60"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:" . $title; - if ($listmode == '1') { - $grd->pageSize = 0; - } - if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> -
    -
    +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +// initialize page view state - the $_PAGE object +$modx->manager->initPageViewState(); +$sqlQuery = ''; +// get and save search string +if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; +} else { + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : (isset($_PAGE['vs']['search']) ? $_PAGE['vs']['search'] : ''); + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; +} + +// get & save listmode +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : (isset($_PAGE['vs']['lm']) ? $_PAGE['vs']['lm'] : ''); +$_PAGE['vs']['lm'] = $listmode; + + +// context menu +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; +$cm = new ContextMenu("cntxm", 150); +$cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0)); +if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { + $cm->addSeparator(); +} +$cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0)); +$cm->addItem($_lang["duplicate"], "js:menuAction(3)", $_style['actions_duplicate'], (!$modx->hasPermission('new_module') ? 1 : 0)); +$cm->addItem($_lang["delete"], "js:menuAction(4)", $_style['actions_delete'], (!$modx->hasPermission('delete_module') ? 1 : 0)); +echo $cm->render(); + +?> + + +

    + +

    + + + +
    +
    +
    + +
    +
    + config['use_udperms'])) { + $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon + FROM ' . $modx->getFullTableName('site_modules') . ' AS sm + LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id + LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 + ORDER BY sm.name'); + if ($modx->hasPermission('edit_module')) { + $title = "[+value+]"; + } else if ($modx->hasPermission('exec_module')) { + $title = "[+value+]"; + } else { + $title = '[+value+]'; + } + } else { + $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name"); + $title = "[+value+]"; + } + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "icon,name,description,locked,disabled"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; + $grd->colWidths = "34,,,60,60"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+e.name+]||template:[+e.description+]"; + if ($listmode == '1') { + $grd->pageSize = 0; + } + if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
    +
    diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 1d4e73112d..8338fff37c 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -4,8 +4,8 @@ } /********************/ -$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; -$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; +$sd = isset($_REQUEST['dir']) && is_scalar($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; +$sb = isset($_REQUEST['sort']) && is_scalar($_REQUEST['dir']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; $add_path = $sd . $sb . $pg; /*******************/ @@ -69,7 +69,7 @@ // check to see if resource isn't locked if($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['resource'])); } // end check for lock @@ -78,7 +78,7 @@ // get document groups for current user $docgrp = ''; -if($_SESSION['mgrDocgroups']) { +if(!empty($_SESSION['mgrDocgroups'])) { $docgrp = implode(',', $_SESSION['mgrDocgroups']); } @@ -99,7 +99,7 @@ $content = array(); if(isset($_REQUEST['newtemplate'])) { - $content['template'] = $_REQUEST['newtemplate']; + $content['template'] = (int)$_REQUEST['newtemplate']; } else { $content['template'] = getDefaultTemplate(); } @@ -118,7 +118,7 @@ // sottwell 02-09-2006 if($formRestored == true) { $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; + $content['content'] = isset($_POST['ta']) && is_scalar($_POST['ta']) ? $_POST['ta'] : ''; if(empty ($content['pub_date'])) { unset ($content['pub_date']); } else { @@ -132,12 +132,12 @@ } // increase menu index if this is a new document -if(!isset ($_REQUEST['id'])) { +if(empty($_REQUEST['id']) ) { if(!isset ($modx->config['auto_menuindex'])) { $modx->config['auto_menuindex'] = 1; } if($modx->config['auto_menuindex']) { - $pid = 0; + $pid = (int)($_REQUEST['pid'] ?? 0); $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); $content['menuindex'] = $modx->db->getValue($rs); } else { @@ -145,7 +145,7 @@ } } -if(isset ($_POST['which_editor'])) { +if(isset ($_POST['which_editor']) && is_scalar($_POST['which_editor'])) { $modx->config['which_editor'] = $_POST['which_editor']; } @@ -561,6 +561,7 @@ function SetUrl(url, width, height, alt) { $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + $out = ''; /*************************/ ?> @@ -577,7 +578,7 @@ function SetUrl(url, width, height, alt) {

    - config['modx_charset']), $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . (int)$_REQUEST['id'] . ')'; } else { if ($modx->manager->action == '4') { @@ -595,7 +596,8 @@ function SetUrl(url, width, height, alt) { config['use_breadcrumbs']) { - $temp = array(); + $out = ''; + $temp = array(); $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; if(isset($_REQUEST['id']) && $content['parent'] != 0) { @@ -746,13 +748,13 @@ function SetUrl(url, width, height, alt) { if($closeOptGroup) { echo "\t\t\t\t\t\n"; } - echo "\t\t\t\t\t\n"; + echo "\t\t\t\t\thtmlspecialchars($thisCategory)}\">\n"; $closeOptGroup = true; } $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; - echo "\t\t\t\t\t" . '\n"; + echo "\t\t\t\t\t" . '\n"; $currentCategory = $thisCategory; } if($thisCategory != '') { @@ -788,7 +790,7 @@ function SetUrl(url, width, height, alt) { " data-tooltip=""> - onclick="changestate(document.mutate.hidemenu);" /> + onclick="changestate(document.mutate.hidemenu);" /> @@ -799,13 +801,13 @@ function SetUrl(url, width, height, alt) { -
    ' . $row['category'] . '
    +
    ' . $modx->htmlspecialchars($row['category']) . '
    ' . "\n"; } else { @@ -982,9 +986,9 @@ function SetUrl(url, width, height, alt) {
    - +
    -
    ' . $row['category'] . '
    +
    ' . $modx->htmlspecialchars($row['category']) . '
    '; } @@ -992,9 +996,9 @@ function SetUrl(url, width, height, alt) { if ($i === 0) { $templateVariablesOutput .= '
    -

    ' . $row['category'] . '

    +

    ' . $modx->htmlspecialchars($row['category']) . '

    - +
    '; } else { @@ -1002,11 +1006,11 @@ function SetUrl(url, width, height, alt) {
    - +
    -

    ' . $row['category'] . '

    +

    ' . $modx->htmlspecialchars($row['category']) . '

    - +
    '; } @@ -1014,18 +1018,18 @@ function SetUrl(url, width, height, alt) { if ($i === 0) { $templateVariablesOutput .= '
    -

    ' . $row['category'] . '

    +

    ' . $modx->htmlspecialchars($row['category']) . '

    '; } else { $templateVariablesOutput .= '
    - +
    -

    ' . $row['category'] . '

    +

    ' . $modx->htmlspecialchars($row['category']) . '

    - + '; } } @@ -1072,13 +1076,13 @@ function SetUrl(url, width, height, alt) { $tvPBV = $row['value']; } - $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; + $tvDescription = (!empty($row['description'])) ? '
    ' . $modx->htmlspecialchars($row['description']) . '' : ''; $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $modx->htmlspecialchars($row['name']) . '*]' : ''; $templateVariablesTmp .= ' - + '; @@ -1462,7 +1466,7 @@ function SetUrl(url, width, height, alt) { } else { ++$permissions_no; } - $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; + $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; } // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { @@ -1544,6 +1548,7 @@ function makePublic(b) { storeCurTemplate(); manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { if(is_array($richtexteditorIds)) { foreach($richtexteditorIds as $editor => $elements) { diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index ff367b4d2b..a6850487d1 100755 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -25,7 +25,7 @@ // check to see the snippet editor isn't locked if ($lockedEl = $modx->elementIsLocked(3, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['chunk'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['chunk'])); } // end check for lock @@ -47,7 +47,7 @@ $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; - $content['category'] = (int)$_REQUEST['catid']; + if (!empty($content['category'])) $content['category'] = (int)$_REQUEST['catid']; } if ($modx->manager->hasFormValues()) { @@ -57,7 +57,7 @@ if (isset($_POST['which_editor'])) { $which_editor = $_POST['which_editor']; } else { - $which_editor = $content['editor_name'] != 'none' ? $content['editor_name'] : 'none'; + $which_editor = isset($content['editor_name']) ? $content['editor_name'] : 'none'; } $content = array_merge($content, $_POST); @@ -97,7 +97,7 @@ function changeRTE() }, duplicate: function() { if (confirm('') === true) { documentDirty = false; - document.location.href = "index.php?id=&a=97"; + document.location.href = "index.php?id=&a=97"; } }, delete: function() { if (confirm('') === true) { @@ -132,11 +132,11 @@ function changeRTE() ?> - +

    - (' . $content['id'] . ')' : $_lang['new_htmlsnippet']) ?> + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['new_htmlsnippet'] ?>

    @@ -158,10 +158,10 @@ function changeRTE()
    - + " class="form-control form-control-lg" onchange="documentDirty=true;" /> hasPermission('save_role')): ?> @@ -175,7 +175,7 @@ function changeRTE()
    - +
    @@ -186,7 +186,11 @@ function changeRTE() $v) { - echo "\t\t\t\t" . '\n"; + $selected = ''; + if ( isset($content['category']) ) { + $selected = ($content['category'] == $v['id'] || (empty($content['category']) && isset($_POST['categoryid']) && $_POST['categoryid'] == $v['id'])) ? ' selected="selected"' : ''; + } + echo "\t\t\t\t" . '\n"; } ?> @@ -200,7 +204,7 @@ function changeRTE()
    - +
    @@ -224,7 +228,7 @@ function changeRTE()
    - +
    diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 9787bf4487..b372a1623e 100755 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -62,7 +62,7 @@ $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; $classes = ($row['deleted']) ? ' deletedNode ' : $classes; $icon = $row['isfolder'] ? ' ' : ' '; - $ressourcelist .= '
  • ' . $icon . $row['pagetitle'] . ' (' . $row['id'] . ')
  • '; + $ressourcelist .= '
  • ' . $icon . $modx->htmlspecialchars($row['pagetitle']) . ' (' . $row['id'] . ')
  • '; } $ressourcelist .= ''; } else { @@ -149,7 +149,7 @@ function resetSortOrder()

    - (' . $id . ')' : $_lang['sort_menuindex']) ?> + htmlspecialchars($pagetitle) . '(' . $id . ')' : $_lang['sort_menuindex']) ?>

    diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 457fa6c91f..97e9817faa 100755 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,733 +1,736 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -switch($modx->manager->action) { - case 107: - if(!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; -// Get table names (alphabetical) -$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); -$tbl_site_module_access = $modx->getFullTableName('site_module_access'); -$tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); -$tbl_site_modules = $modx->getFullTableName('site_modules'); -$tbl_site_plugins = $modx->getFullTableName('site_plugins'); -$tbl_site_snippets = $modx->getFullTableName('site_snippets'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -/** - * create globally unique identifiers (guid) - * - * @return string - */ -function createGUID() { - srand((double) microtime() * 1000000); - $r = rand(); - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); - $m = md5($u); - return $m; -} - -// check to see the module editor isn't locked -if($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); -} -// end check for lock - -// Lock snippet for other users to edit -$modx->lockElement(6, $id); - -if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } -} else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; -} -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); -} - -$content = array_merge($content, $_POST); - -// Add lock-element JS-Script -$lockElementId = $id; -$lockElementType = 6; -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); -?> - - - - invokeEvent('OnModFormPrerender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); - ?> - - - - -

    - (' . $content['id'] . ')' : $_lang['new_module']) ?> -

    - - - -
    -
    -
    - -
    - - - -
    -

    - -
    -
    -
    - -
    -
    - - hasPermission('save_role')): ?> - - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    - - - -
    - -
    - -
    - - -
    -

    - -
    -
    - -
    -
    -
    -
    -
    -
    - - -
    -

    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    - manager->action == '108'): ?> - -
    -

    - -
    -

    -
    - - "> -
    - db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, - CASE smd.type - WHEN 10 THEN 'Chunk' - WHEN 20 THEN 'Document' - WHEN 30 THEN 'Plugin' - WHEN 40 THEN 'Snippet' - WHEN 50 THEN 'Template' - WHEN 60 THEN 'TV' - END AS type", "{$tbl_site_module_depobj} AS smd - LEFT JOIN {$tbl_site_htmlsnippets} AS sc ON sc.id = smd.resource AND smd.type = 10 - LEFT JOIN {$tbl_site_content} AS sd ON sd.id = smd.resource AND smd.type = 20 - LEFT JOIN {$tbl_site_plugins} AS sp ON sp.id = smd.resource AND smd.type = 30 - LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = 40 - LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 - LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); - - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); - ?> -
    -
    - - - -
    -

    - -
    - - db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); - - if($modx->hasPermission('access_permissions')) { - ?> - - -

    - db->select('name, id', $tbl_membergroup_names, '', 'name'); - while($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if($modx->hasPermission('access_permissions')) { - if($checked) { - $notPublic = true; - } - $chks .= '
    \n"; - } else { - if($checked) { - $chks = '' . "\n" . $chks; - } - } - } - if($modx->hasPermission('access_permissions')) { - $chks = '
    ' . "\n" . $chks; - } - echo $chks; - ?> - -
    -
    - - -
    -

    - -
    - -
    -
    - - - invokeEvent('OnModFormRender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> - - +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +switch($modx->manager->action) { + case 107: + if(!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} +$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; +// Get table names (alphabetical) +$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); +$tbl_site_module_access = $modx->getFullTableName('site_module_access'); +$tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); +$tbl_site_modules = $modx->getFullTableName('site_modules'); +$tbl_site_plugins = $modx->getFullTableName('site_plugins'); +$tbl_site_snippets = $modx->getFullTableName('site_snippets'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +/** + * create globally unique identifiers (guid) + * + * @return string + */ +function createGUID() { + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; +} + +// check to see the module editor isn't locked +if($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['module'])); +} +// end check for lock + +// Lock snippet for other users to edit +$modx->lockElement(6, $id); + +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} else { + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; +} +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); +} + +$content = array_merge($content, $_POST); + +// Add lock-element JS-Script +$lockElementId = $id; +$lockElementType = 6; +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); +?> + + +
    + invokeEvent('OnModFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> + + + + +

    + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['new_module']) ?> +

    + + + +
    +
    +
    + +
    + + + +
    +

    + +
    +
    +
    + +
    +
    + + hasPermission('save_role')): ?> + + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    + + + +
    + +
    + +
    + + +
    +

    + +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +

    + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    + manager->action == '108'): ?> + +
    +

    + +
    +

    +
    + + "> +
    + db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + CASE smd.type + WHEN 10 THEN 'Chunk' + WHEN 20 THEN 'Document' + WHEN 30 THEN 'Plugin' + WHEN 40 THEN 'Snippet' + WHEN 50 THEN 'Template' + WHEN 60 THEN 'TV' + END AS type", "{$tbl_site_module_depobj} AS smd + LEFT JOIN {$tbl_site_htmlsnippets} AS sc ON sc.id = smd.resource AND smd.type = 10 + LEFT JOIN {$tbl_site_content} AS sd ON sd.id = smd.resource AND smd.type = 20 + LEFT JOIN {$tbl_site_plugins} AS sp ON sp.id = smd.resource AND smd.type = 30 + LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = 40 + LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 + LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); + + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + $grd->colTypes = "template:[+e.value+]"; + echo $grd->render(); + ?> +
    +
    + + + +
    +

    + +
    + + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); + + if($modx->hasPermission('access_permissions')) { + ?> + + +

    + db->select('name, id', $tbl_membergroup_names, '', 'name'); + while($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if($modx->hasPermission('access_permissions')) { + if($checked) { + $notPublic = true; + } + $chks .= '
    \n"; + } else { + if($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if($modx->hasPermission('access_permissions')) { + $chks = '
    ' . "\n" . $chks; + } + echo $chks; + ?> + +
    +
    + + +
    +

    + +
    + +
    +
    + + + invokeEvent('OnModFormRender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> + + diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index 67953539f1..b20807e0df 100755 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -191,13 +191,13 @@ function openSelector(resource, mode, callback, w, h) {

    - (' . $content['id'] . ')' : $_lang['module_resource_title']) ?> + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['module_resource_title']) ?>

    -
    +
    htmlspecialchars($content["name"]) . " - " . $_lang['module_resource_title']; ?>


    @@ -229,7 +229,7 @@ function openSelector(resource, mode, callback, w, h) { $grd->itemClass = "gridItem"; $grd->altItemClass = "gridAltItem"; $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; - $grd->colTypes = "template: [+value+]"; + $grd->colTypes = "template: [+e.value+]"; $grd->fields = "name,type"; echo $grd->render(); ?> diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index cd20da989f..611a781f85 100755 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,44 +1,44 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -if(!$modx->hasPermission('change_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} -?> - - - -

    - - - -
    -
    -
    - - -

    -
    -
    :
    -
    -
    -
    -
    :
    -
    -
    - - -
    -
    +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} +?> + + + +

    + + + +
    +
    +
    + + +

    +
    +
    :
    +
    +
    +
    +
    :
    +
    +
    + + +
    +
    diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 358be2f648..a07f557c99 100755 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -26,13 +26,14 @@ // check to see the plugin isn't locked if ($lockedEl = $modx->elementIsLocked(5, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['plugin'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['plugin'])); } // end check for lock // Lock plugin for other users to edit $modx->lockElement(5, $id); +$content = array(); if (isset($_GET['id'])) { $rs = $modx->db->select('*', $tbl_site_plugins, "id='{$id}'"); $content = $modx->db->getRow($rs); @@ -46,7 +47,7 @@ $content['properties'] = str_replace("&", "&", $content['properties']); } else { $_SESSION['itemname'] = $_lang["new_plugin"]; - $content['category'] = (int)$_REQUEST['catid']; + if ( !empty($_REQUEST['catid']) ) $content['category'] = (int)$_REQUEST['catid']; } if ($modx->manager->hasFormValues()) { @@ -81,7 +82,7 @@ function bold($cond = false) }, duplicate: function() { if (confirm('') === true) { documentDirty = false; - document.location.href = "index.php?id=&a=105"; + document.location.href = "index.php?id=&a=105"; } }, delete: function() { if (confirm('') === true) { @@ -481,11 +482,11 @@ function contains(a, obj)
    - +

    - (' . $content['id'] . ')' : $_lang['new_plugin']) ?> + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['new_plugin']) ?>

    @@ -512,7 +513,7 @@ function contains(a, obj) hasPermission('save_role')): ?> @@ -526,7 +527,7 @@ function contains(a, obj)
    - +
    @@ -537,7 +538,9 @@ function contains(a, obj) $v) { - echo '"; + $selected = ''; + if ( !empty($content['category']) ) $selected = ($content["category"] == $v["id"]) ? ' selected="selected"' : ''; + echo '"; } ?> @@ -553,7 +556,7 @@ function contains(a, obj) hasPermission('save_role')): ?>
    - +
    diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index bfef13e517..da6bfb2e49 100755 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -47,7 +47,7 @@ $sortableList .= '
    ' . $plugins['evtname'] . '
      '; $insideUl = 1; } - $sortableList .= '
    • ' . $plugins['name'] . ($plugins['disabled'] ? ' (hide)' : '') . '
    • '; + $sortableList .= '
    • ' . $modx->htmlspecialchars($plugins['name']) . ($plugins['disabled'] ? ' (hide)' : '') . '
    • '; $preEvt = $plugins['evtid']; } if ($insideUl) { diff --git a/manager/actions/mutate_role.dynamic.php b/manager/actions/mutate_role.dynamic.php index 3a78cb939d..d922410da4 100755 --- a/manager/actions/mutate_role.dynamic.php +++ b/manager/actions/mutate_role.dynamic.php @@ -24,7 +24,7 @@ // check to see the snippet editor isn't locked if($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['role'])); } // end check for lock @@ -39,7 +39,7 @@ } $_SESSION['itemname'] = $roledata['name']; } else { - $roledata = 0; + $roledata = []; $_SESSION['itemname'] = $_lang["new_role"]; } @@ -80,10 +80,10 @@ function changestate(element) { - +

      - (' . $roledata['id'] . ')' : $_lang['role_title']) ?> + htmlspecialchars($roledata['name']) . (isset($roledata['id']) ? '(' . $roledata['id'] . ')' : '') : $_lang['role_title']) ?>

      @@ -93,11 +93,11 @@ function changestate(element) {
      :
      -
      +
      :
      -
      +
      @@ -309,8 +309,8 @@ function render_form($name, $label, $status = '') { [+label+] '; - $checked = ($roledata[$name] == 1) ? 'checked' : ''; - $value = ($roledata[$name] == 1) ? 1 : 0; + $checked = (isset($roledata[$name]) && $roledata[$name] == 1) ? 'checked' : ''; + $value = (isset($roledata[$name]) && $roledata[$name] == 1) ? 1 : 0; if($status == 'disabled') { $checked = 'checked'; $value = 1; diff --git a/manager/actions/mutate_settings/functions.js b/manager/actions/mutate_settings/functions.js index 084a930306..5dbb90671d 100755 --- a/manager/actions/mutate_settings/functions.js +++ b/manager/actions/mutate_settings/functions.js @@ -50,22 +50,23 @@ function updateContentType(){ * @param string default_str default value of string for loaded manager language - allows some level of confirmation of change from default */ function confirmLangChange(el, lkey, elupd){ - lang_current = document.getElementById(elupd).value; - lang_default = document.getElementById(lkey+'_hidden').value; - changed = lang_current != lang_default; - proceed = true; + var lang = el.options[el.selectedIndex].value; + var lang_default = document.getElementById(lkey+'_hidden').value; + var changed = lang != lang_default; + var proceed = true; if(changed) { proceed = confirm(lang_chg); } if(proceed) { //document.getElementById(elupd).value = ''; - lang = el.options[el.selectedIndex].value; - var myAjax = new Ajax('index.php?a=118', { - method: 'post', - data: 'action=get&lang='+lang+'&key='+lkey - }).request(); - myAjax.addEvent('onComplete', function(resp){ - document.getElementById(elupd).value = resp; - }); + $.post('index.php?a=118', { + action: 'get', + lang: lang !== '' ? lang : lang_default, + key: lkey + }, + function(resp) { + document.getElementById(elupd).value = resp; + } + ); } } diff --git a/manager/actions/mutate_settings/snippet_smtp.inc.php b/manager/actions/mutate_settings/snippet_smtp.inc.php index f22c3b186f..2a670eb366 100755 --- a/manager/actions/mutate_settings/snippet_smtp.inc.php +++ b/manager/actions/mutate_settings/snippet_smtp.inc.php @@ -1,53 +1,53 @@ -
    ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '' . $modx->htmlspecialchars($row['caption']) . $tvName . '' . $tvDescription . $tvInherited . '
    ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    +
    diff --git a/manager/actions/mutate_settings/tab1_site_settings.inc.php b/manager/actions/mutate_settings/tab1_site_settings.inc.php index 01c7f49ffa..0905af13e0 100755 --- a/manager/actions/mutate_settings/tab1_site_settings.inc.php +++ b/manager/actions/mutate_settings/tab1_site_settings.inc.php @@ -1,352 +1,342 @@ - - - -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    [(site_status)]
    -
    - -
    htmlspecialchars($_lang['sitename_title']) ?>
    [(site_name)]
    -
    -

    [(emailsender)]
    -
    -

    [(site_start)]
    -
    -

    [(error_page)]
    -
    -

    [(unauthorized_page)]
    -
    -

    [(site_unavailable_page)]
    -
    -

    [(site_unavailable_message)] -
    -

    - -
    - -
    -

    [(default_template)]
    - db->select( - 't.templatename, t.id, c.category', - $modx->getFullTableName('site_templates')." AS t - LEFT JOIN ".$modx->getFullTableName('categories')." AS c ON t.category = c.id", - "", - 'c.category, t.templatename ASC' - ); - ?> - -
    - - -
    -

    [(auto_template_logic)]
    -

    -
    -
    -
    -

    [(chunk_processor)]
    -
    - -

    [(enable_mootools)]
    -
    - -
    - -
    -

    [(enable_at_syntax)]
    -
    - -
    - - -
    -

    [(enable_filter)]
    - db->getRecordCount( - $modx->db->select('id', '[+prefix+]site_plugins', - "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") - ); - if($count) { - $disabledFilters = 1; - echo ''.$_lang['enable_filter_phx_warning'].'
    '; - } - else $disabledFilters = false; - ?> -
    - -
    -

    [(publish_default)]
    -
    - -
    -

    [(cache_default)]
    -
    - -
    -

    [(search_default)]
    -
    - -
    -

    [(auto_menuindex)]
    -
    - -
    -

    -
    - - -  
    -
    -

    [(docid_incrmnt_method)]
    -
    - -
    -
    -

    [(enable_cache)]
    -
    -
    - -

    [(disable_chunk_cache)]
    -
    -
    -

    [(disable_snippet_cache)]
    -
    -
    -

    [(disable_plugins_cache)]
    -
    -
    -

    [(cache_type)]
    -
    - -

    [(minifyphp_incache)]
    -
    - -
    -

    [(server_offset_time)]
    -
    -

    [(server_protocol)]
    -
    - -
    -

    [(rss_url_news)]
    -
    -

    [(track_visitors)]
    -
    - -
    -
    - invokeEvent('OnSiteSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); - ?> -
    - -
    + + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    [(site_status)]
    +
    + +
    htmlspecialchars($_lang['sitename_title']) ?>
    [(site_name)]
    +
    +

    [(emailsender)]
    +
    +

    [(site_start)]
    +
    +

    [(error_page)]
    +
    +

    [(unauthorized_page)]
    +
    +

    [(site_unavailable_page)]
    +
    +

    [(site_unavailable_message)] +
    +

    + +
    + +
    +

    [(default_template)]
    + db->select( + 't.templatename, t.id, c.category', + $modx->getFullTableName('site_templates')." AS t + LEFT JOIN ".$modx->getFullTableName('categories')." AS c ON t.category = c.id", + "", + 'c.category, t.templatename ASC' + ); + ?> + +
    + + +
    +

    [(auto_template_logic)]
    +

    +
    +
    +
    +

    [(chunk_processor)]
    +
    + +

    [(enable_at_syntax)]
    +
    + +
    + + +
    +

    [(enable_filter)]
    + db->getRecordCount( + $modx->db->select('id', '[+prefix+]site_plugins', + "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") + ); + if($count) { + $disabledFilters = 1; + echo ''.$_lang['enable_filter_phx_warning'].'
    '; + } + else $disabledFilters = false; + ?> +
    + +
    +

    [(publish_default)]
    +
    + +
    +

    [(cache_default)]
    +
    + +
    +

    [(search_default)]
    +
    + +
    +

    [(auto_menuindex)]
    +
    + +
    +

    +
    + + +  
    +
    +

    [(docid_incrmnt_method)]
    +
    + +
    +
    +

    [(enable_cache)]
    +
    +
    + +

    [(disable_chunk_cache)]
    +
    +
    +

    [(disable_snippet_cache)]
    +
    +
    +

    [(disable_plugins_cache)]
    +
    +
    +

    [(cache_type)]
    +
    + +

    [(minifyphp_incache)]
    +
    + +
    +

    [(server_offset_time)]
    +
    +

    [(server_protocol)]
    +
    + +
    +

    [(rss_url_news)]
    +
    +

    [(track_visitors)]
    +
    + +
    +
    + invokeEvent('OnSiteSettingsRender'); + if(is_array($evtOut)) echo implode("",$evtOut); + ?> +
    + +
    diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index 78069daad7..166611dea7 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -104,8 +104,8 @@
    [(login_logo)] -
    - +
    +
    @@ -117,8 +117,8 @@
    [(login_bg)] -
    - +
    +
    diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 196751db7f..4b56686900 100755 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -27,7 +27,7 @@ // check to see the snippet editor isn't locked if ($lockedEl = $modx->elementIsLocked(4, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['snippet'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['snippet'])); } // end check for lock @@ -50,7 +50,7 @@ $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_snippet"]; - $content['category'] = (int)$_REQUEST['catid']; + if (!empty($_REQUEST['catid'])) $content['category'] = (int)$_REQUEST['catid']; } if ($modx->manager->hasFormValues()) { @@ -75,7 +75,7 @@ }, duplicate: function() { if (confirm('') === true) { documentDirty = false; - document.location.href = "index.php?id=&a=98"; + document.location.href = "index.php?id=&a=98"; } }, delete: function() { if (confirm('') === true) { @@ -431,11 +431,11 @@ function contains(a, obj) $docBlockList = $modx->convertDocBlockIntoList($parsed); ?> - +

    - (' . $content['id'] . ')' : $_lang['new_snippet']) ?> + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['new_snippet']) ?>

    @@ -459,10 +459,10 @@ function contains(a, obj)
    - + hasPermission('save_role')): ?> @@ -476,7 +476,7 @@ function contains(a, obj)
    - +
    @@ -487,7 +487,9 @@ function contains(a, obj) $v) { - echo ''; + $selected = ''; + if ( isset($content['category']) ) $selected = ($content['category'] == $v['id']) ? ' selected="selected"' : ''; + echo ''; } ?> @@ -504,7 +506,7 @@ function contains(a, obj)
    - +
    @@ -521,7 +523,7 @@ function contains(a, obj)
    - +
    @@ -552,8 +554,8 @@ function contains(a, obj) +
    diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index 6e8a7e843e..9b524cbba1 100755 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -45,9 +45,9 @@ if ($modx->db->getRecordCount($rs)) { $sortableList = '
      '; while ($row = $modx->db->getRow($rs)) { - $templatename = $row['templatename']; - $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; - $sortableList .= '
    • ' . $caption . ' [*' . $row['name'] . '*]
    • '; + $templatename = $modx->htmlspecialchars($row['templatename']); + $caption = $modx->htmlspecialchars($row['caption'] != '' ? $row['caption'] : $row['name']); + $sortableList .= '
    • ' . $caption . ' [*' . $modx->htmlspecialchars($row['name']) . '*]
    • '; } $sortableList .= '
    '; } else { diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 4d4071a44f..61fd8a902b 100755 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -24,7 +24,7 @@ // check to see the snippet editor isn't locked if($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['template'])); } // end check for lock @@ -109,7 +109,7 @@

    - (' . $content['id'] . ')' : $_lang['new_template']) ?> + htmlspecialchars($content['templatename']) . '(' . $content['id'] . ')' : $_lang['new_template']) ?>

    @@ -141,7 +141,7 @@ hasPermission('save_role')): ?> @@ -153,7 +153,7 @@
    - +
    @@ -173,7 +173,7 @@
    - +
    @@ -190,7 +190,7 @@
    - +
    @@ -218,7 +218,7 @@ } // Catch checkboxes if form not validated - if(isset($_POST['assignedTv'])) { + if(isset($_POST['assignedTv']) && is_array($_POST['assignedTv'])) { $selectedTvs = array(); foreach($_POST['assignedTv'] as $tvid) { if(isset($unselectedTvs[$tvid])) { @@ -250,9 +250,9 @@ if($total > 0) { $tvList .= '
      '; foreach($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $desc = !empty($row['tvdescription']) ? '  (' . $modx->htmlspecialchars($row['tvdescription']) . ')' : ''; $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $modx->htmlspecialchars($row['tvname']), $row['tvid'], $modx->htmlspecialchars($row['tvcaption']), $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); } $tvList .= '
    '; @@ -272,13 +272,13 @@ $row['category'] = stripslashes($row['category']); //pixelchutes if($preCat !== $row['category']) { $tvList .= $insideUl ? '' : ''; - $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $tvList .= '
    • ' . $modx->htmlspecialchars($row['category']) . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
        '; $insideUl = 1; } - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $desc = !empty($row['tvdescription']) ? '  (' . $modx->htmlspecialchars($row['tvdescription']) . ')' : ''; $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
      • %s %s
      • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= sprintf('
      • %s %s
      • ', $row['tvid'], $modx->htmlspecialchars($row['tvname']), $row['tvid'], $modx->htmlspecialchars($row['tvcaption']), $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); $tvList .= ''; $preCat = $row['category']; diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 459ca8c2d6..e8a5aa037f 100755 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -20,7 +20,7 @@ // check to see the snippet editor isn't locked if($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['tmplvar'])); } // end check for lock @@ -44,7 +44,7 @@ $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_tmplvars"]; - $content['category'] = (int)$_REQUEST['catid']; + if (!empty($_REQUEST['catid'])) $content['category'] = (int)$_REQUEST['catid']; } if($modx->manager->hasFormValues()) { @@ -52,6 +52,8 @@ } $content = array_merge($content, $_POST); +$content['type'] = $content['type'] ?? ''; +$content['display'] = $content['display'] ?? ''; // Add lock-element JS-Script $lockElementId = $id; @@ -96,7 +98,7 @@ function check_all() { duplicate: function() { if(confirm("") === true) { documentDirty = false; - document.location.href = "index.php?id=&a=304"; + document.location.href = "index.php?id=&a=304"; } }, delete: function() { @@ -283,15 +285,15 @@ function decode(s) { echo implode("", $evtOut); } ?> - + - +

        - (' . $content['id'] . ')' : $_lang['new_tmplvars']) ?> + htmlspecialchars($content['name']) . '(' . $content['id'] . ')' : $_lang['new_tmplvars'] ?>

        @@ -313,10 +315,10 @@ function decode(s) {
        - + " class="form-control form-control-lg" onchange="documentDirty=true;" /> hasPermission('save_role')): ?> @@ -328,13 +330,13 @@ function decode(s) {
        - + " class="form-control" onchange="documentDirty=true;" />
        - + " class="form-control" onChange="documentDirty=true;">
        @@ -345,7 +347,9 @@ function decode(s) { $v) { - echo ""; + $selected = ''; + if ( !empty($content['category']) ) $selected = ($content["category"] == $v["id"]) ? " selected='selected'" : ''; + echo ""; } ?> @@ -400,7 +404,7 @@ function decode(s) {
        - +
        @@ -408,7 +412,7 @@ function decode(s) {
        - +
        @@ -466,7 +470,7 @@ function decode(s) { $row['category'] = stripslashes($row['category']); //pixelchutes if($preCat !== $row['category']) { $tplList .= $insideUl ? '
      ' : ''; - $tplList .= '
    • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
        '; + $tplList .= '
      • ' . $modx->htmlspecialchars($row['category']) . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
          '; $insideUl = 1; } @@ -474,7 +478,7 @@ function decode(s) { $checked = true; } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { $checked = true; - } elseif($id == 0 && is_array($_POST['template'])) { + } elseif($id == 0 && isset($_POST['template']) && is_array($_POST['template'])) { $checked = in_array($row['id'], $_POST['template']); } else { $checked = $row['tmplvarid']; @@ -482,7 +486,7 @@ function decode(s) { $selectable = !$row['selectable'] ? ' class="disabled"' : ''; $checked = $checked ? ' checked="checked"' : ''; $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + $desc = !empty($row['tpldescription']) ? ' - ' . $modx->htmlspecialchars($row['tpldescription']) : ''; $tplInfo = array(); if($row['tpllocked']) { @@ -493,7 +497,7 @@ function decode(s) { } $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - $tplList .= sprintf('
        • %s%s%s%s
        • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= sprintf('
        • %s%s%s%s
        • ', $selectable, $row['id'], $checked, $modx->htmlspecialchars($row['templatename']), $tplId, $desc, $tplInfo); $tplList .= ''; $preCat = $row['category']; @@ -552,7 +556,7 @@ function makePublic(b) { if($checked) { $notPublic = true; } - $chks .= "
        • "; + $chks .= "
        • "; } else { if($checked) { echo ""; diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index 432f0ab537..30c191ea9f 100755 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -39,8 +39,8 @@ if ($modx->db->getRecordCount($rs)) { $sortableList = '
            '; while ($row = $modx->db->getRow($rs)) { - $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; - $sortableList .= '
          • ' . $caption . ' [*' . $row['name'] . '*]
          • '; + $caption = $modx->htmlspecialchars($row['caption'] != '' ? $row['caption'] : $row['name']); + $sortableList .= '
          • ' . $caption . ' [*' . $modx->htmlspecialchars($row['name']) . '*]
          • '; } $sortableList .= '
          '; } else { diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index f0d739855d..2f382585e1 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -218,7 +218,7 @@ function showHide(what, onoff) { " />

          - (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> + htmlspecialchars($usernamedata['username']) . (isset($usernamedata['id']) ? '(' . $usernamedata['id'] . ')' : '') : $_lang['user_title']) ?>

          @@ -318,7 +318,7 @@ function showHide(what, onoff) { $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; } ?> - + @@ -766,7 +766,7 @@ function SetUrl(url, width, height, alt) { - +
  • @@ -790,7 +790,7 @@ function SetUrl(url, width, height, alt) { db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); while($row = $modx->db->getRow($rs)) { - echo "
    "; + echo "
    "; } } ?> diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 94ec4560c0..39e9cc7f5e 100755 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,560 +1,564 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} - -switch($modx->manager->action) { - case 88: - if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if(!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; - - -// check to see the snippet editor isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); - -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); -} -// end check for lock - -if($modx->manager->action == '88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; - extract($usersettings, EXTR_OVERWRITE); - - if (!isset($usersettings['login_home'])) { - $usersettings['login_home'] = ''; - } - - if (!isset($usersettings['allowed_ip'])) { - $usersettings['allowed_ip'] = ''; - } - - if (!isset($usersettings['allowed_days'])) { - $usersettings['allowed_days'] = ''; - } - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; -} else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; -} - -// avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); -} -if (!isset($userdata['failedlogins'])) { - $userdata['failedlogins'] = 0; -} -$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); - -// restore saved form -$formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); -} - -// include the country list language file -$_country_lang = array(); -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; -} else { - include_once "lang/country/english_country.inc.php"; -} -asort($_country_lang); - -$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; -?> - - - - invokeEvent("OnWUsrFormPrerender", array("id" => $user)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> - - - - " /> - -

    - (' . $usernamedata['id'] . ')' : $_lang['web_user_title']) ?> -

    - - - - -
    - -
    - -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - manager->action == '88') { ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> - - - -
    : "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - - -
    : 
    manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "87" ? " checked disabled" : ""; ?>> - " onChange="documentDirty=true;" /> -
    - " id="passwordBlock"> -
    - - /> - -
    - > - -
    -
    - - -
    - - -
    -
    -
    -
    -
    - - /> - -
    - /> - -
    -
    : 
    :  -
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;' readonly /> - " data-tooltip="">
    : 
    : 
    : manager->action == 87 ? 'checked ' : ''); ?>manager->action == 87 ? 'disabled' : ''); ?>>
    : 
    : toDateFormat($userdata['thislogin'] + $server_offset_time) ?>
    :  -    []
    :  time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0)) ? " checked='checked'" : ""; ?> /> -
    : " onBlur='documentDirty=true;' readonly /> - " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly /> - " data-tooltip="">
    -
    - - -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
    -
    - -
    - -
    - -
    - -
    - -
    - -
     
    -
    - - -
    -

    - - - - - - - - - - - - - - -
    -
     
    " />
    -
    - manager->action == '88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - // retain selected user groups between post - if(!empty($_POST['user_groups']) && is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - ?> -
    -

    - -

    - db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while($row = $modx->db->getRow($rs)) { - echo '
    '; - } - } - ?> -
    - invokeEvent("OnWUsrFormRender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> -
    -
    - - +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 88: + if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if(!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; + + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); + +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +} +// end check for lock + +if($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + extract($usersettings, EXTR_OVERWRITE); + + if (!isset($usersettings['login_home'])) { + $usersettings['login_home'] = ''; + } + + if (!isset($usersettings['allowed_ip'])) { + $usersettings['allowed_ip'] = ''; + } + + if (!isset($usersettings['allowed_days'])) { + $usersettings['allowed_days'] = ''; + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +} +if (!isset($userdata['failedlogins'])) { + $userdata['failedlogins'] = 0; +} +$usernamedata['username'] = html_entity_decode($usernamedata['username'] ?? '', ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + foreach ($_POST as $key => $value) { + if (is_scalar($key) && is_scalar($value)) { + $userdata[$key] = $value; + } + } + $userdata['dob'] = $modx->toTimeStamp($userdata['dob'] ?? ''); + $usernamedata['username'] = $userdata['newusername'] ?? ''; + $usernamedata['oldusername'] = isset($_POST['oldusername']) && is_scalar($_POST['oldusername']) ? $_POST['oldusername'] : ''; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = isset($_POST['allowed_days']) && is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} else { + include_once "lang/country/english_country.inc.php"; +} +asort($_country_lang); + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +?> + + +
    + invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + + " /> + +

    + htmlspecialchars($usernamedata['username']) . (isset($usernamedata['id']) ? '(' . $usernamedata['id'] . ')' : '') : $_lang['web_user_title']) ?> +

    + + + + +
    + +
    + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '88') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + time() && $userdata['blockeduntil'] != 0) || (isset($userdata['blockedafter']) && $userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
    : "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
    : 
    manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "87" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
    + " id="passwordBlock"> +
    + + /> + +
    + > + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + /> + +
    + /> + +
    +
    : 
    :  +
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;' readonly /> + " data-tooltip="">
    : 
    : 
    : manager->action == 87 ? 'checked ' : ''); ?>manager->action == 87 ? 'disabled' : ''); ?>>
    : 
    : toDateFormat($userdata['thislogin'] + $server_offset_time) ?>
    :  +    []
    :  time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0)) ? " checked='checked'" : ""; ?> /> +
    : " onBlur='documentDirty=true;' readonly /> + " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly /> + " data-tooltip="">
    +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    +
    + +
    + +
    + +
    + +
    + +
    + +
     
    +
    + + +
    +

    + + + + + + + + + + + + + + +
    +
     
    htmlspecialchars($userdata['photo'] ?? '') : $_style["tx"]; ?>" />
    +
    + manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if(!empty($_POST['user_groups']) && is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
    +

    + +

    + db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo '
    '; + } + } + ?> +
    + invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    +
    + +
    diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 41a2c19bb7..a14bf47842 100755 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -187,7 +187,7 @@ function setCheckbox(chk) $grd->itemClass = "tableItem"; $grd->altItemClass = "tableAltItem"; $grd->columns = $_lang["name"] . " ," . $_lang["description"]; - $grd->colTypes = "template: [+value+]"; + $grd->colTypes = "template: [+e.value+]||template:[+e.value+]"; $grd->colWidths = "45%"; $grd->fields = "name,description"; if (isset($_REQUEST['listmode']) && $_REQUEST['listmode'] == '1') { diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php index 8255a85aa4..89005304fa 100755 --- a/manager/actions/resources/functions.inc.php +++ b/manager/actions/resources/functions.inc.php @@ -1,267 +1,267 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} - -$tpl = array( - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') -); - -/** - * @param string $tpl - * @param array $ph - * @return string - */ -function parsePh($tpl, $ph) { - $modx = evolutionCMS(); global $_lang; - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); - return $modx->parseText($tpl, $ph); -} - -/** - * @param string|int $cssId - * @return string - */ -function renderViewSwitchButtons($cssId) { - $modx = evolutionCMS(); global $_lang, $tpl; - - return parsePh($tpl['viewForm'], array( - 'cssId' => $cssId - )); -} - -/** - * @param string $resourceTable - * @param mgrResources $resources - * @return string - */ -function createResourceList($resourceTable, $resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; - - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; - - if( ! is_array($items) || empty($items)) { - return $_lang['no_results']; - } - - // Prepare elements- and categories-list - $elements = array(); - $categories = array(); - foreach($items as $row) { - $catid = $row['catid'] ? $row['catid'] : 0; - $categories[$catid] = array('name' => stripslashes($row['category'])); - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); - } - - // Now render categories / panel-collapse - $panelGroup = ''; - foreach($elements as $catid => $elList) { - // Add panel-heading / category-collapse to output - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => $resourceTable, - 'category' => $categories[$catid]['name'], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); - - // Prepare content for panel-collapse - $panelCollapse = ''; - foreach($elList as $el) { - $panelCollapse .= parsePh($tpl['elementsRow'], $el); - } - - // Add panel-collapse with elements to output - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => $resourceTable, - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } - - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => $resourceTable, - 'wrapper' => $panelGroup - )); -} - -/** - * @param mgrResources $resources - * @return string - */ -function createCombinedView($resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; - - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; - $types = isset($resources->types) ? $resources->types : false; - $categories = isset($resources->categories) ? $resources->categories : false; - - if(!$itemsPerCategory) { - return $_lang['no_results']; - } - - $tpl = array( - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), - ); - - // Easily loop through $itemsPerCategory-Array - $panelGroup = ''; - foreach($categories as $catid => $category) { - // Prepare collapse content / elements-list - $panelCollapse = ''; - foreach($itemsPerCategory[$catid] as $el) { - $resourceTable = $el['type']; - $ph = prepareElementRowPh($el, $resourceTable, $resources); - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); - } - - // Add panel-heading / button - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => 'categories_list', - 'category' => $categories[$catid], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); - - // Add panel - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => 'categories_list', - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } - - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => 'categories_list', - 'wrapper' => $panelGroup - )); -} - -/** - * @param array $row - * @param string $resourceTable - * @param mgrResources $resources - * @return array - */ -function prepareElementRowPh($row, $resourceTable, $resources) { - $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; - - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; - - $_lang["confirm_delete"] = $_lang["delete"]; - $lockElementType = ''; - - switch($resourceTable){ - case 'site_templates': - $class = $row['selectable'] ? '' : 'disabledPlugin'; - $lockElementType = 1; - $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; - break; - case 'site_tmplvars': - $class = $row['reltpl'] ? '' : 'disabledPlugin'; - $lockElementType = 2; - $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; - break; - case 'site_htmlsnippets': - $class = $row['disabled'] ? 'disabledPlugin' : ''; - $lockElementType = 3; - $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; - break; - case 'site_snippets': - $class = $row['disabled'] ? 'disabledPlugin' : ''; - $lockElementType = 4; - $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; - break; - case 'site_plugins': - $class = $row['disabled'] ? 'disabledPlugin' : ''; - $lockElementType = 5; - $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; - break; - case 'site_modules': - $class = $row['disabled'] ? '' : 'disabledPlugin'; - $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; - break; - default: - return array(); - } - - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $lockElementType ? $modx->elementIsLocked($lockElementType, $row['id'], true) : null; - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - if($lockedByUser) { - $lockedByUser = '
    ' . $lockedByUser . '
    '; - } - - // Caption - if($resourceTable == 'site_tmplvars') { - $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; - } else { - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; - } - - // Special marks - $tplInfo = array(); - if($row['locked']) { - $tplInfo[] = $_lang['locked']; - } - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - - /* row buttons */ - $buttons = ''; - if($modx->hasPermission($types['actions']['edit'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['duplicate'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['remove'][1])) { - $buttons .= '
  • '; - } - $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; - - $catid = $row['catid'] ? $row['catid'] : 0; - - // Placeholders for elements-row - return array( - 'class' => $class ? ' class="' . $class . '"' : '', - 'lockedByUser' => $lockedByUser, - 'name' => $row['name'], - 'caption' => $caption, - 'buttons' => $buttons, - 'marks' => $marks, - 'id' => $row['id'], - 'resourceTable' => $resourceTable, - 'actionEdit' => $types['actions']['edit'][0], - 'catid' => $catid, - 'textdir' => $modx_textdir ? '‏' : '', - ); -} +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +$tpl = array( + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') +); + +/** + * @param string $tpl + * @param array $ph + * @return string + */ +function parsePh($tpl, $ph) { + $modx = evolutionCMS(); global $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); +} + +/** + * @param string|int $cssId + * @return string + */ +function renderViewSwitchButtons($cssId) { + $modx = evolutionCMS(); global $_lang, $tpl; + + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); +} + +/** + * @param string $resourceTable + * @param mgrResources $resources + * @return string + */ +function createResourceList($resourceTable, $resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; + + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + + if( ! is_array($items) || empty($items)) { + return $_lang['no_results']; + } + + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } + + // Now render categories / panel-collapse + $panelGroup = ''; + foreach($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); + + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } + + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } + + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); +} + +/** + * @param mgrResources $resources + * @return string + */ +function createCombinedView($resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; + + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; + + if(!$itemsPerCategory) { + return $_lang['no_results']; + } + + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); + + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } + + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); + + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } + + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); +} + +/** + * @param array $row + * @param string $resourceTable + * @param mgrResources $resources + * @return array + */ +function prepareElementRowPh($row, $resourceTable, $resources) { + $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; + + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + + $_lang["confirm_delete"] = $_lang["delete"]; + $lockElementType = ''; + + switch($resourceTable){ + case 'site_templates': + $class = $row['selectable'] ? '' : 'disabledPlugin'; + $lockElementType = 1; + $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; + break; + case 'site_tmplvars': + $class = $row['reltpl'] ? '' : 'disabledPlugin'; + $lockElementType = 2; + $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; + break; + case 'site_htmlsnippets': + $class = $row['disabled'] ? 'disabledPlugin' : ''; + $lockElementType = 3; + $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; + break; + case 'site_snippets': + $class = $row['disabled'] ? 'disabledPlugin' : ''; + $lockElementType = 4; + $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; + break; + case 'site_plugins': + $class = $row['disabled'] ? 'disabledPlugin' : ''; + $lockElementType = 5; + $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; + break; + case 'site_modules': + $class = $row['disabled'] ? '' : 'disabledPlugin'; + $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; + break; + default: + return array(); + } + + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $lockElementType ? $modx->elementIsLocked($lockElementType, $row['id'], true) : null; + if($rowLock && $modx->hasPermission('display_locks')) { + if($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $modx->htmlspecialchars($rowLock['username']), + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if($lockedByUser) { + $lockedByUser = '
    ' . $lockedByUser . '
    '; + } + + // Caption + if($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } + + // Special marks + $tplInfo = array(); + if($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + + /* row buttons */ + $buttons = ''; + if($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
  • '; + } + $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; + + $catid = $row['catid'] ? $row['catid'] : 0; + + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); +} diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php index 2b34adb3c3..6e32056103 100755 --- a/manager/actions/resources/mgrResources.class.php +++ b/manager/actions/resources/mgrResources.class.php @@ -1,165 +1,200 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -class mgrResources { +class mgrResources +{ /** * @var array */ - public $types = array(); + public $types = []; /** * @var array */ - public $items = array(); + public $items = []; /** * @var array */ - public $categories = array(); + public $categories = []; /** * @var array */ - public $itemsPerCategory = array(); + public $itemsPerCategory = []; /** * mgrResources constructor. */ - public function __construct() { - $this->setTypes(); - $this->queryItemsFromDB(); - $this->prepareCategoryArrays(); - } + public function __construct() + { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } /** * @return void */ - public function setTypes() { - global $_lang; - $this->types['site_templates'] = array( - 'title'=>$_lang["manage_templates"], - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), - 'permissions'=>array('new_template','edit_template'), - 'name'=>'templatename' - ); - $this->types['site_tmplvars'] = array( - 'title'=>$_lang["tmplvars"], - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), - 'permissions'=>array('new_template','edit_template'), - ); - $this->types['site_htmlsnippets'] = array( - 'title'=>$_lang["manage_htmlsnippets"], - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), - 'permissions'=>array('new_chunk','edit_chunk'), - ); - $this->types['site_snippets'] = array( - 'title'=>$_lang["manage_snippets"], - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), - 'permissions'=>array('new_snippet','edit_snippet'), - ); - $this->types['site_plugins'] = array( - 'title'=>$_lang["manage_plugins"], - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), - 'permissions'=>array('new_plugin','edit_plugin'), - ); - $this->types['site_modules'] = array( - 'title'=>$_lang["manage_modules"], - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), - 'permissions'=>array('new_module','edit_module'), - ); - } + public function setTypes() + { + global $_lang; + $this->types['site_templates'] = [ + 'title' => $_lang["manage_templates"], + 'actions' => [ + 'edit' => [16, 'edit_template'], 'duplicate' => [96, 'new_template'], + 'remove' => [21, 'delete_template'] + ], + 'permissions' => ['new_template', 'edit_template'], + 'name' => 'templatename' + ]; + $this->types['site_tmplvars'] = [ + 'title' => $_lang["tmplvars"], + 'actions' => [ + 'edit' => [301, 'edit_template'], 'duplicate' => [304, 'edit_template'], + 'remove' => [303, 'edit_template'] + ], + 'permissions' => ['new_template', 'edit_template'], + ]; + $this->types['site_htmlsnippets'] = [ + 'title' => $_lang["manage_htmlsnippets"], + 'actions' => [ + 'edit' => [78, 'edit_chunk'], 'duplicate' => [97, 'new_chunk'], 'remove' => [80, 'delete_chunk'] + ], + 'permissions' => ['new_chunk', 'edit_chunk'], + ]; + $this->types['site_snippets'] = [ + 'title' => $_lang["manage_snippets"], + 'actions' => [ + 'edit' => [22, 'edit_snippet'], 'duplicate' => [98, 'new_snippet'], 'remove' => [25, 'delete_snippet'] + ], + 'permissions' => ['new_snippet', 'edit_snippet'], + ]; + $this->types['site_plugins'] = [ + 'title' => $_lang["manage_plugins"], + 'actions' => [ + 'edit' => [102, 'edit_plugin'], 'duplicate' => [105, 'new_plugin'], 'remove' => [104, 'delete_plugin'] + ], + 'permissions' => ['new_plugin', 'edit_plugin'], + ]; + $this->types['site_modules'] = [ + 'title' => $_lang["manage_modules"], + 'actions' => [ + 'edit' => [108, 'edit_module'], 'duplicate' => [111, 'new_module'], 'remove' => [110, 'delete_module'] + ], + 'permissions' => ['new_module', 'edit_module'], + ]; + } /** * @return void */ - public function queryItemsFromDB() { - foreach($this->types as $resourceTable=>$type) { - if($this->hasAnyPermissions($type['permissions'])) { - $nameField = isset($type['name']) ? $type['name'] : 'name'; - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); - } - } - } + public function queryItemsFromDB() + { + foreach ($this->types as $resourceTable => $type) { + if ($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } /** - * @param array $permissions + * @param array $permissions * @return bool */ - public function hasAnyPermissions($permissions) { - $modx = evolutionCMS(); + public function hasAnyPermissions($permissions) + { + $modx = evolutionCMS(); - foreach($permissions as $p) - if($modx->hasPermission($p)) return true; + foreach ($permissions as $p) { + if ($modx->hasPermission($p)) { + return true; + } + } - return false; - } + return false; + } /** - * @param string $resourceTable - * @param string $nameField + * @param string $resourceTable + * @param string $nameField * @return array|bool */ - public function queryResources($resourceTable, $nameField = 'name') { - $modx = evolutionCMS(); global $_lang; + public function queryResources($resourceTable, $nameField = 'name') + { + $modx = evolutionCMS(); + global $_lang; - $allowed = array( + $allowed = [ 'site_htmlsnippets', 'site_snippets', 'site_plugins', 'site_modules' - ); - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if ($resourceTable === 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } - else $sttfield = ''; - - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + ]; + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable === 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', + $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } else { + $sttfield = ''; + } + + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - "category,name" - ); - $limit = $modx->db->getRecordCount($rs); - - if($limit < 1) return false; - - $result = array(); - while ($row = $modx->db->getRow($rs)) { - $result[] = $row; - } - return $result; - } + "", + "category,name" + ); + $limit = $modx->db->getRecordCount($rs); + + if ($limit < 1) { + return false; + } + + $result = []; + while ($row = $modx->db->getRow($rs)) { + foreach ($row as &$item) { + $item = str_replace(['<strong>', '</strong>'], ['', ''], htmlspecialchars($item)); + } + $result[] = $row; + } + return $result; + } /** * @return void */ - public function prepareCategoryArrays() { - foreach($this->items as $type=>$items) { - foreach((array)$items as $item) { - $catid = $item['catid'] ? $item['catid'] : 0; - $this->categories[$catid] = $item['category']; - - $item['type'] = $type; - $this->itemsPerCategory[$catid][] = $item; - } - } - - // Sort categories by name - natcasesort($this->categories); - - // Now sort by name - foreach($this->itemsPerCategory as $catid=>$items) { - usort($this->itemsPerCategory[$catid], function ($a, $b) { - return strcasecmp($a['name'], $b['name']); - }); - } - } + public function prepareCategoryArrays() + { + foreach ($this->items as $type => $items) { + foreach ((array) $items as $item) { + if (empty($item['catid'])) { + continue; + } + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach ($this->itemsPerCategory as $catid => $items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } } diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index bd6adb1dce..0095073a5e 100755 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -48,8 +48,8 @@ } else { ?> - - + htmlspecialchars($row['name']) ?> + htmlspecialchars($row['description']) ?> db->escape(trim($_REQUEST['searchfields'])); $search_alias = $modx->db->escape(trim($_REQUEST['searchfields'])); $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; - $searchcontent = $modx->db->escape($_REQUEST['content']); + $searchcontent = $modx->db->escape($_REQUEST['content'] ?? ''); $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; @@ -327,9 +327,9 @@ //templates if ($modx->hasPermission('edit_template')) { $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), - "`id` like '%" . $searchfields . "%' - OR `templatename` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `templatename` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' OR `content` like '%" . $searchfields . "%'"); $templatecounts = $modx->db->getRecordCount($rs); if ($templatecounts > 0) { @@ -344,13 +344,13 @@ //tvs if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), - "`id` like '%" . $searchfields . "%' - OR `name` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' - OR `type` like '%" . $searchfields . "%' - OR `elements` like '%" . $searchfields . "%' - OR `display` like '%" . $searchfields . "%' - OR `display_params` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `type` like '%" . $searchfields . "%' + OR `elements` like '%" . $searchfields . "%' + OR `display` like '%" . $searchfields . "%' + OR `display_params` like '%" . $searchfields . "%' OR `default_text` like '%" . $searchfields . "%'"); $tvscounts = $modx->db->getRecordCount($rs); if ($tvscounts > 0) { @@ -365,9 +365,9 @@ //Chunks if ($modx->hasPermission('edit_chunk')) { $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), - "`id` like '%" . $searchfields . "%' - OR `name` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' OR `snippet` like '%" . $searchfields . "%'"); $chunkscounts = $modx->db->getRecordCount($rs); if ($chunkscounts > 0) { @@ -383,11 +383,11 @@ //Snippets if ($modx->hasPermission('edit_snippet')) { $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), - "`id` like '%" . $searchfields . "%' - OR `name` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' - OR `snippet` like '%" . $searchfields . "%' - OR `properties` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `snippet` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' OR `moduleguid` like '%" . $searchfields . "%'"); $snippetscounts = $modx->db->getRecordCount($rs); if ($snippetscounts > 0) { @@ -403,11 +403,11 @@ //plugins if ($modx->hasPermission('edit_plugin')) { $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), - "`id` like '%" . $searchfields . "%' - OR `name` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' - OR `plugincode` like '%" . $searchfields . "%' - OR `properties` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `plugincode` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' OR `moduleguid` like '%" . $searchfields . "%'"); $pluginscounts = $modx->db->getRecordCount($rs); if ($pluginscounts > 0) { @@ -423,12 +423,12 @@ //modules if ($modx->hasPermission('edit_module')) { $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), - "`id` like '%" . $searchfields . "%' - OR `name` like '%" . $searchfields . "%' - OR `description` like '%" . $searchfields . "%' - OR `modulecode` like '%" . $searchfields . "%' - OR `properties` like '%" . $searchfields . "%' - OR `guid` like '%" . $searchfields . "%' + "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `modulecode` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' + OR `guid` like '%" . $searchfields . "%' OR `resourcefile` like '%" . $searchfields . "%'"); $modulescounts = $modx->db->getRecordCount($rs); if ($modulescounts > 0) { diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 4538038d8d..ac4e60ae64 100755 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -130,8 +130,8 @@ function menuAction(a) { if(!empty($sqlQuery)) { $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; } - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu - INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu + INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; @@ -156,11 +156,11 @@ function menuAction(a) { $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center"; $grd->colTypes = implode('||', array( 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', + 'template:[+e.value+]', + 'template:[+e.fullname+]', + 'template:[+e.role+]', 'template:[+email+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' H:i', 'template:[+logincount+]', 'template:[+blocked+]' )); diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index dd4fba48a5..61d83b3db9 100755 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -13,7 +13,7 @@ } else { $docgroupselector = '\n"; } @@ -24,7 +24,7 @@ } else { $usrgroupselector = '\n"; } diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 4565c8a247..70819c2af1 100755 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -8,7 +8,7 @@ // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); - +$sqlQuery = ''; // get and save search string if(isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') { $query = ''; @@ -90,7 +90,7 @@ function menuAction(a) {
    - + @@ -124,7 +124,7 @@ function menuAction(a) {
    db->select("wu.id, wu.username, wua.fullname, wua.email, wua.thislogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.thislogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items @@ -137,8 +137,8 @@ function menuAction(a) { $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"]; $grd->colWidths = "1%,,,,1%,1%,1%"; $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center"; - $grd->colTypes = "template:||template:[+value+]||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . - " %H:%M"; + $grd->colTypes = "template:||template:[+value+]||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . + " H:i"; if($listmode == '1') { $grd->pageSize = 0; } diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index add71b8581..5818c1c38d 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - exit(''); + // seems to be a new install - send the user to the configuration page + exit(''); } // set placeholders @@ -17,92 +17,92 @@ // setup message info if($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; - $msg = array(); - $msg[] = sprintf('', $_style['icons_mail_large']); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; - $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); - $msg[] = sprintf('%s', $welcome_messages); - $ph['MessageInfo'] = implode("\n", $msg); + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = implode("\n", $msg); } // setup icons if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { - $icon = ' [%user_management_title%]'; - $ph['SecurityIcon'] = wrapIcon($icon, 75); + $icon = ' [%user_management_title%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { - $icon = ' [%web_user_management_title%]'; - $ph['WebUserIcon'] = wrapIcon($icon, 99); + $icon = ' [%web_user_management_title%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = ' [%modules%]'; - $ph['ModulesIcon'] = wrapIcon($icon, 106); + $icon = ' [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = ' [%elements%]'; - $ph['ResourcesIcon'] = wrapIcon($icon, 76); + $icon = ' [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } if($modx->hasPermission('bk_manager')) { - $icon = ' [%backup%]'; - $ph['BackupIcon'] = wrapIcon($icon, 93); + $icon = ' [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } if($modx->hasPermission('help')) { - $icon = ' [%help%]'; - $ph['HelpIcon'] = wrapIcon($icon, 9); + $icon = ' [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } if($modx->hasPermission('new_document')) { - $icon = '[%add_resource%]'; - $ph['ResourceIcon'] = wrapIcon($icon, 4); - $icon = '[%add_weblink%]'; - $ph['WeblinkIcon'] = wrapIcon($icon, 72); + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); } if($modx->hasPermission('assets_images')) { - $icon = '[%images_management%]'; - $ph['ImagesIcon'] = wrapIcon($icon, 72); + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); } if($modx->hasPermission('assets_files')) { - $icon = '[%files_management%]'; - $ph['FilesIcon'] = wrapIcon($icon, 72); + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); } if($modx->hasPermission('change_password')) { - $icon = '[%change_password%]'; - $ph['PasswordIcon'] = wrapIcon($icon, 28); + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); } $icon = '[%logout%]'; $ph['LogoutIcon'] = wrapIcon($icon, 8); // do some config checks if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); - if($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder if(isset($_SESSION['show_logout_reminder'])) { - switch($_SESSION['show_logout_reminder']['type']) { - case 'logout_reminder': - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); - break; - } - $ph['show_logout_reminder'] = 'block'; - unset($_SESSION['show_logout_reminder']); + switch($_SESSION['show_logout_reminder']['type']) { + case 'logout_reminder': + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); + break; + } + $ph['show_logout_reminder'] = 'block'; + unset($_SESSION['show_logout_reminder']); } else { - $ph['show_logout_reminder'] = 'none'; + $ph['show_logout_reminder'] = 'none'; } // Check multiple sessions @@ -111,13 +111,13 @@ //$count = $modx->db->getValue($rs); /* if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( - 'username' => $_SESSION['mgrShortname'], - 'total' => $count - )); - $ph['show_multiple_sessions'] = 'block'; + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); + $ph['show_multiple_sessions'] = 'block'; } else { - $ph['show_multiple_sessions'] = 'none'; + $ph['show_multiple_sessions'] = 'none'; }*/ $ph['show_multiple_sessions'] = 'none'; @@ -125,36 +125,36 @@ $tpl = ' - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
    [%yourinfo_username%][+username+]
    [%yourinfo_role%][+role+]
    [%yourinfo_previous_login%][+lastlogin+]
    [%yourinfo_total_logins%][+logincount+]
    [%inbox%][+msginfo+]
    [%yourinfo_username%][+username+]
    [%yourinfo_role%][+role+]
    [%yourinfo_previous_login%][+lastlogin+]
    [%yourinfo_total_logins%][+logincount+]
    [%inbox%][+msginfo+]
    '; $nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; $ph['UserInfo'] = $modx->parseText($tpl, array( - 'username' => $modx->getLoginUserName(), - 'role' => $_SESSION['mgrPermissions']['name'], - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), - 'logincount' => $_SESSION['mgrLogincount'] + 1, - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) )); $from = array(); @@ -163,59 +163,59 @@ $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); if($modx->db->getRecordCount($rs) < 1) { - $html = '

    [%no_active_users_found%]

    '; + $html = '

    [%no_active_users_found%]

    '; } else { - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; - $ph['now'] = strftime('%H:%M:%S', $now); - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; - $html = ' -
    - [%onlineusers_message%] - [+now+]): -
    -
    - - - - - - - - - - - '; - - $userList = array(); - $userCount = array(); - // Create userlist with session-count first before output - while($activeusers = $modx->db->getRow($rs)) { - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; - - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $userList[] = array( - $idle, - '', - $activeusers['username'], - $webicon, - abs($activeusers['internalKey']), - $ip, - strftime($modx->toDateFormat(0,'formatOnly').' %H:%M:%S', $activeusers['lasthit'] + $server_offset_time), - $currentaction - ); - } - foreach($userList as $params) { - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; - $html .= "\n\t\t" . vsprintf('', $params); - } - - $html .= ' - -
    [%onlineusers_user%]ID[%onlineusers_ipaddress%][%onlineusers_lasthit%][%onlineusers_action%]                   
    %s%s%s%s%s%s
    + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = date('H:i:s', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = ' +
    + [%onlineusers_message%] + [+now+]): +
    +
    + + + + + + + + + + + '; + + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + date($modx->toDateFormat(0,'formatOnly').' H:i:s', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n\t\t" . vsprintf('', $params); + } + + $html .= ' + +
    [%onlineusers_user%]ID[%onlineusers_ipaddress%][%onlineusers_lasthit%][%onlineusers_action%]                   
    %s%s%s%s%s%s
    '; } @@ -254,135 +254,135 @@ // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); if(is_array($evtOut)) { - $output = implode('', $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } $buttons = ''; if($modx->hasPermission('new_document')) { - $buttons .=' - - - [%add_resource%] - - - - - - [%add_weblink%] - - '; + $buttons .=' + + + [%add_resource%] + + + + + + [%add_weblink%] + + '; } if($modx->hasPermission('assets_images')) { - $buttons .=' - - - [%images_management%] - - '; + $buttons .=' + + + [%images_management%] + + '; } if($modx->hasPermission('assets_files')) { - $buttons .=' - - - [%files_management%] - - '; + $buttons .=' + + + [%files_management%] + + '; } if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { - $buttons .=' - - - [%elements%] - - '; + $buttons .=' + + + [%elements%] + + '; } if($modx->hasPermission('bk_manager')) { - $buttons .=' - - - [%backup%] - - '; + $buttons .=' + + + [%backup%] + + '; } if($modx->hasPermission('change_password')) { - $buttons .=' - - - [%change_password%] - - '; + $buttons .=' + + + [%change_password%] + + '; } $buttons .=' - - - [%logout%] - - '; + + + [%logout%] + + '; $messages = ''; if($modx->hasPermission('messages')) { - $messages = ' - [%inbox%] - [[#getMessageCount]] - '; + $messages = ' + [%inbox%] + [[#getMessageCount]] + '; } $widgets['welcome'] = array( - 'menuindex' => '10', - 'id' => 'welcome', - 'cols' => 'col-lg-6', - 'icon' => 'fa-home', - 'title' => '[%welcome_title%]', - 'body' => ' -
    - '.$buttons.' -
    -
    - - - - - - - - - - - - - - - - - - '.$messages.' -
    [%yourinfo_username%][[#getLoginUserName]]
    [%yourinfo_role%][[$_SESSION[\'mgrPermissions\'][\'name\'] ]]
    [%yourinfo_previous_login%][[$_SESSION[\'mgrLastlogin\']:math(\'%s+[(server_offset_time)]\'):dateFormat]]
    [%yourinfo_total_logins%][[$_SESSION[\'mgrLogincount\']:math(\'%s+1\')]]
    -
    - ', - 'hide'=>'0' + 'menuindex' => '10', + 'id' => 'welcome', + 'cols' => 'col-lg-6', + 'icon' => 'fa-home', + 'title' => '[%welcome_title%]', + 'body' => ' +
    + '.$buttons.' +
    +
    + + + + + + + + + + + + + + + + + + '.$messages.' +
    [%yourinfo_username%][[#getLoginUserName]]
    [%yourinfo_role%][[$_SESSION[\'mgrPermissions\'][\'name\'] ]]
    [%yourinfo_previous_login%][[$_SESSION[\'mgrLastlogin\']:math(\'%s+[(server_offset_time)]\'):dateFormat]]
    [%yourinfo_total_logins%][[$_SESSION[\'mgrLogincount\']:math(\'%s+1\')]]
    +
    + ', + 'hide'=>'0' ); $widgets['onlineinfo'] = array( - 'menuindex' => '20', - 'id' => 'onlineinfo', - 'cols' => 'col-lg-6', - 'icon' => 'fa-user', - 'title' => '[%onlineusers_title%]', - 'body' => '
    [+OnlineInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '20', + 'id' => 'onlineinfo', + 'cols' => 'col-lg-6', + 'icon' => 'fa-user', + 'title' => '[%onlineusers_title%]', + 'body' => '
    [+OnlineInfo+]
    ', + 'hide'=>'0' ); $widgets['recentinfo'] = array( - 'menuindex' => '30', - 'id' => 'modxrecent_widget', - 'cols' => 'col-sm-12', - 'icon' => 'fa-pencil-square-o', - 'title' => '[%activity_title%]', - 'body' => '
    [+RecentInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '30', + 'id' => 'modxrecent_widget', + 'cols' => 'col-sm-12', + 'icon' => 'fa-pencil-square-o', + 'title' => '[%activity_title%]', + 'body' => '
    [+RecentInfo+]
    ', + 'hide'=>'0' ); if ($modx->config['rss_url_news']) { $widgets['news'] = array( @@ -410,7 +410,7 @@ // invoke OnManagerWelcomeHome event $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); if(is_array($sitewidgets)) { - $newwidgets = array(); + $newwidgets = array(); foreach($sitewidgets as $widget){ $newwidgets = array_merge($newwidgets, unserialize($widget)); } @@ -418,49 +418,37 @@ } usort($widgets, function ($a, $b) { - return $a['menuindex'] - $b['menuindex']; + return $a['menuindex'] - $b['menuindex']; }); $tpl = getTplWidget(); $output = ''; foreach($widgets as $widget) { - if ($widget['hide'] != '1'){ - $output .= $modx->parseText($tpl, $widget); - } + if (!isset($widget['hide']) || $widget['hide'] != '1'){ + $output .= $modx->parseText($tpl, $widget); + } } $ph['widgets'] = $output; // load template -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; -} - -$target = $modx->config['manager_welcome_tpl']; +$target = $modx->getConfig('manager_welcome_tpl'); $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); if(substr($target, 0, 1) === '@') { - if(substr($target, 0, 6) === '@CHUNK') { - $content = $modx->getChunk(trim(substr($target, 7))); - } elseif(substr($target, 0, 5) === '@FILE') { - $content = file_get_contents(trim(substr($target, 6))); - } else { - $content = ''; - } + if(substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif(substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if($chunk !== false && !empty($chunk)) { - $content = $chunk; - } elseif(is_file(MODX_BASE_PATH . $target)) { - $content = file_get_contents(MODX_BASE_PATH . $target); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible - { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); - } else { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); - } + if(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders @@ -468,8 +456,8 @@ $content = $modx->mergeSettingsContent($content); $content = $modx->parseText($content, $ph); if(strpos($content, '[+') !== false) { - $modx->toPlaceholders($ph); - $content = $modx->mergePlaceholderContent($content); + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } $content = $modx->parseDocumentSource($content); $content = $modx->parseText($content, $_lang, '[%', '%]'); @@ -477,187 +465,187 @@ $content = $modx->cleanUpMODXTags($content); //cleanup if($js = $modx->getRegisteredClientScripts()) { - $content .= $js; + $content .= $js; } echo $content; // -// +// // // function getTplWidget() { // recent document info - return ' -
    -
    -
    [+title+]
    -
    [+body+]
    -
    -
    + return ' +
    +
    +
    [+title+]
    +
    [+body+]
    +
    +
    '; } function getRecentInfo() { // recent document info - $modx = evolutionCMS(); - - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); - - $html = ' -
    - - - - - - - - - - - - [[#recentInfoList]] - -
    [%id%][%resource_title%][%page_data_edited%][%user%][%mgrlog_action%]
    -
    + $modx = evolutionCMS(); + + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + + $html = ' +
    + + + + + + + + + + + + [[#recentInfoList]] + +
    [%id%][%resource_title%][%page_data_edited%][%user%][%mgrlog_action%]
    +
    '; - return $html; + return $html; } function getRecentInfoList() { - $modx = evolutionCMS(); - - $rs = $modx->db->select('id, pagetitle, editedon, editedby, deleted, published', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if($modx->db->getRecordCount($rs) < 1) { - return '[%no_activity_message%]'; - } - - $tpl = getRecentInfoRowTpl(); - - $btntpl['edit'] = ' '; - $btntpl['preview_btn'] = ' '; - - $output = array(); - while($ph = $modx->db->getRow($rs)) { - $docid = $ph['id']; - $_ = $modx->getUserInfo($ph['editedby']); - $ph['username'] = $_['username']; - - if($ph['deleted'] == 1) { - $ph['status'] = 'deleted text-danger'; - } elseif($ph['published'] == 0) { - $ph['status'] = 'unpublished font-italic text-muted'; - } else { - $ph['status'] = 'published'; - } - - if($modx->hasPermission('edit_document')) { - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); - } else { - $ph['edit_btn'] = ''; - } - - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; - $ph['preview_btn'] = str_replace(array( - '[+id+]', - '[+preview_disabled+]' - ), array( - $docid, - $preview_disabled - ), $btntpl['preview_btn']); - - if($modx->hasPermission('delete_document')) { - if($ph['deleted'] == 0) { - $delete_btn = ' '; - } else { - $delete_btn = ' '; - } - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); - } else { - $ph['delete_btn'] = ''; - } - - if($ph['deleted'] == 1 && $ph['published'] == 0) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { - $publish_btn = ' '; - } else { - $publish_btn = ' '; - } - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); - - $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + $modx = evolutionCMS(); + + $rs = $modx->db->select('id, pagetitle, editedon, editedby, deleted, published', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username'] ?? ''; + + if($ph['deleted'] == 1) { + $ph['status'] = 'deleted text-danger'; + } elseif($ph['published'] == 0) { + $ph['status'] = 'unpublished font-italic text-muted'; + } else { + $ph['status'] = 'published'; + } + + if($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if($modx->hasPermission('delete_document')) { + if($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); $ph['longtitle'] = !isset($ph['longtitle']) || $ph['longtitle'] == '' ? '([%not_set%])' : html_escape($ph['longtitle']); $ph['description'] = !isset($ph['description']) || $ph['description'] == '' ? '([%not_set%])' : html_escape($ph['description']); $ph['introtext'] = !isset($ph['introtext']) || $ph['introtext'] == '' ? '([%not_set%])' : html_escape($ph['introtext']); $ph['alias'] = !isset($ph['alias']) || $ph['alias'] == '' ? '([%not_set%])' : html_escape($ph['alias']); - $output[] = $modx->parseText($tpl, $ph); - } - return implode("\n", $output); + $output[] = $modx->parseText($tpl, $ph); + } + return implode("\n", $output); } function getRecentInfoRowTpl() { - $modx = EvolutionCMS(); - $tpl = ' - - [+id+] - [+pagetitle:htmlentities+] - [+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0,'formatOnly').' %H:%M:%S`+] - [+username:htmlentities+] - [+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+] - - - -
    -
      -
    • [%long_title%]: [+longtitle+]
    • -
    • [%description%]: [+description+]
    • -
    • [%resource_summary%]: [+introtext+]
    • -
    • [%type%]: [+type:is(reference):then([%weblink%]):else([%resource%])+]
    • -
    • [%resource_alias%]: [+alias+]
    • -
    • [%page_data_cacheable%]: [+cacheable:is(1):then([%yes%]):else([%no%])+]
    • -
    • [%resource_opt_show_menu%]: [+hidemenu:is(0):then([%yes%]):else([%no%])+]
    • -
    • [%page_data_template%]: [+template:templatename:htmlentities+]
    • -
    -
    - - '; - return $tpl; + $modx = EvolutionCMS(); + $tpl = ' + + [+id+] + [+pagetitle:htmlentities+] + [+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0,'formatOnly').' H:i:s`+] + [+username:htmlentities+] + [+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+] + + + +
    +
      +
    • [%long_title%]: [+longtitle+]
    • +
    • [%description%]: [+description+]
    • +
    • [%resource_summary%]: [+introtext+]
    • +
    • [%type%]: [+type:is(reference):then([%weblink%]):else([%resource%])+]
    • +
    • [%resource_alias%]: [+alias+]
    • +
    • [%page_data_cacheable%]: [+cacheable:is(1):then([%yes%]):else([%no%])+]
    • +
    • [%resource_opt_show_menu%]: [+hidemenu:is(0):then([%yes%]):else([%no%])+]
    • +
    • [%page_data_template%]: [+template:templatename:htmlentities+]
    • +
    +
    + + '; + return $tpl; } // setup icons function wrapIcon($i, $action) { - return sprintf('%s', $action, $i); + return sprintf('%s', $action, $i); } function getStartUpScript() { - $script = ' + $script = ' '; - return $script; + return $script; } diff --git a/manager/frames/1.php b/manager/frames/1.php index 8ee2d350b3..9537348d48 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,658 +1,679 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -header("X-XSS-Protection: 0"); - -$_SESSION['browser'] = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 1') !== false) ? 'legacy_IE' : 'modern'; - -// invoke OnManagerPreFrameLoader -$modx->invokeEvent('OnManagerPreFrameLoader', array('action' => $action)); - -$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; - -if (!isset($modx->config['manager_menu_height'])) { - $modx->config['manager_menu_height'] = 2.2; // rem -} - -if (!isset($modx->config['manager_tree_width'])) { - $modx->config['manager_tree_width'] = 20; // rem -} - -if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { - $initMainframeAction = $_SESSION['onLoginForwardToAction']; - unset($_SESSION['onLoginForwardToAction']); -} else { - $initMainframeAction = 2; // welcome.static -} - -if (!isset($_SESSION['tree_show_only_folders'])) { - $_SESSION['tree_show_only_folders'] = 0; -} - -$body_class = ''; -$menu_height = $modx->config['manager_menu_height']; -$tree_width = $modx->config['manager_tree_width']; -$tree_min_width = 0; - -if (isset($_COOKIE['MODX_widthSideBar'])) { - $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; -} else { - $MODX_widthSideBar = $tree_width; -} - -if (!$MODX_widthSideBar) { - $body_class .= 'sidebar-closed'; -} - -$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : ''; -$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); -if (!empty($theme_modes[$theme_mode])) { - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; -} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; -} - -$navbar_position = $modx->config['manager_menu_position']; -if ($navbar_position == 'left') { - $body_class .= ' navbar-left navbar-left-icon-and-text'; -} - -if (isset($modx->pluginCache['ElementsInTree'])) { - $body_class .= ' ElementsInTree'; -} - -$unlockTranslations = array( - 'msg' => $_lang["unlock_element_id_warning"], - 'type1' => $_lang["lock_element_type_1"], - 'type2' => $_lang["lock_element_type_2"], - 'type3' => $_lang["lock_element_type_3"], - 'type4' => $_lang["lock_element_type_4"], - 'type5' => $_lang["lock_element_type_5"], - 'type6' => $_lang["lock_element_type_6"], - 'type7' => $_lang["lock_element_type_7"], - 'type8' => $_lang["lock_element_type_8"] -); - -foreach ($unlockTranslations as $key => $value) { - $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); -} - -$user = $modx->getUserInfo($modx->getLoginUserID()); -if (isset($user['which_browser']) && $user['which_browser'] == 'default') { - $user['which_browser'] = $modx->config['which_browser']; -} - -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; - -if ($modx->config['manager_theme'] == 'default') { - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; - $minifier = new Formatter\CSSMinify(); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); - $css = $minifier->minify(); - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); - } - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; - } -} - -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); - -?> - -> - - <?= $site_name ?> (EVO CMS Manager) - - - - - - config['show_picker'] != "0") { ?> - - - - - - - - - - config['show_picker'] != "0") { ?> - - - - - invokeEvent('OnManagerTopPrerender', $_REQUEST); - if (is_array($evtOut)) { - echo implode("\n", $evtOut); - } - ?> - - - -
    - -
    - -
    -
    - config['global_tabs']): ?> -
    -

    -
    -
    - -
    - -
    - -
    - - -
    -
    -
    -
    - - - - - - - ', $action, $action); - echo sprintf(' %s
    ', $img, $text); - } - } - - ?> - - - config['show_fullscreen_btn'] != "0") { ?> - - - invokeEvent('OnManagerFrameLoader', array('action' => $action)); - ?> - -
    -config['show_picker'] != "0") { - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); -} ?> - - +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +header("X-XSS-Protection: 0"); + +$_SESSION['browser'] = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 1') !== false) ? 'legacy_IE' : 'modern'; + +// invoke OnManagerPreFrameLoader +$modx->invokeEvent('OnManagerPreFrameLoader', array('action' => $action)); + +$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; + +if (!isset($modx->config['manager_menu_height'])) { + $modx->config['manager_menu_height'] = 2.2; // rem +} + +if (!isset($modx->config['manager_tree_width'])) { + $modx->config['manager_tree_width'] = 20; // rem +} + +if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { + $initMainframeAction = $_SESSION['onLoginForwardToAction']; + unset($_SESSION['onLoginForwardToAction']); +} else { + $initMainframeAction = 2; // welcome.static +} + +if (!isset($_SESSION['tree_show_only_folders'])) { + $_SESSION['tree_show_only_folders'] = 0; +} + +$body_class = ''; +$menu_height = $modx->config['manager_menu_height']; +$tree_width = $modx->config['manager_tree_width']; +$tree_min_width = 0; + +if (isset($_COOKIE['MODX_widthSideBar'])) { + $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; +} else { + $MODX_widthSideBar = $tree_width; +} + +if (!$MODX_widthSideBar) { + $body_class .= 'sidebar-closed'; +} + +$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : ''; +$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); +if (!empty($theme_modes[$theme_mode])) { + $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode'] ?? 3])) { + $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode'] ?? 3]; +} + +$navbar_position = $modx->config['manager_menu_position'] ?? 'top'; +if ($navbar_position == 'left') { + $body_class .= ' navbar-left navbar-left-icon-and-text'; +} + +if (isset($modx->pluginCache['ElementsInTree'])) { + $body_class .= ' ElementsInTree'; +} + +$unlockTranslations = array( + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] +); + +foreach ($unlockTranslations as $key => $value) { + $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +} + +$user = $modx->getUserInfo($modx->getLoginUserID()); +if (isset($user['which_browser']) && $user['which_browser'] == 'default') { + $user['which_browser'] = $modx->config['which_browser']; +} + +$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; + +if ($modx->config['manager_theme'] == 'default') { + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { + require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; + $minifier = new Formatter\CSSMinify(); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); + $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); + $css = $minifier->minify(); + file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); + } + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { + $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; + } +} + +$modx->config['global_tabs'] = (int) (isset($modx->config['global_tabs']) && $modx->config['global_tabs'] && ($user['role'] == 1 + || $modx->hasPermission('edit_template') + || $modx->hasPermission('edit_chunk') + || $modx->hasPermission('edit_snippet') + || $modx->hasPermission('edit_plugin') + || $modx->hasPermission('edit_document') + ) +); +$which_browser = $which_browser ?? 'mcpuk'; +?> + +> + + <?= $site_name ?> (EVO CMS Manager) + + + + + + config['show_picker'] != "0") { ?> + + + + + + + + + + config['show_picker'] != "0") { ?> + + + + + invokeEvent('OnManagerTopPrerender', $_REQUEST); + if (is_array($evtOut)) { + echo implode("\n", $evtOut); + } + ?> + + + +
    + +
    + +
    +
    + config['global_tabs']): ?> +
    +

    +
    +
    + +
    + +
    + +
    + + +
    +
    +
    +
    + + + + + + + ', $action, $action); + echo sprintf(' %s
    ', $img, $text); + } + } + + ?> + + + config['show_fullscreen_btn'] != "0") { ?> + + + invokeEvent('OnManagerFrameLoader', array('action' => $action)); + ?> + +
    +config['show_picker'] != "0") { + include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); +} ?> + + diff --git a/manager/frames/mainmenu.php b/manager/frames/mainmenu.php index cd73ebd9a2..e6044769c4 100755 --- a/manager/frames/mainmenu.php +++ b/manager/frames/mainmenu.php @@ -238,9 +238,9 @@ $sitemenu['module' . $row['id']] = array( 'module' . $row['id'], 'modules', - ($row['icon'] != '' ? '' : '') . $row['name'], + ($row['icon'] != '' ? '' : '') . $modx->htmlspecialchars($row['name']), 'index.php?a=112&id=' . $row['id'], - $row['name'], + $modx->htmlspecialchars($row['name']), '', '', 'main', diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php index 7de125cb48..8b7de3d917 100755 --- a/manager/includes/accesscontrol.inc.php +++ b/manager/includes/accesscontrol.inc.php @@ -97,11 +97,11 @@ } else { $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg'); } - + // set form position css class - $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']); - - switch ($modx->config['manager_theme_mode']) { + $modx->setPlaceholder('login_form_position_class', 'loginbox-' . ($modx->config['login_form_position'] ?? 'left')); + + switch ($modx->config['manager_theme_mode'] ?? 3) { case '1': $modx->setPlaceholder('manager_theme_style', 'lightness'); break; @@ -116,7 +116,7 @@ break; } // set form style css class - $modx->setPlaceholder('login_form_style_class', 'loginbox-' . $modx->config['login_form_style']); + $modx->setPlaceholder('login_form_style_class', 'loginbox-' . ($modx->config['login_form_style'] ?? 'dark')); // andrazk 20070416 - notify user of install/update if (isset($_GET['installGoingOn'])) { diff --git a/manager/includes/config_check.inc.php b/manager/includes/config_check.inc.php index 1ac749d6d7..7cf7205ad3 100755 --- a/manager/includes/config_check.inc.php +++ b/manager/includes/config_check.inc.php @@ -162,6 +162,7 @@ function checkSiteCache() { if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; $config_check_results = "

    ".$_lang['configcheck_notok']."

    "; +$_SESSION['mgrConfigCheck'] = false; for ($i=0;$ihasPermission('settings')) { $warnings[$i][2] .= ''; } - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); + if(!isset($_SESSION["mgrConfigCheck"]) || !$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); break; case $_lang['configcheck_lang_difference'] : $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php index e6f6c8e34b..60e2f9e5ab 100755 --- a/manager/includes/controls/datagrid.class.php +++ b/manager/includes/controls/datagrid.class.php @@ -279,9 +279,9 @@ public function formatColumnValue($row, $value, $type, &$align) { $value = strtotime($value); } if(!$type_format) { - $type_format = "%A %d, %B %Y"; + $type_format = "l d, F Y"; } - $value = strftime($type_format, $value); + $value = date($type_format, $value); break; case "boolean": @@ -298,11 +298,12 @@ public function formatColumnValue($row, $value, $type, &$align) { case "template": // replace [+value+] first - $value = str_replace("[+value+]", $value, $type_format); + $value = str_replace(["[+value+]", "[+e.value+]"], [$value, htmlspecialchars($value)], $type_format); + // replace other [+fields+] if(strpos($value, "[+") !== false) { foreach($row as $k => $v) { - $value = str_replace("[+$k+]", $v, $value); + $value = str_replace(["[+$k+]", "[+e.$k+]"], [$v, htmlspecialchars($v)], $value); } } break; diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index 9afd6e9718..7e398a7b0a 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -83,7 +83,7 @@ $c['session_timeout'] = 15; $c['site_unavailable_message'] = $_lang['siteunavailable_message_default']; $c['allow_eval'] = 'with_scan'; -$c['safe_functions_at_eval'] = 'time,date,strtotime,strftime'; +$c['safe_functions_at_eval'] = 'time,date,strtotime'; $c['use_udperms'] = '1'; $c['email_sender_method'] = 1; $c['email_method'] = 'mail'; @@ -113,4 +113,3 @@ $c['manager_menu_position'] = 'top'; $c['tinymce4_skin'] = 'lightgray'; $c['chunk_processor'] = ''; -$c['enable_mootools'] = 1; diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 5435b75224..187c8ac62f 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -132,7 +132,6 @@ class DocumentParser public $snippetsTime = []; public $chunkCache; public $snippetCache; - public $contentTypes; public $dumpSQL = false; public $queryCode; public $virtualDir; @@ -149,7 +148,6 @@ class DocumentParser public $pluginCache = []; public $aliasListing; public $lockedElements = null; - public $tmpCache = []; private $version = []; public $extensions = []; public $cacheKey = null; @@ -309,7 +307,7 @@ public function loadExtension($extname, $reload = true) */ public function getMicroTime() { - list ($usec, $sec) = explode(' ', microtime()); + [$usec, $sec] = explode(' ', microtime()); return ((float)$usec + (float)$sec); } @@ -342,7 +340,7 @@ public function sendRedirect($url, $count_attempts = false, $type = 'REDIRECT_HE } $url .= sprintf( '%serr=%s', - strpos($url, '?') > 0 ? '?' : '&', + strpos($url, '?') !==false ? '&' : '?', ($currentNumberOfRedirects + 1) ); } @@ -428,13 +426,16 @@ public function sendUnauthorizedPage($noEvent = false) $this->invokeEvent('OnPageUnauthorized'); } if ($this->config['unauthorized_page']) { - $unauthorizedPage = $this->config['unauthorized_page']; - } elseif ($this->config['error_page']) { - $unauthorizedPage = $this->config['error_page']; - } else { - $unauthorizedPage = $this->config['site_start']; + $this->sendForward($this->config['unauthorized_page'], 'HTTP/1.1 401 Unauthorized'); + exit(); + } + + if ($this->config['error_page']) { + $this->sendForward($this->config['error_page'], 'HTTP/1.1 401 Unauthorized'); + exit(); } - $this->sendForward($unauthorizedPage, 'HTTP/1.1 401 Unauthorized'); + + $this->sendForward($this->config['site_start'], 'HTTP/1.1 401 Unauthorized'); exit(); } @@ -503,12 +504,17 @@ public function getSettings() $this->config['friendly_url_suffix'] = ''; } + if (!isset($this->config['which_browser'])) { + $this->config['which_browser'] = 'mcpuk'; + } + if (!isset($this->config['enable_at_syntax'])) { $this->config['enable_at_syntax'] = 1; } // @TODO: This line is temporary, should be remove in next version // now merge user settings into evo-configuration $this->getUserSettings(); + $this->invokeEvent('OnLoadSettings', ['config' => &$this->config]); } private function recoverySiteCache() @@ -979,8 +985,8 @@ public function outputContent($noEvent = false) { $this->documentOutput = $this->documentContent; - if ($this->documentGenerated == 1 && $this->documentObject['cacheable'] == 1) { - if($this->documentObject['type'] === 'document' && $this->documentObject['published'] == 1) { + if ($this->documentGenerated && $this->documentObject['cacheable']) { + if($this->documentObject['type'] === 'document' && $this->documentObject['published']) { if (!empty($this->sjscripts)) { $this->documentObject['__MODxSJScripts__'] = $this->sjscripts; } @@ -1035,13 +1041,12 @@ public function outputContent($noEvent = false) $name = $this->cleanUpMODXTags($name); $name = strtolower($name); $name = preg_replace('/&.+?;/', '', $name); // kill entities - $name = preg_replace('/[^\.%a-z0-9 _-]/', '', $name); + $name = preg_replace('/[^.%a-z0-9 _-]/', '', $name); $name = preg_replace('/\s+/', '-', $name); - $name = preg_replace('|-+|', '-', $name); + $name = preg_replace('/-+/', '-', $name); $name = trim($name, '-'); } - $header = 'Content-Disposition: attachment; filename=' . $name; - header($header); + header('Content-Disposition: attachment; filename=' . $name); } } $this->setConditional(); @@ -1120,7 +1125,7 @@ public function outputContent($noEvent = false) */ public function RecoveryEscapedTags($contents) { - list($sTags, $rTags) = $this->getTagsForEscape(); + [$sTags, $rTags] = $this->getTagsForEscape(); return str_replace($rTags, $sTags, $contents); } @@ -1162,7 +1167,13 @@ public function getTimerStats($tstart) public function setConditional() { - if (!empty($_POST) || (defined('MODX_API_MODE') && MODX_API_MODE) || $this->getLoginUserID('mgr') || !$this->useConditional || empty($this->recentUpdate)) { + if (!empty($_POST)) { + return; + } + if (defined('MODX_API_MODE') && MODX_API_MODE) { + return; + } + if ($this->getLoginUserID('mgr') || !$this->useConditional || empty($this->recentUpdate)) { return; } $last_modified = gmdate('D, d M Y H:i:s T', $this->recentUpdate); @@ -1447,9 +1458,9 @@ public function mergeDocumentContent($content, $ph = false) $key = substr($key, 1); } // remove # for QuickEdit format - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); if (strpos($key, '@') !== false) { - list($key, $context) = explode('@', $key, 2); + [$key, $context] = explode('@', $key, 2); } else { $context = false; } @@ -1492,12 +1503,12 @@ public function _contextValue($key, $parent = false) if (preg_match('/@\d+\/u/', $key)) { $key = str_replace(array('@', '/u'), array('@u(', ')'), $key); } - list($key, $str) = explode('@', $key, 2); + [$key, $str] = explode('@', $key, 2); if (strpos($str, '(')) { - list($context, $option) = explode('(', $str, 2); + [$context, $option] = explode('(', $str, 2); } else { - list($context, $option) = array($str, false); + [$context, $option] = array($str, false); } if ($option) { @@ -1538,7 +1549,7 @@ public function _contextValue($key, $parent = false) } elseif (strpos($option, ',') === false) { $option .= ',ASC'; } - list($by, $dir) = explode(',', $option, 2); + [$by, $dir] = explode(',', $option, 2); $children = $this->getActiveChildren($parent, $by, $dir); $find = false; $prev = false; @@ -1564,7 +1575,7 @@ public function _contextValue($key, $parent = false) } elseif (strpos($option, ',') === false) { $option .= ',ASC'; } - list($by, $dir) = explode(',', $option, 2); + [$by, $dir] = explode(',', $option, 2); $children = $this->getActiveChildren($parent, $by, $dir); $find = false; $next = false; @@ -1624,7 +1635,7 @@ public function mergeSettingsContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); if (!isset($ph[$key])) { continue; @@ -1679,7 +1690,7 @@ public function mergeChunkContent($content, $ph = false) $key = $snip_call['name']; $params = $this->getParamsFromString($snip_call['params']); - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); if (!isset($ph[$key])) { $ph[$key] = $this->getChunk($key); @@ -1752,7 +1763,7 @@ public function mergePlaceholderContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); if (isset($ph[$key])) { $value = $ph[$key]; @@ -1803,7 +1814,7 @@ public function mergeConditionalTagsContent($content, $iftag = '<@IF:', $elseift $content = $split; continue; } - list($cmd, $text) = explode('>', $split, 2); + [$cmd, $text] = explode('>', $split, 2); $cmd = str_replace("'", "\'", $cmd); $content .= "_parseCTagCMD('" . $cmd . "')): ?>"; $content .= $text; @@ -1814,7 +1825,7 @@ public function mergeConditionalTagsContent($content, $iftag = '<@IF:', $elseift $content = $split; continue; } - list($cmd, $text) = explode('>', $split, 2); + [$cmd, $text] = explode('>', $split, 2); $cmd = str_replace("'", "\'", $cmd); $content .= "_parseCTagCMD('" . $cmd . "')): ?>"; $content .= $text; @@ -1977,7 +1988,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right return $content; } - list($sTags, $rTags) = $this->getTagsForEscape(); + [$sTags, $rTags] = $this->getTagsForEscape(); foreach ($matches[1] as $i => $v) { $v = str_ireplace($sTags, $rTags, $v); $s = &$matches[0][$i]; @@ -2041,7 +2052,7 @@ public function evalPlugin($pluginCode, $params) // When reached here, no fatal error occured so the lock should be removed. /*if(is_file($lock_file_path)) unlink($lock_file_path);*/ - if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) { + if ((0 < ($this->config['error_reporting'] ?? 1)) && $msg && isset($php_errormsg)) { $error_info = error_get_last(); if ($this->detectError($error_info['type'])) { $msg = ($msg === false) ? 'ob_get_contents() error' : $msg; @@ -2171,7 +2182,7 @@ public function _getSGVar($value) $key = $value; $_ = $this->config['enable_filter']; $this->config['enable_filter'] = 1; - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); $this->config['enable_filter'] = $_; $key = str_replace(array('(', ')'), array("['", "']"), $key); $key = rtrim($key, ';'); @@ -2213,7 +2224,7 @@ private function _get_snip_result($piece) $snip_call = $this->_split_snip_call($piece); $key = $snip_call['name']; - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); $snip_call['name'] = $key; $snippetObject = $this->_getSnippetObject($key); if (is_null($snippetObject['content'])) { @@ -2285,7 +2296,7 @@ public function getParamsFromString($string = '') if (in_array($delim, array('"', "'", '`'))) { $null = null; //list(, $value, $_tmp) - list($null, $value, $_tmp) = explode($delim, $_tmp, 3); + [$null, $value, $_tmp] = explode($delim, $_tmp, 3); unset($null); if (substr(trim($_tmp), 0, 2) === '//') { @@ -2293,7 +2304,7 @@ public function getParamsFromString($string = '') } $i = 0; while ($delim === '`' && substr(trim($_tmp), 0, 1) !== '&' && 1 < substr_count($_tmp, '`')) { - list($inner, $outer, $_tmp) = explode('`', $_tmp, 3); + [$inner, $outer, $_tmp] = explode('`', $_tmp, 3); $value .= "`{$inner}`{$outer}"; $i++; if (200 < $i) { @@ -2304,7 +2315,7 @@ public function getParamsFromString($string = '') $value = rtrim($value, '`'); } } elseif (strpos($_tmp, '&') !== false) { - list($value, $_tmp) = explode('&', $_tmp, 2); + [$value, $_tmp] = explode('&', $_tmp, 2); $value = trim($value); } else { $value = $_tmp; @@ -2365,7 +2376,7 @@ public function getParamsFromString($string = '') $k = substr($k, 0, -2); $params[$k][] = current($p); } elseif (strpos($k, '[') !== false && substr($k, -1) === ']') { - list($k, $subk) = explode('[', $k, 2); + [$k, $subk] = explode('[', $k, 2); $subk = substr($subk, 0, -1); $params[$k][$subk] = current($p); } else { @@ -2570,7 +2581,7 @@ public function rewriteUrls($documentSource) { // rewrite the urls if ($this->config['friendly_urls'] == 1) { - $aliases = []; + $aliases = $isfolder = array(); if (is_array($this->documentListing)) { foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site! $aliases[$docid] = $path; @@ -2614,15 +2625,15 @@ public function rewriteUrls($documentSource) $pref = $this->config['friendly_url_prefix']; $suff = $this->config['friendly_url_suffix']; $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { - global $modx; + if ( empty($aliases[$m[1]]) && empty($isfolder[$m[1]]) ) $m[1] = $this->getConfig('error_page'); $thealias = $aliases[$m[1]]; $thefolder = $isfolder[$m[1]]; if ($isfriendly && isset($thealias)) { //found friendly url - $out = ($modx->config['seostrict'] == '1' ? $modx->toAlias($modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])) : $modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])); + $out = ($this->getConfig('seostrict') == '1' ? $this->toAlias($this->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])) : $this->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])); } else { //not found friendly url - $out = $modx->makeFriendlyURL($pref, $suff, $m[1]); + $out = $this->makeFriendlyURL($pref, $suff, $m[1]); } return $out; }, $documentSource); @@ -2650,7 +2661,7 @@ public function sendStrictURI() $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; $len_base_url = strlen($this->config['base_url']); - $url_path = $q;//LANG + $url_path = $q ?? '';//LANG if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) { $url_path = substr($url_path, $len_base_url); @@ -3259,10 +3270,11 @@ public function getUltimateParentId($id, $top = 0) */ public function getChildIds($id, $depth = 10, $children = []) { + static $cache = null; $cacheKey = md5(print_r(func_get_args(), true)); - if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { - return $this->tmpCache[__FUNCTION__][$cacheKey]; + if (isset($cache[$cacheKey])) { + return $cache[$cacheKey]; } if ($this->config['aliaslistingfolder'] == 1 || (isset($this->config['full_aliaslisting']) && $this->config['full_aliaslisting'] == 1)) { @@ -3287,7 +3299,7 @@ public function getChildIds($id, $depth = 10, $children = []) $children = $this->getChildIds($idx, $depth, $children); } } - $this->tmpCache[__FUNCTION__][$cacheKey] = $children; + $cache[$cacheKey] = $children; return $children; } else { @@ -3318,7 +3330,7 @@ public function getChildIds($id, $depth = 10, $children = []) } } } - $this->tmpCache[__FUNCTION__][$cacheKey] = $children; + $cache[$cacheKey] = $children; return $children; } @@ -3405,7 +3417,7 @@ function __alertQuit() { public function hasPermission($pm) { $state = 0; - $pms = $_SESSION['mgrPermissions']; + $pms = $_SESSION['mgrPermissions'] ?? []; if ($pms) { $state = ((isset($pms[$pm]) ? (bool) $pms[$pm] : false) === true); } @@ -3791,25 +3803,25 @@ public function sendmail($params = [], $msg = '', $files = []) $sendto = (!isset($p['to'])) ? $this->config['emailsender'] : $p['to']; $sendto = explode(',', $sendto); foreach ($sendto as $address) { - list($name, $address) = $this->mail->address_split($address); + [$name, $address] = $this->mail->address_split($address); $this->mail->AddAddress($address, $name); } if (isset($p['cc'])) { $p['cc'] = explode(',', $p['cc']); foreach ($p['cc'] as $address) { - list($name, $address) = $this->mail->address_split($address); + [$name, $address] = $this->mail->address_split($address); $this->mail->AddCC($address, $name); } } if (isset($p['bcc'])) { $p['bcc'] = explode(',', $p['bcc']); foreach ($p['bcc'] as $address) { - list($name, $address) = $this->mail->address_split($address); + [$name, $address] = $this->mail->address_split($address); $this->mail->AddBCC($address, $name); } } if (isset($p['from']) && strpos($p['from'], '<') !== false && substr($p['from'], -1) === '>') { - list($p['fromname'], $p['from']) = $this->mail->address_split($p['from']); + [$p['fromname'], $p['from']] = $this->mail->address_split($p['from']); } $this->mail->setFrom( isset($p['from']) ? $p['from'] : $this->config['emailsender'], @@ -3823,9 +3835,16 @@ public function sendmail($params = [], $msg = '', $files = []) if (!is_array($files)) { $files = []; } - foreach ($files as $f) { - if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) { - $this->mail->AddAttachment(MODX_BASE_PATH . $f); + foreach ($files as $name => $path) { + if (!is_file($path) || !is_readable($path)) { + $path = MODX_BASE_PATH . $path; + } + if (is_file($path) && is_readable($path)) { + if (is_numeric($name)) { + $mail->AddAttachment($path); + } else { + $mail->AddAttachment($path, $name); + } } } $rs = $this->mail->send(); @@ -3882,12 +3901,11 @@ public function isFrontend() * @param string $dir Sort direction, ASC and DESC is possible * Default: ASC * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle + * @param bool $checkAccess + * - Check document access permissions. Default: true. * @return array */ - public function getAllChildren($id = 0, - $sort = 'menuindex', - $dir = 'ASC', - $fields = 'id, pagetitle, description, parent, alias, menutitle') + public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle', $checkAccess = true) { static $cache = null; @@ -3903,9 +3921,9 @@ public function getAllChildren($id = 0, sprintf('LEFT JOIN %s dg on dg.document=sc.id', $this->getFullTableName('document_groups')) ], sprintf( - "sc.parent='%s' AND (%s) GROUP BY sc.id", + "sc.parent='%s' %s GROUP BY sc.id", $id, - $this->docAccessConditions() + $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : '' ), sprintf( 'sc.%s %s', @@ -3931,12 +3949,11 @@ public function getAllChildren($id = 0, * @param string $dir Sort direction, ASC and DESC is possible * Default: ASC * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle + * @param bool $checkAccess + * - Check document access permissions. Default: true. * @return array */ - public function getActiveChildren($id = 0, - $sort = 'menuindex', - $dir = 'ASC', - $fields = 'id, pagetitle, description, parent, alias, menutitle') + public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle', $checkAccess = true) { static $cache = null; $cacheKey = md5(print_r(func_get_args(), true)); @@ -3984,17 +4001,10 @@ public function getActiveChildren($id = 0, * @param $sort {comma separated string} - Should be a comma-separated list of field names on which to sort. Default: 'menuindex'. * @param $dir {'ASC'; 'DESC'} - Sort direction, ASC and DESC is possible. Default: 'ASC'. * @param $limit {string} - Should be a valid SQL LIMIT clause without the 'LIMIT ' i.e. just include the numbers as a string. Default: Empty string (no limit). - * + * @param bool $checkAccess - Check document access permissions. Default: true. * @return {array; false} - Result array, or false. */ - public function getDocumentChildren($parentid = 0, - $published = 1, - $deleted = 0, - $fields = '*', - $where = '', - $sort = 'menuindex', - $dir = 'ASC', - $limit = '') + public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '', $checkAccess = true) { static $cache = null; @@ -4017,12 +4027,12 @@ public function getDocumentChildren($parentid = 0, sprintf('LEFT JOIN %s dg on dg.document=sc.id', $this->getFullTableName('document_groups')) ], sprintf( - "sc.parent='%s' %s %s %s AND (%s) GROUP BY sc.id", + "sc.parent='%s' %s %s %s %s GROUP BY sc.id", $parentid, $published !== 'all' ? 'AND sc.published = ' . $published : '', $deleted !== 'all' ? 'AND sc.deleted = ' . $deleted : '', $where ? 'AND ' . $where : '', - $this->docAccessConditions() + $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : '' ), $sort ? sprintf( @@ -4056,17 +4066,12 @@ public function getDocumentChildren($parentid = 0, * @param $sort {comma separated string} - A comma-separated list of field names to sort by. Default: 'menuindex'. * @param $dir {'ASC'; 'DESC'} - Sorting direction. Default: 'ASC'. * @param $limit {string} - SQL LIMIT (without 'LIMIT '). An empty string means no limit. Default: ''. + * @param bool $checkAccess + * - Check document access permissions. Default: true. * * @return {array; false} - Result array with documents, or false. */ - public function getDocuments($ids = [], - $published = 1, - $deleted = 0, - $fields = '*', - $where = '', - $sort = 'menuindex', - $dir = 'ASC', - $limit = '') + public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '', $checkAccess = true) { static $cache = null; @@ -4094,12 +4099,12 @@ public function getDocuments($ids = [], sprintf("LEFT JOIN %s dg on dg.document=sc.id", $this->getFullTableName('document_groups')) ], sprintf( - "(sc.id IN (%s) %s %s %s) AND (%s) GROUP BY sc.id", + "(sc.id IN (%s) %s %s %s) %s GROUP BY sc.id", implode(',', $ids), $published === 'all' ? '' : sprintf("AND sc.published='%s'", $published), $deleted === 'all' ? '' : sprintf("AND sc.deleted='%s'", $deleted), $where ? 'AND ' . $where : '', - $this->docAccessConditions() + $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : '' ), $sort ? sprintf('sc.%s %s', implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))), $dir) @@ -4145,16 +4150,18 @@ private function docAccessConditions() { * - Document publication status. Once the parameter equals 'all', the result will be returned regardless of whether the documents are published or they are not. Default: false. * @param int $deleted {0; 1; 'all'} * - Document removal status. Once the parameter equals 'all', the result will be returned regardless of whether the documents are deleted or they are not. Default: 0. + * @param bool $checkAccess + * - Check document access permissions. Default: true. * @return bool {array; false} - Result array with fields or false. * - Result array with fields or false. */ - public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0) + public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0, $checkAccess = true) { if (!$id) { return false; } - $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1); + $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1, $checkAccess); if (!$docs) { return false; @@ -4188,6 +4195,12 @@ public function getField($field = 'content', $docid = '') } $doc = $this->getDocumentObject('id', $docid); + + if (!isset($doc[$field])) { + $cache[$field][$docid] = false; + return false; + } + if (is_array($doc[$field])) { $tvs = $this->getTemplateVarOutput($field, $docid, 'all'); $cache[$field][$docid] = $tvs[$field]; @@ -4211,7 +4224,7 @@ public function getField($field = 'content', $docid = '') * Default: id, pagetitle, description, alias * @return boolean|array */ - public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitle, description, alias') + public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias', $checkAccess = true) { static $cache = null; @@ -4231,10 +4244,10 @@ public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitl sprintf('LEFT JOIN %s dg on dg.document = sc.id', $this->getFullTableName('document_groups')) ], sprintf( - "(sc.id='%s' %s) AND (%s)", + "(sc.id='%s' %s) %s", $pageid, $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : '', - $this->docAccessConditions() + $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : '' ), '', 1 @@ -4255,19 +4268,19 @@ public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitl * Default: id, pagetitle, description, alias * @return boolean|array */ - public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, description, alias, parent') + public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, description, alias, parent', $checkAccess = true) { if ($pid == -1) { $pid = $this->documentObject['parent']; - return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } elseif ($pid == 0) { + return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields, $checkAccess); + } else if ($pid == 0) { return false; } else { // first get the child document - $child = $this->getPageInfo($pid, $active, "parent"); + $child = $this->getPageInfo($pid, $active, "parent", $checkAccess); // now return the child's parent $pid = ($child['parent']) ? $child['parent'] : 0; - return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); + return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields, $checkAccess); } } @@ -4396,20 +4409,22 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') if ($this->config['aliaslistingfolder'] == 1 || (isset($this->config['full_aliaslisting']) && $this->config['full_aliaslisting'] == 1)) { $al = $this->getAliasListing($id); + } elseif(empty($this->aliasListing[$id])) { + $al = $this->aliasListing[$this->config['error_page']]; } else { $al = $this->aliasListing[$id]; } + if (!empty($al)) { + if ($al['isfolder'] === 1 && $this->config['make_folders'] === '1') { + $f_url_suffix = '/'; + } - if ($al['isfolder'] === 1 && $this->config['make_folders'] === '1') { - $f_url_suffix = '/'; - } - - $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; + $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; - if ($al && $al['alias']) { - $alias = $al['alias']; + if ($al && $al['alias']) { + $alias = $al['alias']; + } } - } $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; @@ -4463,6 +4478,7 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') */ public function getAliasListing($id) { + $out = []; if (isset($this->aliasListing[$id])) { $out = $this->aliasListing[$id]; } else { @@ -4481,7 +4497,7 @@ public function getAliasListing($id) if ($this->config['use_alias_path'] == '1') { //&& $tmp['path'] != '' - fix error slash with epty path $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']); - $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : ''); + $this->aliasListing[$id]['path'] = ($tmp['path'] ?? '') . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : ''); } else { $this->aliasListing[$id]['path'] = ''; } @@ -4490,6 +4506,7 @@ public function getAliasListing($id) $out = $this->aliasListing[$id]; } } + return $out; } @@ -4501,36 +4518,39 @@ public function getAliasListing($id) * @param string $name * @return bool|string */ - public function getConfig($name = '') + public function getConfig($name = '', $default = null) { - if (!empty ($this->config[$name])) { - return $this->config[$name]; - } else { - return false; + if (!isset($this->config[$name])) { + return $default; } + return $this->config[$name]; } /** * Returns the EVO version information as version, branch, release date and full application name. * - * @param null $data + * @param null $key * @return array */ - public function getVersionData($data = null) + public function getVersionData($key = null) { $out = []; if (empty($this->version) || !is_array($this->version)) { //include for compatibility modx version < 1.0.10 include MODX_MANAGER_PATH . "includes/version.inc.php"; - $this->version = []; - $this->version['version'] = isset($modx_version) ? $modx_version : ''; - $this->version['branch'] = isset($modx_branch) ? $modx_branch : ''; - $this->version['release_date'] = isset($modx_release_date) ? $modx_release_date : ''; - $this->version['full_appname'] = isset($modx_full_appname) ? $modx_full_appname : ''; - $this->version['new_version'] = isset($this->config['newversiontext']) ? $this->config['newversiontext'] : ''; + $this->version = [ + 'version' => $modx_version ?? '', + 'branch' => $modx_branch ?? '', + 'release_date' => $modx_release_date ?? '', + 'full_appname' => $modx_full_appname ?? '', + 'new_version' => $this->config['newversiontext'] ?? '' + ]; + } + if (!$key) { + return $this->version; } - return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version; + return $this->version[$key]; } /** @@ -4543,26 +4563,45 @@ public function getVersionData($data = null) public function runSnippet($snippetName, $params = []) { if (isset ($this->snippetCache[$snippetName])) { - $snippet = $this->snippetCache[$snippetName]; - $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; - } else { // not in cache so let's check the db - $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "' AND ss.disabled=0;"; - $result = $this->db->query($sql); - if ($this->db->getRecordCount($result) == 1) { - $row = $this->db->getRow($result); - $snippet = $this->snippetCache[$snippetName] = $row['snippet']; - $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties'])); - $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties); - } else { - $snippet = $this->snippetCache[$snippetName] = "return false;"; - $properties = $this->snippetCache[$snippetName . "Props"] = ''; - } + $parameters = $this->parseProperties( + $this->snippetCache[$snippetName . 'Props'] ?? '', + $snippetName, + 'snippet' + ); + return $this->evalSnippet( + $this->snippetCache[$snippetName], + array_merge($parameters, $params) + ); } - // load default params/properties + + $result = $this->db->select( + "snippet.`name`, snippet.`snippet`, snippet.`properties`, module.properties as `sharedproperties`", + [ + sprintf('%s as snippet', $this->getFullTableName("site_snippets")), + sprintf( + 'LEFT JOIN %s as module on module.guid=snippet.moduleguid', + $this->getFullTableName('site_modules') + ) + ], + "snippet.`name`='" . $this->db->escape($snippetName) . "' AND snippet.disabled=0" + ); + if ($this->db->getRecordCount($result) != 1) { + $this->snippetCache[$snippetName] = 'return false;'; + $this->snippetCache[$snippetName . 'Props'] = ''; + return $this->evalSnippet('return false;', []); + } + + $row = $this->db->getRow($result); + $snippet = $this->snippetCache[$snippetName] = $row['snippet']; + $mergedProperties = array_merge( + $this->parseProperties($row['properties']), + $this->parseProperties($row['sharedproperties']) + ); + $properties = json_encode($mergedProperties); + $this->snippetCache[$snippetName . 'Props'] = $properties; + $parameters = $this->parseProperties($properties, $snippetName, 'snippet'); $parameters = array_merge($parameters, $params); - - // run snippet return $this->evalSnippet($snippet, $parameters); } @@ -4574,26 +4613,36 @@ public function runSnippet($snippetName, $params = []) */ public function getChunk($chunkName) { - $out = null; - if (empty($chunkName)) { - // nop - } elseif ($this->isChunkProcessor('DLTemplate')) { - $out = DLTemplate::getInstance($this)->getChunk($chunkName); - } elseif (isset ($this->chunkCache[$chunkName])) { - $out = $this->chunkCache[$chunkName]; - } elseif (stripos($chunkName, '@FILE') === 0) { - $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); - } else { - $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); - $rs = $this->db->select('snippet', '[+prefix+]site_htmlsnippets', $where); - if ($this->db->getRecordCount($rs) == 1) { - $row = $this->db->getRow($rs); - $out = $this->chunkCache[$chunkName] = $row['snippet']; - } else { - $out = $this->chunkCache[$chunkName] = null; - } + if (!$chunkName) { + return null; } - return $out; + + if ($this->isChunkProcessor('DLTemplate')) { + return DLTemplate::getInstance($this)->getChunk($chunkName); + } + + if (isset ($this->chunkCache[$chunkName])) { + return $this->chunkCache[$chunkName]; + } + + if (stripos($chunkName, '@FILE') === 0) { + $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); + return $this->chunkCache[$chunkName]; + } + + $rs = $this->db->select( + 'snippet', + '[+prefix+]site_htmlsnippets', + sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)) + ); + if ($this->db->getRecordCount($rs) != 1) { + $this->chunkCache[$chunkName] = null; + return null; + } + + $row = $this->db->getRow($rs); + $this->chunkCache[$chunkName] = $row['snippet']; + return $this->chunkCache[$chunkName]; } /** @@ -4635,7 +4684,7 @@ public function parseText($tpl = '', $ph = [], $left = '[+', $right = '+]', $exe foreach ($matches[1] as $i => $key) { if (strpos($key, ':') !== false && $execModifier) { - list($key, $modifiers) = $this->splitKeyAndFilter($key); + [$key, $modifiers] = $this->splitKeyAndFilter($key); } else { $modifiers = false; } @@ -4670,13 +4719,22 @@ public function parseText($tpl = '', $ph = [], $left = '[+', $right = '+]', $exe */ public function isChunkProcessor($processor) { - $value = (string)$this->getConfig('chunk_processor'); - if(is_object($processor)) { $processor = get_class($processor); } - return is_scalar($processor) && mb_strtolower($value) === mb_strtolower($processor) && class_exists($processor, false); + if (!is_scalar($processor)) { + return false; + } + + if (mb_strtolower($this->getConfig('chunk_processor', '')) !== mb_strtolower($processor)) { + return false; + } + if (!class_exists($processor, false)) { + return false; + } + + return true; } /** @@ -4701,9 +4759,14 @@ public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}') return false; } - return $prefix === '[+' && $suffix === '+]' && $this->isChunkProcessor('DLTemplate') ? - DLTemplate::getInstance($this)->parseChunk($chunkName, $chunkArr) : - $this->parseText($this->getChunk($chunkName), $chunkArr, $prefix, $suffix); + if ($prefix !== '[+' || $suffix !== '+]') { + return $this->parseText($this->getChunk($chunkName), $chunkArr, $prefix, $suffix); + } + if (!$this->isChunkProcessor('DLTemplate')) { + return $this->parseText($this->getChunk($chunkName), $chunkArr); + } + + return DLTemplate::getInstance($this)->parseChunk($chunkName, $chunkArr); } /** @@ -4755,31 +4818,26 @@ public function toDateFormat($timestamp = 0, $mode = '') { $timestamp = trim($timestamp); if ($mode !== 'formatOnly' && empty($timestamp)) { - return '-'; + return ''; } $timestamp = (int)$timestamp; switch ($this->config['datetime_format']) { case 'YYYY/mm/dd': - $dateFormat = '%Y/%m/%d'; + $dateFormat = 'Y/m/d'; break; case 'dd-mm-YYYY': - $dateFormat = '%d-%m-%Y'; + $dateFormat = 'd-m-Y'; break; case 'mm/dd/YYYY': - $dateFormat = '%m/%d/%Y'; - break; - /* - case 'dd-mmm-YYYY': - $dateFormat = '%e-%b-%Y'; + $dateFormat = 'm/d/Y'; break; - */ } if (empty($mode)) { - $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp); + $strTime = date($dateFormat . " H:i:s", $timestamp); } elseif ($mode == 'dateOnly') { - $strTime = strftime($dateFormat, $timestamp); + $strTime = date($dateFormat, $timestamp); } elseif ($mode == 'formatOnly') { $strTime = $dateFormat; } @@ -4804,19 +4862,19 @@ public function toTimeStamp($str) if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) { return ''; } - list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); + [$Y, $m, $d, $H, $M, $S] = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); break; case 'dd-mm-YYYY': if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); + [$d, $m, $Y, $H, $M, $S] = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); break; case 'mm/dd/YYYY': if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); + [$m, $d, $Y, $H, $M, $S] = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); break; /* case 'dd-mmm-YYYY': @@ -4857,18 +4915,12 @@ public function toTimeStamp($str) * Default: rank * @param string $tvsortdir How to sort each element of the result array i.e. how to sort the TVs (direction) * Default: ASC + * @param bool $checkAccess - Check document access permissions. Default: true. * @return array|bool */ - public function getDocumentChildrenTVars($parentid = 0, - $tvidnames = [], - $published = 1, - $docsort = "menuindex", - $docsortdir = "ASC", - $tvfields = "*", - $tvsort = "rank", - $tvsortdir = "ASC") + public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $published = 1, $docsort = "menuindex", $docsortdir = "ASC", $tvfields = "*", $tvsort = "rank", $tvsortdir = "ASC", $checkAccess = true) { - $docs = $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); + $docs = $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir, '', $checkAccess); if (!$docs) { return false; } @@ -4943,12 +4995,13 @@ public function getDocumentChildrenTVars($parentid = 0, * - SQL WHERE condition (use only document fields, not TV). Default: ''. * @param string $resultKey {string; false} * - Field, which values are keys into result array. Use the “false”, that result array keys just will be numbered. Default: 'id'. + * @param bool $checkAccess - Check document access permissions. Default: true. * @return array {array; false} - Result array, or false. * - Result array, or false. */ - public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = [], $published = 1, $sortBy = 'menuindex', $sortDir = 'ASC', $where = '', $resultKey = 'id') + public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array(), $published = 1, $sortBy = 'menuindex', $sortDir = 'ASC', $where = '', $resultKey = 'id', $checkAccess = true) { - $docs = $this->getDocumentChildren($parentid, $published, 0, 'id', $where, $sortBy, $sortDir); + $docs = $this->getDocumentChildren($parentid, $published, 0, 'id', $where, $sortBy, $sortDir, '', $checkAccess); if (!$docs) { return false; @@ -5004,13 +5057,13 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = [], $p * Default: 1 * @return bool */ - public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1) + public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1, $checkAccess = true) { if ($idname == "") { return false; } - $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed + $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", "", $checkAccess); //remove sorting for speed return ($result != false) ? $result[0] : false; } @@ -5031,12 +5084,7 @@ public function getTemplateVar($idname = "", $fields = "*", $docid = "", $publis * * @return array|bool Result array, or false. */ - public function getTemplateVars($idnames = [], - $fields = '*', - $docid = '', - $published = 1, - $sort = 'rank', - $dir = 'ASC') + public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $published = 1, $sort = 'rank', $dir = 'ASC', $checkAccess = true) { static $cache = null; $cacheKey = md5(print_r(func_get_args(), true)); @@ -5055,7 +5103,7 @@ public function getTemplateVars($idnames = [], $docid = $this->documentIdentifier; $docRow = $this->documentObject; } else { - $docRow = $this->getDocument($docid, '*', $published); + $docRow = $this->getDocument($docid, '*', $published, 0, $checkAccess); if (!$docRow) { $cache[$cacheKey] = false; return false; @@ -5395,8 +5443,10 @@ public function getLoginUserType() */ public function getUserInfo($uid) { - if (isset($this->tmpCache[__FUNCTION__][$uid])) { - return $this->tmpCache[__FUNCTION__][$uid]; + static $cache = null; + + if (isset($cache[$uid])) { + return $cache[$uid]; } $from = '[+prefix+]manager_users mu INNER JOIN [+prefix+]user_attributes mua ON mua.internalkey=mu.id'; @@ -5404,7 +5454,7 @@ public function getUserInfo($uid) $rs = $this->db->select('mu.username, mu.password, mua.*', $from, $where, '', 1); if (!$this->db->getRecordCount($rs)) { - return $this->tmpCache[__FUNCTION__][$uid] = false; + return $cache[$uid] = false; } $row = $this->db->getRow($rs); @@ -5412,7 +5462,7 @@ public function getUserInfo($uid) $row['usertype'] = 'manager'; } - $this->tmpCache[__FUNCTION__][$uid] = $row; + $cache[$uid] = $row; return $row; } @@ -5873,7 +5923,7 @@ public function getPluginCode($pluginName) */ public function parseProperties($propertyString, $elementName = null, $elementType = null) { - $propertyString = trim($propertyString); + $propertyString = trim($propertyString ?? ''); $propertyString = str_replace('{}', '', $propertyString); $propertyString = str_replace('} {', ',', $propertyString); $property = []; @@ -6214,7 +6264,7 @@ public function cleanUpMODXTags($content = '') $this->config['enable_filter'] = 1; $_ = array('[* *]', '[( )]', '{{ }}', '[[ ]]', '[+ +]'); foreach ($_ as $brackets) { - list($left, $right) = explode(' ', $brackets); + [$left, $right] = explode(' ', $brackets); if (strpos($content, $left) !== false) { if ($left === '[*') { $content = $this->mergeDocumentContent($content); @@ -6228,7 +6278,7 @@ public function cleanUpMODXTags($content = '') } } foreach ($_ as $brackets) { - list($left, $right) = explode(' ', $brackets); + [$left, $right] = explode(' ', $brackets); if (strpos($content, $left) !== false) { $matches = $this->getTagsFromContent($content, $left, $right); $content = isset($matches[0]) ? str_replace($matches[0], '', $content) : $content; @@ -6471,7 +6521,7 @@ public function registerErrorHandlers() */ public function phpError($nr, $text, $file, $line) { - if (error_reporting() == 0 || $nr == 0) { + if (error_reporting() == 0 || $nr == 0 || error_reporting() !== E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT) { return true; } if ($this->stopOnNotice == false) { @@ -6547,7 +6597,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']); if ($is_error) { $str = '

    « Evo Parse Error »

    '; - if ($msg != 'PHP Parse Error') { + if ($msg !== 'PHP Parse Error') { $str .= '

    ' . $msg . '

    '; } } else { @@ -6655,14 +6705,14 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); - $str = str_replace('[^q^]', $queries, $str); - $str = str_replace('[^qt^]', $queryTime, $str); - $str = str_replace('[^p^]', $phpTime, $str); - $str = str_replace('[^t^]', $totalTime, $str); - $str = str_replace('[^m^]', $total_mem, $str); + $str = str_replace( + ['[^q^]', '[^qt^]', '[^p^]', '[^t^]', '[^m^]'], + [$queries, $queryTime, $phpTime, $totalTime, $total_mem], + $str + ); if (isset($php_errormsg) && !empty($php_errormsg)) { - $str = "{$php_errormsg}
    \n{$str}"; + $str = "" . $php_errormsg . "
    \n" . $str; } $str .= $this->get_backtrace(debug_backtrace()); // Log error @@ -6740,67 +6790,55 @@ public function get_backtrace($backtrace) $MakeTable->setRowAlternateClass('gridAltItem'); $table = []; $backtrace = array_reverse($backtrace); - foreach ($backtrace as $key => $val) { - $key++; - if (substr($val['function'], 0, 11) === 'messageQuit') { - break; - } elseif (substr($val['function'], 0, 8) === 'phpError') { + foreach ($backtrace as $val) { + if (strpos($val['function'], 'messageQuit') === 0) { break; } - $path = str_replace('\\', '/', $val['file']); - if (strpos($path, MODX_BASE_PATH) === 0) { - $path = substr($path, strlen(MODX_BASE_PATH)); - } - switch ($val['type']) { - case '->': - case '::': - $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function']; - break; - default: - $functionName = $val['function']; + if (strpos($val['function'], 'phpError') === 0) { + break; } - $tmp = 1; - $_ = (!empty($val['args'])) ? count($val['args']) : 0; + $num = 1; + $_ = empty($val['args']) ? 0 : count($val['args']); $args = array_pad([], $_, '$var'); $args = implode(", ", $args); - $modx = &$this; - $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { - $arg = $val['args'][$tmp - 1]; - switch (true) { - case is_null($arg): { + $args = preg_replace_callback( + '/\$var/', + function () use (&$num, $val) { + $arg = $val['args'][$num - 1]; + if (is_null($arg)) { $out = 'NULL'; - break; - } - case is_numeric($arg): { + } elseif (is_numeric($arg)) { $out = $arg; - break; - } - case is_scalar($arg): { - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); - break; - } - case is_bool($arg): { + } elseif (is_scalar($arg)) { + if (strlen($arg) <= 20) { + $out = sprintf("'%s'", $this->htmlspecialchars(str_replace("'", "\\'", $arg))); + } else { + $out = 'string $var' . $num; + } + } elseif (is_bool($arg)) { $out = $arg ? 'TRUE' : 'FALSE'; - break; - } - case is_array($arg): { - $out = 'array $var' . $tmp; - break; - } - case is_object($arg): { - $out = get_class($arg) . ' $var' . $tmp; - break; - } - default: { - $out = '$var' . $tmp; + } elseif (is_array($arg)) { + $out = 'array $var' . $num; + } elseif (is_object($arg)) { + $out = get_class($arg) . ' $var' . $num; + } else { + $out = '$var' . $num; } - } - $tmp++; - return $out; - }, $args); + $num++; + return $out; + }, + $args + ); + if (in_array($val['type'], ['->', '::'])) { + $val['function'] = $val['class'] . $val['type'] . $val['function']; + } + $path = str_replace('\\', '/', $val['file']); + if (strpos($path, MODX_BASE_PATH) === 0) { + $path = substr($path, strlen(MODX_BASE_PATH)); + } $line = array( - "" . $functionName . "(" . $args . ")", - $path . " on line " . $val['line'] + sprintf('%s(%s)', $val['function'], $args), + sprintf('%s on line %s', $path, $val['line']) ); $table[] = array(implode("
    ", $line)); } @@ -6871,88 +6909,103 @@ public function nicesize($size) */ public function getHiddenIdFromAlias($parentid, $alias) { - $out = false; - if ($alias !== '') { - $table = $this->getFullTableName('site_content'); - $query = $this->db->query("SELECT - `sc`.`id` AS `hidden_id`, - `children`.`id` AS `child_id`, - children.alias AS `child_alias`, - COUNT(`grandsons`.`id`) AS `grandsons_count` - FROM " . $table ." AS `sc` - JOIN " . $table . " AS `children` ON `children`.`parent` = `sc`.`id` - LEFT JOIN " . $table . " AS `grandsons` ON `grandsons`.`parent` = `children`.`id` - WHERE `sc`.`parent` = '" . (int)$parentid . "' AND `sc`.`alias_visible` = '0' - GROUP BY `children`.`id`"); - - while ($child = $this->db->getRow($query)) { - if ($child['child_alias'] == $alias || $child['child_id'] == $alias) { - $out = $child['child_id']; - break; - } elseif ($child['grandsons_count'] > 0 && ($id = $this->getHiddenIdFromAlias($child['hidden_id'], $alias))) { - $out = $id; - break; - } + if ($alias === '') { + return false; + } + + $query = $this->db->select( + 'sc.id AS hidden_id, + children.id AS child_id, + children.alias AS child_alias, + COUNT(grandsons.id) AS grandsons_count', + [ + sprintf('%s AS sc', $this->getFullTableName('site_content')), + sprintf( + 'JOIN %s AS children ON children.parent=sc.id', + $this->getFullTableName('site_content') + ), + sprintf( + 'LEFT JOIN %s AS grandsons ON grandsons.parent=children.id', + $this->getFullTableName('site_content') + ) + ], + sprintf( + "sc.parent='%s' AND sc.alias_visible=0 GROUP BY children.id", + (int)$parentid + ) + ); + + while ($child = $this->db->getRow($query)) { + if ($child['child_alias'] == $alias || $child['child_id'] == $alias) { + return $child['child_id']; + } + $id = $this->getHiddenIdFromAlias($child['hidden_id'], $alias); + if ($child['grandsons_count'] > 0 && $id) { + return $id; } } - return $out; + return false; } /** - * @param string $alias + * @param string $aliasPath * @return bool|int */ - public function getIdFromAlias($alias) + public function getIdFromAlias($aliasPath) { - if (isset($this->documentListing[$alias])) { - return $this->documentListing[$alias]; + if (isset($this->documentListing[$aliasPath])) { + return $this->documentListing[$aliasPath]; } - $tbl_site_content = $this->getFullTableName('site_content'); if (!$this->config['use_alias_path']) { $rs = $this->db->select( 'id', - $tbl_site_content, - "deleted=0 and alias='" . $alias . "'", + $this->getFullTableName('site_content'), + "deleted=0 and alias='" . $aliasPath . "'", 'parent, menuindex' ); $id = $this->db->getValue($rs); if (!$id) { - $id = false; + return false; } return $id; } - if ($alias === '.') { + if ($aliasPath === '.') { return 0; } - if (strpos($alias, '/') !== false) { - $_a = explode('/', $alias); - } else { - $_a[] = $alias; - } - $id = 0; + $_a = strpos($aliasPath, '/') !== false + ? explode('/', $aliasPath) + : [$aliasPath] + ; + $id = 0; foreach ($_a as $alias) { if ($id === false) { - break; + return false; } - $alias = $this->db->escape($alias); $rs = $this->db->select( 'id', - $tbl_site_content, - "deleted=0 and parent='" . $id . "' and alias='" . $alias . "'" + $this->getFullTableName('site_content'), + sprintf( + "deleted=0 and parent='%s' and alias='%s'", + $id, + $this->db->escape($alias) + ) ); - if ($this->db->getRecordCount($rs) == 0) { + if (!$this->db->getRecordCount($rs)) { $rs = $this->db->select( 'id', - $tbl_site_content, - "deleted=0 and parent='" . $id . "' and id='" . $alias . "'" + $this->getFullTableName('site_content'), + sprintf( + "deleted=0 and parent='%s' and id='%s'", + $id, + $this->db->escape($alias) + ) ); } - $next = $this->db->getValue($rs); - $id = $next ?: $this->getHiddenIdFromAlias($id, $alias); + $id = $this->db->getValue($rs) ?: $this->getHiddenIdFromAlias($id, $alias); } return $id; } @@ -6993,7 +7046,7 @@ public function atBindInclude($str = '') return false; } - if (!$file_path || !is_file($file_path)) { + if (!is_file($file_path)) { return false; } diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index cc7a2f785d..3a6f384b4f 100644 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -31,11 +31,11 @@ public function __construct( $charset = '', $connection_method = 'SET CHARACTER SET' ) { - $this->config['host'] = $host ? $host : $GLOBALS['database_server']; - $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; - $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; - $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password']; - $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset']; + $this->config['host'] = $host ?: $GLOBALS['database_server']; + $this->config['dbase'] = $dbase ?: $GLOBALS['dbase']; + $this->config['user'] = $uid ?: $GLOBALS['database_user']; + $this->config['pass'] = $pwd ?: $GLOBALS['database_password']; + $this->config['charset'] = $charset ?: $GLOBALS['database_connection_charset']; $this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method); $this->config['table_prefix'] = ($pre !== null) ? $pre : $GLOBALS['table_prefix']; } @@ -50,19 +50,23 @@ public function __construct( public function connect($host = '', $dbase = '', $uid = '', $pwd = '') { $modx = evolutionCMS(); - $uid = $uid ? $uid : $this->config['user']; - $pwd = $pwd ? $pwd : $this->config['pass']; - $host = $host ? $host : $this->config['host']; + $uid = $uid ?: $this->config['user']; + $pwd = $pwd ?: $this->config['pass']; + $host = $host ?: $this->config['host']; $host = explode(':', $host, 2); - $dbase = $dbase ? $dbase : $this->config['dbase']; + $dbase = $dbase ?: $this->config['dbase']; $dbase = trim($dbase, '`'); // remove the `` chars $charset = $this->config['charset']; $connection_method = $this->config['connection_method']; $tstart = $modx->getMicroTime(); $safe_count = 0; do { - $this->conn = new mysqli($host[0], $uid, $pwd, $dbase, isset($host[1]) ? $host[1] : null); - if ($this->conn->connect_error) { + try { + $this->conn = new mysqli($host[0], $uid, $pwd, $dbase, isset($host[1]) ? $host[1] : null); + } catch (Exception $e) { + $this->conn = null; + } + if (is_null($this->conn) || $this->conn->connect_error) { $this->conn = null; if (isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') { if ($modx->config['send_errormail'] <= 2) { @@ -111,28 +115,24 @@ public function disconnect() /** * @param array|string $s - * @param int $safeCount * @return array|string */ - public function escape($s, $safeCount = 0) + public function escape($s) { - $safeCount++; - if (1000 < $safeCount) { - exit("Too many loops '{$safeCount}'"); - } - if ( ! ($this->conn instanceof mysqli)) { + if (!$this->conn instanceof mysqli) { $this->connect(); } - if (is_array($s)) { - if (count($s) === 0) { - $s = ''; - } else { - foreach ($s as $i => $v) { - $s[$i] = $this->escape($v, $safeCount); - } - } - } else { - $s = $this->conn->escape_string($s); + + if (!is_array($s)) { + return $this->conn->escape_string($s); + } + + if (!count($s)) { + return ''; + } + + foreach ($s as $i => $v) { + $s[$i] = $this->escape($v); } return $s; @@ -154,7 +154,12 @@ public function query($sql, $watchError = true) $sql = implode("\n", $sql); } $this->lastQuery = $sql; - if (!($result = $this->conn->query($sql))) { + try { + $result = $this->conn->query($sql); + } catch (Exception $e) { + $result = false; + } + if (!$result) { if (!$watchError) { return false; } @@ -298,7 +303,7 @@ public function update($fields, $table, $where = "") $modx = evolutionCMS(); if (!$table) { $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); - return; + return false; } $table = $this->replaceFullTableName($table); if (is_array($fields)) { @@ -313,7 +318,7 @@ public function update($fields, $table, $where = "") $fields = implode(',', $fields); } if ($where && stripos(trim($where), 'WHERE') !== 0) { - $where = 'WHERE '.$where; + $where = 'WHERE '.trim($where); } return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); } @@ -339,8 +344,12 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $this->query("INSERT INTO {$intotable} {$fields}"); } else { if (empty($fromtable)) { - $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", - array_values($fields)) . "')"; + $field_values = $fields; //проверим значения на null, их нужно передать в запрос без кавычек + foreach($field_values as &$f_value) + { + $f_value = (null === $f_value) ? "NULL" : "'{$f_value}'"; + } + $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES(" . implode(", ", array_values($field_values)) . ")"; $this->query("INSERT INTO {$intotable} {$fields}"); } else { $fromtable = $this->replaceFullTableName($fromtable); diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php index a80bf0e4de..1eb371a73f 100755 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -513,7 +513,7 @@ function clickAll() { public function createPagingNavigation($numRecords, $qs = '') { global $_lang; - $currentPage = (is_numeric($_GET['page']) ? $_GET['page'] : 1); + $currentPage = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1; $numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM); $nav = ''; if ($numPages > 1) { diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index da6e862edd..7f0e3050f1 100755 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -11,10 +11,6 @@ class MODIFIERS { * @var array */ public $vars = array(); - /** - * @var array - */ - public $tmpCache = array(); /** * @var */ @@ -229,10 +225,11 @@ public function splitEachModifiers($modifiers) { public function parsePhx($key,$value,$modifiers) { + static $cache = null; $modx = evolutionCMS(); $lastKey = ''; - $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); - if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; + $cacheKey = md5(print_r(func_get_args(), true)); + if(isset($cache[$cacheKey])) return $cache[$cacheKey]; if(empty($modifiers)) return ''; foreach($modifiers as $m) @@ -246,11 +243,11 @@ public function parsePhx($key,$value,$modifiers) $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - foreach($modifiers as $i=>$a) + foreach($modifiers as $a) { $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); } - $this->tmpCache[$cacheKey] = $value; + $cache[$cacheKey] = $value; return $value; } @@ -678,14 +675,11 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'dateformat': if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly'); if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - if(strpos($opt,'%')!==false) - return strftime($opt,0+$value); - else - return date($opt,0+$value); + return date($opt,0+$value); case 'time': - if(empty($opt)) $opt = '%H:%M'; + if(empty($opt)) $opt = 'H:i'; if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - return strftime($opt,0+$value); + return date($opt,0+$value); case 'strtotime': return strtotime($value); ##### mathematical function diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 166cd22e0f..10a7686740 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -7,7 +7,7 @@ // invoke OnManagerRegClientStartupHTMLBlock event $evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock'); -$modx_textdir = isset($modx_textdir) ? $modx_textdir : null; +$modx_textdir = $modx_textdir ?? null; $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; if (!isset($modx->config['mgr_jquery_path'])) { @@ -19,30 +19,31 @@ $body_class = ''; $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); -$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : ''; -if (!empty($theme_modes[$theme_mode])) { +$theme_mode = $_COOKIE['MODX_themeMode'] ?? ''; +if ($theme_mode && !empty($theme_modes[$theme_mode])) { $body_class .= ' ' . $theme_modes[$theme_mode]; -} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode'] ?? 3])) { + $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode'] ?? 3]; } -$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; +$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $modx->recentUpdate; -if ($modx->config['manager_theme'] == 'default') { - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') - && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { +$style_path = MODX_MANAGER_PATH . 'media/style/'; +if ($modx->config['manager_theme'] === 'default') { + if (!file_exists($style_path . $modx->config['manager_theme'] . '/css/styles.min.css') + && is_writable($style_path . $modx->config['manager_theme'] . '/css')) { $files = array( - 'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css', - 'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css', - 'fonts' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css', - 'forms' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css', - 'mainmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css', - 'tree' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css', - 'custom' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css', - 'tabpane' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css', - 'contextmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css', - 'index' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css', - 'main' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css' + 'bootstrap' => $style_path . 'common/bootstrap/css/bootstrap.min.css', + 'font-awesome' => $style_path . 'common/font-awesome/css/font-awesome.min.css', + 'fonts' => $style_path . $modx->config['manager_theme'] . '/css/fonts.css', + 'forms' => $style_path . $modx->config['manager_theme'] . '/css/forms.css', + 'mainmenu' => $style_path . $modx->config['manager_theme'] . '/css/mainmenu.css', + 'tree' => $style_path . $modx->config['manager_theme'] . '/css/tree.css', + 'custom' => $style_path . $modx->config['manager_theme'] . '/css/custom.css', + 'tabpane' => $style_path . $modx->config['manager_theme'] . '/css/tabpane.css', + 'contextmenu' => $style_path . $modx->config['manager_theme'] . '/css/contextmenu.css', + 'index' => $style_path . $modx->config['manager_theme'] . '/css/index.css', + 'main' => $style_path . $modx->config['manager_theme'] . '/css/main.css' ); $evtOut = $modx->invokeEvent('OnBeforeMinifyCss', array( 'files' => $files, @@ -63,12 +64,12 @@ $minifier = new Formatter\CSSMinify($files); $css = $minifier->minify(); file_put_contents( - MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', + $style_path . $modx->config['manager_theme'] . '/css/styles.min.css', $css ); } - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; + if (file_exists($style_path . $modx->config['manager_theme'] . '/css/styles.min.css')) { + $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $modx->recentUpdate; } } @@ -88,14 +89,6 @@ - config['enable_mootools'] != "0") { ?> - - - - - diff --git a/manager/includes/lang/belarusian.inc.php b/manager/includes/lang/belarusian.inc.php new file mode 100644 index 0000000000..ca7791242a --- /dev/null +++ b/manager/includes/lang/belarusian.inc.php @@ -0,0 +1,1523 @@ +PHP Application Framework and Content Management System licensed under the GNU GPL.'; +$_lang["about_title"] = 'About Evolution'; +$_lang["access_permission_denied"] = 'You do not have the correct permissions for this Resource.'; +$_lang["access_permission_parent_denied"] = 'You do not have permission to create or move a Resource here! Please choose another location.'; +$_lang["access_permissions"] = 'Access permissions'; +$_lang["access_permissions_add_resource_group"] = 'Create a new Resource Group'; +$_lang["access_permissions_add_user_group"] = 'Create a new User Group'; +$_lang["access_permissions_docs_collision"] = 'Because the Web User Groups and Manager User Groups conflict for your Role, this Resource will be public. Contact a site administrator for further help.'; +$_lang["access_permissions_docs_message"] = 'Select which Resource Groups this Resource belongs to'; +$_lang["access_permissions_group_link"] = 'Create a new group link'; +$_lang["access_permissions_introtext"] = 'Manage the User Groups and Resource Groups used for access permissions. To add a user to a User Group, edit the user and select the groups (s)he should be a member of. To add a Resource to a User Group, edit the Resource and select the groups it should belong to.'; +$_lang["access_permissions_link_to_group"] = 'to Resource Group'; +$_lang["access_permissions_link_user_group"] = 'Link User Group'; +$_lang["access_permissions_links"] = 'User/Resource Group links'; +$_lang["access_permissions_links_tab"] = 'Specify which User Groups are given access (i.e. can edit or create children) to the Resource Groups. To link a Resource Group to a User Group, select the appropriate groups from the drop down menus, and click on \'Submit\'. To remove the link for a certain group, press \'Remove\'. This will immediately remove the link.'; +$_lang["access_permissions_no_resources_in_group"] = 'None.'; +$_lang["access_permissions_no_users_in_group"] = 'None.'; +$_lang["access_permissions_off"] = 'Access Permissions are not activated. This means any changes made here will not have any effect until Access Permissions are activated in your Configuration.'; +$_lang["access_permissions_resource_groups"] = 'Resource Groups'; +$_lang["access_permissions_resources_in_group"] = 'Resources in group: '; +$_lang["access_permissions_resources_tab"] = 'See which Resource Groups have been created. Also create new groups, rename groups, delete groups and see which Resources are in the different groups (hover over the id of the Resource to see it\'s name). To add a Resource to a group or remove a Resource from a group, edit the Resource directly.'; +$_lang["access_permissions_user_groups"] = 'User groups'; +$_lang["access_permissions_user_message"] = 'Select which User Groups this user belongs to:'; +$_lang["access_permissions_users_in_group"] = 'Users in group:'; +$_lang["access_permissions_users_tab"] = 'View the User Groups that have been created. You can also create new groups, rename groups, delete groups and see which users are members of the different groups. To add a new user to a group or to remove a user from a group, edit the user directly. Administrators (users who have been assigned the role with ID 1) always have access to all Resources, so they don\'t need to be added to any groups.'; +$_lang["account_email"] = 'Account email'; +$_lang["actioncomplete"] = 'Action was completed successfully!
    - Please wait while EVO cleans up.'; +$_lang["activity_message"] = 'This list shows the last Resources you created or edited:'; +$_lang["activity_title"] = 'Recently edited/created Resources'; +$_lang["add"] = 'Add'; +$_lang["add_chunk"] = 'Add Chunk'; +$_lang["add_doc"] = 'Add Resource'; +$_lang["add_folder"] = 'New Directory'; +$_lang["add_plugin"] = 'Add Plugin'; +$_lang["add_resource"] = 'New Resource'; +$_lang["add_snippet"] = 'Add Snippet'; +$_lang["add_tag"] = 'Add tag'; +$_lang["add_template"] = 'Add Template'; +$_lang["add_tv"] = 'Add TV'; +$_lang["add_weblink"] = 'New Weblink'; +$_lang["administrator_role_message"] = 'This role cannot be edited or deleted.'; +$_lang["administrators"] = 'Administrators'; +$_lang["after_saving"] = 'After saving'; +$_lang["alert_delete_self"] = 'You can\'t delete yourself!'; +$_lang["alias"] = 'URL alias'; +$_lang["all_doc_groups"] = 'All Resource Groups (Public)'; +$_lang["all_events"] = 'All Events'; +$_lang["all_usr_groups"] = 'All User Groups (Public)'; +$_lang["allow_mgr_access"] = 'Manager Interface Access'; +$_lang["allow_mgr_access_message"] = 'Select this option to enable or disable access to the manager interface. NOTE: If this option is set to no then the user will be redirected to the Manager Login Startup or Site Start web page.'; +$_lang["already_deleted"] = 'has already been deleted.'; +$_lang["attachment"] = 'Attachment'; +$_lang["author_infos"] = 'Author information'; +$_lang["automatic_alias_message"] = 'Select \'yes\' to have the system automatically generate a URL alias based on the Resource\'s page title when saving.'; +$_lang["automatic_alias_title"] = 'Automatically generate URL alias'; +$_lang["backup"] = 'Backup'; +$_lang["bk_manager"] = 'Backup'; +$_lang["block_message"] = 'This user will be blocked after saving the user\'s data!'; +$_lang["blocked_minutes_message"] = 'Enter the number of minutes that a user will be blocked for if they reach their maximum number of allowed failed login attempts. Please enter this value as numbers only (no commas, spaces etc.)'; +$_lang["blocked_minutes_title"] = 'Blocked Minutes'; +$_lang["cache_files_deleted"] = 'The following files were deleted:'; +$_lang["cancel"] = 'Cancel'; +$_lang["captcha_code"] = 'Security code'; +$_lang["captcha_message"] = 'Enable this to strengthen security by requiring users to enter a code which is unreadable by machines (and script-kiddy hacking scripts).'; +$_lang["captcha_title"] = 'Use CAPTCHA codes'; +$_lang["captcha_words_default"] = 'EVO,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'; +$_lang["captcha_words_message"] = 'Enter a list of CAPTCHA words to use if CAPTCHA is enabled. Separate the words with commas. This input field is limited to 255 characters.'; +$_lang["captcha_words_title"] = 'CAPTCHA Words'; +$_lang["category_heading"] = 'Category'; +$_lang["category_manager"] = 'Category Manager'; +$_lang["category_management"] = 'Category management'; +$_lang["manage_categories"] = 'Manage Categories'; +$_lang["category_msg"] = 'View and edit all Elements grouped by category.'; +$_lang["cfg_base_path"] = 'MODX_BASE_PATH'; +$_lang["cfg_base_url"] = 'MODX_BASE_URL'; +$_lang["cfg_manager_path"] = 'MODX_MANAGER_PATH'; +$_lang["cfg_manager_url"] = 'MODX_MANAGER_URL'; +$_lang["cfg_site_url"] = 'MODX_SITE_URL'; +$_lang["change_name"] = 'Change username'; +$_lang["change_password"] = 'Change Password'; +$_lang["change_password_confirm"] = 'Confirm password'; +$_lang["change_password_message"] = 'Please enter your new password, and then enter it again to confirm. Your password needs to be at least 6 characters long.'; +$_lang["change_password_new"] = 'New password'; +$_lang["charset_message"] = 'Select the default character encoding for the [(modx_charset)] system variable. This does not affect the Manager.'; +$_lang["charset_title"] = 'Character encoding'; +$_lang["chunk"] = 'Chunk'; +$_lang["chunk_code"] = 'Chunk code (html)'; +$_lang["chunk_multiple_id"] = 'Error: Multiple Chunks share the same unique ID.'; +$_lang["chunk_no_exist"] = 'Chunk does not exist.'; +$_lang["cleaningup"] = 'Cleaning up'; +$_lang["clean_uploaded_filename"] = 'Use Transliteration for File Uploads'; +$_lang["clean_uploaded_filename_message"] = 'Use the default or transalias settings for the file name to clean special characters from uploaded file names, preserving dot-characters (periods)'; +$_lang["clear_log"] = 'Clear log'; +$_lang["click_to_context"] = 'Click to access context menu'; +$_lang["click_to_edit_title"] = 'Click here to edit this record'; +$_lang["click_to_view_details"] = 'Click here to view details'; +$_lang["close"] = 'Close'; +$_lang["code"] = 'Code'; +$_lang["collapse_tree"] = 'Collapse Site Tree'; +$_lang["comment"] = 'Comment'; +$_lang["configcheck_admin"] = 'Please contact a systems administrator and warn them about this message!'; +$_lang["configcheck_cache"] = 'cache directory not writable'; +$_lang["configcheck_cache_msg"] = 'EVO cannot write to the cache directory. EVO will still function as expected, but no caching will take place. To solve this, make the /_cache/ directory writable.'; +$_lang["configcheck_configinc"] = 'Config file still writable'; +$_lang["configcheck_configinc_msg"] = 'Very naughty people could potentially wreak some havoc on your site and everything associated with it. Really. Please make your config file (/[+MGR_DIR+]/includes/config.inc.php) read only!'; +$_lang["configcheck_default_msg"] = 'An unspecified warning was found. Which is strange.'; +$_lang["configcheck_errorpage_unavailable"] = 'Your site\'s Error page is not available.'; +$_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.'; +$_lang["configcheck_errorpage_unpublished"] = 'Your site\'s Error page is not published or does not exist.'; +$_lang["configcheck_errorpage_unpublished_msg"] = 'This means that your Error page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.'; +$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.'; +$_lang["configcheck_filemanager_path_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; +$_lang["configcheck_hide_warning"] = 'Don\'t show this again.'; +$_lang["configcheck_images"] = 'Images directory not writable'; +$_lang["configcheck_images_msg"] = 'The images directory isn\'t writable, or doesn\'t exist. This means the Image Manager functions in the editor will not work!'; +$_lang["configcheck_installer"] = 'Installer still present'; +$_lang["configcheck_installer_msg"] = 'The /install directory contains the installer for EVO. Just imagine what might happen if an evil person finds this directory and runs the installer! They\'d probably not get too far, because they need to enter some user information for the database, but it is still best to remove this directory from your server.'; +$_lang["configcheck_lang_difference"] = 'Incorrect number of entries in language file'; +$_lang["configcheck_lang_difference_msg"] = 'The currently selected language has a different number of entries than the default language. While not necessarily a problem, this may mean the language file needs to be updated.'; +$_lang["configcheck_notok"] = 'One or more configuration details didn\'t check out OK:'; +$_lang["configcheck_ok"] = 'Check passed OK - no warnings to report.'; +$_lang["configcheck_php_gdzip"] = 'GD and/or Zip PHP extensions not found'; +$_lang["configcheck_php_gdzip_msg"] = 'EVO needs the GD and Zip extension enabled for PHP. While EVO will work without them, you will not be able to take full advantage of the built-in File Manager, Image Editor or Captcha for logins.'; +$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.'; +$_lang["configcheck_rb_base_dir_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; +$_lang["configcheck_register_globals"] = 'register_globals is set to ON in your php.ini configuration file'; +$_lang["configcheck_register_globals_msg"] = 'This configuration makes your site much more susceptible to Cross Site Scripting (XSS) attacks. You should speak to your host about what you can do to disable this setting.'; +$_lang["configcheck_title"] = 'Configuration check'; +$_lang["configcheck_templateswitcher_present"] = 'TemplateSwitcher Plugin detected'; +$_lang["configcheck_templateswitcher_present_delete"] = 'Delete TemplateSwitcher'; +$_lang["configcheck_templateswitcher_present_disable"] = 'Disable TemplateSwitcher'; +$_lang["configcheck_templateswitcher_present_msg"] = 'The TemplateSwitcher plugin has been found to cause caching and performance problems, and should be used only the functionality is required in your site.'; +$_lang["configcheck_unauthorizedpage_unavailable"] = 'Your site\'s Unauthorized page is not published or does not exist.'; +$_lang["configcheck_unauthorizedpage_unavailable_msg"] = 'This means that your Unauthorized page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.'; +$_lang["configcheck_unauthorizedpage_unpublished"] = 'The Unauthorized page defined in the site configuration settings is not published.'; +$_lang["configcheck_unauthorizedpage_unpublished_msg"] = 'This means that your Unauthorized page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.'; +$_lang["configcheck_validate_referer"] = 'Security Warning: HTTP Header Validation'; +$_lang["configcheck_validate_referer_msg"] = 'The configuration setting Validate HTTP_REFERER headers? is Off. We recommend turning it On. Go to Configuration options'; +$_lang["configcheck_warning"] = 'Configuration warning: '; +$_lang["configcheck_what"] = 'What does this mean?'; +$_lang["confirm_block"] = 'Are you sure you want to block this user?'; +$_lang["confirm_delete_category"] = 'Are you sure you want to delete this category?'; +$_lang["confirm_delete_eventlog"] = 'Are you sure you want to delete this event log?'; +$_lang["confirm_delete_file"] = 'Are you sure you want to delete the file?\n\nThis may stop your site from working properly! Only delete this file if you know for certain what you are doing will not break anything.'; +$_lang["confirm_delete_group"] = 'Are you sure you want to delete this group?'; +$_lang["confirm_delete_htmlsnippet"] = 'Are you sure you want to delete this Chunk?'; +$_lang["confirm_delete_keywords"] = 'Are you sure you want to delete these keywords?'; +$_lang["confirm_delete_module"] = 'Are you sure you want to delete this Module?'; +$_lang["confirm_delete_plugin"] = 'Are you sure you want to delete this Plugin?'; +$_lang["confirm_delete_record"] = 'Are you sure you want to delete the selected record(s)?'; +$_lang["confirm_delete_resource"] = 'Are you sure you want to delete this Resource?\nAny children Resources will also be deleted.'; +$_lang["confirm_delete_role"] = 'Are you sure you want to delete this role?'; +$_lang["confirm_delete_snippet"] = 'Are you sure you want to delete this Snippet?'; +$_lang["confirm_delete_tags"] = 'Are you sure you want to delete the selected META tags?'; +$_lang["confirm_delete_template"] = 'Are you sure you want to delete this Template?'; +$_lang["confirm_delete_tmplvars"] = 'Are you sure you want to remove this Template Variable and all stored values?'; +$_lang["confirm_delete_user"] = 'Are you sure you want to delete this User?'; +$_lang["confirm_duplicate_record"] = 'Are you sure you want to duplicate this record?'; +$_lang["confirm_empty_trash"] = 'This will permanently remove ALL deleted Resources?\n\nProceed?'; +$_lang["confirm_load_depends"] = 'Are you sure you want to load the Manage Dependencies screen without saving your modifications?'; +$_lang["confirm_name_change"] = 'Changing the username can affect other applications that are linked to the Content Manager.\n\nAre you sure you want to change this username?'; +$_lang["confirm_publish"] = '\n\nPublishing this Resource now will remove any (un)publishing dates that may have been set. If you wish to set or keep publish or unpublish dates, please choose to \'edit\' the Resource instead.\n\nProceed?'; +$_lang["confirm_remove_locks"] = 'Users sometimes close their browser while editing Resources, Templates, Snippets or parsers, possibly leaving the item they were editing in locked state. By pressing OK you can remove ALL locks currently in place.\n\nProceed?'; +$_lang["confirm_reset_sort_order"] = 'Are you sure you want to reset the \"sort order/index\" of all listed elements to 0 ?'; +$_lang["confirm_resource_duplicate"] = 'Are you sure you want to duplicate this Resource? Any item(s) it contains will also be duplicated.'; +$_lang["confirm_setting_language_change"] = 'You have modified the default value and will lose the changes. Proceed?'; +$_lang["confirm_unblock"] = 'Are you sure you want to unblock this user?'; +$_lang["confirm_undelete"] = '\n\nAny children Resources deleted at the same time as this Resource will also be undeleted, but children Resources deleted at an earlier time will still be deleted.'; +$_lang["confirm_unpublish"] = '\n\nUn-publishing this Resource now will remove any (un)publishing dates that may have been set. If you wish to set or keep publish or unpublish dates, please choose to \'edit\' the Resource instead.\n\nProceed?'; +$_lang["confirm_unzip_file"] = 'Are you sure you want to unzip this file?\n\nExisting files will be overwritten.'; +$_lang["could_not_find_user"] = 'Could not find user'; +$_lang["create_folder_here"] = 'Create Container here'; +$_lang["create_resource_here"] = 'Create Resource here'; +$_lang["create_resource_title"] = 'Create Resource'; +$_lang["create_weblink_here"] = 'Create Weblink here'; +$_lang["createdon"] = 'Creation date'; +$_lang["create_new"] = 'Create new'; +$_lang["credits"] = 'Credits'; +$_lang["credits_shouts_msg"] = '

    EVO is managed and maintained at evo.im.

    '; +$_lang["custom_contenttype_message"] = 'Add custom content types for Resources. To add a new entry, enter the content type in the text box then click the \'Add\' button.'; +$_lang["custom_contenttype_title"] = 'Custom content types'; +$_lang["database_charset"] = 'Database Charset'; +$_lang["database_collation"] = 'Database Collation Charset'; +$_lang["database_name"] = 'Database name'; +$_lang["database_overhead"] = 'Note: Overhead is unused space reserved by MySQL. To free up this space, click on the table\'s overhead figure.'; +$_lang["database_server"] = 'Database server'; +$_lang["database_table_clickbackup"] = 'Backup & download the selected tables'; +$_lang["database_table_clickhere"] = 'Click here'; +$_lang["database_table_datasize"] = 'Data size'; +$_lang["database_table_droptablestatements"] = 'Generate DROP TABLE statements.'; +$_lang["database_table_effectivesize"] = 'Effective size'; +$_lang["database_table_indexsize"] = 'Index size'; +$_lang["database_table_overhead"] = 'Overhead'; +$_lang["database_table_records"] = 'Records'; +$_lang["database_table_tablename"] = 'Table name'; +$_lang["database_table_totals"] = 'Totals'; +$_lang["database_table_totalsize"] = 'Total size'; +$_lang["database_tables"] = 'Database tables'; +$_lang["database_version"] = 'Database Version'; +$_lang["date"] = 'Date'; +$_lang["datechanged"] = 'Date changed'; +$_lang["datepicker_offset"] = 'Datepicker offset'; +$_lang["datepicker_offset_message"] = 'The number of years to show in the past on the datepicker.'; +$_lang["datetime_format"] = 'Date format'; +$_lang["datetime_format_message"] = 'The format for dates in the Manager.'; +$_lang["default"] = 'Default:'; +$_lang["defaultcache_message"] = 'Select \'Yes\' to make all new Resources cacheable by default.'; +$_lang["defaultcache_title"] = 'Cacheable default'; +$_lang["defaultmenuindex_message"] = 'Select \'Yes\' to turn on automatic menu index incrementing by default.'; +$_lang["defaultmenuindex_title"] = 'Menu indexing default'; +$_lang["defaultpublish_message"] = 'Select \'Yes\' to make all new Resources published by default.'; +$_lang["defaultpublish_title"] = 'Published default'; +$_lang["defaultsearch_message"] = 'Select \'Yes\' to make all new Resources searchable by default.'; +$_lang["defaultsearch_title"] = 'Searchable default'; +$_lang["defaulttemplate_message"] = 'Select the Template you wish to use as a system default for new Resources. You can still select a different Template in the Resource editor, this setting just pre-selects one of your Templates for you.'; +$_lang["defaulttemplate_title"] = 'System Default Template'; +$_lang["defaulttemplate_logic_title"] = 'Automatic Template Assignment'; +$_lang["defaulttemplate_logic_general_message"] = 'New Resources will have the following templates, falling back to higher levels if not found:'; +$_lang["defaulttemplate_logic_system_message"] = 'System: the System Default Template.'; +$_lang["defaulttemplate_logic_parent_message"] = 'Parent: the same Template as the parent container.'; +$_lang["defaulttemplate_logic_sibling_message"] = 'Sibling: the same Template as other Resources in the same container.'; +$_lang["delete"] = 'Delete'; +$_lang["delete_resource"] = 'Delete Resource'; +$_lang["delete_tags"] = 'Delete tags'; +$_lang["deleting_file"] = 'Deleting file `%s`: '; +$_lang["description"] = 'Description'; +$_lang["deselect_keywords"] = 'Clear keywords'; +$_lang["deselect_metatags"] = 'Clear META tags'; +$_lang["disabled"] = 'Disabled'; +$_lang["doc_data_title"] = 'View Resource data'; +$_lang["documentation"] = 'Documentation'; +$_lang["duplicate"] = 'Duplicate'; +$_lang["duplicate_alias_found"] = 'Resource \'%s\' is already using the URL alias \'%s\'. Please enter a unique URL alias.'; +$_lang["duplicate_alias_message"] = 'Select \'yes\' to allow duplicate URL aliases to be saved. NOTE: This option should be used with \'Friendly URL alias path\' option set to \'Yes\' in order to avoid problems when referencing a Resource.'; +$_lang["duplicate_alias_title"] = 'Allow duplicate URL aliases'; +$_lang["duplicate_name_found_general"] = 'There is already a %s named \'%s\'. Please enter a unique name.'; +$_lang["duplicate_name_found_module"] = 'There is already a Module named \'%s\'. Please enter a unique name.'; +$_lang["duplicated_el_suffix"] = 'Duplicate'; +$_lang["edit"] = 'Edit'; +$_lang["edit_resource"] = 'Edit Resource'; +$_lang["edit_resource_title"] = 'Edit Resource'; +$_lang["edit_settings"] = 'Configuration'; +$_lang["editedon"] = 'Edit date'; +$_lang["editing_file"] = 'Editing file: '; +$_lang["editor_css_path_message"] = 'Enter the path to your CSS file that you wish to use within the editor. The best way to enter the path is to enter the path from the root of your server, for example: /assets/site/style.css. If you do not wish to load a style sheet into the editor, leave this field blank.'; +$_lang["editor_css_path_title"] = 'Path to CSS file'; +$_lang["element"] = 'Element'; +$_lang["element_categories"] = 'Combined View'; +$_lang["element_filter_msg"] = 'Type here to filter list'; +$_lang["element_management"] = 'Manage Elements'; +$_lang["element_name"] = 'Element name'; +$_lang["element_selector_msg"] = 'Select the Elements(s) from the list below and click the \'Insert\' button.'; +$_lang["element_selector_title"] = 'Element Selector'; +$_lang["elements"] = 'Elements'; +$_lang["email"] = 'Email'; +$_lang["email_sent"] = 'Email sent'; +$_lang["emailsender_message"] = 'The email address of the site administrator. For example, this email address will be used as the destination of system notification e-mail etc.'; +$_lang["emailsender_title"] = 'E-mail address'; +$_lang["emailsubject_default"] = 'Your login details'; +$_lang["emailsubject_message"] = 'Specify the value of the subject of the signup e-mail.'; +$_lang["emailsubject_title"] = 'E-mail subject'; +$_lang["empty_folder"] = 'This Container is empty'; +$_lang["empty_recycle_bin"] = 'Purge deleted Resources'; +$_lang["empty_recycle_bin_empty"] = 'There are no deleted Resources to purge.'; +$_lang["enable_resource"] = 'Enable Element file.'; +$_lang["enable_sharedparams"] = 'Enable parameter sharing'; +$_lang["enable_sharedparams_msg"] = 'NOTE: The above globally unique id (GUID) will be used to uniquely identify this Module and it\'s shared parameters. The GUID is also used to form a link between the Module and the Plugins or Snippets accessing the it\'s shared parameters. '; +$_lang["enabled"] = 'Enabled'; +$_lang["error"] = 'Error'; +$_lang["error_sending_email"] = 'Error sending email'; +$_lang["errorpage_message"] = 'Enter a published and publicly accessible Resource ID to redirect users to when requesting a non-existing Resource.'; +$_lang["errorpage_title"] = 'Error page'; +$_lang["event_id"] = 'Event Id'; +$_lang["eventlog"] = 'Event log'; +$_lang["eventlog_msg"] = 'The event log is used to display information, warning and error messages generated by the content manager. The \'source\' column shows the section of the content manager where the message occurred.'; +$_lang["eventlog_viewer"] = 'System Events'; +$_lang["everybody"] = 'Everybody'; +$_lang["existing_category"] = 'Existing Category'; +$_lang["expand_tree"] = 'Expand Site Tree'; +$_lang["export_site"] = 'Export Static HTML'; +$_lang["export_site_cacheable"] = 'Include non-cacheable files:'; +$_lang["export_site_exporting_document"] = '[+status+] [+url+] - [+pagetitle+] ([+id+])
    '; +$_lang["export_site_failed"] = 'Failed!'; +$_lang["export_site_failed_no_open"] = 'Cannot open file: '; +$_lang["export_site_failed_no_retrieve"] = 'Cannot retrieve document.'; +$_lang["export_site_failed_no_write"] = 'Cannot write file.'; +$_lang["export_site_html"] = 'Export site to HTML'; +$_lang["export_site_maxtime"] = 'Max export time:'; +$_lang["export_site_maxtime_message"] = 'Specify the number of seconds EVO can take to export the site (overriding PHP settings). Enter 0 for unlimited time. Please note, setting 0 or a really high number can do weird things to your server and is not recommended.'; +$_lang["export_site_message"] = '

    Use this to export the entire site to static HTML files. Please note, however, that you will lose a lot of the EVO functionality should you do so:

    • Page reads on the exported files will not be recorded.
    • Interactive Snippets will NOT work in exported files
    • Only regular Resources will be exported, Weblinks will not be exported.
    • The export process may fail if your Resources contain Snippets which send redirection headers.
    • Depending on how you\'ve written your Resources, style sheets and images, the design of your site may be broken. To fix this, save/move your exported files to the same directory where the main EVO index.php file is located.

    Please fill out the form and press \'Export\' to start the export process. The files created will be saved in the /assets/export directory, using the Resources\' URL aliases as filenames when possible. While exporting your site, it\'s best to have the EVO configuration item \'Friendly URL aliases\' set to \'yes\'. Depending on the size of your site, the export may take a while.

    Any existing files will be overwritten by the new files if their names are identical!

    '; +$_lang["export_site_numberdocs"] = '

    Found %s Resources to export...

    '; +$_lang["export_site_prefix"] = 'File prefix:'; +$_lang["export_site_start"] = 'Start export'; +$_lang["export_site_success"] = 'Success!'; +$_lang["export_site_success_skip_dir"] = 'Skip this directory.'; +$_lang["export_site_success_skip_doc"] = 'Skip this document.'; +$_lang["export_site_suffix"] = 'File suffix:'; +$_lang["export_site_target_unwritable"] = 'Target directory isn\'t writable. Please ensure the directory is writable, and try again.'; +$_lang["export_site_time"] = 'Export finished. Export took %s seconds to complete.'; +$_lang["failed_login_message"] = 'Enter the number of failed login attempts allowed before blocking a user.'; +$_lang["failed_login_title"] = 'Failed Login Attempts'; +$_lang["fe_editor_lang_message"] = 'Choose a language for the editor to use when used as a front-end editor.'; +$_lang["fe_editor_lang_title"] = 'Front-end Editor Language'; +$_lang["file_delete_file"] = 'Delete file'; +$_lang["file_delete_folder"] = 'Delete directory'; +$_lang["file_deleted"] = 'Success!'; +$_lang["file_download_file"] = 'Download File'; +$_lang["file_download_unzip"] = 'Unzip File'; +$_lang["file_folder_chmod_error"] = 'Unable to change permissions, you will need to change permissions outside of EVO.'; +$_lang["file_folder_created"] = 'Directory created successfully!'; +$_lang["file_folder_deleted"] = 'Directory was successfully deleted!'; +$_lang["file_folder_not_created"] = 'Unable to create directory'; +$_lang["file_folder_not_deleted"] = 'Unable to delete directory. Make sure it is empty before deleting.'; +$_lang["file_not_deleted"] = 'Failed!'; +$_lang["file_not_saved"] = 'Cannot save file, please ensure target directory is writable!'; +$_lang["file_saved"] = 'File updated successfully!'; +$_lang["file_unzip"] = 'Unzip was successful!'; +$_lang["file_unzip_fail"] = 'Unzip Failed!'; +$_lang["filemanager_path_message"] = 'IIS often does not populate the document_root setting properly, which is used by the file manager to determine what you can see. If you are having problems using the file manager, make sure this path points to the root of your EVO installation.'; +$_lang["filemanager_path_title"] = 'File Manager path'; +$_lang["files_access_denied"] = 'Access denied!'; +$_lang["files_data"] = 'Data'; +$_lang["files_dir_listing"] = 'Directory listing for:'; +$_lang["files_directories"] = 'Directories'; +$_lang["files_directory_is_empty"] = 'This directory is empty.'; +$_lang["files_dirwritable"] = 'Directory writable?'; +$_lang["files_editfile"] = 'Edit file'; +$_lang["files_file_type"] = 'File type: '; +$_lang["files_filename"] = 'Filename'; +$_lang["files_fileoptions"] = 'Options'; +$_lang["files_files"] = 'Files'; +$_lang["files_filesize"] = 'File size'; +$_lang["files_filetype_notok"] = 'Uploading of this kind of file is not allowed!'; +$_lang["files_management"] = 'Manage Files'; +$_lang["files_management_no_permission"] = 'You do not have enough permissions to view or edit these files. Ask the administrator to grant you access to %s.'; +$_lang["files_modified"] = 'Modified'; +$_lang["files_top_level"] = 'To top level'; +$_lang["files_up_level"] = 'Up one level'; +$_lang["files_upload_copyfailed"] = 'Failed to copy file to destination directory - upload failed!'; +$_lang["files_upload_error"] = 'Error'; +$_lang["files_upload_error0"] = 'There was a problem with your upload.'; +$_lang["files_upload_error1"] = 'The file you are trying to upload is too big.'; +$_lang["files_upload_error2"] = 'The file you are trying to upload is too big.'; +$_lang["files_upload_error3"] = 'The file you are trying upload was only partially uploaded.'; +$_lang["files_upload_error4"] = 'You must select a file for upload.'; +$_lang["files_upload_error5"] = 'There was a problem with your upload.'; +$_lang["files_upload_inhibited_msg"] = 'Upload feature inhibited - make sure uploads are supported and the directory is writable for PHP.'; +$_lang["files_upload_ok"] = 'File uploaded successfully!'; +$_lang["files_upload_permissions_error"] = 'Possible permission problems - the directory you want to upload to needs to be writable by your webserver.'; +$_lang["files_uploadfile"] = 'Upload file'; +$_lang["files_uploadfile_msg"] = 'Select a file to upload:'; +$_lang["files_uploading"] = 'Uploading %s to %s/'; +$_lang["files_viewfile"] = 'View file'; +$_lang["folder"] = 'Folder'; +$_lang["forgot_password_email_fine_print"] = '* The URL above will expire once you change your password or after today.'; +$_lang["forgot_password_email_instructions"] = 'From there you will be able to change your password from the My Account menu.'; +$_lang["forgot_password_email_intro"] = 'A request has been made to change the password on your account.'; +$_lang["forgot_password_email_link"] = 'Click here to complete the process.'; +$_lang["forgot_your_password"] = 'Forgot your password?'; +$_lang["friday"] = 'Friday'; +$_lang["friendly_alias_message"] = 'With Friendly URLs enabled, a Resource URL alias will be used when present instead of the Resource ID. E.g., if a Resource with ID 1 has an URL alias of "introduction", no prefix set (empty) and a suffix of ".html", enabling this option would generate an URL alias of "introduction.html". If there is no URL alias set, EVO generates "1.html".'; +$_lang["friendly_alias_title"] = 'Use Friendly URL aliases'; +$_lang["friendlyurls_message"] = 'Use Search Engine Friendly URLs on Apache webservers with mod_rewrite or IIS with third-party plugins. See the .htaccess file in the site root of the distribution for more info.'; +$_lang["friendlyurls_title"] = 'Use FriendlyURLs'; +$_lang["friendlyurlsprefix_message"] = 'A prefix setting of "page" will turn the URL /index.php?id=2 to the URL alias "page2.html" (assuming the suffix is set to .html).'; +$_lang["friendlyurlsprefix_title"] = 'Friendly URL Prefix'; +$_lang["friendlyurlsuffix_message"] = 'Any suffix you choose will work, including no suffix at all. E.g., ".aspx" will append .aspx to all URL aliases.'; +$_lang["friendlyurlsuffix_title"] = 'Friendly URL Suffix'; +$_lang["functionnotimpl"] = 'Sorry!'; +$_lang["functionnotimpl_message"] = 'This function has not been implemented yet.'; +$_lang["further_info"] = 'Further information'; +$_lang["global_tabs"] = 'Global Tabs'; +$_lang["go"] = 'Go'; +$_lang["group_access_permissions"] = 'User group access'; +$_lang['group_tvs'] = 'Group TV'; +$_lang["guid"] = 'GUID'; +$_lang["help"] = 'Help'; +$_lang["help_msg"] = '

    You can obtain free community support by visiting the EVO Forums. There is also a growing body of EVO Documentation and Guides that touch on virtually every aspect of EVO.

    We are planning to offer commercial support services for EVO as well. Please email us if you\'re interested.

    '; +$_lang["help_title"] = 'Help'; +$_lang["hide_tree"] = 'Hide Site Tree'; +$_lang["home"] = 'Dashboard'; +$_lang["htmlsnippet"] = 'Chunk'; +$_lang["htmlsnippets"] = 'Chunks'; +$_lang["htmlsnippet_desc"] = 'Description'; +$_lang["htmlsnippet_management_msg"] = 'Select the Chunk you wish to edit.'; +$_lang["htmlsnippet_msg"] = 'Add and edit Chunks. Remember, Chunks are \'raw\' HTML code, so any PHP code won\'t be processed.'; +$_lang["htmlsnippet_name"] = 'Chunk name'; +$_lang["htmlsnippet_title"] = 'Create/edit Chunk'; +$_lang["icon"] = 'Icon'; +$_lang["icon_description"] = 'CSS class value. e.g. fa fa-star'; +$_lang["id"] = 'ID'; +$_lang["illegal_parent_child"] = 'Parent Assignment:\n\nResource is a child of the selected Resource.'; +$_lang["illegal_parent_self"] = 'Parent Assignment:\n\nThe selected Resource cannot be assigned to itself.'; +$_lang["images_management"] = 'Manage Images'; +$_lang["import_files_found"] = 'Found %s Resources for import...'; +$_lang["import_params"] = 'Import Module shared parameters'; +$_lang["import_params_msg"] = 'You can import the parameters or settings of a Module by selecting the name of the Module from the above drop down menu. NOTE: In order for Modules to appear inside the menu, this Plugin/Snippet must be a part of the Module\'s dependency listing and the Module must have parameter sharing enabled. '; +$_lang["import_parent_resource"] = 'Parent Resource:'; +$_lang["import_site"] = 'Import HTML'; +$_lang["import_site_failed"] = 'Failed!'; +$_lang["import_site_failed_db_error"] = 'A database error occured while trying to clone Resource: '; +$_lang["import_site_failed_no_open_dir"] = 'Could not open directory: '; +$_lang["import_site_failed_no_retrieve_file"] = 'Could not retrieve file: '; +$_lang["import_site_html"] = 'Import site from HTML'; +$_lang["import_site_importing_document"] = 'Importing file %s '; +$_lang["import_site_maxtime"] = 'Max import time:'; +$_lang["import_site_maxtime_message"] = 'Specify the number of seconds allowed for the Content Manager to import the site (overriding PHP settings). Enter 0 for unlimited time. Please note, setting 0 or a really high number can do weird things to your server and is not recommended.'; +$_lang["import_site_message"] = '

    Import an entire HTML site into your site database. Please note that you will need to copy your html files and/or directories into the /assets/import directory.

    Please fill out the form and press \'Import\' to start the import process. The files imported will be saved into the selected location, using the files name as the Resource\'s URL aliases where possible, and the Resource title tag as the pagetitle.'; +$_lang["import_site_skip"] = 'Skipped!'; +$_lang["import_site_start"] = 'Start Import'; +$_lang["import_site_success"] = 'Success!'; +$_lang["import_site_time"] = 'Import finished. Import took %s seconds to complete.'; +$_lang["inbox"] = 'Inbox'; +$_lang["info"] = 'Info'; +$_lang["information"] = 'Information'; +$_lang["inline"] = 'Inline'; +$_lang["insert"] = 'Insert'; +$_lang["maxImageWidth"] = 'Maximum image width'; +$_lang["maxImageHeight"] = 'Maximum image height'; +$_lang["clientResize"] = 'Resize images on client-side'; +$_lang["clientResize_message"] = 'If enabled then images will be resized by browser before upload to the server'; +$_lang["noThumbnailsRecreation"] = 'Create thumbnails on upload only'; +$_lang["noThumbnailsRecreation_message"] = 'File browser will create thumbnails only on upload; if there\'s no thumbnails for some images, they will not be created'; +$_lang["thumbWidth"] = 'Maximum thumbnail width'; +$_lang["thumbHeight"] = 'Maximum thumbnail height'; +$_lang["thumbsDir"] = 'Thumbnails directory location'; +$_lang["jpegQuality"] = 'JPEG compression'; +$_lang["denyZipDownload"] = 'Disable zip-archives downloading'; +$_lang["denyExtensionRename"] = 'Disable renaming of file extensions'; +$_lang["maxImageWidth_message"] = 'If uploaded image resolution exceeds this setting it will be automatically resized. Set 0 to avoid.'; +$_lang["maxImageHeight_message"] = 'If uploaded image resolution exceeds this setting it will be automatically resized. Set 0 to avoid.'; +$_lang["thumbWidth_message"] = 'Maximum thumbnail width.'; +$_lang["thumbHeight_message"] = 'Maximum thumbnail height.'; +$_lang["thumbsDir_message"] = 'The name of thumbnail directory.'; +$_lang["jpegQuality_message"] = 'JPEG compression quality of thumbnails and resized images'; +$_lang["showHiddenFiles"] = 'Show hidden files in file browser'; +$_lang["keyword"] = 'Keyword'; +$_lang["keywords"] = 'Keywords'; +$_lang["keywords_intro"] = 'To edit a keyword, simply type in the new keyword in the text field next to the keyword you wish to change. To delete a keyword, check the \'delete\' box for that keyword. If you check the keyword\'s delete box, and also change it\'s name, it will be deleted, and the renaming of the keyword will not take place!'; +$_lang["language_message"] = 'Select the language for the EVO Content Manager.'; +$_lang["language_title"] = 'Manager language'; +$_lang["last_update"] = 'Last update'; +$_lang["launch_site"] = 'View Site'; +$_lang["license"] = 'License'; +$_lang["link_attributes"] = 'Link Attributes'; +$_lang["link_attributes_help"] = 'Enter optional attributes for a link for this page, such as target="_blank" or rel="external".'; +$_lang["list_mode"] = 'Turn on/off list mode - used to list all records in the grid.'; +$_lang["loading_doc_tree"] = 'Loading Site Tree...'; +$_lang["loading_menu"] = 'Loading menu...'; +$_lang["loading_page"] = 'Please wait while EVO loads the page...'; +$_lang["localtime"] = 'Local Time'; +$_lang["lock_htmlsnippet"] = 'Lock Chunk for editing'; +$_lang["lock_htmlsnippet_msg"] = 'Only Administrators (Role ID 1) can edit this Chunk.'; +$_lang["lock_module"] = 'Lock Module for editing'; +$_lang["lock_module_msg"] = 'Only Administrators (Role ID 1) can edit this Module.'; +$_lang["lock_msg"] = '%s is currently editing this %s. Please wait until the other user has finished and try again.'; +$_lang["lock_plugin"] = 'Lock Plugin for editing'; +$_lang["lock_plugin_msg"] = 'Only Administrators (Role ID 1) can edit this Plugin.'; +$_lang["lock_settings_msg"] = '%s is currently editing these settings. Please wait until the other user has finished and try again.'; +$_lang["lock_snippet"] = 'Lock Snippet for editing'; +$_lang["lock_snippet_msg"] = 'Only Administrators (Role ID 1) can edit this Snippet.'; +$_lang["lock_template"] = 'Lock Template for editing'; +$_lang["lock_template_msg"] = 'Only Administrators (Role ID 1) can edit this Template.'; +$_lang["lock_tmplvars"] = 'Lock Template Variable for editing'; +$_lang["lock_tmplvars_msg"] = 'Only Administrators (Role ID 1) can edit this Template Variable.'; +$_lang["locked"] = 'Locked'; +$_lang["login_allowed_days"] = 'Allowed Days'; +$_lang["login_allowed_days_message"] = 'Select the days that this user is allowed to login.'; +$_lang["login_allowed_ip"] = 'Allowed IP Address'; +$_lang["login_allowed_ip_message"] = 'Enter the IP addresses that this user is allowed to login from. NOTE: Separate multiple IP addresses with a comma (,)'; +$_lang["login_button"] = 'Login'; +$_lang["login_cancelled_install_in_progress"] = 'Install/update of this site is currently in progress. Please retry in a couple of minutes!'; +$_lang["login_cancelled_site_was_updated"] = 'Install/update on this site was executed, please login again!'; +$_lang["login_captcha_message"] = 'Please enter the security code shown in the graphic. If you can\'t read the code, click the image to generate a new one or contact your site admin.'; +$_lang["login_homepage"] = 'Login Home Page'; +$_lang["login_homepage_message"] = 'Enter the ID of the Resource you want to send user to after he/she has logged in. NOTE: make sure the ID you enter belongs to an existing Resource, and that it has been published and is accessible by this user!'; +$_lang["login_message"] = 'Please enter your login credentials to start your Manager session. Your username and password are case-sensitive, so please enter them carefully!'; +$_lang["logo_slogan"] = 'EVO Content Manager - \nCreate and do more with less'; +$_lang["logout"] = 'Logout'; +$_lang["long_title"] = 'Long title'; +$_lang["mail_check_timeperiod_message"] = 'How often to check for new mail messages in the Manager, in seconds.'; +$_lang["mail_check_timeperiod_title"] = 'Mail Check Time Period'; +$_lang["manage_depends"] = 'Manage Dependencies'; +$_lang["manage_files"] = 'Manage Files'; +$_lang["manage_htmlsnippets"] = 'Chunks'; +$_lang["manage_metatags"] = 'Manage META tags and Keywords'; +$_lang["manage_modules"] = 'Manage Modules'; +$_lang["manage_plugins"] = 'Plugins'; +$_lang["manage_snippets"] = 'Snippets'; +$_lang["manage_templates"] = 'Templates'; +$_lang["manage_documents"] = 'Documents'; +$_lang["manager"] = 'Manager'; +$_lang["manager_lockout_message"] = 'You are currently logged into the Content Manager. If you would like to close your login session please click the "Logout" button.

    To go to your startup or home page click the "Home" button.'; +$_lang["manager_permissions"] = 'Manager Permissions'; +$_lang["manager_theme"] = 'Manager Theme'; +$_lang["manager_theme_message"] = 'Select the Theme for the Content Manager.'; +$_lang["manager_theme_mode"] = 'Color Scheme:'; +$_lang["manager_theme_mode1"] = 'everything is light'; +$_lang["manager_theme_mode2"] = 'the header is dark'; +$_lang["manager_theme_mode3"] = 'header and sidebar are dark'; +$_lang["manager_theme_mode4"] = 'everything is dark'; +$_lang['manager_theme_mode_message'] = 'This setting is used as the "default" and can be overridden by the manager when using the theme color mode switch button in the Resource Tree: '; +$_lang['manager_theme_mode_title'] = 'Theme color mode switch'; +$_lang["messages"] = 'Messages'; +$_lang["messages_all"] = 'Everyone'; +$_lang["messages_compose"] = 'Compose a message'; +$_lang["messages_forward"] = 'Forward'; +$_lang["messages_from"] = 'From'; +$_lang["messages_group"] = 'A group'; +$_lang["messages_inbox"] = 'Inbox'; +$_lang["messages_message"] = 'Message'; +$_lang["messages_no_messages"] = 'No messages in Inbox.'; +$_lang["messages_not_allowed_to_read"] = 'You\'re not allowed to read this message!'; +$_lang["messages_private"] = 'Private'; +$_lang["messages_read_message"] = 'Read message'; +$_lang["messages_reply"] = 'Reply'; +$_lang["messages_select_group"] = 'Select a group'; +$_lang["messages_select_user"] = 'Select a user'; +$_lang["messages_send"] = 'Send'; +$_lang["messages_send_to"] = 'Send to'; +$_lang["messages_sent"] = 'Sent on'; +$_lang["messages_subject"] = 'Subject'; +$_lang["messages_system_user"] = '[System]'; +$_lang["messages_title"] = 'Messages'; +$_lang["messages_user"] = 'A user'; +$_lang["meta_keywords"] = 'META Keywords'; +$_lang["metatag_intro"] = 'On this page you can delete, create or edit META tags. To link META tags to Resources, click on the META Keywords tab when editing the Resource, and select the desired META tags and keywords. To add a new tag enter the name and value and click the \'Add tag\' button. To edit the tag click on the name of the tag from within the data grid.'; +$_lang["metatag_notice"] = 'You may wish to reference the HTML Reference Guide site for more information. This is not a complete list of possible Meta Tags.'; +$_lang["metatags"] = 'META tags'; +$_lang["mgr_access_permissions"] = 'Manager access permissions'; +$_lang["mgr_login_start"] = 'Manager Login Startup'; +$_lang["mgr_login_start_message"] = 'Enter the ID of the Resource you want to send the user to after he/she has logged into the manager. NOTE: make sure the ID you\'ve enter belongs to an existing Resource, and that it has been published and is accessible by this user!'; +$_lang["mgrlog_action"] = 'Action'; +$_lang["mgrlog_actionid"] = 'Action ID'; +$_lang["mgrlog_anyall"] = 'Any/All'; +$_lang["mgrlog_datecheckfalse"] = 'checkdate() returned false.'; +$_lang["mgrlog_datefr"] = 'Date from'; +$_lang["mgrlog_dateinvalid"] = 'Invalid date format.'; +$_lang["mgrlog_dateto"] = 'Date to'; +$_lang["mgrlog_emptysrch"] = 'Your search query returned an empty result set (i.e. not matching logs found).'; +$_lang["mgrlog_field"] = 'Field'; +$_lang["mgrlog_itemid"] = 'Item ID'; +$_lang["mgrlog_itemname"] = 'Item name'; +$_lang["mgrlog_msg"] = 'Message'; +$_lang["mgrlog_noquery"] = 'No search query entered yet.'; +$_lang["mgrlog_qresults"] = 'Query results'; +$_lang["mgrlog_query"] = 'Query logging'; +$_lang["mgrlog_query_msg"] = 'Please make a selection for viewing the logs. You can select log entries by date, but be aware that the dates you enter are not inclusive - to select every log entry for 01-01-2004, set \'date from\' to 01-01-2004 and \'date to\' to 02-01-2004.

    Message and action are usually the same. If you\'re searching for a specific message, it\'s best to set action to \'Any/All\'.'; +$_lang["mgrlog_results"] = 'No. of results'; +$_lang["mgrlog_searchlogs"] = 'Search logs'; +$_lang["mgrlog_sortinst"] = 'Sort the table by clicking on the column headers. If the logs are too large, empty the log file to remove all log entries up to now. This cannot be undone!'; +$_lang["mgrlog_time"] = 'Time'; +$_lang["mgrlog_user"] = 'User'; +$_lang["mgrlog_username"] = 'Username'; +$_lang["mgrlog_value"] = 'Value'; +$_lang["mgrlog_view"] = 'View manager logs'; +$_lang["module_code"] = 'Module code (php)'; +$_lang["module_config"] = 'Module configuration'; +$_lang["module_desc"] = 'Description'; +$_lang["module_disabled"] = 'Module disabled'; +$_lang["module_edit_click_title"] = 'Click here to edit this Module'; +$_lang["module_group_access_msg"] = 'Select the User Groups that are allowed to execute this Module from within the Content Manager.'; +$_lang["module_management"] = 'Manage Modules'; +$_lang["module_management_msg"] = 'Choose the Module you would like to execute or modify. To run the Module click on the icon in the grid. To modify the Module click on the name of the Module.'; +$_lang["module_msg"] = 'Add/edit Modules. A Module is a collection of Elements (e.g. Plugins, Snippets, etc).'; +$_lang["module_name"] = 'Module name'; +$_lang["module_resource_msg"] = 'Add or remove Elements upon which this Module depends. To add a new Element click on the one of the add buttons below.'; +$_lang["module_resource_title"] = 'Module Dependencies'; +$_lang["module_title"] = 'Create/edit Module'; +$_lang["module_viewdepend_msg"] = 'View the assigned Elements on which this Module depends. Click on the "Manager Dependencies" button to modify the dependencies'; +$_lang["modules"] = 'Modules'; +$_lang["modx_news"] = 'EVO News Notices'; +$_lang["modx_news_tab"] = 'EVO News'; +$_lang["modx_news_title"] = 'EVO News'; +$_lang["modx_security_notices"] = 'EVO Security Notices'; +$_lang["modx_version"] = 'EVO version'; +$_lang["monday"] = 'Monday'; +$_lang["move"] = 'Move'; +$_lang["move_resource"] = 'Move Resource'; +$_lang["move_resource_message"] = 'Move a Resource and all its children by selecting a new parent in the Site Tree. If you select a Resource that is not already a Container, it will be changed into one. Please click on the new parent in the Site Tree.'; +$_lang["move_resource_new_parent"] = 'Please select a new parent in the Site Tree.'; +$_lang["move_resource_title"] = 'Move Resource'; +$_lang["name"] = 'Username'; +$_lang["new_category"] = 'New Category'; +$_lang["new_file_permissions_message"] = 'When uploading a new file in the File Manager, the File Manager will attempt to change the file permissions to those entered in this setting. This may not work on some setups, such as IIS, in which case you will need to manually change the permissions.'; +$_lang["new_file_permissions_title"] = 'New File Permissions'; +$_lang["new_folder_permissions_message"] = 'When creating a new directory in the File Manager, the File Manager will attempt to change the directory permissions to those entered in this setting. This may not work on some setups, such as IIS, in which case you will need to manually change the permissions.'; +$_lang["new_folder_permissions_title"] = 'New Directory Permissions'; +$_lang["new_htmlsnippet"] = 'New Chunk'; +$_lang["new_keyword"] = 'Add new keyword:'; +$_lang["new_module"] = 'New Module'; +$_lang["new_parent"] = 'New parent'; +$_lang["new_plugin"] = 'New Plugin'; +$_lang["new_role"] = 'New Role'; +$_lang["new_snippet"] = 'New Snippet'; +$_lang["new_template"] = 'New Template'; +$_lang["new_tmplvars"] = 'New Template Variable'; +$_lang["new_user"] = 'New Manager User'; +$_lang["new_web_user"] = 'New Web User'; +$_lang["new_resource"] = 'New Resource'; +$_lang["no"] = 'No'; +$_lang["no_active_users_found"] = 'No active users found.'; +$_lang["no_activity_message"] = 'You have not yet created or edited any Resources.'; +$_lang["no_category"] = 'uncategorized'; +$_lang["no_docs_pending_publishing"] = 'No Resources pending publishing.'; +$_lang["no_docs_pending_pubunpub"] = 'No Events Found'; +$_lang["no_docs_pending_unpublishing"] = 'No Resources pending unpublishing.'; +$_lang["no_edits_creates"] = 'No edits or creates found.'; +$_lang["no_groups_found"] = 'No groups found.'; +$_lang["no_keywords_found"] = 'There are currently no keywords.'; +$_lang["no_records_found"] = 'No records found.'; +$_lang["no_results"] = 'No results found'; +$_lang["nologentries_message"] = 'Enter the number of log entries shown per page when you browse the Audit trail.'; +$_lang["nologentries_title"] = 'Number of log entries'; +$_lang["nomessages_message"] = 'Enter the number of messages to show in inbox when viewing messages.'; +$_lang["nomessages_title"] = 'Number of messages'; +$_lang["none"] = 'None'; +$_lang["noresults_message"] = 'Enter the number of results to show in the data grid when viewing listings and search results.'; +$_lang["noresults_title"] = 'Number of Results'; +$_lang["not_deleted"] = 'has not been deleted.'; +$_lang["not_set"] = 'Not set'; +$_lang["offline"] = 'Offline'; +$_lang["online"] = 'Online'; +$_lang["onlineusers_action"] = 'Action'; +$_lang["onlineusers_actionid"] = 'Action-ID'; +$_lang["onlineusers_ipaddress"] = 'IP address'; +$_lang["onlineusers_lasthit"] = 'Last hit'; +$_lang["onlineusers_message"] = 'This list shows all users active within the last 20 minutes (current time is '; +$_lang["onlineusers_title"] = 'Online users'; +$_lang["onlineusers_user"] = 'Username'; +$_lang["onlineusers_userid"] = 'User\'s ID'; +$_lang["optimize_table"] = 'Click here to optimize this table'; +$_lang["page_data_alias"] = 'Alias'; +$_lang["page_data_cacheable"] = 'Cacheable'; +$_lang["page_data_cacheable_help"] = 'This allows the Resource to be saved to the site cache, and affects all Snippets on the page.'; +$_lang["page_data_cached"] = 'Source retrieved from cache:'; +$_lang["page_data_changes"] = 'Changes'; +$_lang["page_data_contentType"] = 'Internet Media Type'; +$_lang["page_data_contentType_help"] = 'Select the content type for this Resource. If you\'re not sure which content type the Resource should have, just leave it as text/html.'; +$_lang["page_data_created"] = 'Created'; +$_lang["page_data_edited"] = 'Edited'; +$_lang["page_data_editor"] = 'Edit using rich text editor'; +$_lang["page_data_folder"] = 'Resource is Container'; +$_lang["page_data_general"] = 'General'; +$_lang["page_data_markup"] = 'Markup/structure'; +$_lang["page_data_mgr_access"] = 'Manager access'; +$_lang["page_data_notcached"] = 'This Resource has not yet been cached.'; +$_lang["page_data_publishdate"] = 'Publish date'; +$_lang["page_data_publishdate_help"] = 'If you set a publish date, the Resource will be published as soon as the publish date is reached. Click on the calender icon to select a date, or on the icon next to it to remove the publish date. This will then mean the Resource is never automatically published.'; +$_lang["page_data_published"] = 'Published'; +$_lang["page_data_searchable"] = 'Searchable'; +$_lang["page_data_searchable_help"] = 'Checking this field will allow the Resource to be searched. You can also use this field for other purposes in your Snippets.'; +$_lang["page_data_source"] = 'Source'; +$_lang["page_data_status"] = 'Status'; +$_lang["page_data_template"] = 'Uses Template'; +$_lang["page_data_template_help"] = 'Select the Template for this Resource.'; +$_lang["page_data_title"] = 'Page data'; +$_lang["page_data_unpublishdate"] = 'Un-publish date'; +$_lang["page_data_unpublishdate_help"] = 'If you set an unpublish date, the Resource will be unpublished as soon as the unpublish date is reached. Click on the calender icon to select a date, or on the icon next to it to remove the unpublish date. This will then mean the Resource is never automatically unpublished.'; +$_lang["page_data_unpublished"] = 'Un-published'; +$_lang["page_data_web_access"] = 'Web access'; +$_lang["pagetitle"] = 'Resource\'s title'; +$_lang["pagination_table_first"] = 'First'; +$_lang["pagination_table_gotopage"] = 'Go to page'; +$_lang["pagination_table_last"] = 'Last'; +$_lang["paging_first"] = 'first'; +$_lang["paging_last"] = 'last'; +$_lang["paging_next"] = 'next'; +$_lang["paging_prev"] = 'prev'; +$_lang["paging_showing"] = 'Showing'; +$_lang["paging_to"] = 'to'; +$_lang["paging_total"] = 'total'; +$_lang["parameter"] = 'Parameter'; +$_lang["parse_docblock"] = 'Parse DocBlock'; +$_lang["parse_docblock_msg"] = 'Attention (!): Resets actual name, configuration, description and category to install-defaults by parsing the source code.'; +$_lang["password"] = 'Password'; +$_lang["password_change_request"] = 'Password change request'; +$_lang["password_gen_gen"] = 'Let EVO generate a password.'; +$_lang["password_gen_length"] = 'The password you specify needs to be at least 6 characters long.'; +$_lang["password_gen_method"] = 'New password method'; +$_lang["password_gen_specify"] = 'Let me specify the password:'; +$_lang["password_method"] = 'Password notification method'; +$_lang["password_method_email"] = 'Send the new password by e-mail.'; +$_lang["password_method_screen"] = 'Show the new password on screen.'; +$_lang["password_msg"] = 'The new password for %s is %s
    '; +$_lang["php_version_check"] = 'EVO Evolution is compatible with PHP version 5.6.0 and higher. This server is using version %s%. Please upgrade your PHP installation!'; +$_lang["plugin"] = 'Plugin'; +$_lang["plugins"] = 'Plugins'; +$_lang["plugin_code"] = 'Plugin code (php)'; +$_lang["plugin_config"] = 'Plugin configuration'; +$_lang["plugin_desc"] = 'Description'; +$_lang["plugin_disabled"] = 'Plugin Disabled'; +$_lang["plugin_event_msg"] = 'Select the events that you would like this Plugin to listen to.'; +$_lang["plugin_management_msg"] = 'Choose which Plugin you wish to edit.'; +$_lang["plugin_msg"] = 'Add/edit Plugins. Plugins use PHP code that is invoked whenever specific System Events trigger.'; +$_lang["plugin_name"] = 'Plugin name'; +$_lang["plugin_priority"] = 'Edit Plugin Execution Order by Event'; +$_lang["plugin_priority_instructions"] = 'Drag to reorder the Plugins under each Event header. The first plugin to execute should go at the top.'; +$_lang["plugin_priority_title"] = 'Plugin Execution Order'; +$_lang["purge_plugin"] = 'Purge obsolete plugins'; +$_lang["purge_plugin_confirm"] = 'Are you sure you want to purge obsolete plugins?'; +$_lang["plugin_title"] = 'Create/edit Plugin'; +$_lang["preview"] = 'Preview'; +$_lang["preview_msg"] = 'This is a preview of your last saved changes. Click here to Save and Refresh your current changes'; +$_lang["preview_resource"] = 'Preview Resource'; +$_lang["private"] = 'Private'; +$_lang["public"] = 'Public'; +$_lang["publish_date"] = 'Publish Date'; +$_lang["publish_events"] = 'Publish Events'; +$_lang["publish_resource"] = 'Publish Resource'; +$_lang["rb_base_dir_message"] = 'Enter the physical path to the File Browser directory. This setting is usually automatically generated. If you\'re using IIS, however, EVO may not be able to work the path out on its own, causing the File Browser to show an error. In that case, you can enter the path to the images directory here (the path as you\'d see it in Windows Explorer). NOTE: The File Browser directory must contain the subdirectories images, files, flash and media in order for the file browser to function correctly.'; +$_lang["rb_base_dir_title"] = 'File base path'; +$_lang["rb_base_url_message"] = 'Enter the virtual path to files directory. This setting is usually automatically generated. If you\'re using IIS, however, EVO may not be able to work the URL out on it\'s own, causing the File Browser to show an error. In that case, you can enter the URL to the images directory here (the URL as you\'d enter it on Internet Explorer).'; +$_lang["rb_base_url_title"] = 'File Browser URL'; +$_lang["rb_message"] = 'Select yes to enable the File Browser. This will allow your users to browse and upload files such as images, flash and media files on the server.'; +$_lang["rb_title"] = 'Enable File Browser'; +$_lang["rb_webuser_message"] = 'Do you want to allow a web user the ability to use the file browser? WARNING: Allowing web users the use of the file browser exposes the files available to manager users. Only use this option for trusted web users.'; +$_lang["rb_webuser_title"] = 'Web Users?'; +$_lang["recent_docs"] = 'Recent Resources'; +$_lang["recommend_setting_change_title"] = 'Recommended Setting Change'; +$_lang["recommend_setting_change_description"] = 'Your site is not configured to validate the HTTP_REFERER of incoming requests to the Manager. We strongly recommend enabling this setting to reduce the risk of a CSRF (Cross Site Request Forgery) attack.'; +$_lang["references"] = 'References'; +$_lang["refresh_cache"] = 'Cache: Found %s files in cache directory and deleted %d cache files.

    New cache files will be created when pages are requested.'; +$_lang["refresh_published"] = '%s Resources were published.'; +$_lang["refresh_site"] = 'Clear Cache'; +$_lang["refresh_title"] = 'Refresh site'; +$_lang["refresh_tree"] = 'Refresh Site Tree'; +$_lang["refresh_unpublished"] = '%s Resources were unpublished.'; +$_lang["release_date"] = 'Release date'; +$_lang["remember_last_tab"] = 'Remember tabs'; +$_lang["remember_last_tab_message"] = 'Tabbed Manager pages load with the last tab viewed instead of defaulting to the first tab'; +$_lang["remember_username"] = 'Remember me'; +$_lang["remove"] = 'Remove'; +$_lang["remove_date"] = 'Remove date'; +$_lang["remove_locks"] = 'Remove Locks'; +$_lang["rename"] = 'Rename'; +$_lang["reports"] = 'Reports'; +$_lang["report_issues"] = 'Report issues'; +$_lang["require_tagname"] = 'A tag name is required'; +$_lang["require_tagvalue"] = 'A tag value is required'; +$_lang["reserved_name_warning"] = 'You have used a reserved name.'; +$_lang["reset"] = 'Reset'; +$_lang["reset_failedlogins"] = 'reset'; +$_lang["reset_sort_order"] = 'Reset sort order'; +$_lang["resource"] = 'Resource'; +$_lang["resource_alias"] = 'URL alias'; +$_lang["resource_alias_help"] = 'Set the URL alias to make the Resource accessible as http://example.com/weburl. This only works Friendly URLs are enabled in the site configuration.'; +$_lang["resource_content"] = 'Resource content'; +$_lang["resource_description"] = 'Description'; +$_lang["resource_description_help"] = 'Enter an optional description of this Resource.'; +$_lang["resource_duplicate"] = 'Duplicate Resource'; +$_lang["resource_long_title_help"] = 'Enter an optional longer title for your Resource. This can be used for automatic Resource header tags for search engines, and might be more descriptive for your Resource.'; +$_lang["resource_metatag_help"] = 'Select the META tags or keywords you wish to assign to this Resource. Hold down the CTRL key to select multiple keywords or meta tags.'; +$_lang["resource_opt_contentdispo"] = 'Content-Disposition'; +$_lang["resource_opt_contentdispo_help"] = 'Use the content disposition field to specify how this Resource will be handled by the web browser. For file downloads select the Attachment option.'; +$_lang["resource_opt_emptycache"] = 'Empty cache'; +$_lang["resource_opt_emptycache_help"] = 'Leaving this field checked will make EVO empty the cache after you save the Resource. This way your visitors will not see an older version of the Resource.'; +$_lang["resource_opt_folder"] = 'Container'; +$_lang["resource_opt_folder_help"] = 'Check this to make the Resource also act as a Container for other Resources. A \'Container\' is like a folder, only it can also have content.'; +$_lang["resource_opt_menu_index"] = 'Menu index'; +$_lang["resource_opt_menu_index_help"] = 'Menu Index is a field that can control sorting Resources, particularly in menu Snippet(s). You can also use it for any other purpose in your Snippets.'; +$_lang["resource_opt_menu_title"] = 'Menu title'; +$_lang["resource_opt_menu_title_help"] = 'Menu title is an optional field used to display a short title in menu Snippet(s) or Modules.'; +$_lang["resource_opt_published"] = 'Published'; +$_lang["resource_opt_published_help"] = 'Check this field to have the Resource published immediately after saving it.'; +$_lang["resource_opt_richtext"] = 'Rich text'; +$_lang["resource_opt_richtext_help"] = 'Leave this checked to use the rich text editor for editing Resources. If your Resources contain JavaScript and forms, uncheck this to edit in HTML mode to prevent the editor from incorrectly changing your Resources.'; +$_lang["resource_opt_show_menu"] = 'Show in menu'; +$_lang["resource_opt_show_menu_help"] = 'Select this option to show Resource inside a web menu. Please note that some Menu Builders might choose to ignore this option.'; +$_lang["resource_opt_trackvisit_help"] = 'Log each visitor\'s visit to this page'; +$_lang["resource_overview"] = 'Resource overview'; +$_lang["resource_parent"] = 'Resource parent'; +$_lang["resource_parent_help"] = 'Click the icon to enable setting a Resource parent, then click a Resource in the Site Tree to set a new parent.'; +$_lang["resource_permissions_error"] = 'Assign this Resource to at least one Resource Group to which you have access.'; +$_lang["resource_setting"] = 'Resource setting'; +$_lang["resource_summary"] = 'Summary (introtext)'; +$_lang["resource_summary_help"] = 'Type a brief summary of the Resource'; +$_lang["resource_title"] = 'Title'; +$_lang["resource_title_help"] = 'Enter the name/title of the Resource. Avoid using backslashes in the name.'; +$_lang["resource_to_be_moved"] = 'Resource to be moved'; +$_lang["resource_type"] = 'Resource Type'; +$_lang["resource_type_message"] = 'Weblinks reference Resources on the Internet including another EVO Resource, an external page, or an image or other file on the Internet. Weblinks should have a text/html Internet Media Type and Inline Content-Disposition.'; +$_lang["resource_type_weblink"] = 'Weblink'; +$_lang["resource_type_webpage"] = 'Web page'; +$_lang["resource_weblink_help"] = 'Type the address of the object you wish to reference with this Weblink here. Alternatively insert from the File Browser or use the link selection icon and select a resource from the Site Tree.'; +$_lang["resources_in_container"] = 'Resources in this Container'; +$_lang["resources_in_container_no"] = 'This Container does not have child-Resources.'; +$_lang["role"] = 'Role'; +$_lang["role_about"] = 'View the about page'; +$_lang["role_access_persmissions"] = 'Access permissions'; +$_lang["role_actionok"] = 'View action completed screen'; +$_lang["role_assets_images"] = 'Manage assets/images'; +$_lang["role_assets_files"] = 'Manage assets/files'; +$_lang["role_bk_manager"] = 'Use the Backup Manager'; +$_lang["role_cache_refresh"] = 'Empty the site\'s cache'; +$_lang["role_category_manager"] = 'Use the Category Manager'; +$_lang["role_change_password"] = 'Change password'; +$_lang["role_change_resourcetype"] = 'Change Resource-Type'; +$_lang["role_chunk_management"] = 'Chunk management'; +$_lang["role_config_management"] = 'Configuration management'; +$_lang["role_content_management"] = 'Content management'; +$_lang["role_create_chunk"] = 'Create new Chunks'; +$_lang["role_create_doc"] = 'Create new Resources'; +$_lang["role_create_plugin"] = 'Create new Plugins'; +$_lang["role_create_snippet"] = 'Create new Snippets'; +$_lang["role_create_template"] = 'Create new site Templates'; +$_lang["role_credits"] = 'View credits'; +$_lang["role_delete_chunk"] = 'Delete Chunks'; +$_lang["role_delete_doc"] = 'Delete Resources'; +$_lang["role_delete_eventlog"] = 'Delete event log'; +$_lang["role_delete_module"] = 'Delete Module'; +$_lang["role_delete_plugin"] = 'Delete Plugins'; +$_lang["role_delete_role"] = 'Delete roles'; +$_lang["role_delete_snippet"] = 'Delete Snippets'; +$_lang["role_delete_template"] = 'Delete Templates'; +$_lang["role_delete_user"] = 'Delete manager users'; +$_lang["role_delete_web_user"] = 'Delete web users'; +$_lang["role_edit_chunk"] = 'Edit Chunks'; +$_lang["role_edit_doc"] = 'Edit a Resource'; +$_lang["role_edit_doc_metatags"] = 'Edit Resource META tags and keywords'; +$_lang["role_edit_module"] = 'Edit Module'; +$_lang["role_edit_plugin"] = 'Edit Plugins'; +$_lang["role_edit_role"] = 'Edit roles'; +$_lang["role_edit_settings"] = 'Change site settings'; +$_lang["role_edit_snippet"] = 'Edit Snippets'; +$_lang["role_edit_template"] = 'Edit site Templates'; +$_lang["role_edit_user"] = 'Edit manager users'; +$_lang["role_edit_web_user"] = 'Edit web users'; +$_lang["role_empty_trash"] = 'Permanently purge deleted Resources'; +$_lang["role_errors"] = 'View error dialog'; +$_lang["role_eventlog_management"] = 'Event log management'; +$_lang["role_export_static"] = 'Export Static HTML'; +$_lang["role_file_management"] = 'File Management'; +$_lang["role_file_manager"] = 'Use the file manager (full root access)'; +$_lang["role_frames"] = 'Request manager frames'; +$_lang["role_help"] = 'View help pages'; +$_lang["role_home"] = 'Request manager intro page'; +$_lang["role_import_static"] = 'Import HTML'; +$_lang["role_logout"] = 'Log out of the manager'; +$_lang["role_manage_metatags"] = 'Manage site META tags and keywords'; +$_lang["role_management_msg"] = 'Choose the role you wish to edit.'; +$_lang["role_management_title"] = 'Roles'; +$_lang["role_messages"] = 'View and send messages'; +$_lang["role_module_management"] = 'Module management'; +$_lang["role_name"] = 'Role name'; +$_lang["role_new_module"] = 'Create new Module'; +$_lang["role_new_role"] = 'Create new roles'; +$_lang["role_new_user"] = 'Create new manager users'; +$_lang["role_new_web_user"] = 'Create new web users'; +$_lang["role_plugin_management"] = 'Plugin management'; +$_lang["role_publish_doc"] = 'Publish Resources'; +$_lang["role_remove_locks"] = 'Remove Locks'; +$_lang["role_role_management"] = 'Roles'; +$_lang["role_run_module"] = 'Run Module'; +$_lang["role_save_chunk"] = 'Save Chunks'; +$_lang["role_save_doc"] = 'Save Resources'; +$_lang["role_save_module"] = 'Save Module'; +$_lang["role_save_password"] = 'Save password'; +$_lang["role_save_plugin"] = 'Save Plugins'; +$_lang["role_save_role"] = 'Save roles'; +$_lang["role_save_snippet"] = 'Save Snippets'; +$_lang["role_save_template"] = 'Save Templates'; +$_lang["role_save_user"] = 'Save manager users'; +$_lang["role_save_web_user"] = 'Save web users'; +$_lang["role_snippet_management"] = 'Snippet management'; +$_lang["role_template_management"] = 'Template management'; +$_lang["role_title"] = 'Create/edit role'; +$_lang["role_udperms"] = 'Permissions management'; +$_lang["role_user_management"] = 'Manager user management'; +$_lang["role_view_docdata"] = 'View a Resource\'s data'; +$_lang["role_view_eventlog"] = 'View event log'; +$_lang["role_view_logs"] = 'View system logs'; +$_lang["role_view_unpublished"] = 'View Unpublished Resources'; +$_lang["role_web_access_persmissions"] = 'Web access permissions'; +$_lang["role_web_user_management"] = 'Web user management'; +$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news'; +$_lang["rss_url_news_message"] = 'Enter the URL for the EVO News Feed.'; +$_lang["rss_url_news_title"] = 'RSS News Feed'; +$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news'; +$_lang["rss_url_security_message"] = 'Enter the URL for the EVO Security Feed.'; +$_lang["rss_url_security_title"] = 'RSS Security Feed'; +$_lang["run_module"] = 'Run Module'; +$_lang["saturday"] = 'Saturday'; +$_lang["save"] = 'Save'; +$_lang["save_all_changes"] = 'Save all changes'; +$_lang["save_tag"] = 'Save tag'; +$_lang["saving"] = 'Saving, please wait...'; +$_lang["search"] = 'Search'; +$_lang["search_criteria"] = 'Search criteria'; +$_lang["search_criteria_content"] = 'Search by content'; +$_lang["search_criteria_content_msg"] = 'Find all Resources with the entered text in their content.'; +$_lang["search_criteria_id"] = 'Search by ID'; +$_lang["search_criteria_id_msg"] = 'Enter a Resource\'s ID to quickly locate that Resource.'; +$_lang["search_criteria_top"] = 'Search in main fields'; +$_lang["search_criteria_top_msg"] = 'Pagetitle, Longtitle, Alias, ID'; +$_lang["search_criteria_template_id"] = 'Search by template ID'; +$_lang["search_criteria_template_id_msg"] = 'Find all Resources using the specified template.'; +$_lang["search_criteria_url_msg"] = 'Find Resource by exact URL.'; +$_lang["search_criteria_longtitle"] = 'Search by long title'; +$_lang["search_criteria_longtitle_msg"] = 'Find all Resources with the entered text in their long title.'; +$_lang["search_criteria_title"] = 'Search by title'; +$_lang["search_criteria_title_msg"] = 'Find all Resources with the entered text in their title.'; +$_lang["search_empty"] = 'Your search returned no results. Please broaden your search criteria and try again.'; +$_lang["search_item_deleted"] = 'This item has been deleted'; +$_lang["search_results"] = 'Search results'; +$_lang["search_results_returned_desc"] = 'Description'; +$_lang["search_results_returned_id"] = 'ID'; +$_lang["search_results_returned_msg"] = 'Your search criteria returned %s Resources. If a lot of results are being returned, try to enter a more specific search. The two left-most columns will allow you to find the Resource in the Site Tree or view the Resource. The two right most columns show, respectively, if a Resource has been deleted and what it\'s published status is.

    '; +$_lang["search_results_returned_title"] = 'Title'; +$_lang["search_view_docdata"] = 'View this item'; +$_lang["security"] = 'Users'; +$_lang["security_notices_tab"] = 'Security Notices'; +$_lang["security_notices_title"] = 'Security Notices'; +$_lang["select_date"] = 'Select a date'; +$_lang["send"] = 'Send'; +$_lang["server_protocol_http"] = 'http'; +$_lang["server_protocol_https"] = 'https'; +$_lang["server_protocol_message"] = 'If your site is on a https connection, please specify so here.'; +$_lang["server_protocol_title"] = 'Server type'; +$_lang["serveroffset"] = 'Server offset'; +$_lang["serveroffset_message"] = 'Select the number of hours time difference between where you are and where the server is. Current time on server is [%s], current time on server using the currently saved offset is [%s].'; +$_lang["serveroffset_title"] = 'Server offset time'; +$_lang["servertime"] = 'Server Time'; +$_lang["set_automatic"] = 'Set automatic'; +$_lang["set_default"] = 'Set default'; +$_lang["set_default_all"] = 'Set defaults'; +$_lang["settings_after_install"] = 'As this is a new install, you are required to review these settings and change any that you wish to. After you have reviewed the settings, press \'Save\' to update the settings database.'; +$_lang["settings_config"] = 'Configuration'; +$_lang["settings_dependencies"] = 'Dependencies'; +$_lang["settings_events"] = 'System Events'; +$_lang["settings_furls"] = 'Friendly URLs'; +$_lang["settings_general"] = 'General'; +$_lang["settings_group_tv_message"] = 'Choose if Template Variables should be grouped in sections or tabs (named by TV category) when editing a Resource'; +$_lang["settings_group_tv_options"] = 'No,Sections in General tab,Tabs in General tab,Sections in new tab,Tabs in new tab,New tabs'; +$_lang["settings_misc"] = 'File Manager'; +$_lang["settings_security"] = 'Security'; +$_lang["settings_KC"] = 'File Browser'; +$_lang["settings_page_settings"] = 'Settings'; +$_lang["settings_photo"] = 'Photo'; +$_lang["settings_properties"] = 'Properties'; +$_lang["show_fullscreen_btn_message"] = 'Show Menu toggle Fullscreen button'; +$_lang["show_newresource_btn_message"] = 'Show Menu New Resource button'; +$_lang["settings_show_picker_message"] = 'Customize manager theme and save to localstorage'; +$_lang["show_fullscreen_btn"] = 'Toggle Fullscreen button'; +$_lang["show_newresource_btn"] = 'New Resource button'; +$_lang["settings_site"] = 'Site'; +$_lang["settings_strip_image_paths_message"] = 'If this is set to \'No\', EVO will write file browser src\'s (images, files, flash, etc.) as absolute URLs. Relative URLs are helpful should you wish to move your EVO install, e.g., from a staging site to a production site. If you have no idea what this means, it\'s best just to leave it set to \'Yes\'.'; +$_lang["settings_strip_image_paths_title"] = 'Rewrite browser paths?'; +$_lang["settings_templvars"] = 'Template Variables'; +$_lang["settings_title"] = 'System configuration'; +$_lang["settings_ui"] = 'Interface & Features'; +$_lang["settings_users"] = 'User'; +$_lang["show_meta"] = 'Show META Keywords tab'; +$_lang["show_meta_message"] = 'Show the deprecated META Keywords tab when editing Resources in the Manager.'; +$_lang["show_tree"] = 'Show Site Tree'; +$_lang["show_picker"] = 'Show Color Switcher'; +$_lang["showing"] = 'Showing'; +$_lang["signupemail_message"] = 'Set the email message sent to users when creating accounts including their username and password.
    Note: The following Placeholders are replaced by the Content Manager when the message is sent:

    [+sname+] - Name of your web site,
    [+saddr+] - Your web site email address,
    [+surl+] - Your site url,
    [+uid+] - User\'s Login name or id,
    [+pwd+] - User\'s password,
    [+ufn+] - User\'s full name.

    Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your users won\'t know their username or password!'; +$_lang["signupemail_title"] = 'Signup e-mail'; +$_lang["site"] = 'Site'; +$_lang["site_schedule"] = 'Schedule'; +$_lang["sitename_message"] = 'Enter the name of your site here.'; +$_lang["sitename_title"] = 'Site name'; +$_lang["sitestart_message"] = 'Enter the ID of the Resource you want to use as homepage here. NOTE: make sure this ID you enter belongs to an existing Resource, and that it has been published!'; +$_lang["sitestart_title"] = 'Site start'; +$_lang["sitestatus_message"] = 'Select \'Online\' to publish your site on the web. If you select \'Offline\', your visitors will see the \'Site unavailable message\', and won\'t be able to browse the site.'; +$_lang["sitestatus_title"] = 'Site status'; +$_lang["siteunavailable_message"] = 'Message to show when the site is offline or if an error occurs. Note: This message will only be displayed if the Site unavailable page option is not set.'; +$_lang["siteunavailable_message_default"] = 'The site is currently unavailable.'; +$_lang["siteunavailable_page_message"] = 'Enter the ID of the Resource you want to use as an offline page here. NOTE: make sure this ID you enter belongs to an existing Resource, and that it has been published!'; +$_lang["siteunavailable_page_title"] = 'Site unavailable page'; +$_lang["siteunavailable_title"] = 'Site unavailable message'; +$_lang["snippet"] = 'Snippet'; +$_lang["snippets"] = 'Snippets'; +$_lang["snippet_code"] = 'Snippet code (php)'; +$_lang["snippet_desc"] = 'Description'; +$_lang["snippet_execonsave"] = 'Execute Snippet after saving.'; +$_lang["snippet_management_msg"] = 'Choose the Snippet you wish to edit.'; +$_lang["snippet_msg"] = 'Add/edit Snippets. Remember, Snippets are \'raw\' PHP code, and if you expect the output of the Snippet to be shown at a certain point within the Template, you need to return a value from within the Snippet.'; +$_lang["snippet_name"] = 'Snippet name'; +$_lang["snippet_properties"] = 'Default Properties'; +$_lang["snippet_title"] = 'Create/edit Snippet'; +$_lang["sort_alphabetically"] = 'Sort alphabetically'; +$_lang["sort_asc"] = 'Ascending'; +$_lang["sort_desc"] = 'Descending'; +$_lang["sort_menuindex"] = 'Sort menu index'; +$_lang["sort_tree"] = 'Sort the Site Tree'; +$_lang['sort_updating'] = 'Updating ...'; +$_lang['sort_updated'] = 'Updated!'; +$_lang['sort_nochildren'] = 'Parent does not have any children'; +$_lang["sort_elements_msg"] = 'Drag to reorder the listed elements.'; +$_lang["source"] = 'Source'; +$_lang["stay"] = 'Continue editing'; +$_lang["stay_new"] = 'Add another'; +$_lang["submit"] = 'Submit'; +$_lang["sunday"] = 'Sunday'; +$_lang["sys_alert"] = 'System Alert'; +$_lang["sysinfo_activity_message"] = 'This list show which Resources have been recently edited by your users.'; +$_lang["sysinfo_userid"] = 'User'; +$_lang["system"] = 'System'; +$_lang["system_email_signup"] = ' + +Hello [+uid+] + +Here are your login details for [+sname+] Content Manager: + +Username: [+uid+] +Password: [+pwd+] + +Once you log into the Content Manager ([+surl+]), you can change your password. + +Regards, +Site Administrator +'; +$_lang["system_email_webreminder"] = 'Hello [+uid+] + +To activate your new password click the following link: + +[+surl+] + +If successful you can use the following password to login: + +Password:[+pwd+] + +If you did not request this email then please ignore it. + +Regards, +Site Administrator'; +$_lang["system_email_websignup"] = 'Hello [+uid+] + +Here are your login details for [+sname+]: + +Username: [+uid+] +Password: [+pwd+] + +Once you log into [+sname+] ([+surl+]), you can change your password. + +Regards, +Site Administrator'; +$_lang["table_hoverinfo"] = 'Hover the mouse cursor over a table\'s name to see a short description of the table\'s function (not all tables have comments set).'; +$_lang["table_prefix"] = 'Table prefix'; +$_lang["tag"] = 'Tag'; +$_lang["template"] = 'Template'; +$_lang["templates"] = 'Templates'; +$_lang["template_assignedtv_tab"] = 'Assigned Template Variables'; +$_lang["template_code"] = 'Template code (html)'; +$_lang["template_desc"] = 'Description'; +$_lang["template_edit_tab"] = 'Edit Template'; +$_lang["template_management_msg"] = 'Choose which Template you wish to edit.'; +$_lang["template_msg"] = 'Create and edit Templates. Changed or new Templates won\'t be visible in your site\'s cached pages until the cache is emptied, however, you can use the preview function on a page to see the Template in action.'; +$_lang["template_name"] = 'Template name'; +$_lang["template_no_tv"] = 'No Template Variables have been assigned to this Template yet.'; +$_lang["template_notassigned_tv"] = 'These Template Variables are available for assigning.'; +$_lang["template_reset_all"] = 'Reset all pages to use Default Template'; +$_lang["template_reset_specific"] = 'Reset only \'%s\' pages'; +$_lang["template_selectable"] = 'Template selectable when creating or editing ressources.'; +$_lang["template_title"] = 'Create/edit Template'; +$_lang["template_tv_edit"] = 'Edit the TV sort order'; +$_lang["template_tv_edit_message"] = 'Drag to reorder the Template Variables for this template.'; +$_lang["template_tv_edit_title"] = 'Template Variable Sort Order'; +$_lang["template_tv_msg"] = 'The Template Variables assigned to this Template are listed below.'; +$_lang["thursday"] = 'Thursday'; +$_lang["tmplvar_access_msg"] = 'Select the Resource Groups that are allowed to modify the content or value of this Template Variable'; +$_lang["tmplvar_change_template_msg"] = 'Changing this Template will cause the page to reload the Template Variables, losing any unsaved changes.\n\n Are you sure you want to change this Template?'; +$_lang["tmplvar_inuse"] = 'The following Resource(s) are currently using this Template Variable. To continue with the delete operation click the Delete button otherwise click the Cancel button.'; +$_lang["tmplvar_tmpl_access"] = 'Template Access'; +$_lang["tmplvar_tmpl_access_msg"] = 'Select the Templates that are allowed to access/process this Template Variable'; +$_lang["tmplvar"] = 'Template Variable'; +$_lang["tmplvars"] = 'Template Variables'; +$_lang["tmplvars_binding_msg"] = 'This field supports data source bindings using the @ commands'; +$_lang["tmplvars_caption"] = 'Caption'; +$_lang["tmplvars_default"] = 'Default Value'; +$_lang["tmplvars_description"] = 'Description'; +$_lang["tmplvars_elements"] = 'Input Option Values'; +$_lang["tmplvars_inherited"] = 'Value inherited'; +$_lang["tmplvars_management_msg"] = 'Manage additional Template Variables for your Resources.'; +$_lang["tmplvars_msg"] = 'Add or edit Template Variables here. Template Variables must be assigned to Templates in order to access them from Snippets and Resources.'; +$_lang["tmplvars_name"] = 'Template Variable Name'; +$_lang["tmplvars_novars"] = 'No Template Variables found'; +$_lang["tmplvars_rank"] = 'Sort Order'; +$_lang["tmplvars_rank_edit_message"] = 'Drag to reorder the Template Variables.'; +$_lang["tmplvars_reset_params"] = 'Reset parameters'; +$_lang["tmplvars_title"] = 'Create/edit Template Variable'; +$_lang["tmplvars_type"] = 'Input Type'; +$_lang["tmplvars_widget"] = 'Widget'; +$_lang["tmplvars_widget_prop"] = 'Widget Properties'; +$_lang["to"] = 'to'; +$_lang["toggle_fullscreen"] = 'Toggle Fullscreen'; +$_lang["tools"] = 'Tools'; +$_lang["top_howmany_message"] = 'When viewing reports, how large should the \'Top ...\' lists be?'; +$_lang["top_howmany_title"] = 'Top how many'; +$_lang["total"] = 'total'; +$_lang["track_visitors_message"] = 'Check to show the child resources in the document tree'; +$_lang["track_visitors_title"] = 'Show child resources'; +$_lang["tree_page_click"] = 'Page Click Behavior'; +$_lang["tree_page_click_message"] = 'The default behavior when clicking on a page in the site tree.'; +$_lang["use_breadcrumbs"] = 'Show navigation'; +$_lang["use_breadcrumbs_message"] = 'Show the navigation when creating or editing Resource in the Manager'; +$_lang["tree_show_protected"] = 'Show protected pages'; +$_lang["tree_show_protected_message"] = 'When set to "No", Protected Resources (and all their child-Resources) do not appear in the Site Tree menu. "No" is the legacy setting for EVO.'; +$_lang["truncate_table"] = 'Click here to truncate this table'; +$_lang["tuesday"] = 'Tuesday'; +$_lang["tv"] = 'TV'; +$_lang["type"] = 'Type'; +$_lang["udperms_allowroot_message"] = 'Allow Users to create new Resources in the site root. '; +$_lang["udperms_allowroot_title"] = 'Allow root'; +$_lang["udperms_message"] = 'Control access to Resources via User Groups and Resource Groups.'; +$_lang["udperms_title"] = 'Use access permissions'; +$_lang["unable_set_link"] = 'Unable to set the link!'; +$_lang["unable_set_parent"] = 'Unable to set new parent!'; +$_lang["unauthorizedpage_message"] = 'Enter a published and publicly accessible Resource ID to redirect Users to when requesting a secured/unauthorized Resource.'; +$_lang["unauthorizedpage_title"] = 'Unauthorized page'; +$_lang["unblock_message"] = 'This User will not be blocked after saving the User\'s data.'; +$_lang["undelete_resource"] = 'Undelete Resource'; +$_lang["unpublish_date"] = 'Unpublish Date'; +$_lang["unpublish_events"] = 'Un-publish Events'; +$_lang["unpublish_resource"] = 'Un-publish Resource'; +$_lang["untitled_resource"] = 'Untitled Resource'; +$_lang["untitled_weblink"] = 'Untitled Weblink'; +$_lang["update_params"] = 'Update parameter display'; +$_lang["update_settings_from_language"] = 'Replace current with:'; +$_lang["upload_maxsize_message"] = 'Enter the maximum file size that can be uploaded via the file manager. Upload file size must be entered in bytes. NOTE: Large files can take a very long time to upload!'; +$_lang["upload_maxsize_title"] = 'Maximum upload size'; +$_lang["uploadable_files_message"] = 'Enter a list of files that can be uploaded into \'assets/files/\' using the File Browser. Please enter the extensions for the filetypes, separated by commas.'; +$_lang["uploadable_files_title"] = 'Uploadable File Types'; +$_lang["uploadable_flash_message"] = 'Enter a list of files that can be uploaded into \'assets/flash/\' using the File Browser. Please enter the extensions for the flash types, separated by commas.'; +$_lang["uploadable_flash_title"] = 'Uploadable Flash Types'; +$_lang["uploadable_images_message"] = 'Enter a list of files that can be uploaded into \'assets/images/\' using the File Browser. Please enter the extensions for the image types, separated by commas.'; +$_lang["uploadable_images_title"] = 'Uploadable Image Types'; +$_lang["uploadable_media_message"] = 'Enter a list of files that can be uploaded into \'assets/media/\' using the File Browser. Please enter the extensions for the media types, separated by commas.'; +$_lang["uploadable_media_title"] = 'Uploadable Media Types'; +$_lang["use_alias_path_message"] = 'Enabling this option generates a virtual path to the Resource. E.g., if a Resource "child.html" is located in a Container Resource "parent", then the full URL alias path URL will be "/parent/child.html".'; +$_lang["use_alias_path_title"] = 'Use Friendly URL alias path'; +$_lang["use_editor_message"] = 'Enable editing with a Rich Text Editor (RTE). This setting applies to all Resources, but can be overridden in the User settings.'; +$_lang["use_editor_title"] = 'Enable editor'; +$_lang["use_global_tabs"] = 'Use global Tabs'; +$_lang["user"] = 'User'; +$_lang["user_block"] = 'Blocked'; +$_lang["user_blockedafter"] = 'Blocked After'; +$_lang["user_blockeduntil"] = 'Blocked Until'; +$_lang["user_changeddata"] = 'Your data has been changed. Please log in again.'; +$_lang["user_country"] = 'Country'; +$_lang["user_dob"] = 'Date of birth'; +$_lang["user_doesnt_exist"] = 'User does not exist'; +$_lang["user_edit_self_msg"] = 'You may need to log out and log in again after saving to fully update your information. New passwords will be sent to your e-mail address or shown onscreen.'; +$_lang["user_email"] = 'E-mail address'; +$_lang["user_failedlogincount"] = 'Failed logins'; +$_lang["user_fax"] = 'Fax'; +$_lang["user_female"] = 'Female'; +$_lang["user_full_name"] = 'Full name'; +$_lang["user_gender"] = 'Gender'; +$_lang["user_is_blocked"] = 'This User is blocked!'; +$_lang["user_logincount"] = 'Login count'; +$_lang["user_male"] = 'Male'; +$_lang["user_management_msg"] = 'Choose the Content Manager to edit. Content Manager Users are those Users who are allowed to log into the Content Manager'; +$_lang["user_management_title"] = 'Manager Users'; +$_lang["user_mobile"] = 'Mobile phone number'; +$_lang["user_phone"] = 'Phone number'; +$_lang["user_photo"] = 'User Photo'; +$_lang["user_photo_message"] = 'Enter the image url for the this User or use the insert button to selected or upload an image file on the server.'; +$_lang["user_prevlogin"] = 'Last login'; +$_lang["user_role"] = 'User\'s role'; +$_lang["user_state"] = 'State'; +$_lang["user_title"] = 'Create/Edit Manager User'; +$_lang["user_upload_message"] = ' If you wish to stop this User uploading any filetypes in this category, make sure that the \'Use Main Configuration Setting\' checkbox is not ticked and leave the field blank.'; +$_lang["user_use_config"] = 'Use System Configuration Setting'; +$_lang["user_verification"] = 'User is verified'; +$_lang["user_zip"] = 'Zip'; +$_lang["username"] = 'Username'; +$_lang["users"] = 'Users'; +$_lang["valid_hostnames_message"] = 'Help prevent XSS exploits misusing the site_url system setting by providing a comma separated list of valid hostnames for this installation. This is important for some types of shared hosts or hosts direct accessible via an IP address. First hostname in the list is used if the HTTP_HOST does not match any valid hostname.'; +$_lang["valid_hostnames_title"] = 'Valid hostnames'; +$_lang["validate_referer_message"] = 'Validate the HTTP_REFERER headers to reduce the risk of your content editors being tricked into performing unintended actions in the manager as victims of a CSRF (Cross Site Request Forgery) attack. Some configurations may not be able to use this option if the server is not sending HTTP_REFERER headers.'; +$_lang["validate_referer_title"] = 'Validate HTTP_REFERER headers?'; +$_lang["value"] = 'Value'; +$_lang["version"] = 'Version'; +$_lang["view"] = 'View'; +$_lang["view_child_resources_in_container"] = 'View children'; +$_lang["view_log"] = 'View log'; +$_lang["view_logging"] = 'Manager Actions'; +$_lang["view_sysinfo"] = 'System Info'; +$_lang["warning"] = 'Warning!'; +$_lang["warning_not_saved"] = 'The changes you have made have not been saved yet. You can choose to stay on the current page in order to save the changes (\'Cancel\'), or you can leave this page, losing any changes you have made (\'OK\').'; +$_lang["warning_visibility"] = 'Configuration Warnings visible to'; +$_lang["warning_visibility_message"] = 'Control the visibility of the configuration warnings shown on the Manager welcome page'; +$_lang["web_access_permissions"] = 'Web access permissions'; +$_lang["web_access_permissions_user_groups"] = 'Web User groups'; +$_lang["web_permissions"] = 'Web Permissions'; +$_lang["web_user_management_msg"] = 'Choose the web User you wish to edit. Web Users are those Users who are only allowed to log into the web site'; +$_lang["web_user_management_title"] = 'Web Users'; +$_lang["web_user_title"] = 'Create/edit Web User'; +$_lang["web_users"] = 'Web Users'; +$_lang["weblink"] = 'Weblink'; +$_lang["webpwdreminder_message"] = 'Enter a message to be sent to your Web Users whenever they request a new password via email. The Content Manager will send an e-mail containing their new password and activation information.
    Note: The following Placeholders are replaced by the Content Manager when the message is sent:

    [+sname+] - Name of your web site,
    [+saddr+] - Your web site email address,
    [+surl+] - Your site url,
    [+uid+] - User\'s Login name or id,
    [+pwd+] - User\'s password,
    [+ufn+] - User\'s full name.

    Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your Users won\'t know their username or password!'; +$_lang["webpwdreminder_title"] = 'Web Reminder Email'; +$_lang["websignupemail_message"] = 'Set the email message sent to Users when creating accounts including their username and password
    Note: The following Placeholders are replaced by the Content Manager when the message is sent:

    [+sname+] - Name of your web site,
    [+saddr+] - Your web site email address,
    [+surl+] - Your site url,
    [+uid+] - User\'s Login name or id,
    [+pwd+] - User\'s password,
    [+ufn+] - User\'s full name.

    Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your Users won\'t know their username or password!'; +$_lang["websignupemail_title"] = 'Web Signup e-mail'; +$_lang["allow_multiple_emails_title"] = 'Duplicate Web User email address'; +$_lang["allow_multiple_emails_message"] = 'Allows Web Users to share the same email address for situations when a member may not have their own email address or there is just one family email address.
    Note: Any password reminder and registration logic will need to account for this option if set to yes.'; +$_lang["wednesday"] = 'Wednesday'; +$_lang["welcome_messages"] = 'Your Inbox contains %d message(s), of which %s are unread.'; +$_lang["welcome_title"] = 'Welcome to your EVO Content Manager'; +$_lang["which_editor_message"] = 'Select the rich text editor (RTE). You can download and install additional RTEs from the EVO download page.'; +$_lang["which_editor_title"] = 'Editor to use'; +$_lang["working"] = 'Working...'; +$_lang["wrap_lines"] = 'Wrap lines'; +$_lang["xhtml_urls_message"] = 'Replaces ampersand (&) characters in urls that are generated by EVO with the validating &amp; htmlentity'; +$_lang["xhtml_urls_title"] = 'XHTML URLs'; +$_lang["yes"] = 'Yes'; +$_lang["you_got_mail"] = 'You got mail'; +$_lang["yourinfo_message"] = 'This section shows some information about you:'; +$_lang["yourinfo_previous_login"] = 'Your last login:'; +$_lang["yourinfo_role"] = 'Your role is:'; +$_lang["yourinfo_title"] = 'Your info'; +$_lang["yourinfo_total_logins"] = 'Total number of logins:'; +$_lang["yourinfo_username"] = 'You are logged in as:'; + +$_lang["a17_error_reporting_title"] = 'Detection level of PHP errors'; +$_lang["a17_error_reporting_msg"] = 'Set the detection level of the PHP errors.'; +$_lang["a17_error_reporting_opt0"] = 'Ignore all'; +$_lang["a17_error_reporting_opt1"] = 'Ignore warnings of a slight notice level (E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT)'; +$_lang["a17_error_reporting_opt2"] = 'Detect all errors except E_NOTICE'; +$_lang["a17_error_reporting_opt99"] = 'Detect all'; + +$_lang["pwd_hash_algo_title"] = 'Hash algorithm'; +$_lang["pwd_hash_algo_message"] = 'Password hash algorithm.'; + +$_lang["enable_bindings_title"] = 'Enable @Bindings commands'; +$_lang["enable_bindings_message"] = 'Prevents the execution of PHP functions through TV @Bindings. Useful if you have Manager users who should not be able to create PHP code but need to be able to create or edit TVs. The output of any TV with an @Binding will be "@Bindings disabled".'; +$_lang["enable_filter_title"] = 'Enable filters'; +$_lang["enable_filter_message"] = 'Filters allow you to manipulate the way data is presented or parsed in a tag. They allow you to modify values from inside your templates. This is analogous to PHx. More info'; // todo: change link to documentation +$_lang["enable_filter_phx_warning"] = 'When PHx plugin enabled, built-in filters are disabled by default'; + +$_lang["enable_at_syntax_title"] = 'Enable <@SYNTAX>'; +$_lang["enable_at_syntax_message"] = '<@SYNTAX>(atmark syntax) is simple and lightweight template syntax. This is designed to consider coexistence with HTML tags and content strings.'; + +$_lang["bkmgr_alert_mkdir"] = 'A file cannot be created in a directory. Please check the permission of [+snapshot_path+]'; +$_lang["bkmgr_restore_msg"] = '

    Database tables could be restored by SQL:

    '; +$_lang["bkmgr_restore_title"] = 'Restore'; +$_lang["bkmgr_import_ok"] = 'SQL recovery was performed normally.'; +$_lang["bkmgr_snapshot_ok"] = 'The snapshot was saved normally.'; +$_lang["bkmgr_run_sql_file_label"] = 'Execute by SQL file'; +$_lang["bkmgr_run_sql_direct_label"] = 'Direct execute SQL commands'; +$_lang["bkmgr_run_sql_submit"] = 'Execute restore'; +$_lang["bkmgr_run_sql_result"] = 'Result'; +$_lang["bkmgr_snapshot_title"] = 'Snapshot save and recovery'; +$_lang["bkmgr_snapshot_msg"] = '

    The contents of the database are saved in and restored from a server directory.
    Location: [+snapshot_path+] ($modx->config[\'snapshot_path\'])

    '; +$_lang["bkmgr_snapshot_submit"] = 'Add Snapshot'; +$_lang["bkmgr_snapshot_list_title"] = 'List of snapshots'; +$_lang["bkmgr_restore_submit"] = 'Revert this data'; +$_lang["bkmgr_restore_confirm"] = 'Are you sure you want to revert backup\n[+filename+] ?'; +$_lang["bkmgr_snapshot_nothing"] = 'No snapshots available'; + +$_lang["files.dynamic.php1"] = 'New File'; +$_lang["files.dynamic.php2"] = 'This directory cannot be displayed.'; +$_lang["files.dynamic.php3"] = 'There is a problem in a file name.'; +$_lang["files.dynamic.php4"] = 'The text file was created.'; +$_lang["files.dynamic.php5"] = 'File could not be duplicated.'; +$_lang["files.dynamic.php6"] = 'File or directory could not be renamed.'; +$_lang["files_dynamic_new_folder_name"] = 'Enter new directory name:'; +$_lang["files_dynamic_new_file_name"] = 'Enter new file name:'; +$_lang["not_readable_dir"] = 'Can not read this directory.'; +$_lang["confirm_delete_dir"] = 'Are you sure you want to delete the directory?'; +$_lang["confirm_delete_dir_recursive"] = 'Are you sure you want to delete this directory?\n\nAll files inside this directory will also be deleted.'; + +$_lang["make_folders_title"] = 'End Container URL with Slash'; +$_lang["make_folders_message"] = 'Append trailing slash to Resources that are set as containers when using Friendly URLs.'; + +$_lang["check_files_onlogin_title"] = 'Check core files on login'; +$_lang["check_files_onlogin_message"] = 'By enabling this option, important system files will be checked for modification typical of scripted website attacks. While not a foolproof guarantee, it may alert you to a compromised EVO system file and website.'; + +$_lang["configcheck_sysfiles_mod"] = 'Important System Files have been modified.'; +$_lang["configcheck_sysfiles_mod_msg"] = 'You have configured EVO to check important system files for possible website script attacks. This warning does not necessarily mean your site has been compromised, however, you should review the watched files in your installation (set in System configuration -> User -> Check core files on login). If you find your files unaltered or changes were made by site administrators, go to System Configuration and click to re-save settings to dismiss this message. Changes in the following files have been found:'; + +$_lang['email_method_title'] = 'Sendmail method'; +$_lang['email_method_mail'] = 'PHP mail() function'; +$_lang['email_method_smtp'] = 'SMTP Server'; +$_lang['smtp_auth_title'] = 'SMTP-AUTH'; +$_lang['smtp_host_title'] = 'SMTP host'; +$_lang['smtp_secure_title'] = 'Encrypted SMTP'; +$_lang['smtp_username_title'] = 'SMTP username'; +$_lang['smtp_password_title'] = 'SMTP password'; +$_lang['smtp_port_title'] = 'SMTP port'; + +$_lang["setting_resource_tree_node_name"] = 'Display Name in Resource Tree'; +$_lang["setting_resource_tree_node_name_desc"] = 'Select the Resource field to show as the Resource name in the Resource Tree. The default setting is pagetitle.'; +$_lang["setting_resource_tree_node_name_desc_add"] = 'Note: Since EVO 1.1 you can change this Display Name within Resource-Tree´s sorting option. This setting is used when Display Name in Resource Tree is set to "Default".'; + +$_lang["resource_opt_alvisibled"] = 'Use current alias in alias path'; +$_lang["resource_opt_alvisibled_help"] = 'The alias of this Resource is inserted in Friendly URL alias path'; +$_lang['resource_opt_is_published'] = 'Published'; +$_lang["docid_incrmnt_method_title"] = 'Increment Resource ID method'; +$_lang["docid_incrmnt_method_0"] = 'DB auto increment'; +$_lang["docid_incrmnt_method_1"] = 'Minimum missed ID'; +$_lang["docid_incrmnt_method_2"] = 'Maximal ID + 1'; + +$_lang["enable_cache_title"] = 'Document caching'; +$_lang["disable_chunk_cache_title"] = 'Disable chunk caching'; +$_lang["disable_snippet_cache_title"] = 'Disable snippet caching'; +$_lang["disable_plugins_cache_title"] = 'Disable plugins caching'; +$_lang["disabled_at_login"] = 'Disabled at login'; + +$_lang["cache_type_title"] = 'Document caching type'; +$_lang["cache_type_1"] = 'Cache is based only on Resource ID (standard)'; +$_lang["cache_type_2"] = 'Cache is based on Resource ID and $_GET parameters'; +$_lang["seostrict_title"] = 'Use SEO Strict URLs'; +$_lang["seostrict_message"] = 'Enforces the use of strict URLs to prevent duplicate content (if needed)'; +$_lang["aliaslistingfolder_title"] = 'Use AliasListing only for Folders'; +$_lang["full_aliaslisting_title"] = 'Disable AliasListing for all resources'; +$_lang["aliaslistingfolder_message"] = 'Reduces memory consumption when a large number of resources'; + +$_lang["settings_friendlyurls_alert"] = 'It is necessary to rename the ht.access file in the EVO installation directory at .htaccess to use the Friendly URL function.'; +$_lang["settings_friendlyurls_alert2"] = 'Since EVO was installed in a subdirectory, it is necessary to change the content of .htaccess.'; + +$_lang["user_street"] = 'Street'; +$_lang["user_city"] = 'City'; +$_lang["user_other"] = 'Other'; + +$_lang["import_site.static.php1"] = 'Reset resource tree'; +$_lang["import_site.static.php2"] = 'Reset resource tree and initialize all Resource IDs.'; +$_lang["import_site.static.php3"] = 'Target'; +$_lang["import_site.static.php4"] = 'Only <body></body> part'; +$_lang["import_site.static.php5"] = 'Whole file content'; + +$_lang["a83_ignore_ids_title"] = 'Ignore IDs (comma separated)'; +$_lang["export_site.static.php1"] = 'Target'; +$_lang["export_site.static.php2"] = 'Only edited Resources'; +$_lang["export_site.static.php3"] = 'All Resources'; +$_lang["export_site.static.php4"] = 'Search for'; +$_lang["export_site.static.php5"] = 'Replace with'; +$_lang["export_site.static.php6"] = 'Target'; +$_lang["export_site.static.php7"] = 'Files could not be saved to [+rb_base_url+]'; + +$_lang["mutate_settings.dynamic.php6"] = 'Send mail on EVO errors'; +$_lang["mutate_settings.dynamic.php7"] = 'not notify'; +$_lang["mutate_settings.dynamic.php8"] = 'A mail with the error source will be sent to [(emailsender)] ([+emailsender+]) if a EVO error occurs. The details of the error could be seen in the EVO system events log.'; + +$_lang["error_no_privileges"] = "You don't have enough privileges for this action!"; +$_lang["error_no_optimise_tablename"] = "Table to optimise not found in request!"; +$_lang["error_no_truncate_tablename"] = "Table to truncate not found in request!"; +$_lang["error_double_action"] = "Double action (GET & POST) posted!"; +$_lang["error_no_id"] = "ID not passed in request!"; +$_lang["error_id_nan"] = "ID passed in request is NaN!"; +$_lang["error_no_parent"] = "Couldn't find parent document's name!"; +$_lang["error_parent_deleted"] = "Failed because resource parent is deleted!"; +$_lang["error_many_results"] = "Too many results returned from database!"; +$_lang["error_no_results"] = "Not enough/ no results returned from database!"; +$_lang["error_no_user_selected"] = "No user selected as recipient of this message!"; +$_lang["error_no_group_selected"] = "No group selected as recipient of this message!"; +$_lang["error_movedocument1"] = "Document cannot be it's own parent!"; +$_lang["error_movedocument2"] = "Document's ID not passed in request!"; +$_lang["error_movedocument3"] = "New parent not set in request!"; +$_lang["error_internet_connection"] = "Server isn't available. Check your internet connection!"; + +$_lang["login_processor_unknown_user"] = "Incorrect username or password entered!"; +$_lang["login_processor_wrong_password"] = "Incorrect username or password entered!"; +$_lang["login_processor_many_failed_logins"] = "Due to too many failed logins, you have been blocked!"; +$_lang["login_processor_blocked1"] = "You are blocked and cannot log in!"; +$_lang["login_processor_blocked2"] = "You are blocked and cannot log in! Please try again later."; +$_lang["login_processor_blocked3"] = "You are blocked automatic after a specified date and you cannot log in anymore!"; +$_lang["login_processor_bad_code"] = "The security code you entered didn't validate! Please try to login again!"; +$_lang["login_processor_remotehost_ip"] = "Your hostname doesn't point back to your IP!"; +$_lang["login_processor_remote_ip"] = "You are not allowed to login from this location."; +$_lang["login_processor_date"] = "You are not allowed to login at this time. Please try again later."; +$_lang["login_processor_captcha_config"] = "Captcha is not configured properly."; + +$_lang["dp_dayNames"] = "['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']"; +$_lang["dp_monthNames"] = "['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']"; +$_lang["dp_startDay"] = "1"; + +$_lang["check_all"] = "Select all"; +$_lang["check_none"] = "Select none"; +$_lang["check_toggle"] = "Toggle selection"; + +$_lang["version_notices"] = "Version Notices"; + +$_lang["em_button_shift"] = " (Shift-Mouseclick to open multiple windows)"; + +$_lang["reset_sysfiles_checksum_button"] = "Rebuild Checksums"; +$_lang["reset_sysfiles_checksum_alert"] = "Are you sure you want to reset the system files checksums?"; + +$_lang["file_browser_disabled_msg"] = "The File Browser Feature is not enabled."; +$_lang["which_browser_default_title"]= "Default File Browser"; +$_lang["which_browser_default_msg"]= "Choose the File Browser you prefer as default. In User-Settings you can choose a Custom Browser per User, or leave it on "default"."; +$_lang["which_browser_title"]= "File Browser"; +$_lang["which_browser_msg"]= "You can choose a custom File Browser for this user. To use the System´s default Browser, leave it on "Default"."; +$_lang["option_default"] = "Default"; +$_lang["position"] = "Position"; +$_lang["are_you_sure"] = "Are you sure?"; + +$_lang['evo_downloads_title'] = "Evolution Downloads"; +$_lang['help_translating_title'] = "Help translating Evolution"; +$_lang['download'] = "Download"; +$_lang['downloads'] = "Downloads"; +$_lang["previous_releases"] = "Previous Releases"; +$_lang["extras"] = "Extras"; + +$_lang["display_locks"] = "Display Locks"; +$_lang["role_display_locks"] = "Display Locks"; +$_lang["session_timeout"] = "Session Timeout"; +$_lang["session_timeout_msg"] = "EVO will ping the server as per setting "Mail Check Time Period". If the last ping exceeds this setting, the associated session will be considered invalid and all related locks will be removed automatically. Set value in minutes (>2min, default 15min)."; +$_lang["unlock_element_id_warning"] = "Are you sure you want to unlock this [+element_type+] (ID [+id+])?"; +$_lang["lock_element_type_1"] = "Template"; +$_lang["lock_element_type_2"] = "Template-Variable"; +$_lang["lock_element_type_3"] = "Chunk"; +$_lang["lock_element_type_4"] = "Snippet"; +$_lang["lock_element_type_5"] = "Plugin"; +$_lang["lock_element_type_6"] = "Module"; +$_lang["lock_element_type_7"] = "Resource"; +$_lang["lock_element_type_8"] = "Role"; +$_lang["lock_element_editing"] = "You are editing this [+element_type+] since\n[+lasthit_df+]"; +$_lang["lock_element_locked_by"] = "This [+element_type+] is locked by user\n[+username+] since [+lasthit_df+]"; + +$_lang["minifyphp_incache_title"] = 'Minify php code in site cache'; +$_lang["minifyphp_incache_message"] = 'Minify php code (snippets and plugins) and store in the site cache file, ref:#938'; + +$_lang["logout_reminder_msg"] = "Reminder: It seems on [+date+] you forgot to logout. Please pay attention in future to do so after your work is finished."; + +$_lang["allow_eval_title"] = "Eval php code in snippet call"; +$_lang["allow_eval_msg"] = "For developer : Please use \$modx->safeEval()."; +$_lang["allow_eval_with_scan"] = "Execute only permitted functions"; +$_lang["allow_eval_with_scan_at_post"] = "Execute all. However, at POST, only permitted functions"; +$_lang["allow_eval_everytime_eval"] = "Unlimited (Use only for debugging)"; +$_lang["allow_eval_dont_eval"] = "Do not allow all functions"; + +$_lang["safe_functions_at_eval_title"] = "Functions to allow eval"; +$_lang["safe_functions_at_eval_msg"] = "Comma separated list"; + +$_lang["multiple_sessions_msg"] = "Information: Multiple active user sessions (total [+total+]) found for user [+username+]."; +$_lang["iconv_not_available"] = "It is important to install/enable extension iconv. Please speak to your host if you don´t know how to enable it."; + +$_lang["cm_create_new_category"] = "Create the new category"; +$_lang["cm_category_name"] = "Category name"; +$_lang["cm_category_position"] = "Category position"; +$_lang["cm_no_x_assigned"] = "No %s assigned"; +$_lang["cm_save_categorization"] = "Save categorization"; +$_lang["cm_update_categories"] = "Update categories"; +$_lang["cm_assigned_elements"] = "Assigned elements"; +$_lang["cm_edit_name"] = "Edit name"; +$_lang["cm_mark_for_deletion"] = "Mark for deletion"; +$_lang["cm_delete_now"] = "Delete immediately"; +$_lang["cm_delete_element_x_now"] = "Delete "%s" immediately"; +$_lang["cm_select_element_group"] = "Select an element group"; +$_lang["cm_global_messages"] = "Global Messages"; +$_lang["cm_add_new_category"] = "Add a new category"; +$_lang["cm_edit_categories"] = "Edit categories"; +$_lang["cm_sort_categories"] = "Sort categories"; +$_lang["cm_categorize_elements"] = "Categorize elements"; +$_lang["cm_translation"] = "Translation"; +$_lang["cm_translations"] = "Translations"; +$_lang["cm_categorize_x"] = "Categorize %s"; +$_lang["cm_unknown_error"] = "Something went wrong."; +$_lang["cm_x_assigned_to_category_y"] = "%s(%s) has been assigned to category %s(%s)"; +$_lang["cm_no_categorization"] = "No categorization made."; +$_lang["cm_no_changes"] = "Nothing to change, so no changes made."; +$_lang["cm_x_changes_made"] = "%s changes made"; +$_lang["cm_enter_name_for_category"] = "Please enter a name for the new category."; +$_lang["cm_category_x_exists"] = "Category %s already exists."; +$_lang["cm_category_x_saved_at_position_y"] = "The new category %s was saved at position %s."; +$_lang["cm_category_x_moved_to_position_y"] = "Category %s was moved to position %s"; +$_lang["cm_category_x_deleted"] = "Category %s has been deleted"; +$_lang["cm_category_x_renamed_to_y"] = "Category %s was renamed to %s"; +$_lang["cm_translation_for_x_empty"] = "Translation for %s was empty"; +$_lang["cm_translation_for_x_to_y_success"] = "Translation for %s to %s successfully saved"; +$_lang["cm_save_new_sorting"] = "Save new sorting"; +$_lang["cm_translate_phrases"] = "Translate phrases"; +$_lang["cm_translate_module_phrases"] = "Translate module-phrases"; +$_lang["cm_native_phrase"] = "Native phrase"; + +$_lang["btn_view_options"] = 'View Options'; +$_lang["view_options_msg"] = 'The display & listing of elements can be customized via "View Options"-button. Settings are saved and restored per Browser using HTML5´s localStorage.'; +$_lang["viewopts_title"] = 'View Options'; +$_lang["viewopts_cb_buttons"] = 'Buttons'; +$_lang["viewopts_cb_descriptions"] = 'Descriptions'; +$_lang["viewopts_cb_icons"] = 'Icons'; +$_lang["viewopts_radio_list"] = 'List'; +$_lang["viewopts_radio_inline"] = 'Inline'; +$_lang["viewopts_radio_flex"] = 'Flex'; +$_lang["viewopts_fontsize"] = 'Font-Size'; +$_lang["viewopts_cb_alltabs"] = 'All Tabs'; + +$_lang['email_sender_method'] = 'The envelope sender of the message'; +$_lang['auto'] = 'Auto-detect'; +$_lang['use_emailsender'] = 'Use [(emailsender)] value'; +$_lang['email_sender_method_message'] = 'The envelope sender of the message. This will usually be turned into a Return-Path header by the receiver, and is the address that bounces will be sent to. Auto-detect will work in most cases.'; + +$_lang['login_form_position_title'] = 'Login form postiton'; +$_lang['login_form_position_left'] = 'left'; +$_lang['login_form_position_center'] = 'center'; +$_lang['login_form_position_right'] = 'right'; +$_lang["login_form_style"] = 'Login form style:'; +$_lang["login_form_style_dark"] = 'dark'; +$_lang["login_form_style_light"] = 'light'; +$_lang['login_logo_title'] = 'Login page logo image'; +$_lang['login_logo_message'] = 'Recomended login logo image width: 360px, type .png'; +$_lang['login_bg_title'] = 'Login page background image'; +$_lang['login_bg_message'] = 'Recomended login page background image width: 1920px '; + +$_lang['manager_menu_position_title'] = 'Main menu position'; +$_lang['manager_menu_position_top'] = 'top'; +$_lang['manager_menu_position_left'] = 'left'; + +$_lang['invalid_event_response'] = 'The %s event has invalid output'; + +$_lang['chunk_processor'] = 'Chunks processing class'; diff --git a/manager/includes/lang/bulgarian.inc.php b/manager/includes/lang/bulgarian.inc.php index ce4653ada2..1b7846b200 100755 --- a/manager/includes/lang/bulgarian.inc.php +++ b/manager/includes/lang/bulgarian.inc.php @@ -839,10 +839,10 @@ $_lang["role_view_unpublished"] = 'Преглед на непубликувани документи'; $_lang["role_web_access_persmissions"] = 'Права за уеб достъп'; $_lang["role_web_user_management"] = 'Управление на уеб потребителите'; -$_lang["rss_url_news_default"] = 'http://feeds.feedburner.com/evocms-release-news'; +$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news'; $_lang["rss_url_news_message"] = 'Въвеждане на URL адрес за MODX Новините.'; $_lang["rss_url_news_title"] = 'RSS на Новините'; -$_lang["rss_url_security_default"] = 'http://feeds.feedburner.com/evocms-security-news'; +$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news'; $_lang["rss_url_security_message"] = 'Въвеждане на URL адрес за MODX Сигурността.'; $_lang["rss_url_security_title"] = 'RSS на Сигурността'; $_lang["run_module"] = 'Стартиране на модул'; @@ -941,7 +941,7 @@ $_lang["sys_alert"] = 'Системен сигнал'; $_lang["sysinfo_activity_message"] = 'Този списък показва кои документи са били редактирани напоследък от потребителите.'; $_lang["sysinfo_userid"] = 'Потребител'; -$_lang["system_email_signup"] = 'Здравей [+uid+] +$_lang["system_email_signup"] = 'Здравей [+uid+] Въведи потребителско име и парола, за да влезеш в Мениджъра на [+sname+]: @@ -966,7 +966,7 @@ С уважение, Администратор'; -$_lang["system_email_websignup"] = 'Здравей [+uid+] +$_lang["system_email_websignup"] = 'Здравей [+uid+] Ето детайлите за акаунта ти в [+sname+]: diff --git a/manager/includes/lang/country/belarusian_country.inc.php b/manager/includes/lang/country/belarusian_country.inc.php new file mode 100644 index 0000000000..a4ea14be56 --- /dev/null +++ b/manager/includes/lang/country/belarusian_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/country/chinese_country.inc.php b/manager/includes/lang/country/chinese_country.inc.php new file mode 100644 index 0000000000..677c9f05a8 --- /dev/null +++ b/manager/includes/lang/country/chinese_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/country/czech_country.inc.php b/manager/includes/lang/country/czech_country.inc.php new file mode 100644 index 0000000000..677c9f05a8 --- /dev/null +++ b/manager/includes/lang/country/czech_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/country/hebrew_country.inc.php b/manager/includes/lang/country/hebrew_country.inc.php new file mode 100644 index 0000000000..677c9f05a8 --- /dev/null +++ b/manager/includes/lang/country/hebrew_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/country/norsk_country.inc.php b/manager/includes/lang/country/norsk_country.inc.php new file mode 100644 index 0000000000..677c9f05a8 --- /dev/null +++ b/manager/includes/lang/country/norsk_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/country/ukrainian_country.inc.php b/manager/includes/lang/country/ukrainian_country.inc.php new file mode 100644 index 0000000000..677c9f05a8 --- /dev/null +++ b/manager/includes/lang/country/ukrainian_country.inc.php @@ -0,0 +1,257 @@ + \ No newline at end of file diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 66f17728f2..eeb97f659b 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1360,6 +1360,7 @@ $_lang["error_no_id"] = "ID not passed in request!"; $_lang["error_id_nan"] = "ID passed in request is NaN!"; $_lang["error_no_parent"] = "Couldn't find parent document's name!"; +$_lang["error_parent_deleted"] = "Failed because resource parent is deleted!"; $_lang["error_many_results"] = "Too many results returned from database!"; $_lang["error_no_results"] = "Not enough/ no results returned from database!"; $_lang["error_no_user_selected"] = "No user selected as recipient of this message!"; @@ -1517,8 +1518,6 @@ $_lang['manager_menu_position_top'] = 'top'; $_lang['manager_menu_position_left'] = 'left'; -$_lang['invalid_event_response'] = 'The %s event has ivalid output'; +$_lang['invalid_event_response'] = 'The %s event has invalid output'; $_lang['chunk_processor'] = 'Chunks processing class'; -$_lang['enable_mootools'] = 'Enable Mootools in manager'; -$_lang['enable_mootools_message'] = 'Load Mootools.js in manager for backward compatibility'; diff --git a/manager/includes/lang/japanese-utf8.inc.php b/manager/includes/lang/japanese-utf8.inc.php index 9d49e9af4b..aebe70ac3d 100755 --- a/manager/includes/lang/japanese-utf8.inc.php +++ b/manager/includes/lang/japanese-utf8.inc.php @@ -851,10 +851,10 @@ $_lang["role_view_unpublished"] = '未公開のリソースの閲覧'; $_lang["role_web_access_persmissions"] = 'ウェブアクセス許可'; $_lang["role_web_user_management"] = 'ウェブユーザー管理'; -$_lang["rss_url_news_default"] = 'http://feeds2.feedburner.com/modxjp'; +$_lang["rss_url_news_default"] = 'https://feeds2.feedburner.com/modxjp'; $_lang["rss_url_news_message"] = '管理画面トップの「MODX News」のフィードURL'; $_lang["rss_url_news_title"] = 'RSS ニュースフィード'; -$_lang["rss_url_security_default"] = 'http://feeds.feedburner.com/evocms-security-news'; +$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news'; $_lang["rss_url_security_message"] = '管理画面トップの「MODX Security」のフィードURL'; $_lang["rss_url_security_title"] = 'RSS セキュリティ情報フィード'; $_lang["run_module"] = 'モジュールの実行'; diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index d9020f45aa..a63bde7155 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1263,9 +1263,6 @@ $_lang["bkmgr_snapshot_nothing"] = 'Нет резервных копий'; $_lang["files.dynamic.php1"] = 'Создать файл'; -$_lang["files.dynamic.php2"] = 'files.dynamic.php2'; -$_lang["files.dynamic.php3"] = 'files.dynamic.php3'; -$_lang["files.dynamic.php4"] = 'files.dynamic.php4'; $_lang["files.dynamic.php5"] = 'Файл не может быть дублирован.'; $_lang["files.dynamic.php6"] = 'Файл или директория не могут быть переименованы.'; $_lang["files_dynamic_new_folder_name"] = 'Укажите новое имя для папки:'; @@ -1353,6 +1350,7 @@ $_lang["error_no_id"] = "Не верно указан ID в вашем запросе!"; $_lang["error_id_nan"] = "ID переданного запроса пуст!"; $_lang["error_no_parent"] = "Не удалось найти имя родительского документа!"; +$_lang["error_parent_deleted"] = "Не удалось выполнить, потому что родитель отмечен как удаленный!"; $_lang["error_many_results"] = "Слишком много результатов возвращается из базы данных!"; $_lang["error_no_results"] = "Результаты из базы данных не вернулись или вернулись не полностью!"; $_lang["error_no_user_selected"] = "Не указан получатель этого сообщения!"; diff --git a/manager/includes/lang/ukrainian.inc.php b/manager/includes/lang/ukrainian.inc.php index d3e7f59192..c2750ca67e 100755 --- a/manager/includes/lang/ukrainian.inc.php +++ b/manager/includes/lang/ukrainian.inc.php @@ -1,20 +1,1517 @@ ' . $contents); +//$modx_textdir = 'rtl'; // uncomment this line for RTL languages $modx_lang_attribute = 'uk'; // Manager HTML/XML Language Attribute see http://en.wikipedia.org/wiki/ISO_639-1 +$modx_manager_charset = 'UTF-8'; setlocale (LC_ALL, 'uk_UA.UTF-8'); + +$_lang["about_msg"] = 'EVO - це PHP Application Framework та Content Management System, поширювана за ліцензією GNU GPL.'; +$_lang["about_title"] = 'Про EVO'; +$_lang["access_permission_denied"] = 'У вас недостатньо прав для перегляду цього ресурсу.'; +$_lang["access_permission_parent_denied"] = 'У вас недостатньо прав для створення ресурсу в цьому розділі'; +$_lang["access_permissions"] = 'Права доступу'; +$_lang["access_permissions_add_resource_group"] = 'Створити нову групу ресурсів'; +$_lang["access_permissions_add_user_group"] = 'Створити нову групу користувачів'; +$_lang["access_permissions_docs_collision"] = 'Оскільки групи веб-користувачів та менеджерів конфліктують з вашою роллю, цей ресурс буде доступний всім.'; +$_lang["access_permissions_docs_message"] = 'Тут ви можете вибрати, до яких груп ресурсів належить цей ресурс.'; +$_lang["access_permissions_group_link"] = 'Створити новий зв\'язок групи користувачів та групи ресурсів'; +$_lang["access_permissions_introtext"] = 'Тут можна керувати доступом груп користувачів до груп ресурсів. Щоб додати користувача до групи, під час редагування виберіть групу, до якої він належатиме. Ресурс також можна додати до групи під час його редагування.'; +$_lang["access_permissions_link_to_group"] = 'із групою ресурсів'; +$_lang["access_permissions_link_user_group"] = 'Зв\'язати групу користувачів'; +$_lang["access_permissions_links"] = 'Зв\'язки груп користувачів та груп ресурсів'; +$_lang["access_permissions_links_tab"] = 'Тут можна визначити, які групи користувачів мають доступ (тобто створювати та редагувати) до груп ресурсів. Щоб прив\'язати групу ресурсів до групи користувачів, виберіть групу зі списку та натисніть \'Виконати\'. Щоб видалити прив\'язку до групи, натисніть \'Видалити\'.'; +$_lang["access_permissions_no_resources_in_group"] = 'Немає ресурсів.'; +$_lang["access_permissions_no_users_in_group"] = 'Немає користувачів.'; +$_lang["access_permissions_off"] = 'Права доступу не активовані. Це означає, що жодні зміни не набудуть чинності, доки ви не зміните налаштування.'; +$_lang["access_permissions_resource_groups"] = 'Групи ресурсів'; +$_lang["access_permissions_resources_in_group"] = 'ресурсів в групі: '; +$_lang["access_permissions_resources_tab"] = 'Тут ви можете побачити усі групи ресурсів. Також тут можна створити, перейменувати, видалити групу, переглянути ресурси в групі. Для додавання або видалення ресурсу з групи редагуйте ресурс безпосередньо.'; +$_lang["access_permissions_user_groups"] = 'Групи користувачів'; +$_lang["access_permissions_user_message"] = 'Тут ви можете вибрати, до якої групи належить цей користувач:'; +$_lang["access_permissions_users_in_group"] = 'Користувачів в групі:'; +$_lang["access_permissions_users_tab"] = 'Тут ви можете побачити усі групи користувачів. Також, ви можете створити, перейменувати, видалити групу, переглянути членів групи. Щоб додати або видалити користувача з групи, редагуйте користувача безпосередньо. Менеджери завжди мають доступ до всіх ресурсів.'; +$_lang["account_email"] = 'E-mail облікового запису'; +$_lang["actioncomplete"] = 'Дія успішно завершена
    Зачекайте, поки EVO здійснить очищення.'; +$_lang["activity_message"] = 'Цей список показує недавно створені або відредаговані ресурси:'; +$_lang["activity_title"] = 'Нещодавно створені/відредаговані ресурси'; +$_lang["add"] = 'Створити'; +$_lang["add_chunk"] = 'Чанк'; +$_lang["add_doc"] = 'Ресурс'; +$_lang["add_folder"] = 'Нова папка'; +$_lang["add_plugin"] = 'Плагін'; +$_lang["add_resource"] = 'Новий ресурс'; +$_lang["add_snippet"] = 'Сніппет'; +$_lang["add_tag"] = 'Створити тег'; +$_lang["add_template"] = 'Шаблон'; +$_lang["add_tv"] = 'Параметр (TV)'; +$_lang["add_weblink"] = 'Нове посилання'; +$_lang["administrator_role_message"] = 'Цю роль неможливо редагувати або видалити.'; +$_lang["administrators"] = 'Адміністраторів'; +$_lang["after_saving"] = 'Після збереження'; +$_lang["alert_delete_self"] = 'Ви не можете видалити себе:)'; +$_lang["alias"] = 'Псевдонім'; +$_lang["all_doc_groups"] = 'Без групи (доступний для всіх)'; +$_lang["all_events"] = 'Всі події'; +$_lang["all_usr_groups"] = 'Всі групи (доступні для всіх)'; +$_lang["allow_mgr_access"] = 'Доступ до інтерфейсу системи керування сайтом'; +$_lang["allow_mgr_access_message"] = 'Виберіть цей параметр для дозволу/заборони доступу до системи керування сайтом.
    Примітка: якщо вимкнено, користувач буде спрямований на стартову сторінку системи керування або на початкову сторінку сайту.'; +$_lang["already_deleted"] = 'вже видалено.'; +$_lang["attachment"] = 'Прикріплене'; +$_lang["author_infos"] = 'Інформація про авторів'; +$_lang["automatic_alias_message"] = 'Виберіть \'Так\' для того, щоб система автоматично генерувала псевдоніми на основі заголовків сторінок (для транслітерації символів кирилиці налаштуйте плагін TransAlias).'; +$_lang["automatic_alias_title"] = 'Автоматично генерувати псевдонім:'; +$_lang["backup"] = 'Бекап'; +$_lang["bk_manager"] = 'Резервне копіювання'; +$_lang["block_message"] = 'Після збереження користувач буде заблокований.'; +$_lang["blocked_minutes_message"] = 'Тут ви можете ввести час у хвилинах, на який користувач буде заблокований, якщо він досягне максимальної кількості дозволених невдалих спроб входу до системи. Будь ласка, введіть це значення як число (не використовуйте розділових знаків, пропуску тощо)'; +$_lang["blocked_minutes_title"] = 'Час блокування:'; +$_lang["cache_files_deleted"] = 'Наступні файли були видалені:'; +$_lang["cancel"] = 'Скасувати'; +$_lang["captcha_code"] = 'Код підтвердження'; +$_lang["captcha_message"] = 'Увімкніть для посилення безпеки. Для авторизації необхідно буде ввести код, який не розпізнається різними скриптами (показаний у вигляді графічного зображення).'; +$_lang["captcha_title"] = 'Використати код CAPTCHA:'; +$_lang["captcha_words_default"] = 'EVO,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'; +$_lang["captcha_words_message"] = 'Тут можна задати список слів для генерування коду CAPTCHA. Слова у списку повинні розділятися комами.'; +$_lang["captcha_words_title"] = 'Слова для створення CAPTCHA-кодів:'; +$_lang["category_heading"] = 'Категорія'; +$_lang["category_manager"] = 'Менеджер категорій'; +$_lang["category_management"] = 'Категорії'; +$_lang["manage_categories"] = 'Категорії'; +$_lang["category_msg"] = 'Тут можна переглядати та редагувати всі елементи, згруповані за категоріями.'; +$_lang["cfg_base_path"] = 'MODX_BASE_PATH'; +$_lang["cfg_base_url"] = 'MODX_BASE_URL'; +$_lang["cfg_manager_path"] = 'MODX_MANAGER_PATH'; +$_lang["cfg_manager_url"] = 'MODX_MANAGER_URL'; +$_lang["cfg_site_url"] = 'MODX_SITE_URL'; +$_lang["change_name"] = 'Змінити ім\'я'; +$_lang["change_password"] = 'Змінити пароль'; +$_lang["change_password_confirm"] = 'Підтвердити пароль'; +$_lang["change_password_message"] = 'Введіть новий пароль, а потім введіть його ще раз для підтвердження. Довжина паролю повинна становити від 6 до 15 символів.'; +$_lang["change_password_new"] = 'Новий пароль'; +$_lang["charset_message"] = 'Виберіть кодування сторінок сайту. Памятайте, що EVO не тестувався на всіх кодуваннях. Для більшості мов підходить кодування UTF-8.'; +$_lang["charset_title"] = 'Кодування:'; +$_lang["chunk"] = 'Чанк (HTML-елемент шаблону)'; +$_lang["chunk_code"] = 'Код чанку (HTML)'; +$_lang["chunk_multiple_id"] = 'Помилка: Кілька чанків мають однаковий ідентифікатор.'; +$_lang["chunk_no_exist"] = 'Чанк не знайдено.'; +$_lang['chunk_processor'] = 'Клас обробки чанків'; +$_lang["cleaningup"] = 'Очищення...'; +$_lang["clean_uploaded_filename"] = 'Використовувати транслітерацію при завантаженні файлів.'; +$_lang["clean_uploaded_filename_message"] = 'Використовувати налаштування плагіна transalias для транслітерації імен файлів, що завантажуються зі збереженням крапок і ком.'; +$_lang["clear_log"] = 'Очистити протокол'; +$_lang["click_to_context"] = 'Контекстне меню'; +$_lang["click_to_edit_title"] = 'Редагувати запис'; +$_lang["click_to_view_details"] = 'Деталі'; +$_lang["close"] = 'Закрити'; +$_lang["code"] = 'Код'; +$_lang["collapse_tree"] = 'Згорнути дерево'; +$_lang["comment"] = 'Коментар'; +$_lang["configcheck_admin"] = 'Будь ласка, зв\'яжіться із системним адміністратором та повідомте про цю помилку'; +$_lang["configcheck_cache"] = 'неможливий запис до папки кешування'; +$_lang["configcheck_cache_msg"] = 'EVO не в змозі записувати дані до папки кешування. Система працюватиме нормально, але кешування не відбуватиметься. Щоб вирішити цю проблему, дозвольте запис до папки /assets/cache.'; +$_lang["configcheck_configinc"] = 'Файл конфігурації все ще доступний для запису'; +$_lang["configcheck_configinc_msg"] = 'Зловмисники потенційно можуть зашкодити вашому сайту. Серйозно. Будь ласка, встановіть права доступу до файлу конфігурації (/[+MGR_DIR+]/includes/config.inc.php) в режим \'Тільки для читання\''; +$_lang["configcheck_default_msg"] = 'Невизначена помилка.'; +$_lang["configcheck_errorpage_unavailable"] = 'Сторінка повідомлення про помилку, вказана в конфігурації сайту, недоступна.'; +$_lang["configcheck_errorpage_unavailable_msg"] = 'Це означає, що вона не існує або недоступна звичайним відвідувачам сайту. Це може призвести до циклічного виклику функції \'повідомлення про помилку\' та великої кількості записів у журналі сайту. Переконайтеся, що немає груп веб-користувачів, яким призначено цю сторінку.'; +$_lang["configcheck_errorpage_unpublished"] = 'Сторінку повідомлення про помилку, вказану в конфігурації сайту, не опубліковано.'; +$_lang["configcheck_errorpage_unpublished_msg"] = 'Це означає, що вона недоступна для відвідувачів сайту. Необхідно опублікувати сторінку повідомлення про помилку, щоб ця функція працювала правильно.'; +$_lang["configcheck_filemanager_path"] = 'Вказано неправильний шлях для файлового менеджера'; +$_lang["configcheck_filemanager_path_msg"] = 'Це може статися, наприклад, після переміщення вашого сайту в інший каталог або на інший сервер. Будь ласка, перевірте та оновіть налаштування вашої системи EvolutionCMS'; +$_lang["configcheck_hide_warning"] = 'Більше не показувати це повідомлення.'; +$_lang["configcheck_images"] = 'Папка зображень (images) недоступна для запису'; +$_lang["configcheck_images_msg"] = 'Папка зображень недоступна для запису або не існує на сервері. З цього випливає, що управління зображеннями не працюватиме'; +$_lang["configcheck_installer"] = 'Не видалено папку з файлами, що використовувалися в процесі установки'; +$_lang["configcheck_installer_msg"] = 'Папка /install містить інсталяційні файли системи EVO. Зловмисники можуть скористатися цими файлами для зламу/пошкодження сайту, тому краще видалити папку з сервера.'; +$_lang["configcheck_lang_difference"] = 'Невірна кількість записів у мовному пакеті.'; +$_lang["configcheck_lang_difference_msg"] = 'Поточний мовний пакет має кількість записів, відмінну від необхідного. Незважаючи на те, що система працюватиме нормально, можливо, мовний пакет потребує доопрацювання.'; +$_lang["configcheck_notok"] = 'Конфігурація містить помилки.'; +$_lang["configcheck_ok"] = 'Конфігурація не містить помилок.'; +$_lang["configcheck_php_gdzip"] = 'GD та/або Zip PHP розширення не знайдені'; +$_lang["configcheck_php_gdzip_msg"] = 'Для нормальної роботи EVO необхідно, щоб були дозволені GD та Zip розширення для PHP. EVO буде працювати без цих розширень, але ви не зможете використовувати всі можливості вбудованого файл-менеджера, редактора зображень або код CAPTCHA для авторизації.'; +$_lang["configcheck_rb_base_dir"] = 'Вказано невірний шлях для файл-браузера'; +$_lang["configcheck_rb_base_dir_msg"] = 'Це може статися, наприклад, після переміщення вашого сайту в інший каталог або на інший сервер. Будь ласка, перевірте та оновіть налаштування вашої системи EvolutionCMS'; +$_lang["configcheck_register_globals"] = 'Параметр \'register_globals\' має значення \'ON\' у конфігураційному файлі \'php.ini\'.'; +$_lang["configcheck_register_globals_msg"] = 'Така конфігурація робить ваш сайт значно вразливішим для Cross Site Scripting (XSS) атак. Зверніться до служби підтримки вашого хостингу за інформацією, яким чином вимкнути цей параметр.'; +$_lang["configcheck_title"] = 'Перевірка конфігурації'; +$_lang["configcheck_templateswitcher_present"] = 'Виявлено плагін TemplateSwitcher'; +$_lang["configcheck_templateswitcher_present_delete"] = 'Видалити плагін TemplateSwitcher'; +$_lang["configcheck_templateswitcher_present_disable"] = 'Вимкнути плагін TemplateSwitcher'; +$_lang["configcheck_templateswitcher_present_msg"] = 'Виявлено проблеми з кешуванням та продуктивністю при використанні плагіна TemplateSwitcher'; +$_lang["configcheck_unauthorizedpage_unavailable"] = 'Сторінка повідомлення про обмежений доступ, вказана в конфігурації сайту, не опублікована або не існує.'; +$_lang["configcheck_unauthorizedpage_unavailable_msg"] = 'Це означає, що вона не існує або недоступна звичайним відвідувачам сайту. Це може призвести до рекурсивного виклику функції \'повідомлення про помилку\' та великої кількості записів у журналі сайту. Переконайтеся, що немає груп веб-користувачів, яким призначено цю сторінку.'; +$_lang["configcheck_unauthorizedpage_unpublished"] = 'Сторінку повідомлення про обмежений доступ, зазначену в конфігурації сайту, не опубліковано.'; +$_lang["configcheck_unauthorizedpage_unpublished_msg"] = 'Це означає, що вона недоступна для відвідувачів сайту. Необхідно опублікувати сторінку повідомлення про обмеження доступу, щоб ця функція працювала правильно.'; +$_lang["configcheck_validate_referer"] = 'Попередження безпеки: перевірка заголовка HTTP'; +$_lang["configcheck_validate_referer_msg"] = 'У конфігурації параметр Перевіряти серверні заголовки HTTP_REFERER? вимкнено. Ми рекомендуємо її увімкнути. Перейти до налаштування конфігурації'; +$_lang["configcheck_warning"] = 'Помилка конфігурації:'; +$_lang["configcheck_what"] = 'Що це означає?'; +$_lang["confirm_block"] = 'Ви впевнені, що хочете заблокувати користувача?'; +$_lang["confirm_delete_category"] = 'Ви впевнені, що хочете видалити цю категорію?'; +$_lang["confirm_delete_eventlog"] = 'Ви впевнені, що хочете видалити протокол подій?'; +$_lang["confirm_delete_file"] = 'Ви впевнені, що хочете видалити файл? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте файл, якщо ви на 100% впевнені, що робота сайту не постраждає.'; +$_lang["confirm_delete_group"] = 'Ви впевнені, що хочете видалити цю групу?'; +$_lang["confirm_delete_htmlsnippet"] = 'Ви впевнені, що хочете видалити цей чанк?'; +$_lang["confirm_delete_keywords"] = 'Ви впевнені, що хочете видалити ці ключові слова?'; +$_lang["confirm_delete_module"] = 'Ви впевнені, що хочете видалити цей модуль?'; +$_lang["confirm_delete_plugin"] = 'Ви впевнені, що хочете видалити цей плагін?'; +$_lang["confirm_delete_record"] = 'Ви впевнені, що хочете видалити ці записи?'; +$_lang["confirm_delete_resource"] = 'Ви впевнені, що хочете видалити цей ресурс? \nВсі дочірні ресурси будуть також видалені.'; +$_lang["confirm_delete_role"] = 'Ви впевнені, що хочете видалити цю роль?'; +$_lang["confirm_delete_snippet"] = 'Ви впевнені, що хочете видалити цей сніпет?'; +$_lang["confirm_delete_tags"] = 'Ви впевнені, що хочете видалити вибрані META-теги?'; +$_lang["confirm_delete_template"] = 'Ви впевнені, що хочете видалити цей шаблон?'; +$_lang["confirm_delete_tmplvars"] = 'Ви впевнені, що хочете видалити цей параметр (TV) та всі збережені в ньому дані?'; +$_lang["confirm_delete_user"] = 'Ви впевнені, що хочете видалити цього користувача?'; +$_lang["confirm_duplicate_record"] = 'Ви впевнені, що хочете зробити копію цього запису?'; +$_lang["confirm_empty_trash"] = 'Видалити ВСІ помічені видалення файлів назавжди? \n\nПродовжити?'; +$_lang["confirm_load_depends"] = 'Ви впевнені, що хочете завантажити панель \'Залежності\' без збереження змін?'; +$_lang["confirm_name_change"] = 'Зміна імені користувача може вплинути на деякі додатки системи EVO. \n\nВи впевнені, що хочете змінити ім\'я користувача?'; +$_lang["confirm_publish"] = '\n\nПублікація цього ресурсу зараз видаляє всі встановлені розклади публікації. Якщо ви хочете встановити новий розклад або залишити старий – виберіть \'Редагувати\'.\n\nПродовжити?'; +$_lang["confirm_remove_locks"] = 'Користувачі іноді закривають браузер у процесі редагування ресурсів, шаблонів, сніппетів тощо, залишаючи їх заблокованими. Натискаючи \"ОК\", ви видаляєте всі поточні блокування. \n\nПродовжити?'; +$_lang["confirm_reset_sort_order"] = 'Ви впевнені, що хочете скинути \"sort order/index\" з усіх перелічених елементів до 0?'; +$_lang["confirm_resource_duplicate"] = 'Ви впевнені, що хочете зробити копію цього ресурсу? \nВсі дочірні ресурси також будуть скопійовані.'; +$_lang["confirm_setting_language_change"] = 'Ви змінили значення за промовчанням, виконані раніше виправлення будуть втрачені. Продовжити?'; +$_lang["confirm_unblock"] = 'Ви впевнені, що хочете розблокувати цього користувача?'; +$_lang["confirm_undelete"] = '\n\nВсі дочірні ресурси, видалені разом із цим ресурсом, будуть відновлені. Проте ресурси, видалені раніше, не будуть відновлені.'; +$_lang["confirm_unpublish"] = '\n\nСкасування публікації цього ресурсу зараз видаляє всі встановлені розклади публікації. Якщо ви хочете встановити новий розклад або залишити старий - виберіть \'Редагувати\'.\n\nПродовжити?'; +$_lang["confirm_unzip_file"] = 'Ви впевнені, що хочете розпакувати архів? \n\nІснуючі файли будуть перезаписані.'; +$_lang["could_not_find_user"] = 'Не можу знайти користувача'; +$_lang["create_folder_here"] = 'Дочірній контейнер'; +$_lang["create_resource_here"] = 'Дочірній ресурс'; +$_lang["create_resource_title"] = 'Створити ресурс'; +$_lang["create_weblink_here"] = 'Дочірнє веб-посилання'; +$_lang["createdon"] = 'Дата створення'; +$_lang["create_new"] = 'Створити'; +$_lang["credits"] = 'EVO використовує'; +$_lang["credits_shouts_msg"] = '

    EVO підтримується на сайті evo.im.

    '; +$_lang["custom_contenttype_message"] = 'Тут можна додати типи вмісту (Content-Type) для сайту. Для цього введіть тип вмісту та натисніть \'Додати\'.'; +$_lang["custom_contenttype_title"] = 'Типи вмісту (Content-Type):'; +$_lang["database_charset"] = 'Кодування бази даних'; +$_lang["database_collation"] = 'Співставлення бази даних'; +$_lang["database_name"] = 'Ім\'я бази даних'; +$_lang["database_overhead"] = 'Примітка: \'перевитрата\' – це невикористовуваний, але зарезервований MySQL простір. Щоб звільнити це місце, натисніть \'Перевитрата\' у таблиці (таблицях).'; +$_lang["database_server"] = 'Сервер бази даних'; +$_lang["database_table_clickbackup"] = 'створити та завантажити резервну копію вибраних таблиць'; +$_lang["database_table_clickhere"] = 'Натисніть тут'; +$_lang["database_table_datasize"] = 'Обсяг даних'; +$_lang["database_table_droptablestatements"] = 'Включати в дамп інструкцію \'DROP TABLE\''; +$_lang["database_table_effectivesize"] = 'Зайнятий об\'єм'; +$_lang["database_table_indexsize"] = 'Обсяг індексу'; +$_lang["database_table_overhead"] = 'Перевитрата'; +$_lang["database_table_records"] = 'Записи'; +$_lang["database_table_tablename"] = 'Назва таблиці'; +$_lang["database_table_totals"] = 'Всього:'; +$_lang["database_table_totalsize"] = 'Загальний обсяг'; +$_lang["database_tables"] = 'Таблиці бази даних'; +$_lang["database_version"] = 'Версія бази даних:'; +$_lang["date"] = 'Дата'; +$_lang["datechanged"] = 'Дата зміни'; +$_lang["datepicker_offset"] = 'Зміщення років: '; +$_lang["datepicker_offset_message"] = 'Число минулих років, яке буде показано у вікні вибору дати.'; +$_lang["datetime_format"] = 'Формат дати:'; +$_lang["datetime_format_message"] = 'Виберіть формат дати, який буде використано в системі керування.'; +$_lang["default"] = 'За замовчуванням:'; +$_lang["defaultcache_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення кешувалися за замовчуванням.'; +$_lang["defaultcache_title"] = 'Кешований\' за замовчуванням:'; +$_lang["defaultmenuindex_message"] = 'Виберіть \'Так\', для автоматичного збільшення позиції в меню для нових ресурсів.'; +$_lang["defaultmenuindex_title"] = '\'Індексація меню\' за замовчуванням:'; +$_lang["defaultpublish_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення публікувалися за замовчуванням.'; +$_lang["defaultpublish_title"] = '\'Публікувати\' за замовчуванням:'; +$_lang["defaultsearch_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення були доступні для пошуку за замовчуванням.'; +$_lang["defaultsearch_title"] = '\'Доступний для пошуку\' за замовчуванням:'; +$_lang["defaulttemplate_message"] = 'Виберіть шаблон, який буде застосовуватись до нових ресурсів за промовчанням. Під час редагування ресурсу ви можете встановити будь-який шаблон.'; +$_lang["defaulttemplate_title"] = 'Шаблон за замовчуванням:'; +$_lang["defaulttemplate_logic_title"] = 'Автоматичне призначення шаблону'; +$_lang["defaulttemplate_logic_general_message"] = 'Шаблон, призначений для нових ресурсів:'; +$_lang["defaulttemplate_logic_system_message"] = 'Системний: такий самий шаблон, як у системних налаштуваннях.'; +$_lang["defaulttemplate_logic_parent_message"] = 'Батько: такий самий шаблон, як у батька (якщо ресурс у корені сайту, шаблон Системний).'; +$_lang["defaulttemplate_logic_sibling_message"] = 'Сусідний: такий самий шаблон, як у сусідніх ресурсів у цьому контейнері (якщо сусідніх ресурсів немає, шаблон Батько).'; +$_lang["delete"] = 'Видалити'; +$_lang["delete_resource"] = 'Видалити'; +$_lang["delete_tags"] = 'Видалити теги'; +$_lang["deleting_file"] = 'Видаляється файл %s: '; +$_lang["description"] = 'Опис'; +$_lang["deselect_keywords"] = 'Видалити ключові слова'; +$_lang["deselect_metatags"] = 'Видалити META-теги'; +$_lang["disabled"] = 'Вимкнено'; +$_lang["doc_data_title"] = 'Огляд ресурсу'; +$_lang["documentation"] = 'Документація'; +$_lang["duplicate"] = 'Зробити копію'; +$_lang["duplicate_alias_found"] = 'Ресурс %s вже використовує псевдонім %s. Введіть унікальний псевдонім.'; +$_lang["duplicate_alias_message"] = 'Виберіть \'Так\', щоб дозволити повторення псевдонімів.
    Примітка: цей параметр повинен використовуватися разом із включеною функцією \'Використовувати вкладені URL\'. '; +$_lang["duplicate_alias_title"] = 'Дозволити повторювані псевдоніми:'; +$_lang["duplicate_name_found_general"] = 'Об\'єкт %s з ім\'ям %s вже існує. Будь ласка, введіть інше ім\'я.'; +$_lang["duplicate_name_found_module"] = 'Модуль із ім\'ям %s вже існує. Будь ласка, введіть інше ім\'я.'; +$_lang["duplicated_el_suffix"] = 'Копія'; +$_lang["edit"] = 'Редагувати'; +$_lang["edit_resource"] = 'Редагувати'; +$_lang["edit_resource_title"] = 'Редагувати ресурс'; +$_lang["edit_settings"] = 'Конфігурація'; +$_lang["editedon"] = 'Дата редагування'; +$_lang["editing_file"] = 'Редагований файл: '; +$_lang["editor_css_path_message"] = 'Введіть шлях до файлу CSS, який ви бажаєте використовувати для редактора. Рекомендується вводити шлях від кореня сайту, наприклад: /assets/site/style.css. Якщо ви не хочете використовувати файл CSS для редактора, залиште це поле порожнім.'; +$_lang["editor_css_path_title"] = 'Шлях до CSS файлу:'; +$_lang["element"] = 'Елемент'; +$_lang["element_categories"] = 'Спільний перегляд'; +$_lang["element_filter_msg"] = 'Введіть тут, щоб фільтрувати список'; +$_lang["element_management"] = 'Елементи'; +$_lang["element_name"] = 'Назва елемента'; +$_lang["element_selector_msg"] = 'Виберіть елемент(и) зі списку внизу та натисніть кнопку \'Вставити\'.'; +$_lang["element_selector_title"] = 'Вибір елемента'; +$_lang["elements"] = 'Елементи'; +$_lang["email"] = 'E-mail'; +$_lang["email_sent"] = 'Лист надісланий'; +$_lang["emailsender_message"] = 'Вкажіть адресу e-mail, яка буде відображена у листі підтвердження реєстрації в полі \'Від\'.'; +$_lang["emailsender_title"] = 'Зворотня електронна адреса:'; +$_lang["emailsubject_default"] = 'Дані для авторизації'; +$_lang["emailsubject_message"] = 'Вкажіть текст, який буде відображено у листі підтвердження реєстрації в полі \'Тема\'.'; +$_lang["emailsubject_title"] = 'Тема листа підтвердження реєстрації:'; +$_lang["empty_folder"] = 'Папка порожня'; +$_lang["empty_recycle_bin"] = 'Очистити кошик'; +$_lang["empty_recycle_bin_empty"] = 'Немає ресурсів, помічених на видалення.'; +$_lang["enable_resource"] = 'Підключити файл елементів.'; +$_lang["enable_sharedparams"] = 'Включити \'загальні\' параметри'; +$_lang["enable_sharedparams_msg"] = 'Примітка: Вказаний вище унікальний глобальний ідентифікатор (GUID) буде використаний для ідентифікації цього модуля та загальних параметрів. GUID також використовується для формування зв\'язку модуля, плагінів або сніпетів, які використовують його загальні параметри.'; +$_lang["enabled"] = 'Увімкнено'; +$_lang["error"] = 'Помилка'; +$_lang["error_sending_email"] = 'Помилка надсилання e-mail'; +$_lang["errorpage_message"] = 'Введіть ID ресурсу, який ви хочете використовувати як сторінку помилки (404 - ресурс не знайдено).
    Примітка: переконайтеся, що цей ID належить існуючому ресурсу, і що цей ресурс опубліковано'; +$_lang["errorpage_title"] = 'Сторінка помилки \'404\':'; +$_lang["event_id"] = 'ID події'; +$_lang["eventlog"] = 'Протокол подій'; +$_lang["eventlog_msg"] = 'Протокол подій використовується для відображення системних інформаційних повідомлень, попереджень та повідомлень про помилки. У колонці \'Код\' показаний розділ системи управління, де сталася подія.'; +$_lang["eventlog_viewer"] = 'Перегляд подій'; +$_lang["everybody"] = 'Всім'; +$_lang["existing_category"] = 'Існуючі категорії'; +$_lang["expand_tree"] = 'Розгорнути дерево'; +$_lang["export_site"] = 'Експортувати сайт'; +$_lang["export_site_cacheable"] = 'Експортувати некешовані ресурси:'; +$_lang["export_site_exporting_document"] = '[+status+] [+url+] - [+pagetitle+] ([+id+])
    '; +$_lang["export_site_failed"] = 'Помилка'; +$_lang["export_site_failed_no_open"] = 'Неможливо відкрити файл:'; +$_lang["export_site_failed_no_retrieve"] = 'Неможливо отримати ресурс.'; +$_lang["export_site_failed_no_write"] = 'Неможливо записати у файл.'; +$_lang["export_site_html"] = 'Експортувати сайт до HTML'; +$_lang["export_site_maxtime"] = 'Максимальний час експорту:'; +$_lang["export_site_maxtime_message"] = 'Вкажіть максимальну кількість секунд, протягом яких буде виконуватися процес експорту сайту (нехтуючи налаштуваннями PHP). Введіть 0 для необмеженого часу. Майте на увазі, що 0 або дуже багато часу, задані для процесу експорту, можуть призвести до неадекватної роботи сервера, тому такі значення задавати не рекомендується.'; +$_lang["export_site_message"] = '

    Ця функція дозволяє експортувати сайт у HTML файли повністю. Майте на увазі, що статичний HTML-сайт має дуже обмежені можливості порівняно з EVO-сайтом:

    • не буде записуватися статистика відвідувань;
    • інтерактивні сніпети працювати не будуть;
    • веб-посилання експортовані не будуть;
    • процес експорту може не вдасться, якщо ресурси містять сніпети з перенаправленням;
    • можлива неправильна робота дизайну шаблону вашого сайту. Щоб уникнути цього, експортовані файли повинні знаходитися в кореневій папці (там же, де і файл index.php системи EVO).

    Будь ласка, заповніть форму та натисніть \'Почати експорт\'. Файли будуть записані в папку /assets/export, використовуючи, де можливо, псевдоніми як імена. При експорті сайту рекомендується в конфігурації EVO увімкнути функцію \'Використовувати псевдоніми в URL\'. Час експорту залежить від розмірів вашого сайту.

    Існуючі файли з іменами, що збігаються, будуть замінені на нові.

    '; +$_lang["export_site_numberdocs"] = '

    Знайдено %s ресурсів для експорту...

    '; +$_lang["export_site_prefix"] = 'Префікс файлів:'; +$_lang["export_site_start"] = 'Почати експорт'; +$_lang["export_site_success"] = 'Експорт завершено'; +$_lang["export_site_success_skip_dir"] = 'Пропустити цю папку.'; +$_lang["export_site_success_skip_doc"] = 'Пропустити цей ресурс.'; +$_lang["export_site_suffix"] = 'Суфікс файлів:'; +$_lang["export_site_target_unwritable"] = 'Папка експорту недоступна для запису. Виправте це і спробуйте знову.'; +$_lang["export_site_time"] = 'Експорт завершено. Процес зайняв %s секунд.'; +$_lang["failed_login_message"] = 'Тут можна ввести кількість невдалих спроб входу в систему, які дозволені, перш ніж користувач буде заблокований.'; +$_lang["failed_login_title"] = 'Ліміт невдалих спроб входу до системи:'; +$_lang["fe_editor_lang_message"] = 'Виберіть мову редактора, яка використовуватиметься у фронтенді.'; +$_lang["fe_editor_lang_title"] = 'Мова фронтенд-редактора:'; +$_lang["file_delete_file"] = 'Видалити файл'; +$_lang["file_delete_folder"] = 'Видалити папку'; +$_lang["file_deleted"] = 'Видалено'; +$_lang["file_download_file"] = 'Завантажити файл'; +$_lang["file_download_unzip"] = 'Розпакувати файл'; +$_lang["file_folder_chmod_error"] = 'Не вдалося змінити права, необхідно встановити потрібні права поза EVO.'; +$_lang["file_folder_created"] = 'Папка успішно створена'; +$_lang["file_folder_deleted"] = 'Папка успішно видалена'; +$_lang["file_folder_not_created"] = 'Неможливо створити папку'; +$_lang["file_folder_not_deleted"] = 'Неможливо видалити папку. Переконайтеся, що вона порожня'; +$_lang["file_not_deleted"] = 'Помилка'; +$_lang["file_not_saved"] = 'Неможливо зберегти файл'; +$_lang["file_saved"] = 'Файл збережено'; +$_lang["file_unzip"] = 'Архів успішно розпакований'; +$_lang["file_unzip_fail"] = 'Архів не вдалося розпакувати'; +$_lang["filemanager_path_message"] = 'Часто IIS неправильно виводить параметр document_root, який використовується файл-менеджером. Встановіть правильний шлях, щоб уникнути проблем із файл-менеджером.'; +$_lang["filemanager_path_title"] = 'Шлях для файл-менеджера:'; +$_lang["files_access_denied"] = 'Доступ заборонено'; +$_lang["files_data"] = 'Сумарний об\'єм'; +$_lang["files_dir_listing"] = 'Список файлів у папці: '; +$_lang["files_directories"] = 'Папки'; +$_lang["files_directory_is_empty"] = 'У цій папці немає файлів.'; +$_lang["files_dirwritable"] = 'Дозволений запис до папки?'; +$_lang["files_editfile"] = 'Редагувати файл'; +$_lang["files_file_type"] = 'Тип файлу: '; +$_lang["files_filename"] = 'Ім\'я файлу'; +$_lang["files_fileoptions"] = 'Параметри'; +$_lang["files_files"] = 'Файли'; +$_lang["files_filesize"] = 'Розмір файлу'; +$_lang["files_filetype_notok"] = 'Завантаження файлів такого типу заборонено'; +$_lang["files_management"] = 'Файли'; +$_lang["files_management_no_permission"] = 'У вас немає достатньо прав для перегляду або редагування цих файлів. Зверніться до адміністратора, щоб надати вам доступ до %s.'; +$_lang["files_modified"] = 'Змінено'; +$_lang["files_top_level"] = 'На кореневий рівень'; +$_lang["files_up_level"] = 'На рівень вище'; +$_lang["files_upload_copyfailed"] = 'Не вдалося скопіювати файл у потрібну папку - завантаження перервано!'; +$_lang["files_upload_error"] = 'Помилка'; +$_lang["files_upload_error0"] = 'Повстала проблема під час завантаження.'; +$_lang["files_upload_error1"] = 'Файл, який ви намагаєтесь завантажити, занадто великий.'; +$_lang["files_upload_error2"] = 'Файл, який ви намагаєтесь завантажити, занадто великий.'; +$_lang["files_upload_error3"] = 'Файл, який ви намагалися завантажити, завантажено лише частково.'; +$_lang["files_upload_error4"] = 'Ви повинні вибрати файл для завантаження.'; +$_lang["files_upload_error5"] = 'Виникли проблеми із завантаженням.'; +$_lang["files_upload_inhibited_msg"] = 'Функція завантаження файлів на сервер файлів недоступна - переконайтеся, що папка доступна PHP для запису.'; +$_lang["files_upload_ok"] = 'Файл успішно завантажено'; +$_lang["files_upload_permissions_error"] = 'Можлива помилка прав доступу - папка, в яку ви хочете завантажити дані, не доступна для запису на вашому сервері.'; +$_lang["files_uploadfile"] = 'Завантажити'; +$_lang["files_uploadfile_msg"] = 'Виберіть файли для завантаження:'; +$_lang["files_uploading"] = 'Завантажується файл %s у %s/
    '; +$_lang["files_viewfile"] = 'Перегляд файлу'; +$_lang["folder"] = 'Папка'; +$_lang["forgot_password_email_fine_print"] = '* Вказана адреса стане недійсною, як тільки ви зміните пароль (або автоматично післязавтра).'; +$_lang["forgot_password_email_instructions"] = 'Звідти ви зможете змінити свій пароль, редагуючи обліковий запис.'; +$_lang["forgot_password_email_intro"] = 'Було зроблено запит на зміну пароля вашого облікового запису.'; +$_lang["forgot_password_email_link"] = 'Натисніть тут, щоб завершити процес.'; +$_lang["forgot_your_password"] = 'Забули свій пароль?'; +$_lang["friday"] = 'П\'ятниця'; +$_lang["friendly_alias_message"] = 'Якщо сайт використовує дружні URL, і ресурс має псевдонім, то при включенні цього параметра URL ресурсу матиме вигляд: \'http://mysite.com/псевдонім\'. Якщо визначено суфікс (наприклад \'.html\') та/або префікс (наприклад \'page-\') дружніх URL, адреса сторінки буде така: \'http://mysite.com/page-псевдонім.html\' . Якщо не задані псевдоніми, суфікси та префікси, EVO згенерує таку URL: \'http://mysite.com/2\', де 2 - ID ресурсу.'; +$_lang["friendly_alias_title"] = 'Використовувати псевдоніми в URL:'; +$_lang["friendlyurls_message"] = 'Даний параметр дає можливість використання дружніх URL-адрес на сайті. Пам\'ятайте, що ця можливість доступна лише тоді, коли EVO працює на сервері Apache із встановленим mod_rewrite; Крім того, потрібно змінити файл .htaccess. Для отримання детальної інформації дивіться файл .htaccess, який входить до дистрибутиву EVO.'; +$_lang["friendlyurls_title"] = 'Використовувати дружні URL:'; +$_lang["friendlyurlsprefix_message"] = 'Тут можна вказати особливий префікс для дружніх URL. Наприклад, якщо в якості такого префікса ви вкажете слово \'page\', то URL типу /index.php?id=2 буде перетворено на /page2.html (як суфікс URL тут виступає \'.html\').' ; +$_lang["friendlyurlsprefix_title"] = 'Префікс для дружніх URL:'; +$_lang["friendlyurlsuffix_message"] = 'Тут можна вказати суфікс для дружніх URL. Вказавши \'.html\', ви додасте .html до всіх дружніх URL.'; +$_lang["friendlyurlsuffix_title"] = 'Суфікс для дружніх URL:'; +$_lang["functionnotimpl"] = 'На жаль'; +$_lang["functionnotimpl_message"] = 'Ця функція ще не використовується цією версією EVO.'; +$_lang["further_info"] = 'Докладна інформація'; +$_lang["global_tabs"] = 'Глобальні вкладки'; +$_lang["go"] = 'Перейти'; +$_lang["group_access_permissions"] = 'Доступ груп користувачів'; +$_lang['group_tvs'] = 'Групувати ТV-параметри'; +$_lang["guid"] = 'GUID'; +$_lang["help"] = 'Допомога'; +$_lang["help_msg"] = '

    Ви можете отримати безкоштовну допомогу спільноти EVO на форумах EVO. Дивіться також \'Документація та уроки з EVO\', де докладно описано кожен аспект системи.

    '; +$_lang["help_title"] = 'Допомога'; +$_lang["hide_tree"] = 'Сховати дерево'; +$_lang["home"] = 'Головна'; +$_lang["htmlsnippet"] = 'Чанк'; +$_lang["htmlsnippets"] = 'Чанки'; +$_lang["htmlsnippet_desc"] = 'Опис'; +$_lang["htmlsnippet_management_msg"] = 'Чанки - це шматки (X)HTML-коду, які використовуються в незмінному вигляді в декількох місцях. Щоб мати можливість централізовано редагувати код, що повторюється, винесіть його в чанк. Чанки не можуть прямо містити виконуваний код, однак можуть включати виклики сніппетів та/або параметрів (TV), що забезпечують динамічну логіку.

    Використання: вставте {{chunkName}} десь у шаблоні, у області контенту, в коді іншого чанка або в параметрі (TV).

    Виклик через EVO API: $modx->getChunk(\'chunkName\'); $modx->putChunk(\'chunkName\');


    Виберіть чанк для редагування або створіть новий.'; +$_lang["htmlsnippet_msg"] = 'Тут можна створити / відредагувати чанк.
    Пам\'ятайте, чанки – чистий HTML-код, і будь-які php-скрипти виконуватись у них не будуть.'; +$_lang["htmlsnippet_name"] = 'Назва чанка'; +$_lang["htmlsnippet_title"] = 'Створити/редагувати чанк'; +$_lang["icon"] = 'Значок'; +$_lang["icon_description"] = "CSS клас"; +$_lang["id"] = 'ID'; +$_lang["illegal_parent_child"] = 'Зміна батьківського ресурсу: \n\nресурс є дочірнім до обраного.'; +$_lang["illegal_parent_self"] = 'Зміна батьківського ресурсу: \n\nвибраний ресурс не може бути присвоєний як батько самому собі.'; +$_lang["images_management"] = 'Зображення'; +$_lang["import_files_found"] = 'Знайдено %s ресурсів для імпорту...'; +$_lang["import_params"] = 'Імпортувати загальні параметри модуля'; +$_lang["import_params_msg"] = 'Ви можете імпортувати параметри та установки модуля, вибравши його назву зі списку вгорі.
    Примітка: щоб модулі відображалися в меню, цей плагін/сніппет повинен бути однією з залежностей модуля і модуля повинні бути включені загальні параметри.'; +$_lang["import_parent_resource"] = 'Батьківський ресурс:'; +$_lang["import_site"] = 'Імпортувати сайт'; +$_lang["import_site_failed"] = 'Помилка'; +$_lang["import_site_failed_db_error"] = 'Під час копіювання ресурсу сталася помилка в базі даних: '; +$_lang["import_site_failed_no_open_dir"] = 'Неможливо відкрити папку: '; +$_lang["import_site_failed_no_retrieve_file"] = 'Неможливо вийняти файл: '; +$_lang["import_site_html"] = 'Імпортувати сайт із HTML'; +$_lang["import_site_importing_document"] = 'Імпортується файл %s'; +$_lang["import_site_maxtime"] = 'Максимальний час імпорту:'; +$_lang["import_site_maxtime_message"] = 'Тут ви можете вказати скільки секунд може зайняти процес імпорту (перевизначення установок PHP). Введіть 0, щоб встановити необмежений час. Майте на увазі, що 0 або дуже великий проміжок часу, задані для процесу імпорту, можуть призвести до неадекватної роботи сервера, тому такі значення не рекомендується.'; +$_lang["import_site_message"] = 'Використовуючи цю функцію, ви можете імпортувати сайт з HTML до бази даних. Зверніть увагу, що всі HTML-файли потрібно скопіювати в папку \'assets/import\'.

    Заповніть форму, виберіть батьківський ресурс у дереві сайту та натисніть \'Почати імпорт\' для початку процесу. Файли будуть скопійовані у вказане місце, використовуючи, де можливо, імена файлів як псевдоніми та заголовки сторінок як назви ресурсів.

    '; +$_lang["import_site_skip"] = 'Пропущено'; +$_lang["import_site_start"] = 'Почати імпорт'; +$_lang["import_site_success"] = 'Успішно'; +$_lang["import_site_time"] = 'Імпорт завершено. Процес зайняв %s секунд.'; +$_lang["inbox"] = 'Вхідні'; +$_lang["info"] = 'Інформація'; +$_lang["information"] = 'Інформація'; +$_lang["inline"] = 'Відображуване'; +$_lang["insert"] = 'Вставити'; +$_lang["maxImageWidth"] = 'Максимальна ширина зображення'; +$_lang["maxImageHeight"] = 'Максимальна висота зображення'; +$_lang["clientResize"] = 'Зміна розміру зображення на стороні клієнта'; +$_lang["clientResize_message"] = 'Якщо увімкнено, зображення будуть змінюватися браузером до завантаження на сервер'; +$_lang["noThumbnailsRecreation"] = 'Створення ескізів лише при завантаженні зображення'; +$_lang["noThumbnailsRecreation_message"] = 'Файловий менеджер створюватиме ескізи тільки при завантаженні; якщо для деяких зображень немає ескізів, вони не створені'; +$_lang["thumbWidth"] = 'Максимальна ширина прев\'ю'; +$_lang["thumbHeight"] = 'Максимальна висота прев\'ю'; +$_lang["thumbsDir"] = 'Папка для зберігання прев\'ю'; +$_lang["jpegQuality"] = 'Ступінь стиснення JPEG'; +$_lang["denyZipDownload"] = 'Заборонити скачування zip-архівів'; +$_lang["denyExtensionRename"] = 'Заборонити перейменування розширень файлів'; +$_lang["maxImageWidth_message"] = 'Якщо зображення ширше, ніж зазначено, воно буде зменшено. Вкажіть 0, щоб не змінювати ширину зображення під час завантаження.'; +$_lang["maxImageHeight_message"] = 'Якщо зображення вище, ніж зазначено, воно буде зменшено. Вкажіть 0, щоб не змінювати висоту зображення під час завантаження.'; +$_lang["thumbWidth_message"] = 'Максимальна ширина прев\'ю'; +$_lang["thumbHeight_message"] = 'Максимальна висота прев\'ю'; +$_lang["thumbsDir_message"] = 'Назва папки, в якій зберігатимуться прев\'ю'; +$_lang["jpegQuality_message"] = 'Ступінь стиснення зображень та прев\'ю JPEG-формату'; +$_lang["showHiddenFiles"] = 'Показувати приховані файли'; +$_lang["keyword"] = 'Ключове слово'; +$_lang["keywords"] = 'Ключові слова'; +$_lang["keywords_intro"] = 'Для редагування ключового слова просто введіть нове значення поруч із наявним. Для видалення - поставте галочку в поле \'видалити\'.'; +$_lang["language_message"] = 'Виберіть мову системи керування сайтом.'; +$_lang["language_title"] = 'Мова системи управління:'; +$_lang["last_update"] = 'Останні оновлення'; +$_lang["launch_site"] = 'Запустити сайт'; +$_lang["license"] = 'Ліцензія'; +$_lang["link_attributes"] = 'Атрибути посилання'; +$_lang["link_attributes_help"] = 'Тут ви можете ввести атрибути посилання для цієї сторінки, наприклад target="_blank" або rel="external".'; +$_lang["list_mode"] = 'Включити/вимкнути режим списку - використовується для виведення списку записів.'; +$_lang["loading_doc_tree"] = 'Завантажується дерево сайту...'; +$_lang["loading_menu"] = 'Завантажується меню...'; +$_lang["loading_page"] = 'Зачекайте...'; +$_lang["localtime"] = 'Місцевий час'; +$_lang["lock_htmlsnippet"] = 'Обмежити доступ до редагування чанка'; +$_lang["lock_htmlsnippet_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей чанк.'; +$_lang["lock_module"] = 'Обмежити доступ до редагування модуля'; +$_lang["lock_module_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей модуль.'; +$_lang["lock_msg"] = '%s зараз редагує %s. Зачекайте, поки інший користувач закінчить редагування, і спробуйте знову.'; +$_lang["lock_plugin"] = 'Обмежити доступ до редагування плагіна'; +$_lang["lock_plugin_msg"] = 'Тільки адміністратори (ID ролі - 1) мають право редагувати цей плагін.'; +$_lang["lock_settings_msg"] = '%s зараз редагує системні установки. Зачекайте, поки інший користувач закінчить редагування, і спробуйте знову.'; +$_lang["lock_snippet"] = 'Обмежити доступ до редагування сніпету'; +$_lang["lock_snippet_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей сніпет.'; +$_lang["lock_template"] = 'Обмежити доступ до редагування шаблону'; +$_lang["lock_template_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей шаблон.'; +$_lang["lock_tmplvars"] = 'Обмежити доступ до редагування параметра'; +$_lang["lock_tmplvars_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей параметр.'; +$_lang["locked"] = 'Заблоковано'; +$_lang["login_allowed_days"] = 'Дозволені дні'; +$_lang["login_allowed_days_message"] = 'Виберіть дні, в які цей користувач може входити.'; +$_lang["login_allowed_ip"] = 'Дозволена IP-адреса'; +$_lang["login_allowed_ip_message"] = 'Введіть IP-адресу, з якої дозволено заходити цьому користувачеві.
    Примітка: кілька IP-адрес розділяйте комами (,)'; +$_lang["login_button"] = 'Увійти'; +$_lang["login_cancelled_install_in_progress"] = 'На даний момент виконується встановлення/оновлення сайту.
    Повторіть спробу за кілька хвилин!
    '; +$_lang["login_cancelled_site_was_updated"] = 'Процес встановлення/оновлення сайту завершено успішно. Потрібна повторна авторизація в системі!
    '; +$_lang["login_captcha_message"] = 'Введіть код підтвердження. \n\nЯкщо у вас виникли труднощі з прочитанням коду, натисніть на нього, щоб створити новий варіант.'; +$_lang["login_homepage"] = 'Сторінка успішної авторизації'; +$_lang["login_homepage_message"] = 'Введіть ID ресурсу, який завантажиться після успішної авторизації користувача.
    Примітка: переконайтеся, що цей ID належить існуючому ресурсу, що цей ресурс опублікований і що він доступний для цього користувача'; +$_lang["login_message"] = 'Введіть ваше ім\'я користувача та пароль. Зверніть увагу - малі та великі літери різняться.'; +$_lang["logo_slogan"] = 'Створюйте більше з меншими зусиллями - \nСистема керування сайтом EVO'; +$_lang["logout"] = 'Вийти'; +$_lang["long_title"] = 'Розширений заголовок'; +$_lang["mail_check_timeperiod_message"] = 'Як часто перевіряти наявність нових повідомлень у системі управління, (сек).'; +$_lang["mail_check_timeperiod_title"] = 'Період перевірки пошти:'; +$_lang["manage_depends"] = 'Залежності'; +$_lang["manage_files"] = 'Файли'; +$_lang["manage_htmlsnippets"] = 'Чанки'; +$_lang["manage_metatags"] = 'META-теги та ключові слова'; +$_lang["manage_modules"] = 'Модулі'; +$_lang["manage_plugins"] = 'Плагіни'; +$_lang["manage_snippets"] = 'Сніпети'; +$_lang["manage_templates"] = 'Шаблони'; +$_lang["manage_documents"] = 'Документи'; +$_lang["manager"] = 'Менеджер'; +$_lang["manager_lockout_message"] = 'В даний момент ви перебуваєте в режимі керування сайтом. Щоб завершити сеанс адміністрування, натисніть кнопку "Вийти".

    Щоб перейти на головну або стартову сторінку, натисніть кнопку \'Додому\'.'; +$_lang["manager_permissions"] = 'Права менеджерів'; +$_lang["manager_theme"] = 'Шаблон системи керування:'; +$_lang["manager_theme_message"] = 'Виберіть шаблон для системи керування.'; +$_lang["manager_theme_mode"] = 'Схема кольорів:'; +$_lang["manager_theme_mode1"] = 'все світле'; +$_lang["manager_theme_mode2"] = 'шапка темна'; +$_lang["manager_theme_mode3"] = 'шапка та дерево темні'; +$_lang["manager_theme_mode4"] = 'все темне'; +$_lang['manager_theme_mode_message'] = 'Цей параметр використовується як \'за замовчуванням\' і може бути перевизначений при перемиканні режиму кольору теми в дереві документів: '; +$_lang['manager_theme_mode_title'] = 'Перемикач колірної схеми: 4 схеми'; +$_lang["messages"] = 'Повідомлення'; +$_lang["messages_all"] = 'Всім'; +$_lang["messages_compose"] = 'Написати повідомлення'; +$_lang["messages_forward"] = 'Переслати'; +$_lang["messages_from"] = 'Від'; +$_lang["messages_group"] = 'Група'; +$_lang["messages_inbox"] = 'Поштова скринька'; +$_lang["messages_message"] = 'Повідомлення'; +$_lang["messages_no_messages"] = 'Поштова скринька порожня'; +$_lang["messages_not_allowed_to_read"] = 'Вам заборонено читати ці повідомлення'; +$_lang["messages_private"] = 'Приватне'; +$_lang["messages_read_message"] = 'Читати повідомлення'; +$_lang["messages_reply"] = 'Відповісти'; +$_lang["messages_select_group"] = 'Виберіть групу'; +$_lang["messages_select_user"] = 'Виберіть користувача'; +$_lang["messages_send"] = 'Надіслати'; +$_lang["messages_send_to"] = 'Кому'; +$_lang["messages_sent"] = 'Надіслано'; +$_lang["messages_subject"] = 'Тема'; +$_lang["messages_system_user"] = '[System]'; +$_lang["messages_title"] = 'Повідомлення'; +$_lang["messages_user"] = 'Користувач'; +$_lang["meta_keywords"] = 'Ключові слова'; +$_lang["metatag_intro"] = 'На цій сторінці ви можете створювати/редагувати/вилучати теги META. Щоб прив\'язати теги META до ресурсів, натисніть Ключові слова, коли редагуєте ресурс, і виберіть потрібні ключові слова та теги META. Щоб створити новий тег, введіть його ім\'я та значення та натисніть \'Створити тег\'. Для редагування натисніть назву тега.'; +$_lang["metatag_notice"] = 'Це не повний список можливих мета-тегів. Детальну інформацію щодо використання мета-тегів ви можете отримати тут: HTML Reference Guide.'; +$_lang["metatags"] = 'META-теги'; +$_lang["mgr_access_permissions"] = 'Права доступу менеджерів'; +$_lang["mgr_login_start"] = 'Авторизація менеджера сайту'; +$_lang["mgr_login_start_message"] = 'Введіть ID ресурсу, який ви хочете надіслати користувачеві після авторизації в системі керування сайтом.
    Примітка: переконайтеся, що ID належить існуючому ресурсу, який опубліковано і доступний цьому користувачеві'; +$_lang["mgrlog_action"] = 'Дія:'; +$_lang["mgrlog_actionid"] = 'ID дії:'; +$_lang["mgrlog_anyall"] = 'Будь-яке / Всі'; +$_lang["mgrlog_datecheckfalse"] = 'Функція checkdate() повернула значення false.'; +$_lang["mgrlog_datefr"] = 'Починаючи з дати'; +$_lang["mgrlog_dateinvalid"] = 'Помилковий формат дати.'; +$_lang["mgrlog_dateto"] = 'Закінчуючи датою'; +$_lang["mgrlog_emptysrch"] = 'За вашим запитом нічого не знайдено (немає записів, що відповідають заданим критеріям).'; +$_lang["mgrlog_field"] = 'Поле'; +$_lang["mgrlog_itemid"] = 'ID ресурсу'; +$_lang["mgrlog_itemname"] = 'Назва ресурсу'; +$_lang["mgrlog_msg"] = 'Повідомлення'; +$_lang["mgrlog_noquery"] = 'Ви не ввели запиту. Вкажіть критерії запиту.'; +$_lang["mgrlog_qresults"] = 'Результати запиту'; +$_lang["mgrlog_query"] = 'Протокол запитів до бази'; +$_lang["mgrlog_query_msg"] = 'Будь ласка, вкажіть критерії перегляду записів.

    Примітка: вказаний діапазон дат не включає результати за дату, вказану в полі \'Закінчуючи датою\'. Наприклад, щоб зробити вибірку за 25-12-2018, вкажіть у полі \'Починаючи з дати\' значення 25-12-2018, а в полі \'Закінчуючи датою\' - значення 25-12-2018.

    Повідомлення та дія зазвичай однакові. Якщо ви хочете знайти якесь конкретне повідомлення, зазвичай найкраще встановити дію \'Будь-яке / Все\'.'; +$_lang["mgrlog_results"] = 'Відображати результати порціями'; +$_lang["mgrlog_searchlogs"] = 'Знайти записи протоколу'; +$_lang["mgrlog_sortinst"] = 'Ви можете відсортувати таблицю, вибравши заголовок будь-якої колонки. Якщо записів буде занадто багато, можна очистити протокол. УВАГА: це призведе до видалення всіх записів протоколу до сьогодні!'; +$_lang["mgrlog_time"] = 'Час'; +$_lang["mgrlog_user"] = 'Користувач'; +$_lang["mgrlog_username"] = 'Ім\'я користувача'; +$_lang["mgrlog_value"] = 'Значення'; +$_lang["mgrlog_view"] = 'Перегляд записів протоколу системи управління сайтом'; +$_lang["module_code"] = 'Код модуля (php)'; +$_lang["module_config"] = 'Конфігурація модуля'; +$_lang["module_desc"] = 'Опис'; +$_lang["module_disabled"] = 'Модуль вимкнено'; +$_lang["module_edit_click_title"] = 'Натисніть, щоб редагувати модуль'; +$_lang["module_group_access_msg"] = 'Виберіть групи користувачів, які можуть запускати цей модуль.'; +$_lang["module_management"] = 'Модулі'; +$_lang["module_management_msg"] = 'Модуль - це програма, заснована на архітектурі EVO та розширює можливості системи управління. Модуль може групувати набір елементів (сніпети, чанки, дані), реалізуючи принцип інкапсуляції через поділ інтерфейсу та реалізації.

    Виберіть модуль, який потрібно запустити або змінити, або створіть новий модуль. Для запуску модуля натисніть на значок поруч із його ім\'ям, для редагування модуля натисніть його назву.'; +$_lang["module_msg"] = 'Тут ви можете створювати/редагувати модулі. Модуль - це набір елементів (плагінів, сніппетів тощо).'; +$_lang["module_name"] = 'Назва модуля'; +$_lang["module_resource_msg"] = 'Тут ви можете додати/видалити елементи, від яких залежить цей модуль. Щоб додати новий елемент, натисніть одну з клавіш внизу.'; +$_lang["module_resource_title"] = 'Залежність модуля'; +$_lang["module_title"] = 'Створити/редагувати модуль'; +$_lang["module_viewdepend_msg"] = 'Тут можна переглянути, від яких елементів залежить цей модуль. Щоб змінити залежність, натисніть \'Залежність\'.'; +$_lang["modules"] = 'Модулі'; +$_lang["modx_news"] = 'Новини EVO'; +$_lang["modx_news_tab"] = 'Новини EVO'; +$_lang["modx_news_title"] = 'Новини EVO'; +$_lang["modx_security_notices"] = 'Оповіщення безпеки EVO'; +$_lang["modx_version"] = 'Версія EVO'; +$_lang["monday"] = 'Понеділок'; +$_lang["move"] = 'Перемістити'; +$_lang["move_resource"] = 'Перемістити'; +$_lang["move_resource_message"] = 'Ви можете перемістити ресурс і всі його дочірні ресурси, вибравши новий \'батьківський\' ресурс. Якщо ви виберете як батьківський ресурс, який не є папкою, EVO автоматично зробить його папкою. Виберіть новий \'батьківський ресурс\' у дереві сайту ліворуч.'; +$_lang["move_resource_new_parent"] = 'Виберіть новий \'батьківський\' ресурс у дереві сайту зліва.'; +$_lang["move_resource_title"] = 'Перемістити'; +$_lang["name"] = 'Назва'; +$_lang["new_category"] = 'Нова категорія'; +$_lang["new_file_permissions_message"] = 'При завантаженні нового файлу за допомогою файл-менеджера буде зроблено спробу встановити права на файл відповідно до вказаного тут значення. На деяких системах автоматичне встановлення прав може бути недоступне (зокрема, при використанні IIS) - у такому разі необхідно буде встановити відповідні права вручну.'; +$_lang["new_file_permissions_title"] = 'Права на новий файл:'; +$_lang["new_folder_permissions_message"] = 'Під час створення нової папки за допомогою файл-менеджера буде спроба встановити права на папку відповідно до вказаного тут значення. На деяких системах автоматичне встановлення прав може бути недоступне (зокрема, при використанні IIS) - у такому разі необхідно буде встановити відповідні права вручну.'; +$_lang["new_folder_permissions_title"] = 'Права на нову папку:'; +$_lang["new_htmlsnippet"] = 'Новий чанк'; +$_lang["new_keyword"] = 'Додати ключове слово:'; +$_lang["new_module"] = 'Новий модуль'; +$_lang["new_parent"] = 'Новий батьківський ресурс'; +$_lang["new_plugin"] = 'Новий плагін'; +$_lang["new_role"] = 'Нова роль'; +$_lang["new_snippet"] = 'Новий сніпет'; +$_lang["new_template"] = 'Новий шаблон'; +$_lang["new_tmplvars"] = 'Новий параметр (TV)'; +$_lang["new_user"] = 'Новий користувач'; +$_lang["new_web_user"] = 'Новий веб-користувач'; +$_lang["new_resource"] = 'Новий ресурс'; +$_lang["no"] = 'Ні'; +$_lang["no_active_users_found"] = 'Не знайдено активних користувачів.'; +$_lang["no_activity_message"] = 'Ви не створили або не редагували жодного ресурсу.'; +$_lang["no_category"] = 'Без категорії'; +$_lang["no_docs_pending_publishing"] = 'Немає ресурсів, які чекають на публікацію.'; +$_lang["no_docs_pending_pubunpub"] = 'Події не знайдені.'; +$_lang["no_docs_pending_unpublishing"] = 'Немає ресурсів, які чекають на скасування публікації.'; +$_lang["no_edits_creates"] = 'Створених або редагованих ресурсів не виявлено.'; +$_lang["no_groups_found"] = 'Груп не знайдено.'; +$_lang["no_keywords_found"] = 'Ключових слів немає.'; +$_lang["no_records_found"] = 'Не знайдено записів.'; +$_lang["no_results"] = 'Нічого не знайдено'; +$_lang["nologentries_message"] = 'Виберіть кількість записів протоколу на сторінці під час перегляду.'; +$_lang["nologentries_title"] = 'Кількість записів протоколу:'; +$_lang["nomessages_message"] = 'Виберіть кількість повідомлень на сторінці під час їх перегляду.'; +$_lang["nomessages_title"] = 'Кількість повідомлень:'; +$_lang["none"] = 'Ні'; +$_lang["noresults_message"] = 'Введіть кількість елементів, що відображаються у списках та результатах пошуку.'; +$_lang["noresults_title"] = 'Кількість результатів:'; +$_lang["not_deleted"] = 'не видалено.'; +$_lang["not_set"] = 'немає даних'; +$_lang["offline"] = 'Оффлайн'; +$_lang["online"] = 'Онлайн'; +$_lang["onlineusers_action"] = 'Дія'; +$_lang["onlineusers_actionid"] = 'ID дії'; +$_lang["onlineusers_ipaddress"] = 'IP-адреса відвідувача сайту'; +$_lang["onlineusers_lasthit"] = 'Момент останньої дії'; +$_lang["onlineusers_message"] = 'Цей список показує всіх користувачів, активних протягом останніх 20 хвилин (поточний час - '; +$_lang["onlineusers_title"] = 'Користувачі онлайн'; +$_lang["onlineusers_user"] = 'Користувач'; +$_lang["onlineusers_userid"] = 'ID користувача'; +$_lang["optimize_table"] = 'Натисніть, щоб оптимізувати таблицю'; +$_lang["page_data_alias"] = 'Псевдонім'; +$_lang["page_data_cacheable"] = 'Кешований'; +$_lang["page_data_cacheable_help"] = 'Позначте, щоб дозволити кешування ресурсу. Будьте уважні в тому випадку, якщо ресурс містить виклики сніпетів - можливо, краще скасувати кешування.'; +$_lang["page_data_cached"] = 'Код взятий із кешу:'; +$_lang["page_data_changes"] = 'Створення та зміна'; +$_lang["page_data_contentType"] = 'Тип вмісту'; +$_lang["page_data_contentType_help"] = 'Виберіть тип вмісту ресурсу. Якщо ви не впевнені, який тип даних повинен бути у ресурсу, залиште text/html.'; +$_lang["page_data_created"] = 'Створено'; +$_lang["page_data_edited"] = 'Редагувався'; +$_lang["page_data_editor"] = 'Використовувати HTML-редактор'; +$_lang["page_data_folder"] = 'Ресурс є контейнером'; +$_lang["page_data_general"] = 'Загальні'; +$_lang["page_data_markup"] = 'Розмітка/структура'; +$_lang["page_data_mgr_access"] = 'Менеджерський доступ'; +$_lang["page_data_notcached"] = 'Ресурс ще не кешувався.'; +$_lang["page_data_publishdate"] = 'Дата публікації'; +$_lang["page_data_publishdate_help"] = 'Якщо ви встановите дату публікації, ресурс буде опубліковано після настання цієї дати. Натисніть значок календаря, щоб вибрати дату, або значок поряд, щоб видалити дату публікації. Це означатиме, що ресурс не буде публікуватися автоматично.'; +$_lang["page_data_published"] = 'Опубліковано'; +$_lang["page_data_searchable"] = 'Доступний для пошуку'; +$_lang["page_data_searchable_help"] = 'Позначте, щоб дозволити пошук у вмісті цього ресурсу (внутрішньою пошуковою машиною). Цей параметр також можна використовувати при розробці сніпетів.'; +$_lang["page_data_source"] = 'Код'; +$_lang["page_data_status"] = 'Статус'; +$_lang["page_data_template"] = 'Шаблон'; +$_lang["page_data_template_help"] = 'Тут можна вказати, який шаблон має використовувати ресурс. Виберіть (blank), якщо хочете, щоб ресурс не використовував жодних шаблонів (рекомендується для порожніх ресурсів, що виконують роль контейнера).'; +$_lang["page_data_title"] = 'Дані ресурсу (сторінки)'; +$_lang["page_data_unpublishdate"] = 'Дата скасування публікації'; +$_lang["page_data_unpublishdate_help"] = 'Якщо ви встановите дату скасування публікації, ресурс буде знято з публікації після настання цієї дати. Натисніть значок календаря, щоб вибрати дату, або значок поряд, щоб видалити дату скасування публікації. Це означатиме, що ресурс не буде знято з публікації автоматично.'; +$_lang["page_data_unpublished"] = 'Не опубліковано'; +$_lang["page_data_web_access"] = 'Веб-доступ'; +$_lang["pagetitle"] = 'Заголовок ресурсу'; +$_lang["pagination_table_first"] = 'Перший'; +$_lang["pagination_table_gotopage"] = 'Перейти на'; +$_lang["pagination_table_last"] = 'Останній'; +$_lang["paging_first"] = 'На початок'; +$_lang["paging_last"] = 'Наприкінці'; +$_lang["paging_next"] = 'Далі'; +$_lang["paging_prev"] = 'Назад'; +$_lang["paging_showing"] = 'Відображаються записи з'; +$_lang["paging_to"] = 'по'; +$_lang["paging_total"] = 'всього'; +$_lang["parameter"] = 'Параметр'; +$_lang["parse_docblock"] = 'Аналізувати DocBlock'; +$_lang["parse_docblock_msg"] = 'Увага (!): Скидання актуального імені, конфігурації, опису та категорії для встановлення дефолту шляхом аналізу вихідного коду.'; +$_lang["password"] = 'Пароль'; +$_lang["password_change_request"] = 'Запит на зміну пароля'; +$_lang["password_gen_gen"] = 'Дозволити EVO згенерувати пароль.'; +$_lang["password_gen_length"] = 'Пароль повинен містити мінімум 6 символів.'; +$_lang["password_gen_method"] = 'Спосіб завдання нового пароля'; +$_lang["password_gen_specify"] = 'Я сам задам пароль:'; +$_lang["password_method"] = 'Спосіб сповіщення про новий пароль'; +$_lang["password_method_email"] = 'Надіслати новий пароль по e-mail.'; +$_lang["password_method_screen"] = 'Показати новий пароль на екрані.'; +$_lang["password_msg"] = 'Для користувача %s задано новий пароль - %s
    '; +$_lang["php_version_check"] = 'Система EVO працює з PHP версії 5.6.0 або вищою. Будь ласка, оновіть PHP'; +$_lang["plugin"] = 'Плагін'; +$_lang["plugins"] = 'Плагіни'; +$_lang["plugin_code"] = 'Код плагіна (php)'; +$_lang["plugin_config"] = 'Конфігурація плагіна'; +$_lang["plugin_desc"] = 'Опис'; +$_lang["plugin_disabled"] = 'Плагін вимкнено'; +$_lang["plugin_event_msg"] = 'Виберіть події, які слід відстежувати плагін.'; +$_lang["plugin_management_msg"] = 'Плагіни - це інтерактивні PHP-скрипти, що запускаються при настанні події, яку вони відстежують.

    Виберіть плагін для редагування або створіть новий. Також ви можете встановити порядок виклику плагінів при настанні подій, які вони обробляють.'; +$_lang["plugin_msg"] = 'Тут можна створити / відредагувати плагін.'; +$_lang["plugin_name"] = 'Назва плагіна'; +$_lang["plugin_priority"] = 'Редагувати порядок виклику плагінів'; +$_lang["plugin_priority_instructions"] = 'Перетягніть мишею для визначення порядку виконання плагінів для кожної події. Спочатку виконується перший у списку плагін.'; +$_lang["plugin_priority_title"] = 'Порядок виклику плагінів'; +$_lang["purge_plugin"] = 'Видалення старих плагінів'; +$_lang["purge_plugin_confirm"] = 'Ви дійсно хочете видалити застарілі плагіни?'; +$_lang["plugin_title"] = 'Створити/редагувати плагін'; +$_lang["preview"] = 'Перегляд'; +$_lang["preview_msg"] = 'Перегляд останніх змін. Зберегти та оновити останні зміни'; +$_lang["preview_resource"] = 'Перегляд'; +$_lang["private"] = 'Особистий'; +$_lang["public"] = 'Доступний для всіх'; +$_lang["publish_date"] = 'Дата публікації'; +$_lang["publish_events"] = 'Події, пов\'язані з публікацією ресурсів.'; +$_lang["publish_resource"] = 'Опублікувати'; +$_lang["rb_base_dir_message"] = 'Введіть шлях до папки файлів. Зазвичай, цей шлях встановлюється автоматично. Якщо ви використовуєте сервер IIS, цього може статися. У такому разі введіть шлях, як він відображається в адресному рядку Internet Explorer.
    Примітка: для коректної роботи браузера папка файлів повинна містити вкладені папки: images, files, flash та media.'; +$_lang["rb_base_dir_title"] = 'Шлях до файлів:'; +$_lang["rb_base_url_message"] = 'Введіть адресу (URL) папки файлів. Зазвичай, цей шлях встановлюється автоматично. Якщо ви використовуєте сервер IIS, цього може не статися. У такому разі введіть шлях, як він відображається в Internet Explorer.'; +$_lang["rb_base_url_title"] = 'URL до файлів:'; +$_lang["rb_message"] = 'Виберіть \'Так\', щоб увімкнути браузер файлів. Це дозволить менеджерам завантажувати файли (зображення, медіа-файли) на сервер.'; +$_lang["rb_title"] = 'Увімкнути файл-менеджер:'; +$_lang["rb_webuser_message"] = 'Чи хочете, щоб веб-користувачі використовували файл-менеджер? Примітка: Дозволяючи веб-користувачам використовувати файл-менеджер, ви робите доступ для всіх файлів, доступних менеджерам. Використовуйте це налаштування лише для перевірених веб-користувачів.'; +$_lang["rb_webuser_title"] = 'Користувачі?'; +$_lang["recent_docs"] = 'Останні зміни'; +$_lang["recommend_setting_change_title"] = 'Рекомендована зміна налаштування'; +$_lang["recommend_setting_change_description"] = 'Ваш сайт не налаштований на перевірку серверних заголовків HTTP_REFERER у вхідних запитах до системи керування. Ми рекомендуємо включити цей параметр, щоб знизити ризик CSRF (Cross Site Request Forgery - підробка міжсайтових запитів) атак.'; +$_lang["references"] = 'Рекомендації'; +$_lang["refresh_cache"] = 'Кеш: знайдено %s файлів у папці кешування та видалено %d кеш-файлів.

    Нові кеш-файли будуть створені при запити сторінок.'; +$_lang["refresh_published"] = '%s ресурсів опубліковано.'; +$_lang["refresh_site"] = 'Очистити кеш'; +$_lang["refresh_title"] = 'Оновити сайт'; +$_lang["refresh_tree"] = 'Оновити дерево'; +$_lang["refresh_unpublished"] = '%s ресурсів знято з публікації.'; +$_lang["release_date"] = 'Дата випуску'; +$_lang["remember_last_tab"] = 'Запам\'ятовувати вкладки'; +$_lang["remember_last_tab_message"] = 'Відкривається не перша вкладка, а використовувана під час останнього відвідування'; +$_lang["remember_username"] = 'Запам\'ятати мене'; +$_lang["remove"] = 'Видалити'; +$_lang["remove_date"] = 'Видалити дату'; +$_lang["remove_locks"] = 'Видалити блокування'; +$_lang["rename"] = 'Перейменувати'; +$_lang["reports"] = 'Звіти'; +$_lang["report_issues"] = 'Повідомити про проблеми'; +$_lang["require_tagname"] = 'Назва тега обов\'язково'; +$_lang["require_tagvalue"] = 'Значення тега є обов\'язковим'; +$_lang["reserved_name_warning"] = 'Ви використовували зарезервоване ім\'я.'; +$_lang["reset"] = 'Скидання'; +$_lang["reset_failedlogins"] = 'скидання'; +$_lang["reset_sort_order"] = 'Скидання сортування'; +$_lang["resource"] = 'Ресурс'; +$_lang["resource_alias"] = 'Псевдонім'; +$_lang["resource_alias_help"] = 'Тут ви можете вибрати псевдонім для ресурсу. Псевдонім дозволяє звертатися до ресурсу за адресою http://example.com/псевдонім. УВАГА: функція буде працювати тільки при включених \'дружніх URL\'.'; +$_lang["resource_content"] = 'Вміст ресурсу'; +$_lang["resource_description"] = 'Опис'; +$_lang["resource_description_help"] = 'Тут можна ввести опис ресурсу.'; +$_lang["resource_duplicate"] = 'Зробити копію'; +$_lang["resource_long_title_help"] = 'Тут ви можете ввести розширений заголовок вашого ресурсу, що може бути корисним для пошукових систем.'; +$_lang["resource_metatag_help"] = 'Виберіть теги META та ключові слова, які ви бажаєте надати цьому ресурсу. Щоб вибрати кілька ключових слів або МЕТА-тегів, натискайте на них мишкою, утримуючи Ctrl.'; +$_lang["resource_opt_contentdispo"] = 'Місцезнаходження вмісту'; +$_lang["resource_opt_contentdispo_help"] = 'Цей параметр визначає, як браузер повинен обробити ресурс. Щоб ресурс став доступним для завантаження, а не відображався у вікні браузера, виберіть \'Прикріплене\'.'; +$_lang["resource_opt_emptycache"] = 'Очистити кеш'; +$_lang["resource_opt_emptycache_help"] = 'Позначте, щоб очистити кеш після збереження змін цього ресурсу. У цьому випадку відвідувачі побачать нову версію ресурсу.'; +$_lang["resource_opt_folder"] = 'Контейнер (містить дочірні ресурси)'; +$_lang["resource_opt_folder_help"] = 'Позначте, щоб ресурс виконував роль папки (батька) для інших ресурсів. Не варто звертати увагу на цей параметр – EVO автоматично встановить для ресурсу режим папки, якщо всередині нього почнуть створюватися ресурси.'; +$_lang["resource_opt_menu_index"] = 'Позиція в меню'; +$_lang["resource_opt_menu_index_help"] = 'Позиція (індекс) у меню – це порядковий номер ресурсу в меню. Цю величину можна також використовувати у розробці сніпетів.'; +$_lang["resource_opt_menu_title"] = 'Пункт меню'; +$_lang["resource_opt_menu_title_help"] = 'Пункт меню - це параметр, який можна використовувати для відображення короткого заголовка ресурсу в меню.'; +$_lang["resource_opt_published"] = 'Публікувати'; +$_lang["resource_opt_published_help"] = 'Позначте, щоб опублікувати ресурс одразу після збереження.'; +$_lang["resource_opt_richtext"] = 'Використовувати HTML-редактор'; +$_lang["resource_opt_richtext_help"] = 'Позначте, щоб для редагування ресурсу використовувався HTML-редактор. Якщо ресурс містить JavaScript або форми - зніміть галочку, щоб редагувати його в режимі HTML-коду (щоб HTML-редактор не вносив жодних змін до коду).'; +$_lang["resource_opt_show_menu"] = 'Показувати в меню'; +$_lang["resource_opt_show_menu_help"] = 'Увімкніть цей параметр для відображення ресурсу в будь-якому меню сайту. Майте на увазі, що деякі сніпети можуть ігнорувати цей параметр.'; +$_lang["resource_opt_trackvisit_help"] = 'Позначте, щоб показувати дочірні ресурси у дереві документів'; +$_lang["resource_overview"] = 'Огляд ресурсу'; +$_lang["resource_parent"] = 'Папка'; +$_lang["resource_parent_help"] = 'Клацніть мишею на піктограмі контейнера вгорі, щоб увімкнути (вимкнути) режим вибору батьківського ресурсу, потім виберіть його в дереві сайту ліворуч.'; +$_lang["resource_permissions_error"] = 'Зв\'яжіть цей ресурс принаймні з однією групою ресурсів, до якої ви маєте доступ.'; +$_lang["resource_setting"] = 'Налаштування ресурсу'; +$_lang["resource_summary"] = 'Анотація (введення)'; +$_lang["resource_summary_help"] = 'Введіть короткий опис ресурсу'; +$_lang["resource_title"] = 'Заголовок'; +$_lang["resource_title_help"] = 'Введіть ім\'я/заголовок ресурсу. Небажано використовувати зворотний слеш (\)'; +$_lang["resource_to_be_moved"] = 'Переміщуваний ресурс'; +$_lang["resource_type"] = 'Тип ресурсу'; +$_lang["resource_type_message"] = 'Веб-посилання на ресурс в Інтернеті, включаючи інші ресурси EVO, зовнішні веб-сторінки, зображення або інші файли в Інтернеті. Для ресурсу повинен бути заданий тип вмісту text/html, а місцезнаходження вмісту - відображається.'; +$_lang["resource_type_weblink"] = 'Веб-посилання'; +$_lang["resource_type_webpage"] = 'Веб-сторінка'; +$_lang["resource_weblink_help"] = 'Введіть адресу (URI) об\'єкта в мережі, на яку має вказувати веб-посилання.'; +$_lang["resources_in_container"] = '- кількість ресурсів у контейнері'; +$_lang["resources_in_container_no"] = 'Поточний контейнер не містить дочірніх ресурсів.'; +$_lang["role"] = 'Роль'; +$_lang["role_about"] = 'Перегляд інформації про систему'; +$_lang["role_access_persmissions"] = 'Менеджерський доступ'; +$_lang["role_actionok"] = 'Перегляд сторінки підтвердження завершення дії'; +$_lang["role_assets_images"] = 'Доступ до assets/images'; +$_lang["role_assets_files"] = 'Доступ до assets/files'; +$_lang["role_bk_manager"] = 'Використовувати резервне копіювання'; +$_lang["role_cache_refresh"] = 'Очищення кешу'; +$_lang["role_category_manager"] = 'Використовувати менеджер категорій'; +$_lang["role_change_password"] = 'Зміна пароля'; +$_lang["role_change_resourcetype"] = 'Зміна типу ресурсу'; +$_lang["role_chunk_management"] = 'Чанки'; +$_lang["role_config_management"] = 'Зміна конфігурації'; +$_lang["role_content_management"] = 'Вміст'; +$_lang["role_create_chunk"] = 'Створення нових чанків'; +$_lang["role_create_doc"] = 'Створення нових ресурсів'; +$_lang["role_create_plugin"] = 'Створення нових плагінів'; +$_lang["role_create_snippet"] = 'Створення нових сніпетів'; +$_lang["role_create_template"] = 'Створення нових шаблонів'; +$_lang["role_credits"] = 'Перегляд списку розробників'; +$_lang["role_delete_chunk"] = 'Видалення чанків'; +$_lang["role_delete_doc"] = 'Видалення ресурсів'; +$_lang["role_delete_eventlog"] = 'Видалення протоколу подій'; +$_lang["role_delete_module"] = 'Видалення модулів'; +$_lang["role_delete_plugin"] = 'Видалення плагінів'; +$_lang["role_delete_role"] = 'Видалення ролей'; +$_lang["role_delete_snippet"] = 'Видалення сніпетів'; +$_lang["role_delete_template"] = 'Видалення шаблонів'; +$_lang["role_delete_user"] = 'Видалення користувачів'; +$_lang["role_delete_web_user"] = 'Видалення веб-користувачів'; +$_lang["role_edit_chunk"] = 'Редагування чанків'; +$_lang["role_edit_doc"] = 'Редагування ресурсів'; +$_lang["role_edit_doc_metatags"] = 'Редагувати META-теги та ключові слова'; +$_lang["role_edit_module"] = 'Редагування модулів'; +$_lang["role_edit_plugin"] = 'Редагування плагінів'; +$_lang["role_edit_role"] = 'Редагування ролей'; +$_lang["role_edit_settings"] = 'Змінювати конфігурацію сайту'; +$_lang["role_edit_snippet"] = 'Редагування сніпетів'; +$_lang["role_edit_template"] = 'Редагування шаблонів'; +$_lang["role_edit_user"] = 'Редагування користувачів'; +$_lang["role_edit_web_user"] = 'Редагування веб-користувачів'; +$_lang["role_empty_trash"] = 'Очищення кошика'; +$_lang["role_errors"] = 'Перегляд діалогу помилки'; +$_lang["role_eventlog_management"] = 'Протокол подій'; +$_lang["role_export_static"] = 'Експорт статичних сторінок в HTML'; +$_lang["role_file_management"] = 'Файли'; +$_lang["role_file_manager"] = 'Використання файл-менеджера'; +$_lang["role_frames"] = 'Запит менеджерських кадрів'; +$_lang["role_help"] = 'Перегляд сторінок допомоги'; +$_lang["role_home"] = 'Запит на вхідну сторінку менеджера'; +$_lang["role_import_static"] = 'Імпорт HTML'; +$_lang["role_logout"] = 'Вихід із системи управління'; +$_lang["role_manage_metatags"] = 'META-теги та ключові слова'; +$_lang["role_management_msg"] = 'Роль - це набір прав здійснювати певні дії. Ролі призначаються користувачам. Типові ролі:

    • Адміністратори сайту - керують користувачами та загальними налаштуваннями;
    • Розробники - пишуть код і, відповідно, мають набір прав на створення / редагування / видалення модулів, плагінів, сніппетів< /i>, чанків, параметрів (TV);
    • Дизайнери - відповідають за зовнішній вигляд та верстку сторінок сайту, мають набір прав на створення / редагування / видалення шаблонів та чанків;
    • Редактори - відповідають за зміст сторінок сайту, створюють, редагують та видаляють ресурси;
    • Коректори - читають та коригують ресурси, але не мають прав на їх створення та видалення; >Головний редактор - приймає рішення про публікацію нових ресурсів, керує розкладом публікації.

    Виберіть роль для редагування або створіть нову роль.'; +$_lang["role_management_title"] = 'Ролі'; +$_lang["role_messages"] = 'Читати та надсилати повідомлення'; +$_lang["role_module_management"] = 'Модулі'; +$_lang["role_name"] = 'Назва ролі'; +$_lang["role_new_module"] = 'Створення нових модулів'; +$_lang["role_new_role"] = 'Створення нових ролей'; +$_lang["role_new_user"] = 'Створення нових користувачів'; +$_lang["role_new_web_user"] = 'Створення веб-користувачів'; +$_lang["role_plugin_management"] = 'Плагіни'; +$_lang["role_publish_doc"] = 'Публікація ресурсів'; +$_lang["role_remove_locks"] = 'Видалити блокування'; +$_lang["role_role_management"] = 'Ролі'; +$_lang["role_run_module"] = 'Запуск модулів'; +$_lang["role_save_chunk"] = 'Збереження чанків'; +$_lang["role_save_doc"] = 'Збереження ресурсів'; +$_lang["role_save_module"] = 'Збереження модулів'; +$_lang["role_save_password"] = 'Збереження пароля'; +$_lang["role_save_plugin"] = 'Збереження плагінів'; +$_lang["role_save_role"] = 'Збереження ролей'; +$_lang["role_save_snippet"] = 'Збереження сніпетів'; +$_lang["role_save_template"] = 'Збереження шаблонів'; +$_lang["role_save_user"] = 'Збереження користувачів'; +$_lang["role_save_web_user"] = 'Збереження веб-користувачів'; +$_lang["role_snippet_management"] = 'Сніппети'; +$_lang["role_template_management"] = 'Шаблони'; +$_lang["role_title"] = 'Створити/редагувати роль'; +$_lang["role_udperms"] = 'Доступ'; +$_lang["role_user_management"] = 'Користувачі'; +$_lang["role_view_docdata"] = 'Перегляд інформації про ресурс'; +$_lang["role_view_eventlog"] = 'Перегляд протоколу подій'; +$_lang["role_view_logs"] = 'Перегляд системного протоколу'; +$_lang["role_view_unpublished"] = 'Перегляд неопублікованих ресурсів'; +$_lang["role_web_access_persmissions"] = 'Права веб-доступу'; +$_lang["role_web_user_management"] = 'Веб-користувачі'; +$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news'; +$_lang["rss_url_news_message"] = 'Введіть адресу (URL) RSS-стрічки новин EVO.'; +$_lang["rss_url_news_title"] = 'Лента RSS новин'; +$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news'; +$_lang["rss_url_security_message"] = 'Введіть адресу (URL) RSS-стрічки безпеки EVO.'; +$_lang["rss_url_security_title"] = 'Стрічка RSS безпеки'; +$_lang["run_module"] = 'Запуск модуля'; +$_lang["saturday"] = 'Субота'; +$_lang["save"] = 'Зберегти'; +$_lang["save_all_changes"] = 'Зберегти зміни'; +$_lang["save_tag"] = 'Зберегти тег'; +$_lang["saving"] = 'Збереження ресурсу, зачекайте, будь ласка...'; +$_lang["search"] = 'Пошук'; +$_lang["search_criteria"] = 'Критерій пошуку'; +$_lang["search_criteria_content"] = 'Шукати у вмісті'; +$_lang["search_criteria_content_msg"] = 'Знайти всі ресурси, які містять введений текст у своєму тілі.'; +$_lang["search_criteria_id"] = 'Шукати за ID'; +$_lang["search_criteria_id_msg"] = 'Введіть ID ресурсу, щоб швидко знайти його.'; +$_lang["search_criteria_top"] = 'Шукати за основними полями'; +$_lang["search_criteria_top_msg"] = 'Заголовок, Розширений заголовок, Псевдонім, ID'; +$_lang["search_criteria_template_id"] = 'Шукати за ID шаблоном'; +$_lang["search_criteria_template_id_msg"] = 'Знайти всі документи, що використовують вказаний шаблон.'; +$_lang["search_criteria_url_msg"] = 'Знайти ресурс по повному URL або ID.'; +$_lang["search_criteria_longtitle"] = 'Шукати в розширених заголовках'; +$_lang["search_criteria_longtitle_msg"] = 'Знайти всі ресурси, які містять текст у розширених заголовках.'; +$_lang["search_criteria_title"] = 'Шукати в заголовках'; +$_lang["search_criteria_title_msg"] = 'Знайти всі ресурси, які містять введений текст у заголовку.'; +$_lang["search_empty"] = 'На ваш запит нічого не знайдено. Спробуйте розширити критерій пошуку.'; +$_lang["search_item_deleted"] = 'Видалено'; +$_lang["search_results"] = 'Результати пошуку'; +$_lang["search_results_returned_desc"] = 'Опис'; +$_lang["search_results_returned_id"] = 'ID'; +$_lang["search_results_returned_msg"] = 'За вашим запитом знайдено %s ресурсів. Якщо знайдено дуже багато ресурсів, спробуйте сформувати більш специфічний запит. Дві крайні колонки зліва дозволять знайти ресурс у дереві сайту або переглянути ресурс. Дві крайні колонки справа показують, відповідно, чи був ресурс позначений видалення і чи опублікований он.'; +$_lang["search_results_returned_title"] = 'Заголовок'; +$_lang["search_view_docdata"] = 'Переглянути'; +$_lang["security"] = 'Менеджери'; +$_lang["security_notices_tab"] = 'Повіщення безпеки'; +$_lang["security_notices_title"] = 'Повіщення безпеки'; +$_lang["select_date"] = 'Вибрати дату'; +$_lang["send"] = 'Надіслати'; +$_lang["server_protocol_http"] = 'http'; +$_lang["server_protocol_https"] = 'https'; +$_lang["server_protocol_message"] = 'Якщо ваш сайт використовує https-з\'єднання, вкажіть це тут.'; +$_lang["server_protocol_title"] = 'Тип сервера:'; +$_lang["serveroffset"] = 'Поправка часу на сервері'; +$_lang["serveroffset_message"] = 'Виберіть поправку (кількість годин) між часом на місці вашого перебування та на місці знаходження сервера. Поточний час на сервері - [%s], поточний час на сервері з урахуванням тимчасової зміни - [%s].'; +$_lang["serveroffset_title"] = 'Різниця в часі:'; +$_lang["servertime"] = 'Час на сервері'; +$_lang["set_automatic"] = 'Автоматично'; +$_lang["set_default"] = 'За замовчуванням'; +$_lang["set_default_all"] = 'Все за замовчуванням'; +$_lang["settings_after_install"] = 'Оскільки ви щойно встановили систему, слід встановити основні налаштування. Внесіть бажані зміни і натисніть \'Зберегти\' для набуття чинності.

    '; +$_lang["settings_config"] = 'Конфігурація'; +$_lang["settings_dependencies"] = 'Залежності'; +$_lang["settings_events"] = 'Системні події'; +$_lang["settings_furls"] = 'Дружні URL'; +$_lang["settings_general"] = 'Загальні'; +$_lang["settings_group_tv_message"] = 'Виберіть тип групування параметрів TV під час редагування документа.'; +$_lang["settings_group_tv_options"] = 'Ні,Секціями на вкладці Загальні,Табами на вкладці Загальні,Секціями на новій вкладці,Табами на новій вкладці,На нових вкладках'; +$_lang["settings_misc"] = 'Файл-менеджер'; +$_lang["settings_security"] = 'Безпека'; +$_lang["settings_KC"] = 'Файл-браузер'; +$_lang["settings_page_settings"] = 'Налаштування сторінки'; +$_lang["settings_photo"] = 'Фото'; +$_lang["settings_properties"] = 'Властивості'; +$_lang["show_fullscreen_btn_message"] = 'Показувати на головному меню кнопку \'На весь екран\''; +$_lang["show_newresource_btn_message"] = 'Показувати на головному меню кнопку \'Новий ресурс\''; +$_lang["settings_show_picker_message"] = 'Налаштувати тему панелі адміністрування та зберегти в localstorage'; +$_lang["show_fullscreen_btn"] = 'Кнопка \'На весь екран\''; +$_lang["show_newresource_btn"] = 'Кнопка \'Новий ресурс\''; +$_lang["settings_site"] = 'Сайт'; +$_lang["settings_strip_image_paths_message"] = 'Якщо встановлено значення \'Ні\', EVO буде використовувати абсолютні посилання для зображень, файлів, анімація тощо. Відносні посилання є зручнішими, якщо ви в майбутньому збираєтеся перемістити свій сайт, наприклад, з тестового сервера на кінцевий. Якщо ви не знаєте, про що йдеться, залиште значення \'Так\'.'; +$_lang["settings_strip_image_paths_title"] = 'Переписувати шляхи для браузера?'; +$_lang["settings_templvars"] = 'Параметри (TV)'; +$_lang["settings_title"] = 'Системна конфігурація'; +$_lang["settings_ui"] = 'Інтерфейс та уявлення'; +$_lang["settings_users"] = 'Користувачі'; +$_lang["show_meta"] = 'Показувати вкладку з META-тегами та ключовими словами'; +$_lang["show_meta_message"] = 'Показувати нерекомендовану вкладку з META-тегами та ключовими словами під час редагування ресурсів.'; +$_lang["show_tree"] = 'Показати дерево'; +$_lang["show_picker"] = 'Показати перемикач кольору'; +$_lang["showing"] = 'Показано'; +$_lang["signupemail_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься менеджерам, коли створюється обліковий запис нового менеджера. Лист повинен містити ім\'я користувача та пароль.
    Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа:

    [+sname+] - назва сайту ,
    [+saddr+] - e-mail адреса сайту,
    [+surl+] - адреса (URL) сайту,
    [+uid+] – ім\'я користувача або id користувача,
    [+pwd+] - пароль користувача,
    [+ufn+] - повне ім\'я користувача.

    Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається про своє ім\'я користувача та пароль'; +$_lang["signupemail_title"] = 'Реєстрація менеджера:'; +$_lang["site"] = 'Сайт'; +$_lang["site_schedule"] = 'Розклад сайту'; +$_lang["sitename_message"] = 'Введіть заголовок вашого сайту.'; +$_lang["sitename_title"] = 'Заголовок сайту:'; +$_lang["sitestart_message"] = 'Введіть ID ресурсу, який ви хочете використовувати як стартову (домашню) сторінку.
    Примітка: переконайтеся, що цей ID належить існуючому ресурсу і що цей ресурс опубліковано'; +$_lang["sitestart_title"] = 'Перша сторінка:'; +$_lang["sitestatus_message"] = 'Виберіть \'Онлайн\' для опублікування вашого сайту. Якщо ви оберете \'Оффлайн\', відвідувачі сайту побачать повідомлення про недоступність сайту та не зможуть переглянути сам сайт.'; +$_lang["sitestatus_title"] = 'Статус сайту:'; +$_lang["siteunavailable_message"] = 'Повідомлення, що відображається у разі недоступності сайту (коли вибрано статус \'Оффлайн\') або у разі виникнення помилки.
    Примітка: це повідомлення виводиться лише в тому випадку, якщо не вибрано сторінку \'Сайт недоступний\'.'; +$_lang["siteunavailable_message_default"] = 'В даний час сайт недоступний.'; +$_lang["siteunavailable_page_message"] = 'Введіть ID ресурсу, який повинні будуть побачити відвідувачі, якщо спробують зайти на сайт, коли він недоступний.
    Примітка: переконайтеся, що цей ID належить існуючому ресурсу , та що цей ресурс опубліковано'; +$_lang["siteunavailable_page_title"] = 'Сторінка \'Сайт недоступний\':'; +$_lang["siteunavailable_title"] = 'Повідомлення про недоступність сайту:'; +$_lang["snippet"] = 'Сніппет'; +$_lang["snippets"] = 'Сніппети'; +$_lang["snippet_code"] = 'Код сніпету (php)'; +$_lang["snippet_desc"] = 'Опис'; +$_lang["snippet_execonsave"] = 'Виконати сніпет після збереження'; +$_lang["snippet_management_msg"] = 'Сніппети - це чистий PHP-код, що забезпечує динамічну логіку. Сніппети дозволяють відокремити бізнес-логіку від структури та представлення даних на веб-сторінці. Вони можуть використовуватися для генерації динамічних меню, виведення контенту з бази даних за певною умовою (наприклад, тільки для зареєстрованих користувачів), взагалі для будь-яких дій, доступних через EVO API. Сніпети можуть (але не зобов\'язані) приймати параметри та виводити будь-який результат (наприклад, генерувати HTML-код).

    Використання: вставте [[snippetName]]< /code> або [!snippetName!] де-небудь у шаблоні, у області контенту, у чанці або у параметрі (TV). Формат [[snippetName]] дозволяє кешувати результати виконання сніпету, якщо для сторінки включено кешування. Формат [!snippetName!] використовується для виконання PHP-коду сніпету при кожному перегляді сторінки, навіть якщо для сторінки дозволено кешування. Щоб під час виклику PHP-коду сніпета передати параметри, використовуйте формат [[snippetName? &param1=\'value1\' &param2=\'value2\' .. &paramN=\'valueN\']] (або [!snippetName? &param1=\' value1\' &param2=\'value2\' .. &paramN=\'valueN\'!]). В якості параметрів виклику сніпету можна використовувати виклик інших сніпетів (також з параметрами) або чанків.

    Виклик через EVO API: $modx->runSnippet(\'snippetName\');


    Виберіть сніпет для редагування або створіть новий.'; +$_lang["snippet_msg"] = '

    Тут можна створити або відредагувати сніпет. Код сніпету повинен починатися з <?php

    Пам\'ятайте, сніпети - це чистий PHP-код, і якщо ви хочете вивести дані сніпета в певному місці в шаблоні, вам необхідно повертати дані із самого сніппета.

    '; +$_lang["snippet_name"] = 'Назва сніпета'; +$_lang["snippet_properties"] = 'Настройки за замовчуванням'; +$_lang["snippet_title"] = 'Створити/редагувати сніпет'; +$_lang["sort_alphabetically"] = 'Сортувати за алфавітом'; +$_lang["sort_asc"] = 'За зростанням'; +$_lang["sort_desc"] = 'За спаданням'; +$_lang["sort_menuindex"] = 'Сортувати за позицією в меню'; +$_lang["sort_tree"] = 'Сортувати дерево'; +$_lang['sort_updating'] = 'Оновлення...'; +$_lang['sort_updated'] = 'Оновлено!'; +$_lang['sort_nochildren'] = 'Документ не містить дочірніх документів'; +$_lang["sort_elements_msg"] = 'Перетягніть, щоб змінити порядок вибраних елементів.'; +$_lang["source"] = 'Код'; +$_lang["stay"] = 'Продовжити'; +$_lang["stay_new"] = 'Створити новий'; +$_lang["submit"] = 'Виконати'; +$_lang["sunday"] = 'Неділя'; +$_lang["sys_alert"] = 'Системне попередження'; +$_lang["sysinfo_activity_message"] = 'Цей список показує останні створені/відредаговані ресурси.'; +$_lang["sysinfo_userid"] = 'Користувач'; +$_lang["system"] = 'Службове'; +$_lang["system_email_signup"] = 'Здрастуйте, [+uid+]! + +Ваші дані для авторизації в системі керування сайтом [+sname+]: + +Ім\'я користувача: [+uid+] +Пароль: [+pwd+] + +Після успішної авторизації в системі керування сайтом ([+surl+]), ви зможете змінити свій пароль. + +З повагою адміністрація'; +$_lang["system_email_webreminder"] = 'Здрастуйте, [+uid+]! + +Щоб активувати новий пароль, перейдіть за наступним посиланням: + +[+surl+] + +Пізніше ви зможете використовувати наступний пароль для авторизації: [+ pwd+] + +Якщо цей лист прийшов до вас помилково, будь ласка, проігноруйте його. + +З повагою адміністрація'; +$_lang["system_email_websignup"] = 'Здрастуйте, [+uid+]! + +Ваші дані для авторизації на [+sname+]: + +Ім\'я користувача: [+uid+] +Пароль: [+pwd+] + +Після успішної авторизації на [+sname+] ([+surl+]), ви зможете змінити свій пароль. + +З повагою адміністрація'; +$_lang["table_hoverinfo"] = 'Затримайте вказівник миші над рядком таблиці, щоб побачити коротке пояснення призначення таблиці (коментарі є не всі таблиці).'; +$_lang["table_prefix"] = 'Префікс таблиць бази даних'; +$_lang["tag"] = 'Тег'; +$_lang["template"] = 'Шаблон'; +$_lang["templates"] = 'Шаблони'; +$_lang["template_assignedtv_tab"] = 'Призначені параметри (TV)'; +$_lang["template_code"] = 'Код шаблону (HTML)'; +$_lang["template_desc"] = 'Опис'; +$_lang["template_edit_tab"] = 'Редагувати шаблон'; +$_lang["template_management_msg"] = 'Шаблони - це (X)HTML-розмітка сторінок сайту. Шаблон описує структуру та дизайн відображення елементів сторінки (статичних та генерованих). Шаблон може містити виклики сніппетів, чанків, параметрів (TV), а також посилання на CSS-файли та інші об\'єкти, що визначають візуальне відображення сторінки та її елементів.

    Використання: призначте шаблон будь-якому ресурсу.


    Виберіть шаблон для редагування або створіть новий.'; +$_lang["template_msg"] = 'Тут можна створити / відредагувати шаблон.'; +$_lang["template_name"] = 'Ім\'я шаблону'; +$_lang["template_no_tv"] = 'Цему шаблону не надано жодних параметрів (TV).'; +$_lang["template_notassigned_tv"] = 'Ці TV доступні для вибору.'; +$_lang["template_reset_all"] = 'Скинути всі шаблони (буде встановлено шаблон за замовчуванням)'; +$_lang["template_reset_specific"] = 'Скинути лише сторінки із шаблоном %s'; +$_lang["template_selectable"] = 'Шаблон вибирається під час створення або редагування ресурсів.'; +$_lang["template_title"] = 'Створити/редагувати шаблон'; +$_lang["template_tv_edit"] = 'Редагувати порядок TV'; +$_lang["template_tv_edit_message"] = 'Перетягніть мишею для зміни порядку параметрів (TV) для цього шаблону.'; +$_lang["template_tv_edit_title"] = 'Порядок сортування параметрів (TV)'; +$_lang["template_tv_msg"] = 'Наведені нижче параметри (TV) призначені для цього шаблону.'; +$_lang["thursday"] = 'Четвер'; +$_lang["tmplvar_access_msg"] = 'Виберіть групи ресурсів, в яких можна змінити цей Додатковий Параметр (TV)'; +$_lang["tmplvar_change_template_msg"] = 'Зміна шаблону спричинить перезавантаження сторінки. Усі незбережені зміни будуть втрачені. \n\nВи впевнені, що хочете змінити шаблон?'; +$_lang["tmplvar_inuse"] = 'Цей параметр (TV) використовують наступні шаблони. Щоб продовжити процес видалення, натисніть \'Видалити\', для скасування - натисніть \'Скасувати\'.'; +$_lang["tmplvar_tmpl_access"] = 'Доступ шаблонів'; +$_lang["tmplvar_tmpl_access_msg"] = 'Вкажіть шаблони, які можуть використовувати цей параметр (TV)'; +$_lang["tmplvar"] = 'Додаткові поля'; +$_lang["tmplvars"] = 'Параметри (TV)'; +$_lang["tmplvars_binding_msg"] = 'Це поле підтримує прив\'язку даних з використанням @-команд'; +$_lang["tmplvars_caption"] = 'Заголовок'; +$_lang["tmplvars_default"] = 'Значення за замовчуванням'; +$_lang["tmplvars_description"] = 'Опис'; +$_lang["tmplvars_elements"] = 'Можливі значення'; +$_lang["tmplvars_inherited"] = 'Value inherited'; +$_lang["tmplvars_management_msg"] = 'Параметри (TV) - це динамічні елементи шаблону, які набувають свого значення з якогось джерела даних. Існують також параметри, визначені для кожного конкретного ресурсу (наприклад, визначений параметр [*pagetitle*] містить заголовок сторінки). Параметри можуть мати різний тип даних і різне значення на різних сторінках сайту. вираз [*tvName*]

    Виклик через EVO API: $modx->documentObject[\'variable-name\']


    Виберіть параметр для редагування або створіть новий.'; +$_lang["tmplvars_msg"] = 'Тут можна створити / відредагувати параметр (TV).
    Пам\'ятайте, що параметри повинні бути доступні для вибраних шаблонів, щоб їх можна було використовувати.'; +$_lang["tmplvars_name"] = 'Ім\'я параметра'; +$_lang["tmplvars_novars"] = 'Параметрів (TV) не знайдено'; +$_lang["tmplvars_rank"] = 'Порядок у списку'; +$_lang["tmplvars_rank_edit_message"] = 'Перетягніть, щоб змінити порядок TV.'; +$_lang["tmplvars_reset_params"] = 'Скинути параметри'; +$_lang["tmplvars_title"] = 'Створити/редагувати параметр (TV)'; +$_lang["tmplvars_type"] = 'Тип введення'; +$_lang["tmplvars_widget"] = 'Візуальний компонент'; +$_lang["tmplvars_widget_prop"] = 'Властивості компонента (widget)'; +$_lang["to"] = 'до'; +$_lang["toggle_fullscreen"] = 'Розгорнути на весь екран'; +$_lang["tools"] = 'Інструменти'; +$_lang["top_howmany_message"] = 'Кількість найкращих показників у звітах статистики. Наприклад, \'10 найпопулярніших...\''; +$_lang["top_howmany_title"] = 'Кількість найкращих показників:'; +$_lang["total"] = 'всього'; +$_lang["track_visitors_message"] = 'Надає дані для плагіна аналітики, наприклад, прапорець, який визначає, чи враховувати перегляди конкретного ресурсу.'; +$_lang["track_visitors_title"] = 'Показувати дочірні ресурси'; +$_lang["tree_page_click"] = 'Режим клацання мишею на ресурсі'; +$_lang["tree_page_click_message"] = 'Дій за замовчуванням при клацанні мишею на ресурсі в дереві сайту.'; +$_lang["use_breadcrumbs"] = 'Показати навігацію'; +$_lang["use_breadcrumbs_message"] = 'Показувати навігацію при створенні або редагуванні ресурсу'; +$_lang["tree_show_protected"] = 'Показувати захищені ресурси у дереві сайту:'; +$_lang["tree_show_protected_message"] = 'Якщо включено \'Ні\', то захищені ресурси (включаючи їх дочірні ресурси) не відображатимуться в дереві сайту.'; +$_lang["truncate_table"] = 'Натисніть для усічення таблиці (TRUNCATE)'; +$_lang["tuesday"] = 'Вівторок'; +$_lang["tv"] = 'Параметр (TV)'; +$_lang["type"] = 'Тип'; +$_lang["udperms_allowroot_message"] = 'Дозволити користувачам створювати ресурси в кореневій папці.'; +$_lang["udperms_allowroot_title"] = 'Дозволити доступ до кореневої папки:'; +$_lang["udperms_message"] = 'Права доступу дозволяють визначити, які сторінки можуть редагувати користувачі. Для цього необхідно, щоб користувачі належали до групи користувачів, а ресурси до групи ресурсів і далі ви можете вибрати, які групи ресурсів може редагувати та чи інша група користувачів. При першому включенні цієї функції редагувати ресурси можуть лише менеджери.'; +$_lang["udperms_title"] = 'Використовувати права доступу:'; +$_lang["unable_set_link"] = 'Неможливо встановити посилання'; +$_lang["unable_set_parent"] = 'Неможливо встановити новий батьківський ресурс'; +$_lang["unauthorizedpage_message"] = 'Введіть ID ресурсу, який повинні будуть побачити відвідувачі, якщо спробують зайти на закриту сторінку (403 – доступ заборонено).
    Примітка: переконайтеся, що цей ID належить існуючому ресурсу, і що цей ресурс опубліковано'; +$_lang["unauthorizedpage_title"] = 'Сторінка \'Доступ заборонено\':'; +$_lang["unblock_message"] = 'Після збереження користувач буде розблокований.'; +$_lang["undelete_resource"] = 'Відновити'; +$_lang["unpublish_date"] = 'Дата скасування публікації'; +$_lang["unpublish_events"] = 'Події, пов\'язані зі скасуванням публікації ресурсів.'; +$_lang["unpublish_resource"] = 'Скасувати публікацію'; +$_lang["untitled_resource"] = 'Новий ресурс'; +$_lang["untitled_weblink"] = 'Нове веб-посилання'; +$_lang["update_params"] = 'Оновити параметри'; +$_lang["update_settings_from_language"] = 'Змінити на:'; +$_lang["upload_maxsize_message"] = 'Встановіть максимальний розмір файлів, що завантажуються. Значення має бути в байтах.
    Примітка: великі файли завантажуються, як правило, ДУЖЕ довго'; +$_lang["upload_maxsize_title"] = 'Максимальний розмір завантаження:'; +$_lang["uploadable_files_message"] = 'Тут можна вказати, які типи файлів можуть бути завантажені на сервер через файл-менеджер. Задайте список розширень через кому.'; +$_lang["uploadable_files_title"] = 'Дозволені до завантаження файли:'; +$_lang["uploadable_flash_message"] = 'Тут ви можете ввести список файлів, які можуть бути завантажені в \'assets/flash/\' за допомогою файл-менеджера. Введіть розширення дозволених типів флеш-файлів, розділяючи їх комами.'; +$_lang["uploadable_flash_title"] = 'Дозволені до завантаження flash-файли:'; +$_lang["uploadable_images_message"] = 'Тут можна ввести список файлів, які можуть бути завантажені в \'assets/images/\' за допомогою файл-менеджера. Введіть розширення типів графічних файлів, розділяючи їх комами.'; +$_lang["uploadable_images_title"] = 'Дозволені для завантаження зображення:'; +$_lang["uploadable_media_message"] = 'Тут ви можете ввести список файлів, які можуть бути завантажені в \'assets/media/\' за допомогою файл-менеджера. Введіть розширення дозволених типів медіа-файлів, розділяючи їх комами.'; +$_lang["uploadable_media_title"] = 'Дозволені до завантаження медіа-файли:'; +$_lang["use_alias_path_message"] = 'Увімкнувши цю функцію, ви отримаєте вкладену структуру URL. Наприклад, якщо дочірній ресурс називається \'дочірній\', а батьківський ресурс називається \'батьківський\', ми отримаємо URL такого типу: http://example.com/батьківський/дочірній.
    Увага:< /b> якщо ця функція включена, переконайтеся, що всі шляхи до зображень, css, java-скриптів мають шлях типу \'/assets/images/...\', а не \'assets/images/...\' , або ви завжди можете використовувати приставку [(site_url)] для правильного розуміння сервером шляху, наприклад \'[(site_url)]assets/images/...\'. Також можна використовувати HTML-тег <base href=\'[(site_url)]\'> у HEAD-секції кожної сторінки сайту, тоді всі відносні шляхи будуть працювати правильно.'; +$_lang["use_alias_path_title"] = 'Використовувати вкладені URL:'; +$_lang["use_editor_message"] = 'Хочете використовувати HTML-редактор? Якщо ви звикли писати HTML-теги вручну, вимкніть цю функцію. Майте на увазі, що це налаштування застосовується до всіх ресурсів для всіх менеджерів'; +$_lang["use_editor_title"] = 'Використовувати HTML-редактор:'; +$_lang["use_global_tabs"] = 'Використовувати глобальні вкладки'; +$_lang["user"] = 'Користувач'; +$_lang["user_block"] = 'Заблоковано'; +$_lang["user_blockedafter"] = 'Заблоковано після'; +$_lang["user_blockeduntil"] = 'Заблоковано до'; +$_lang["user_changeddata"] = 'Дані вашої реєстрації змінені. Будь ласка, заново авторизуйтесь у системі.'; +$_lang["user_country"] = 'Країна'; +$_lang["user_dob"] = 'Дата народження'; +$_lang["user_doesnt_exist"] = 'Користувач не існує'; +$_lang["user_edit_self_msg"] = 'Рекомендується вийти і знову авторизуватися для того, щоб усі зміни набули чинності.
    Також, якщо ви вирішили згенерувати новий пароль для себе, він буде надісланий вам по e-mail.'; +$_lang["user_email"] = 'Адреса e-mail'; +$_lang["user_failedlogincount"] = 'Відмови авторизації'; +$_lang["user_fax"] = 'Факс'; +$_lang["user_female"] = 'Жіночий'; +$_lang["user_full_name"] = 'Повне ім\'я'; +$_lang["user_gender"] = 'Стать'; +$_lang["user_is_blocked"] = 'Цей користувач заблокований'; +$_lang["user_logincount"] = 'Кількість авторизацій'; +$_lang["user_male"] = 'Чоловічий'; +$_lang["user_management_msg"] = 'Менеджери - це користувачі з правом авторизації в системі керування сайтом.

    Виберіть менеджера, налаштування якого ви хочете редагувати, або створіть нового менеджера.'; +$_lang["user_management_title"] = 'Менеджери'; +$_lang["user_mobile"] = 'Номер мобільного телефону'; +$_lang["user_phone"] = 'Номер телефону'; +$_lang["user_photo"] = 'Фото користувача'; +$_lang["user_photo_message"] = 'Введіть адресу (URL) зображення для цього користувача або натисніть кнопку вставки, щоб завантажити її на сервер.'; +$_lang["user_prevlogin"] = 'Остання авторизація'; +$_lang["user_role"] = 'Роль користувача'; +$_lang["user_state"] = 'Регіон/область/район'; +$_lang["user_title"] = 'Створити/редагувати користувача'; +$_lang["user_upload_message"] = 'Якщо ви бажаєте заборонити цьому користувачеві завантаження будь-яких файлів цієї категорії, переконайтеся, що прапорець \'Використовувати загальні налаштування\' не встановлений, і залиште це поле порожнім.'; +$_lang["user_use_config"] = 'Використовувати системні установки'; +$_lang["user_verification"] = 'Користувача перевірено'; +$_lang["user_zip"] = 'Поштовий індекс'; +$_lang["username"] = 'Користувач'; +$_lang["users"] = 'Користувачі'; +$_lang["valid_hostnames_message"] = 'Допомагає запобігти XSS вразливості в системному налаштуванні site_url надаючи розділений комами список доступних імен хостів для цієї установки. Це важливо для деяких типів шаред-хостингів або хостів, доступних за IP-адресою. Перше ім\'я хоста у списку використовується, якщо HTTP_HOST не збігається з жодним доступним ім\'ям хоста зі списку.'; +$_lang["valid_hostnames_title"] = 'Допустимі імена хостів'; +$_lang["validate_referer_message"] = 'Перевіряти серверні заголовки HTTP_REFERER для захисту від уразливостей CSRF (Cross Site Request Forgery). Якщо сервер не використовує заголовки HTTP_REFERER, ця функція не буде працювати.'; +$_lang["validate_referer_title"] = 'Перевіряти серверні заголовки HTTP_REFERER?'; +$_lang["value"] = 'Значення'; +$_lang["version"] = 'Версія'; +$_lang["view"] = 'Перегляд'; +$_lang["view_child_resources_in_container"] = 'Перегляд дочірніх ресурсів'; +$_lang["view_log"] = 'Переглянути протокол'; +$_lang["view_logging"] = 'Протокол системи керування'; +$_lang["view_sysinfo"] = 'Системна інформація'; +$_lang["warning"] = 'Попередження'; +$_lang["warning_not_saved"] = 'Зміни не були збережені. Ви можете залишитися на цій сторінці для того, щоб зберегти зміни (\'Скасувати\'), або залишити її, втративши всі зміни (\'OK\').'; +$_lang["warning_visibility"] = 'Показувати попередження'; +$_lang["warning_visibility_message"] = 'Показувати звіт про перевірку конфігурації на сторінці привітання менеджера'; +$_lang["web_access_permissions"] = 'Права доступу для веб-користувачів'; +$_lang["web_access_permissions_user_groups"] = 'Групи веб-користувачів'; +$_lang["web_permissions"] = 'Права веб-користувачів'; +$_lang["web_user_management_msg"] = 'Веб-користувачі - це зареєстровані відвідувачі сайту (не менеджери).

    Виберіть веб-користувача, налаштування якого ви хочете редагувати, або створіть нового веб-користувача.'; +$_lang["web_user_management_title"] = 'Веб-користувачі'; +$_lang["web_user_title"] = 'Створити/редагувати веб-користувача'; +$_lang["web_users"] = 'Користувачі'; +$_lang["weblink"] = 'Веб-посилання'; +$_lang["webpwdreminder_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься користувачам, коли вони запитують нагадування пароля. Лист повинен містити ім\'я користувача та пароль.
    Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа:

    [+sname+] - назва сайту ,
    [+saddr+] - e-mail адреса сайту,
    [+surl+] - адреса (URL) сайту,
    [+uid+] - ім\'я користувача або id користувача,
    [+pwd+] - пароль користувача,
    [+ufn+] - повне ім\'я користувача.

    Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається свої ім\'я користувача та пароль'; +$_lang["webpwdreminder_title"] = 'Нагадування пароля:'; +$_lang["websignupemail_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься веб-користувачам, коли створюється обліковий запис нового веб-користувача. Лист повинен містити ім\'я користувача та пароль.
    Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа:

    [+sname+] - назва сайту ,
    [+saddr+] - e-mail адреса сайту,
    [+surl+] - URL сайту,
    [+uid+] - ім\'я користувача або id користувача,
    [+pwd+ ] - пароль користувача,
    [+ufn+] - повне ім\'я користувача.

    Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається про своє ім\'я користувача та пароль'; +$_lang["websignupemail_title"] = 'Реєстрація веб-користувача:'; +$_lang["allow_multiple_emails_title"] = 'Повторювані e-mail у веб-користувачів'; +$_lang["allow_multiple_emails_message"] = 'Дозволяє веб-користувачам використовувати ту саму адресу електронної пошти для ситуацій, коли у користувача може бути відсутня власна адреса електронної пошти або є тільки єдина адреса електронної пошти для сімейства.
    Примітка: Будь-які нагадування про паролі та логіку реєстрації повинні враховувати цей параметр, якщо він встановлений на «Так».'; +$_lang["wednesday"] = 'Середа'; +$_lang["welcome_messages"] = 'У вашій скриньці %d повідомлень, з яких %s не прочитані.'; +$_lang["welcome_title"] = 'Ласкаво просимо до системи керування сайтом'; +$_lang["which_editor_message"] = 'Виберіть HTML-редактор. Ви також можете завантажити та встановити редактори зі списку, доступних на сайті EVO.'; +$_lang["which_editor_title"] = 'Редактор:'; +$_lang["working"] = 'Обробка даних...'; +$_lang["wrap_lines"] = 'Переносити рядки по ширині вікна'; +$_lang["xhtml_urls_message"] = 'Якщо цей параметр увімкнено, всі амперсанди (&) у посиланнях будуть замінені на конструкцію &amp; відповідно до формату XHTML.'; +$_lang["xhtml_urls_title"] = 'Посилання у форматі XHTML:'; +$_lang["yes"] = 'Так'; +$_lang["you_got_mail"] = 'Нове повідомлення'; +$_lang["yourinfo_message"] = 'Цей розділ містить деякі дані про вас:'; +$_lang["yourinfo_previous_login"] = 'Остання авторизація:'; +$_lang["yourinfo_role"] = 'Ваша роль:'; +$_lang["yourinfo_title"] = 'Інформація про вас'; +$_lang["yourinfo_total_logins"] = 'Всього авторизацій:'; +$_lang["yourinfo_username"] = 'Ви авторизовані як:'; + +$_lang["a17_error_reporting_title"] = 'Виявлення рівня помилки РНР'; +$_lang["a17_error_reporting_msg"] = 'Набір виявлення рівня помилок РНР'; +$_lang["a17_error_reporting_opt0"] = 'Ігнорувати все'; +$_lang["a17_error_reporting_opt1"] = 'Ігнорувати попередження про незначні помилки(E_ALL & ~E_NOTICE & ~ E_DEPRECATED & ~E_STRICT)'; +$_lang["a17_error_reporting_opt2"] = 'Виявити всі помилки, крім E_NOTICE'; +$_lang["a17_error_reporting_opt99"] = 'Виявити все'; + +$_lang["pwd_hash_algo_title"] = 'Алгоритм шифрування'; +$_lang["pwd_hash_algo_message"] = 'Алгоритм шифрування паролів.'; + +$_lang["enable_bindings_title"] = 'Дозволити @-прив\'язки'; +$_lang["enable_bindings_message"] = 'Запобігає виконанню PHP-коду за допомогою @-прив\'язок у TV-параметрах. Потрібно, якщо у вас є користувачі, які не повинні мати можливість створювати PHP-код, але можуть створювати або редагувати TV-параметри. Виведення будь-якого TV-параметра @-прив\'язкою буде \'@-прив\'язки заборонені\'.'; +$_lang["enable_filter_title"] = 'Включити фільтри'; +$_lang["enable_filter_message"] = 'Фільтри дозволяють керувати вихідними даними, перетворюючи їх прямо в тег всередині шаблону. Аналог PHx. Більше інформації'; // todo: change link to documentation +$_lang["enable_filter_phx_warning"] = 'Коли плагін PHx увімкнено, вбудовані фільтри відключені за замовчуванням'; + +$_lang["enable_at_syntax_title"] = 'Включити <@SYNTAX>'; +$_lang["enable_at_syntax_message"] = '<@SYNTAX>(не рекомендований до використання синтаксис). Додає підтримку умовних операторів у HTML коді'; + +$_lang["bkmgr_alert_mkdir"] = 'Файл не може бути створений. Перевірте права на папку assets/backup'; +$_lang["bkmgr_restore_msg"] = '

    Сайт може бути відновлений за допомогою файлу SQL.

    '; +$_lang["bkmgr_restore_title"] = 'Відновити'; +$_lang["bkmgr_import_ok"] = 'SQL відновлення було виконано нормально.'; +$_lang["bkmgr_snapshot_ok"] = 'Резервну копію було збережено.'; +$_lang["bkmgr_run_sql_file_label"] = 'Виконати SQL файл'; +$_lang["bkmgr_run_sql_direct_label"] = 'Виконати довільну команду SQL'; +$_lang["bkmgr_run_sql_submit"] = 'Надіслати'; +$_lang["bkmgr_run_sql_result"] = 'Результат'; +$_lang["bkmgr_snapshot_title"] = 'Резервне копіювання'; +$_lang["bkmgr_snapshot_msg"] = 'Резервні копії зберігаються та відновлюються на сервер.
    Шлях для резервних копій: /assets/backup/

    '; +$_lang["bkmgr_snapshot_submit"] = 'Створити резервну копію'; +$_lang["bkmgr_snapshot_list_title"] = 'Список резервних копій'; +$_lang["bkmgr_restore_submit"] = 'Відновити резервну копію'; +$_lang["bkmgr_restore_confirm"] = 'Ви впевнені, що хочете відновити резервну копію\n[+filename+]. ?'; +$_lang["bkmgr_snapshot_nothing"] = 'Немає резервних копій'; + +$_lang["files.dynamic.php1"] = 'Створити файл'; +$_lang["files.dynamic.php2"] = 'files.dynamic.php2'; +$_lang["files.dynamic.php3"] = 'files.dynamic.php3'; +$_lang["files.dynamic.php4"] = 'files.dynamic.php4'; +$_lang["files.dynamic.php5"] = 'Файл не може бути дубльований.'; +$_lang["files.dynamic.php6"] = 'Файл або директорія не можуть бути перейменовані.'; +$_lang["files_dynamic_new_folder_name"] = 'Вкажіть нове ім\'я для папки:'; +$_lang["files_dynamic_new_file_name"] = 'Вкажіть нове ім\'я для файлу:'; +$_lang["not_readable_dir"] = 'Директорія недоступна для запису'; +$_lang["confirm_delete_dir"] = 'Ви впевнені, що хочете видалити папку? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте папку, якщо ви на 100% впевнені, що робота сайту не постраждає.'; +$_lang["confirm_delete_dir_recursive"] = 'Ви впевнені, що хочете видалити папку з усім вмістом? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте папку, якщо ви на 100% впевнені, що робота сайту не постраждає.'; + +$_lang["make_folders_title"] = 'Додавати слеш до контейнера'; +$_lang["make_folders_message"] = 'При використанні дружніх URL-адрес до ресурсу, який є контейнером, додається слеш.'; + +$_lang["check_files_onlogin_title"] = 'Перевіряти системні файли на наявність змін'; +$_lang["check_files_onlogin_message"] = 'При використанні цієї опції важливі системні файли будуть перевірятися на наявність змін, типових для зламаних сайтів. Це не гарантує повного захисту, але може допомогти у запобіганні злому.'; + +$_lang["configcheck_sysfiles_mod"] = 'Системні файли були змінені.'; +$_lang["configcheck_sysfiles_mod_msg"] = 'Ви підключили перевірку системних файлів на наявність змін, характерних для зламаних сайтів. Це не означає, що сайт був зламаний, але бажано переглянути змінені файли.(index.php, .htaccess, [+MGR_DIR+]/index.php, [+MGR_DIR+]/includes/config.inc.php)'; + +$_lang['email_method_title'] = 'Метод надсилання листів'; +$_lang['email_method_mail'] = 'MAIL - повідомлення надсилаються за допомогою функції mail().'; +$_lang['email_method_smtp'] = 'Через SMTP-сервер'; +$_lang['smtp_auth_title'] = 'SMTP авторизація'; +$_lang['smtp_host_title'] = 'Адреса SMTP-сервера'; +$_lang['smtp_secure_title'] = 'Захист SMTP'; +$_lang['smtp_username_title'] = 'SMTP пошта'; +$_lang['smtp_password_title'] = 'SMTP пароль'; +$_lang['smtp_port_title'] = 'SMTP порт'; + +$_lang["setting_resource_tree_node_name"] = 'Назва ресурсу в дереві'; +$_lang["setting_resource_tree_node_name_desc"] = 'Виберіть поле ресурсу, яке буде використовуватися як назва ресурсу в дереві. За замовчуванням використовується поле "заголовок"; можна використовувати будь-яке інше поле, наприклад, \'пункт меню\', \'псевдонім\'.'; +$_lang["setting_resource_tree_node_name_desc_add"] = 'Примітка: Починаючи з версії MODX Evolution 1.1, Ви можете змінити відображене ім\'я ресурсу через опцію \'Сортувати дерево\'. Цей параметр використовується, якщо ім\'я, що відображається в дереві ресурсів, встановлюється на \'За замовчуванням\'.'; + +$_lang["resource_opt_alvisibled"] = 'Бере участь в URL'; +$_lang["resource_opt_alvisibled_help"] = 'Для участі даного документа в адресному рядку поставте галку, і навпаки - зніміть, якщо псевдонім цього документа потрібно забрати з URL.'; +$_lang['resource_opt_is_published'] = 'Опубліковано'; +$_lang["docid_incrmnt_method_title"] = 'Спосіб додавання Resource ID'; +$_lang["docid_incrmnt_method_0"] = 'DB автоінкримент'; +$_lang["docid_incrmnt_method_1"] = 'Мінімальний пропущений ID'; +$_lang["docid_incrmnt_method_2"] = 'Максимальний ID+1'; + +$_lang["enable_cache_title"] = 'Спосіб кешування'; +$_lang["disable_chunk_cache_title"] = 'Вимкнути кешування чанків'; +$_lang["disable_snippet_cache_title"] = 'Вимкнути кешування сніпетів'; +$_lang["disable_plugins_cache_title"] = 'Вимкнути кешування плагіни'; +$_lang["disabled_at_login"] = 'Вимкнути для адміністраторів'; + +$_lang["cache_type_title"] = 'Спосіб кешування сторінок'; +$_lang["cache_type_1"] = 'Тільки з урахуванням ID (стандартний метод)'; +$_lang["cache_type_2"] = 'З урахуванням ID та $_GET'; +$_lang["seostrict_title"] = 'Використовувати SEO Strict URLs'; +$_lang["seostrict_message"] = 'використання strict URLs видаляє дублі сторінок за різними посиланнями'; +$_lang["aliaslistingfolder_title"] = 'Використовувати AliasListing тільки для папок'; +$_lang["full_aliaslisting_title"] = 'Вимкнути AliasListing для всіх ресурсів'; +$_lang["aliaslistingfolder_message"] = 'Зменшує споживання пам\'яті та прискорює роботу сайту при великій кількості документів'; + +$_lang["settings_friendlyurls_alert"] = 'Для використання дружніх URL необхідно змінити ім\'я файлу ht.access у папці, в яку встановлено EVO, на .htaccess.'; +$_lang["settings_friendlyurls_alert2"] = 'При встановленні EVO в підпапку необхідно внести зміни до файлу .htaccess.'; + +$_lang["user_street"] = 'Вулиця'; +$_lang["user_city"] = 'Місто'; +$_lang["user_other"] = 'Інше'; + +$_lang["import_site.static.php1"] = 'Скинути дерево ресурсів'; +$_lang["import_site.static.php2"] = 'Скинути дерево ресурсів та ініціалізувати всі ідентифікатори ресурсів.'; +$_lang["import_site.static.php3"] = 'Мета'; +$_lang["import_site.static.php4"] = 'Тільки те, що в <body></body> '; +$_lang["import_site.static.php5"] = 'Весь вміст файлу'; + +$_lang["a83_ignore_ids_title"] = 'Ігноровані ID (через кому)'; +$_lang["export_site.static.php1"] = 'Мета'; +$_lang["export_site.static.php2"] = 'Тільки відредаговані ресурси'; +$_lang["export_site.static.php3"] = 'Всі ресурси'; +$_lang["export_site.static.php4"] = 'Знайти'; +$_lang["export_site.static.php5"] = 'Замінити'; +$_lang["export_site.static.php6"] = 'Мета'; +$_lang["export_site.static.php7"] = 'Файл не може бути збережений у [+rb_base_url+]'; + +$_lang["mutate_settings.dynamic.php6"] = 'Повідомлення про системні помилки'; +$_lang["mutate_settings.dynamic.php7"] = 'Не повідомляти'; +$_lang["mutate_settings.dynamic.php8"] = 'Повідомлення надходять на [+emailsender+] (задається налаштуванням [(emailsender)]) в момент генерації помилки. Деталі можна побачити у журналі помилок.'; + +$_lang["error_no_privileges"] = "У вас немає відповідних прав для виконання цієї дії."; +$_lang["error_no_optimise_tablename"] = "Немає таблиць, які потребують оптимізації!"; +$_lang["error_no_truncate_tablename"] = "Таблиця для очищення не знайдена!"; +$_lang["error_double_action"] = "Подвійна дія (GET & POST) надіслана!"; +$_lang["error_no_id"] = "Не вказано ID у вашому запиті!"; +$_lang["error_id_nan"] = "ID переданого запиту порожній!"; +$_lang["error_no_parent"] = "Не вдалося знайти ім'я батьківського документа!"; +$_lang["error_parent_deleted"] = "Не вдалося виконати, бо батько відзначень як віддалень!"; +$_lang["error_many_results"] = "Занадто багато результатів повертається з бази даних!"; +$_lang["error_no_results"] = "Результати з бази даних не повернулися або повернулися не повністю!"; +$_lang["error_no_user_selected"] = "Не вказано отримувача цього повідомлення!"; +$_lang["error_no_group_selected"] = "Не вказано групу одержувачів для цього повідомлення!"; +$_lang["error_movedocument1"] = "Документ не може бути своїм батьком!"; +$_lang["error_movedocument2"] = "ID документа не пройшов у запиті!"; +$_lang["error_movedocument3"] = "Новий батько не вказаний!"; +$_lang["error_internet_connection"] = "Сервер недоступний, перевірте підключення до інтернету!"; + +$_lang["login_processor_unknown_user"] = "Невірно вказано логін або пароль!"; +$_lang["login_processor_wrong_password"] = "Невірно вказано логін або пароль!"; +$_lang["login_processor_many_failed_logins"] = "Дуже багато невдалих спроб увійти, ви заблоковані!"; +$_lang["login_processor_blocked1"] = "Ви заблоковані та не можете увійти!"; +$_lang["login_processor_blocked2"] = "Ви заблоковані та не можете увійти! Спробуйте увійти пізніше."; +$_lang["login_processor_blocked3"] = "Ви заблоковані автоматично після вказаної дати, і ви не можете увійти!"; +$_lang["login_processor_bad_code"] = "Перевірний код введений неправильно! Спробуйте ще раз!"; +$_lang["login_processor_remotehost_ip"] = "Ваше ім'я хоста не вказує на ваш IP!"; +$_lang["login_processor_remote_ip"] = "Ви не можете увійти до системи з цього місця."; +$_lang["login_processor_date"] = "Ви не можете зараз увійти. Будь ласка, повторіть спробу пізніше."; +$_lang["login_processor_captcha_config"] = "Капча не настроєна належним чином."; + +$_lang["dp_dayNames"] = "['Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П'ятниця', 'Субота']"; +$_lang["dp_monthNames"] = "['Січень', 'Лютий', 'Березень', 'Квітень', 'Май', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'] "; +$_lang["dp_startDay"] = "1"; + +$_lang["check_all"] = "Включити усі"; +$_lang["check_none"] = "Вимкнути все"; +$_lang["check_toggle"] = "Перемкнути"; + +$_lang["version_notices"] = "Повідомлення про версії"; + +$_lang["em_button_shift"] = "(Shift + клік, щоб відкрити кілька вікон)"; + +$_lang["reset_sysfiles_checksum_button"] = "Оновити контрольну суму"; +$_lang["reset_sysfiles_checksum_alert"] = "Ви впевнені, що хочете скинути контрольну суму системних файлів?"; + +$_lang["file_browser_disabled_msg"] = "Файл-браузер вимкнено."; +$_lang["which_browser_default_title"]= "Файл-браузер за замовчуванням"; +$_lang["which_browser_default_msg"]= "Вкажіть Файл-браузер за замовчуванням. У налаштуваннях менеджерів ви можете вказати файл-браузер відмінний від системного."; +$_lang["which_browser_title"]= "Файл-браузер"; +$_lang["which_browser_msg"]= "Ви можете вибрати файл-браузер для цього користувача. Або залиште за замовчуванням"; +$_lang["option_default"] = "За замовчуванням"; +$_lang["position"] = "Позиція"; +$_lang["are_you_sure"] = "Ви впевнені?"; + +$_lang['evo_downloads_title'] = "Evolution Downloads"; +$_lang['help_translating_title'] ="Допомога з перекладом Evolution CMS"; +$_lang['download'] = "Скачати"; +$_lang['downloads'] = "Завантаження"; +$_lang["previous_releases"] = "Попередній реліз"; +$_lang["extras"] = "Extras"; + +$_lang["display_locks"] = "Відображати блокування"; +$_lang["role_display_locks"] = "Відображати блокування"; +$_lang["session_timeout"] = "Тайм-аут сесії"; +$_lang["session_timeout_msg"] = "EVO пінгуватиме сервер раз на хвилину, щоб оновити сеанс (сесію). Якщо останній пінг перевищує цей параметр, пов'язаний з ним сеанс буде вважатися недійсним, і всі пов'язані з ним блокування будуть автоматично видалені. Встановлене значення в хвилинах (> 2хв, за замовчуванням 15хв)."; +$_lang["unlock_element_id_warning"] = "Ви впевнені, що хочете розблокувати [+element_type+] (ID [+id+])?"; +$_lang["lock_element_type_1"] = "Шаблон"; +$_lang["lock_element_type_2"] = "Template-Variable"; +$_lang["lock_element_type_3"] = "Чанк"; +$_lang["lock_element_type_4"] = "Сніппет"; +$_lang["lock_element_type_5"] = "Плагін"; +$_lang["lock_element_type_6"] = "Модуль"; +$_lang["lock_element_type_7"] = "Ресурс"; +$_lang["lock_element_type_8"] = "Роль"; +$_lang["lock_element_editing"] = "Ви редагуєте [+element_type+] з \n[+lasthit_df+]"; +$_lang["lock_element_locked_by"] = "Цей [+element_type+] заблокований користувачем [+username+], з "; + +$_lang["minifyphp_incache_title"] = 'Стиснути код php у файлі кеша'; +$_lang["minifyphp_incache_message"] = 'Стиск PHP коду(сніпетів та плагінів) та збереження у файл кешу, реф: #938'; + +$_lang["logout_reminder_msg"] ="Нагадування: Схоже [+date+] Ви забули вийти із системи. Будь ласка, зверніть увагу в майбутньому, потрібно виходити із системи після того, як закінчили роботу."; + +$_lang["allow_eval_title"] = "Використання функції EVAL"; +$_lang["allow_eval_msg"] = "Для розробників: використовуйте \$modx->safeEval()."; +$_lang["allow_eval_with_scan"] = "Виконувати лише дозволені функції наведені нижче"; +$_lang["allow_eval_with_scan_at_post"] = "Дозволено всі. Але при POST тільки вказані нижче"; +$_lang["allow_eval_everytime_eval"] = "Дозволено всі (використовувати тільки для налагодження)"; +$_lang["allow_eval_dont_eval"] = "Не відображати всі функції"; + +$_lang["safe_functions_at_eval_title"] = "Дозволені функції в EVAL"; +$_lang["safe_functions_at_eval_msg"] = "Список розділений комами"; + +$_lang["multiple_sessions_msg"] = "Інформація: Кілька активних сесій (всього [+total+]) знайдено для користувача [+username+]."; +$_lang["iconv_not_available"] = "Важливо встановити/увімкнути розширення iconv. Будь ласка, зв'яжіться зі своїм провайдером, якщо Ви не знаєте, як його увімкнути."; + +$_lang["cm_create_new_category"] = "Створити нову категорію"; +$_lang["cm_category_name"] = "Назва категорії"; +$_lang["cm_category_position"] = "Позиція категорії"; +$_lang["cm_no_x_assigned"] = " +Чи не %s присвоєно"; +$_lang["cm_save_categorization"] = "Зберегти список категорій"; +$_lang["cm_update_categories"] = "Оновити категорії"; +$_lang["cm_assigned_elements"] = "Призначені елементи"; +$_lang["cm_edit_name"] = "Редагувати ім'я"; +$_lang["cm_mark_for_deletion"] = "Відзначити для видалення"; +$_lang["cm_delete_now"] = "Видалити негайно"; +$_lang["cm_delete_element_x_now"] = " +Видалити %s негайно"; +$_lang["cm_select_element_group"] = "Вибрати елемент групи"; +$_lang["cm_global_messages"] = "Глобальні повідомлення"; +$_lang["cm_add_new_category"] = "Додати нову категорію"; +$_lang["cm_edit_categories"] = "Редагувати категорії"; +$_lang["cm_sort_categories"] = "Сортувати категорії"; +$_lang["cm_categorize_elements"] = "Класифікувати елементи"; +$_lang["cm_translation"] = "Переклад"; +$_lang["cm_translations"] = "Переклади"; +$_lang["cm_categorize_x"] = "Класифікувати %s"; +$_lang["cm_unknown_error"] = "Щось пішло не так..."; +$_lang["cm_x_assigned_to_category_y"] = "%s (%s) присвоєно категорії %s (%s)"; +$_lang["cm_no_categorization"] = "Класифікація не проводилася."; +$_lang["cm_no_changes"] = "Нічого міняти, тому змін не було."; +$_lang["cm_x_changes_made"] = "%s змін зроблено"; +$_lang["cm_enter_name_for_category"] = "Будь ласка, введіть ім'я для нової категорії"; +$_lang["cm_category_x_exists"] = "Категорія %s вже існує."; +$_lang["cm_category_x_saved_at_position_y"] = "Нова категорія %s збережена на позиції %s."; +$_lang["cm_category_x_moved_to_position_y"] = "Категорія %s переміщена до позиції %s"; +$_lang["cm_category_x_deleted"] = "Категорія %s видалена"; +$_lang["cm_category_x_renamed_to_y"] = "Категорія %s перейменована на %s"; +$_lang["cm_translation_for_x_empty"] = "Переклад для %s порожній"; +$_lang["cm_translation_for_x_to_y_success"] = "Переклад для %s до %s успішно збережений"; +$_lang["cm_save_new_sorting"] = "Зберегти нове сортування"; +$_lang["cm_translate_phrases"] = "Перекласти фрази"; +$_lang["cm_translate_module_phrases"] = "Перекласти фрази модуля"; +$_lang["cm_native_phrase"] = "Рідна фраза"; + +$_lang["btn_view_options"] = 'Показати параметри'; +$_lang["view_options_msg"] = 'Відображення та перерахування елементів можна налаштувати за допомогою кнопки \'Перегляд параметрів\'. Налаштування зберігаються та відновлюються у кожному браузері за допомогою локального сховища HTML5.'; +$_lang["viewopts_title"] = 'Показати параметри'; +$_lang["viewopts_cb_buttons"] = 'Кнопки'; +$_lang["viewopts_cb_descriptions"] = 'Описи'; +$_lang["viewopts_cb_icons"] = 'Іконки'; +$_lang["viewopts_radio_list"] = 'Список'; +$_lang["viewopts_radio_inline"] = 'Інлайн'; +$_lang["viewopts_radio_flex"] = 'Флекс'; +$_lang["viewopts_fontsize"] = 'Розмір шрифту'; +$_lang["viewopts_cb_alltabs"] = 'Всі таби'; + +$_lang['email_sender_method'] = 'Відправник листалиста'; +$_lang['auto'] = 'Автовизначення'; +$_lang['use_emailsender'] = 'Використовуйте значення [(emailsender)]'; +$_lang['email_sender_method_message'] = 'Відправник листа. Це зазвичай перетворюється одержувачем на заголовок Return-Path, і це адреса, на яку буде надіслано відповідь. Автоматичне визначення спрацює в більшості випадків.'; + +$_lang['login_form_position_title'] = 'Положення форми авторизації'; +$_lang['login_form_position_left'] = 'ліворуч'; +$_lang['login_form_position_center'] = 'по центру'; +$_lang['login_form_position_right'] = 'праворуч'; +$_lang['login_form_style'] = 'Стиль форми авторизації:'; +$_lang['login_form_style_dark'] = 'Темний'; +$_lang['login_form_style_light'] = 'Світлий'; +$_lang['login_logo_title'] = 'Логотип на сторінці авторизації'; +$_lang['login_logo_message'] = 'Рекомендований розмір логотипу за шириною: 360px, тип .png'; +$_lang['login_bg_title'] = 'Фонове зображення на сторінці авторизації'; +$_lang['login_bg_message'] = 'Рекомендований розмір фонового зображення за шириною: 1920px'; + +$_lang['manager_menu_position_title'] = 'Розташування основного меню'; +$_lang['manager_menu_position_top'] = 'нагорі'; +$_lang['manager_menu_position_left'] = 'ліворуч'; + +$_lang['invalid_event_response'] = 'Подія %s повернула неправильний результат'; \ No newline at end of file diff --git a/manager/includes/mutate_settings.ajax.php b/manager/includes/mutate_settings.ajax.php index caee7e9249..40935a4ed6 100755 --- a/manager/includes/mutate_settings.ajax.php +++ b/manager/includes/mutate_settings.ajax.php @@ -11,7 +11,7 @@ $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']); $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']); $key = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['key']); -$value = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['value']); +$value = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['value'] ?? ''); $action = $modx->db->escape($action); $lang = $modx->db->escape($lang); diff --git a/manager/includes/rss.inc.php b/manager/includes/rss.inc.php index c3328894a0..9ee9ec5933 100755 --- a/manager/includes/rss.inc.php +++ b/manager/includes/rss.inc.php @@ -26,66 +26,32 @@ NO NEED TO EDIT BELOW THIS LINE ---------------------------------------------- */ -// include MagPieRSS -require_once(MODX_MANAGER_PATH . 'media/rss/rss_fetch.inc'); -/** - * Convert relative path into absolute url - * - * @param string $rel - * @param string $base - * @return string - */ -function rel2abs($rel, $base) -{ - // parse base URL and convert to local variables: $scheme, $host, $path - $tmp = parse_url($base); - extract($tmp); - if (strpos($rel, "//") === 0) { - return $scheme . ':' . $rel; - } - // return if already absolute URL - if (parse_url($rel, PHP_URL_SCHEME) != '') { - return $rel; - } - // queries and anchors - if ($rel[0] == '#' || $rel[0] == '?') { - return $base . $rel; - } - // remove non-directory element from path - $path = preg_replace('#/[^/]*$#', '', $path); - // destroy path if relative url points to root - if ($rel[0] == '/') { - $path = ''; - } - // dirty absolute URL - $abs = $host . $path . "/" . $rel; - // replace '//' or '/./' or '/foo/../' with '/' - $abs = preg_replace("/(\/\.?\/)/", "/", $abs); - $abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs); - - // absolute URL is ready! - return $scheme . '://' . $abs; +if (!class_exists('SimplePie\SimplePie')) { + require_once(MODX_MANAGER_PATH . 'media/rss/vendor/autoload.php'); } - -$feedData = array(); - +$feed = new SimplePie\SimplePie(); +$feedCache = MODX_BASE_PATH . 'assets/cache/rss'; +if (!is_dir($feedCache)) { + @mkdir($feedCache, intval($modx->getConfig('new_folder_permissions'), 8), true); +} +$feed->set_cache_location($feedCache); // create Feed foreach ($urls as $section => $url) { $output = ''; - $rss = @fetch_rss($url); - if (!$rss) { + $feed->set_feed_url($url); + $feed->init(); + $items = $feed->get_items(0, $itemsNumber); + if (empty($items)) { $feedData[$section] = 'Failed to retrieve ' . $url; continue; } $output .= '
      '; - - $items = array_slice($rss->items, 0, $itemsNumber); foreach ($items as $item) { - $href = rel2abs($item['link'], 'https://github.com'); - $title = $item['title']; - $pubdate = $item['pubdate']; + $href = $item->get_link(); + $title = $item->get_title(); + $pubdate = $item->get_date(); $pubdate = $modx->toDateFormat(strtotime($pubdate)); - $description = strip_tags($item['description']); + $description = strip_tags($item->get_content()); if (strlen($description) > 199) { $description = substr($description, 0, 200); $description .= '...
      Read more.'; diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php index 8137692b9d..8bf4a81879 100755 --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -73,22 +73,22 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA case "INHERIT" : $output = $param; // Default to param value if no content from parents - $doc = $modx->getPageInfo($docid, 0, 'id,parent'); + $doc = $modx->getPageInfo($docid, 0, 'id,parent', false); while ($doc['parent'] != 0) { $parent_id = $doc['parent']; // Grab document regardless of publish status - $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); + $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published', false); if ($doc['parent'] != 0 && !$doc['published']) continue; // hide unpublished docs if we're not at the top - $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); + $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published'], false); // if an inherited value is found and if there is content following the @INHERIT binding // remove @INHERIT and output that following content. This content could contain other // @ bindings, that are processed in the next step - if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { + if (!empty($tv) && $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { $output = trim(str_replace('@INHERIT', '', (string) $tv['value'])); break 2; } diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index 862e00e76a..978f4e0064 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -101,8 +101,8 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = $value = 'now'; } $timestamp = getUnixtimeFromDateString($value); - $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; - $o = strftime($p, $timestamp); + $p = $params['format'] ? $params['format'] : "l d, F Y"; + $o = date($p, $timestamp); } else { $value = ''; } @@ -113,7 +113,7 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = $o = ''; $countValue = count($value); for($i = 0; $i < $countValue; $i++) { - list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); + list($name, $url) = is_array($value[$i]) ? $value[$i] : array_merge(explode("==", $value[$i]), ['']); if(!$url) { $url = $name; } diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 82116c8aad..6dd0d093f5 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -65,7 +65,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el $field_html .= ''; $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); foreach($index_list as $item => $itemvalue) { - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : array_merge(explode("==", $itemvalue), ['']); if(strlen($itemvalue) == 0) { $itemvalue = $item; } @@ -90,7 +90,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el $field_html .= ' -
    - - -
    - - -
    - - -
    -
    [+login_captcha_message+]
    -

    [+captcha_image+]

    - [+captcha_input+] -
    - - -
    - - -
    - - - [+OnManagerLoginFormRender+] - - -
    - - -
    -

    -
    © 2005-2020 by the EVO. EVO™ is licensed under the GPL.
    -
    - - - -
    - - - - - + + + + [(site_name)] (Evolution CMS Manager Login) + + + + + + + + +
    +
    +
    + + + [+OnManagerLoginFormPrerender+] + + + + + +
    + + +
    + + +
    + + +
    + + +
    +
    [+login_captcha_message+]
    +

    [+captcha_image+]

    + [+captcha_input+] +
    + + +
    + + +
    + + + [+OnManagerLoginFormRender+] + +
    +
    + + +
    +

    +
    © 2005-2023 by the EVO. EVO™ is licensed under the GPL.
    +
    +
    + + +
    + + + + + diff --git a/manager/media/style/default/style.php b/manager/media/style/default/style.php index e1d0021aea..e68ebf9ba5 100755 --- a/manager/media/style/default/style.php +++ b/manager/media/style/default/style.php @@ -1,515 +1,529 @@ -config['manager_theme']/style.php - * Function: Manager style variables for images and icons. - * Encoding: UTF-8 - * Credit: icons by Mark James of FamFamFam http://www.famfamfam.com/lab/icons/ - * Date: 18-Mar-2010 - * Version: 1.1 - * MODX version: 1.0.3 - */ -$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; -$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; -if(empty($modx->config['lang_code'])) { - global $modx_lang_attribute; - $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; -} - -if(isset($_GET['a']) && $_GET['a'] == 2) { - include_once('welcome.php'); -} - -// Favicon -$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'); - -//Main Menu -$_style['menu_search'] = ''; -$_style['menu_preview_site'] = ''; -$_style['menu_new_resource'] = ''; -$_style['menu_system'] = ''; -$_style['menu_user'] = ''; -// full screen -$_style['menu_expand'] = 'fa-expand'; -$_style['menu_compress'] = 'fa-compress'; -//help toggle -$_style['icons_help'] = ''; -//pages -$_style['page_settings'] = ''; -$_style['page_shedule'] = ''; -$_style['page_eventlog'] = ''; -$_style['page_manager_logs'] = ''; -$_style['page_sys_info'] = ''; -$_style['page_help'] = ''; -$_style['page_change_password'] = ''; -$_style['page_logout'] = ''; - -// Tree Menu Toolbar -$_style['add_doc_tree'] = ''; -$_style['add_weblink_tree'] = ''; -$_style['collapse_tree'] = ''; -$_style['empty_recycle_bin'] = ''; -$_style['empty_recycle_bin_empty'] = ''; -$_style['expand_tree'] = ''; -$_style['hide_tree'] = ''; -$_style['refresh_tree'] = ''; -$_style['show_tree'] = $style_path.'tree/expand.png'; -$_style['sort_tree'] = ''; -$_style['sort_menuindex'] = ''; -$_style['element_management'] = ''; -$_style['images_management'] = ''; -$_style['files_management'] = ''; -$_style['email'] = ''; - -//Tree Contextual Menu Popup -$_style['ctx_new_document'] = 'fa fa-file-o'; -$_style['ctx_edit_document'] = 'fa fa-pencil-square-o'; -$_style['ctx_move_document'] = 'fa fa-arrows'; -$_style['ctx_resource_duplicate'] = 'fa fa-clone'; -$_style['ctx_sort_menuindex'] = 'fa fa-sort-numeric-asc'; -$_style['ctx_publish_document'] = 'fa fa-check'; -$_style['ctx_unpublish_resource'] = 'fa fa-close'; -$_style['ctx_delete'] = 'fa fa-trash'; -$_style['ctx_undelete_resource'] = 'fa fa-undo'; -$_style['ctx_weblink'] = 'fa fa-link'; -$_style['ctx_resource_overview'] = 'fa fa-info'; -$_style['ctx_preview_resource'] = 'fa fa-eye'; - -// Tree Icons -$_style['tree_deletedpage'] = ""; -$_style['tree_folder'] = $style_path.'tree/folder-close-alt.png'; /* folder.png */ -$_style['tree_folderopen'] = $style_path.'tree/folder-open-alt.png'; /* folder-open.png */ -$_style['tree_globe'] = $style_path.'tree/globe.png'; -$_style['tree_folder_new'] = ""; /* folder.png */ -$_style['tree_folderopen_new'] = ""; /* folder-open.png */ -$_style['tree_folder_secure'] = ""; -$_style['tree_folderopen_secure'] = ""; -$_style['tree_linkgo'] = ""; -$_style['tree_page'] = ""; -$_style['tree_page_home'] = ""; -$_style['tree_page_404'] = ""; -$_style['tree_page_hourglass'] = ""; -$_style['tree_page_info'] = ""; -$_style['tree_page_blank'] = ""; -$_style['tree_page_css'] = ""; -$_style['tree_page_html'] = ""; -$_style['tree_page_xml'] = ""; -$_style['tree_page_js'] = ""; -$_style['tree_page_rss'] = ""; -$_style['tree_page_pdf'] = ""; -$_style['tree_page_word'] = ""; -$_style['tree_page_excel'] = ""; - -$_style['tree_minusnode'] = "";//$style_path.'tree/angle-down.png'; -$_style['tree_plusnode'] = "";//$style_path.'tree/angle-right.png'; -$_style['tree_weblink'] = $style_path.'tree/link.png'; -$_style['tree_preview_resource'] = "";//$style_path.'icons/eye.png'; - -$_style['tree_showtree'] = ''; -$_style['tree_working'] = ''; -$_style['tree_info'] = ''; - -$_style['tree_page_secure'] = ""; -$_style['tree_page_blank_secure'] = ""; -$_style['tree_page_css_secure'] = ""; -$_style['tree_page_html_secure'] = ""; -$_style['tree_page_xml_secure'] = ""; -$_style['tree_page_js_secure'] = ""; -$_style['tree_page_rss_secure'] = ""; -$_style['tree_page_pdf_secure'] = ""; -$_style['tree_page_word_secure'] = ""; -$_style['tree_page_excel_secure'] = ""; - -//search -$_style['icons_external_link'] = ''; - -//View Resource data -$_style['icons_new_document'] = 'fa fa-file-o'; -$_style['icons_new_weblink'] = 'fa fa-link'; -$_style['icons_move_document'] = 'fa fa-arrows'; -$_style['icons_publish_document'] = 'fa fa-check'; -$_style['icons_unpublish_resource'] = 'fa fa-close'; -$_style['icons_delete_resource'] = 'fa fa-trash'; -$_style['icons_undelete_resource'] = 'fa fa-undo'; -$_style['icons_resource_overview'] = 'fa fa-info'; -$_style['icons_edit_resource'] = 'fa fa-pencil-square-o'; -//context menu -$_style['icons_resource_duplicate'] = $style_path.'icons/clone.png'; -$_style['icons_edit_document'] = $style_path.'icons/save.png'; -$_style['icons_delete_document'] = $style_path.'icons/trash.png'; -//locks -$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; -$_style['icons_secured'] = '';//$style_path.'icons/lock.png'; - -//file manager icons -$_style['files_save'] = 'fa fa-floppy-o'; -$_style['files_folder'] = 'fa fa-folder-o'; -$_style['files_deleted_folder'] = 'fa fa-folder-o'; -$_style['files_folder-open'] = 'fa fa-folder-open-o'; -$_style['files_page_php'] = 'fa fa-file-o'; -$_style['files_page_html'] = 'fa fa-file-o'; -$_style['files_cancel'] = 'fa fa-times-circle'; -$_style['files_top'] = 'fa fa-folder-open-o'; -$_style['files_add'] = 'fa fa-plus-circle'; -$_style['files_upload'] = 'fa fa-upload'; -$_style['files_delete'] = 'fa fa-trash'; -$_style['files_duplicate'] = 'fa fa-clone'; -$_style['files_rename'] = 'fa fa-i-cursor'; -$_style['files_view'] = 'fa fa-eye'; -$_style['files_download'] = 'fa fa-download'; -$_style['files_unzip'] = 'fa fa-file-archive-o'; -$_style['files_edit'] = 'fa fa-pencil-square-o'; - -//Action buttons -$_style['actions_save'] = 'fa fa-floppy-o'; -$_style['actions_duplicate'] = 'fa fa-clone'; -$_style['actions_delete'] = 'fa fa-trash'; -$_style['actions_cancel'] = 'fa fa-times-circle'; -$_style['actions_close'] = 'fa fa-times-circle'; -$_style['actions_add'] = 'fa fa-plus-circle'; -$_style['actions_preview'] = 'fa fa-eye'; -$_style['actions_run'] = 'fa fa-play'; -$_style['actions_stop'] = 'fa fa-stop'; -$_style['actions_new'] = 'fa fa-plus-circle'; -$_style['actions_help'] = 'fa fa-question-circle'; -$_style['actions_sort'] = 'fa fa-sort'; -$_style['actions_options'] = 'fa fa-check-square'; -$_style['actions_categories'] = 'fa fa-folder-open'; -$_style['actions_search'] = 'fa fa-search'; -$_style['actions_file'] = 'fa fa-file-o'; -$_style['actions_folder'] = 'fa fa-folder-o'; -$_style['actions_folder_open'] = 'fa fa-folder-open-o'; -$_style['actions_calendar'] = 'fa fa-calendar'; -$_style['actions_calendar_delete'] = 'fa fa-calendar-times-o'; -$_style['actions_angle_up'] = 'fa fa-angle-up'; -$_style['actions_angle_down'] = 'fa fa-angle-down'; -$_style['actions_angle_left'] = 'fa fa-angle-left'; -$_style['actions_angle_right'] = 'fa fa-angle-right'; -$_style['actions_chain'] = 'fa fa-chain'; -$_style['actions_chain_broken'] = 'fa fa-chain-broken'; -$_style['actions_edit'] = 'fa fa-edit'; -$_style['actions_move'] = 'fa fa-arrows'; -$_style['actions_pencil'] = 'fa fa-pencil'; -$_style['actions_reply'] = 'fa fa-reply'; -$_style['actions_plus'] = 'fa fa-plus'; -$_style['actions_refresh'] = 'fa fa-refresh'; -$_style['actions_error'] = 'fa fa-times-circle'; -$_style['actions_info'] = 'fa fa-info-circle'; -$_style['actions_triangle'] = 'fa fa-exclamation-triangle'; -$_style['actions_table'] = 'fa fa-table'; - -//for back compatibility - -$_style['icons_save'] = $style_path.'icons/save.png'; -$_style['icons_delete'] = $style_path.'icons/trash.png'; -$_style['icons_deleted_folder'] = $style_path.'tree/deletedfolder.png'; -$_style['icons_unzip'] = $style_path.'icons/download-alt.png'; - - -// Indicators -$_style['icons_tooltip'] = 'fa fa-question-circle'; -$_style['icons_tooltip_over'] = $style_path.'icons/question-sign.png'; -$_style['icons_cal'] = $style_path.'icons/calendar.png'; -$_style['icons_cal_nodate'] = $style_path.'icons/calendar.png'; -$_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; - -//modules -$_style['icons_module'] = 'fa fa-cube'; -$_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png'; -$_style['icons_run'] = $style_path.'icons/play.png'; - -//users and webusers -$_style['icons_user'] = 'fa fa-user-circle-o'; //$style_path.'icons/user.png'; -$_style['icons_web_user'] = 'fa fa-user'; //$style_path.'icons/user.png'; - -//Messages -$_style['icons_message_unread'] = $style_path.'icons/email.png'; -$_style['icons_message_forward'] = $style_path.'icons/forward.png'; -$_style['icons_message_reply'] = $style_path.'icons/reply.png'; - -// Icons -$_style['icons_add'] = $style_path.'icons/add.png'; -$_style['icons_cancel'] = $style_path.'icons/cancel.png'; -$_style['icons_close'] = $style_path.'icons/stop.png'; -$_style['icons_refresh'] = $style_path.'icons/refresh.png'; -$_style['icons_table'] = $style_path.'icons/table.png'; - -// top bar -$_style['icons_loading_doc_tree'] = $style_path.'icons/info-sign.png'; -$_style['icons_mail'] = $style_path.'icons/email.png'; -$_style['icons_working'] = $style_path.'icons/exclamation.png'; - -//event log -$_style['icons_event1'] = $style_path.'icons/event1.png'; -$_style['icons_event2'] = $style_path.'icons/event2.png'; -$_style['icons_event3'] = $style_path.'icons/event3.png'; - - -//nowhere in the manager -$_style['icons_folder'] = $style_path.'icons/folder.png'; -$_style['icons_email'] = $style_path.'icons/email.png'; -$_style['icons_home'] = $style_path.'icons/home.png'; -$_style['icons_sort_menuindex'] = $style_path.'icons/sort_index.png'; -$_style['icons_weblink'] = $style_path.'icons/world_link.png'; -$_style['icons_tab_preview'] = $style_path.'icons/preview.png'; // Tabs -$_style['icons_information'] = $style_path.'icons/info-sign.png'; - - -// Miscellaneous -$_style['ajax_loader'] = '

    '.$_lang['loading_page'].'

    '; -$_style['tx'] = $style_path.'misc/_tx_.gif'; -$_style['icons_right_arrow'] = $style_path.'icons/arrow-right.png'; -$_style['fade'] = $style_path.'misc/fade.gif'; -$_style['ed_save'] = $style_path.'misc/ed_save.gif'; - -// actions buttons templates -$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; -if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) { - $_REQUEST['stay'] = 2; -} -if (isset($_REQUEST['stay'])) { - $_SESSION['stay'] = $_REQUEST['stay']; -} else if (isset($_SESSION['stay'])) { - $_REQUEST['stay'] = $_SESSION['stay']; -} -$stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; -$addnew = 0; -$run = 0; -switch($action) { - case '3': - case '4': - case '27': - case '72': - if($modx->hasPermission('new_document')) { - $addnew = 1; - } - break; - case '16': - case '19': - if($modx->hasPermission('new_template')) { - $addnew = 1; - } - break; - case '300': - case '301': - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { - $addnew = 1; - } - break; - case '77': - case '78': - if($modx->hasPermission('new_chunk')) { - $addnew = 1; - } - break; - case '22': - case '23': - if($modx->hasPermission('new_snippet')) { - $addnew = 1; - } - break; - case '101': - case '102': - if($modx->hasPermission('new_plugin')) { - $addnew = 1; - } - break; - case '106': - case '107': - case '108': - if($modx->hasPermission('new_module')) { - $addnew = 1; - } - if($modx->hasPermission('exec_module')) { - $run = 1; - } - break; - case '88': - if($modx->hasPermission('new_web_user')) { - $addnew = 1; - } - break; -} - -$disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; - -$_style['actionbuttons'] = array( - 'dynamic' => array( - 'document' => '
    -
    -
    - - ' . $_lang['save'] . ' - - - -
    ' . - ($addnew ? ' - - ' . $_lang['duplicate'] . ' - - ' : '') . ' - - ' . $_lang['delete'] . ' - - - ' . $_lang['cancel'] . ' - - - ' . $_lang['preview'] . ' - -
    -
    ', - 'user' => '
    -
    -
    - - ' . $_lang['save'] . ' - - - -
    - - ' . $_lang['delete'] . ' - - - ' . $_lang['cancel'] . ' - -
    -
    ', - 'element' => '
    -
    -
    - - ' . $_lang['save'] . ' - - - -
    - ' . ($addnew ? ' - - ' . $_lang['duplicate'] . ' - - ' : '') . ' - - ' . $_lang['delete'] . ' - - - ' . $_lang['cancel'] . ' - - ' . ($run ? ' - - ' . $_lang['run_module'] . ' - - ' : '') . ' -
    -
    ', - 'newmodule' => ($addnew ? '' : ''), - 'close' => '', - 'save' => '', - 'savedelete' => '', - 'cancel' => '', - 'canceldelete' => '', - ), - 'static' => array( - 'document' => '', - 'cancel' => '', - ) -); +config['manager_theme']/style.php + * Function: Manager style variables for images and icons. + * Encoding: UTF-8 + * Credit: icons by Mark James of FamFamFam http://www.famfamfam.com/lab/icons/ + * Date: 18-Mar-2010 + * Version: 1.1 + * MODX version: 1.0.3 + */ +$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; +$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; +if(empty($modx->config['lang_code'])) { + global $modx_lang_attribute; + $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; +} + +if (isset($_GET['a']) && $_GET['a'] == 2) { + include_once('welcome.php'); +} + +// Favicon +$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'); + +// Icons +$_style['icon_size_2x'] = ' fa-2x'; +$_style['icon_size_fix'] = ' fa-fw'; +$_style['icon_spin'] = ' fa-spin'; +$_style['icon_template'] = 'fa fa-newspaper-o'; +$_style['icon_tv'] = 'fa fa-list-alt'; +$_style['icon_chunk'] = 'fa fa-th-large'; +$_style['icon_code'] = 'fa fa-code'; +$_style['icon_plugin'] = 'fa fa-plug'; +$_style['icon_elements'] = 'fa fa-th'; +$_style['icon_edit'] = 'fa fa-edit'; +$_style['icon_circle'] = 'fa fa-circle'; +$_style['icon_refresh'] = 'fa fa-refresh'; + +//Main Menu +$_style['menu_search'] = ''; +$_style['menu_preview_site'] = ''; +$_style['menu_new_resource'] = ''; +$_style['menu_system'] = ''; +$_style['menu_user'] = ''; +// full screen +$_style['menu_expand'] = 'fa-expand'; +$_style['menu_compress'] = 'fa-compress'; +//help toggle +$_style['icons_help'] = ''; +//pages +$_style['page_settings'] = ''; +$_style['page_shedule'] = ''; +$_style['page_eventlog'] = ''; +$_style['page_manager_logs'] = ''; +$_style['page_sys_info'] = ''; +$_style['page_help'] = ''; +$_style['page_change_password'] = ''; +$_style['page_logout'] = ''; + +// Tree Menu Toolbar +$_style['add_doc_tree'] = ''; +$_style['add_weblink_tree'] = ''; +$_style['collapse_tree'] = ''; +$_style['empty_recycle_bin'] = ''; +$_style['empty_recycle_bin_empty'] = ''; +$_style['expand_tree'] = ''; +$_style['hide_tree'] = ''; +$_style['refresh_tree'] = ''; +$_style['show_tree'] = $style_path.'tree/expand.png'; +$_style['sort_tree'] = ''; +$_style['sort_menuindex'] = ''; +$_style['element_management'] = ''; +$_style['images_management'] = ''; +$_style['files_management'] = ''; +$_style['email'] = ''; + +//Tree Contextual Menu Popup +$_style['ctx_new_document'] = 'fa fa-file-o'; +$_style['ctx_edit_document'] = 'fa fa-pencil-square-o'; +$_style['ctx_move_document'] = 'fa fa-arrows'; +$_style['ctx_resource_duplicate'] = 'fa fa-clone'; +$_style['ctx_sort_menuindex'] = 'fa fa-sort-numeric-asc'; +$_style['ctx_publish_document'] = 'fa fa-check'; +$_style['ctx_unpublish_resource'] = 'fa fa-close'; +$_style['ctx_delete'] = 'fa fa-trash'; +$_style['ctx_undelete_resource'] = 'fa fa-undo'; +$_style['ctx_weblink'] = 'fa fa-link'; +$_style['ctx_resource_overview'] = 'fa fa-info'; +$_style['ctx_preview_resource'] = 'fa fa-eye'; + +// Tree Icons +$_style['tree_deletedpage'] = ""; +$_style['tree_folder'] = $style_path.'tree/folder-close-alt.png'; /* folder.png */ +$_style['tree_folderopen'] = $style_path.'tree/folder-open-alt.png'; /* folder-open.png */ +$_style['tree_globe'] = $style_path.'tree/globe.png'; +$_style['tree_folder_new'] = ""; /* folder.png */ +$_style['tree_folderopen_new'] = ""; /* folder-open.png */ +$_style['tree_folder_secure'] = ""; +$_style['tree_folderopen_secure'] = ""; +$_style['tree_linkgo'] = ""; +$_style['tree_page'] = ""; +$_style['tree_page_home'] = ""; +$_style['tree_page_404'] = ""; +$_style['tree_page_hourglass'] = ""; +$_style['tree_page_info'] = ""; +$_style['tree_page_blank'] = ""; +$_style['tree_page_css'] = ""; +$_style['tree_page_html'] = ""; +$_style['tree_page_xml'] = ""; +$_style['tree_page_js'] = ""; +$_style['tree_page_rss'] = ""; +$_style['tree_page_pdf'] = ""; +$_style['tree_page_word'] = ""; +$_style['tree_page_excel'] = ""; + +$_style['tree_minusnode'] = "";//$style_path.'tree/angle-down.png'; +$_style['tree_plusnode'] = "";//$style_path.'tree/angle-right.png'; +$_style['tree_weblink'] = $style_path.'tree/link.png'; +$_style['tree_preview_resource'] = "";//$style_path.'icons/eye.png'; + +$_style['tree_showtree'] = ''; +$_style['tree_working'] = ''; +$_style['tree_info'] = ''; + +$_style['tree_page_secure'] = ""; +$_style['tree_page_blank_secure'] = ""; +$_style['tree_page_css_secure'] = ""; +$_style['tree_page_html_secure'] = ""; +$_style['tree_page_xml_secure'] = ""; +$_style['tree_page_js_secure'] = ""; +$_style['tree_page_rss_secure'] = ""; +$_style['tree_page_pdf_secure'] = ""; +$_style['tree_page_word_secure'] = ""; +$_style['tree_page_excel_secure'] = ""; + +//search +$_style['icons_external_link'] = ''; + +//View Resource data +$_style['icons_new_document'] = 'fa fa-file-o'; +$_style['icons_new_weblink'] = 'fa fa-link'; +$_style['icons_move_document'] = 'fa fa-arrows'; +$_style['icons_publish_document'] = 'fa fa-check'; +$_style['icons_unpublish_resource'] = 'fa fa-close'; +$_style['icons_delete_resource'] = 'fa fa-trash'; +$_style['icons_undelete_resource'] = 'fa fa-undo'; +$_style['icons_resource_overview'] = 'fa fa-info'; +$_style['icons_edit_resource'] = 'fa fa-pencil-square-o'; +//context menu +$_style['icons_resource_duplicate'] = $style_path.'icons/clone.png'; +$_style['icons_edit_document'] = $style_path.'icons/save.png'; +$_style['icons_delete_document'] = $style_path.'icons/trash.png'; +//locks +$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; +$_style['icons_secured'] = '';//$style_path.'icons/lock.png'; + +//file manager icons +$_style['files_save'] = 'fa fa-floppy-o'; +$_style['files_folder'] = 'fa fa-folder-o'; +$_style['files_deleted_folder'] = 'fa fa-folder-o'; +$_style['files_folder-open'] = 'fa fa-folder-open-o'; +$_style['files_page_php'] = 'fa fa-file-o'; +$_style['files_page_html'] = 'fa fa-file-o'; +$_style['files_cancel'] = 'fa fa-times-circle'; +$_style['files_top'] = 'fa fa-folder-open-o'; +$_style['files_add'] = 'fa fa-plus-circle'; +$_style['files_upload'] = 'fa fa-upload'; +$_style['files_delete'] = 'fa fa-trash'; +$_style['files_duplicate'] = 'fa fa-clone'; +$_style['files_rename'] = 'fa fa-i-cursor'; +$_style['files_view'] = 'fa fa-eye'; +$_style['files_download'] = 'fa fa-download'; +$_style['files_unzip'] = 'fa fa-file-archive-o'; +$_style['files_edit'] = 'fa fa-pencil-square-o'; + +//Action buttons +$_style['actions_save'] = 'fa fa-floppy-o'; +$_style['actions_duplicate'] = 'fa fa-clone'; +$_style['actions_delete'] = 'fa fa-trash'; +$_style['actions_cancel'] = 'fa fa-times-circle'; +$_style['actions_close'] = 'fa fa-times-circle'; +$_style['actions_add'] = 'fa fa-plus-circle'; +$_style['actions_preview'] = 'fa fa-eye'; +$_style['actions_run'] = 'fa fa-play'; +$_style['actions_stop'] = 'fa fa-stop'; +$_style['actions_new'] = 'fa fa-plus-circle'; +$_style['actions_help'] = 'fa fa-question-circle'; +$_style['actions_sort'] = 'fa fa-sort'; +$_style['actions_options'] = 'fa fa-check-square'; +$_style['actions_categories'] = 'fa fa-folder-open'; +$_style['actions_search'] = 'fa fa-search'; +$_style['actions_file'] = 'fa fa-file-o'; +$_style['actions_folder'] = 'fa fa-folder-o'; +$_style['actions_folder_open'] = 'fa fa-folder-open-o'; +$_style['actions_calendar'] = 'fa fa-calendar'; +$_style['actions_calendar_delete'] = 'fa fa-calendar-times-o'; +$_style['actions_angle_up'] = 'fa fa-angle-up'; +$_style['actions_angle_down'] = 'fa fa-angle-down'; +$_style['actions_angle_left'] = 'fa fa-angle-left'; +$_style['actions_angle_right'] = 'fa fa-angle-right'; +$_style['actions_chain'] = 'fa fa-chain'; +$_style['actions_chain_broken'] = 'fa fa-chain-broken'; +$_style['actions_edit'] = 'fa fa-edit'; +$_style['actions_move'] = 'fa fa-arrows'; +$_style['actions_pencil'] = 'fa fa-pencil'; +$_style['actions_reply'] = 'fa fa-reply'; +$_style['actions_plus'] = 'fa fa-plus'; +$_style['actions_refresh'] = 'fa fa-refresh'; +$_style['actions_error'] = 'fa fa-times-circle'; +$_style['actions_info'] = 'fa fa-info-circle'; +$_style['actions_triangle'] = 'fa fa-exclamation-triangle'; +$_style['actions_table'] = 'fa fa-table'; + +//for back compatibility + +$_style['icons_save'] = $style_path.'icons/save.png'; +$_style['icons_delete'] = $style_path.'icons/trash.png'; +$_style['icons_deleted_folder'] = $style_path.'tree/deletedfolder.png'; +$_style['icons_unzip'] = $style_path.'icons/download-alt.png'; + + +// Indicators +$_style['icons_tooltip'] = 'fa fa-question-circle'; +$_style['icons_tooltip_over'] = $style_path.'icons/question-sign.png'; +$_style['icons_cal'] = $style_path.'icons/calendar.png'; +$_style['icons_cal_nodate'] = $style_path.'icons/calendar.png'; +$_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; + +//modules +$_style['icons_module'] = 'fa fa-cube'; +$_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png'; +$_style['icons_run'] = $style_path.'icons/play.png'; + +//users and webusers +$_style['icons_user'] = 'fa fa-user-circle-o'; //$style_path.'icons/user.png'; +$_style['icons_web_user'] = 'fa fa-user'; //$style_path.'icons/user.png'; + +//Messages +$_style['icons_message_unread'] = $style_path.'icons/email.png'; +$_style['icons_message_forward'] = $style_path.'icons/forward.png'; +$_style['icons_message_reply'] = $style_path.'icons/reply.png'; + +// Icons +$_style['icons_add'] = $style_path.'icons/add.png'; +$_style['icons_cancel'] = $style_path.'icons/cancel.png'; +$_style['icons_close'] = $style_path.'icons/stop.png'; +$_style['icons_refresh'] = $style_path.'icons/refresh.png'; +$_style['icons_table'] = $style_path.'icons/table.png'; + +// top bar +$_style['icons_loading_doc_tree'] = $style_path.'icons/info-sign.png'; +$_style['icons_mail'] = $style_path.'icons/email.png'; +$_style['icons_working'] = $style_path.'icons/exclamation.png'; + +//event log +$_style['icons_event1'] = $style_path.'icons/event1.png'; +$_style['icons_event2'] = $style_path.'icons/event2.png'; +$_style['icons_event3'] = $style_path.'icons/event3.png'; + + +//nowhere in the manager +$_style['icons_folder'] = $style_path.'icons/folder.png'; +$_style['icons_email'] = $style_path.'icons/email.png'; +$_style['icons_home'] = $style_path.'icons/home.png'; +$_style['icons_sort_menuindex'] = $style_path.'icons/sort_index.png'; +$_style['icons_weblink'] = $style_path.'icons/world_link.png'; +$_style['icons_tab_preview'] = $style_path.'icons/preview.png'; // Tabs +$_style['icons_information'] = $style_path.'icons/info-sign.png'; + + +// Miscellaneous +$_style['ajax_loader'] = '

    '.$_lang['loading_page'].'

    '; +$_style['tx'] = $style_path.'misc/_tx_.gif'; +$_style['icons_right_arrow'] = $style_path.'icons/arrow-right.png'; +$_style['fade'] = $style_path.'misc/fade.gif'; +$_style['ed_save'] = $style_path.'misc/ed_save.gif'; + +// actions buttons templates +$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; +if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) { + $_REQUEST['stay'] = 2; +} +if (isset($_REQUEST['stay'])) { + $_SESSION['stay'] = $_REQUEST['stay']; +} else if (isset($_SESSION['stay'])) { + $_REQUEST['stay'] = $_SESSION['stay']; +} +$stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; +$addnew = 0; +$run = 0; +switch ($action) { + case '3': + case '4': + case '27': + case '72': + if ($modx->hasPermission('new_document')) { + $addnew = 1; + } + break; + case '16': + case '19': + if ($modx->hasPermission('new_template')) { + $addnew = 1; + } + break; + case '300': + case '301': + if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { + $addnew = 1; + } + break; + case '77': + case '78': + if ($modx->hasPermission('new_chunk')) { + $addnew = 1; + } + break; + case '22': + case '23': + if ($modx->hasPermission('new_snippet')) { + $addnew = 1; + } + break; + case '101': + case '102': + if ($modx->hasPermission('new_plugin')) { + $addnew = 1; + } + break; + case '106': + case '107': + case '108': + if ($modx->hasPermission('new_module')) { + $addnew = 1; + } + if ($modx->hasPermission('exec_module')) { + $run = 1; + } + break; + case '88': + if ($modx->hasPermission('new_web_user')) { + $addnew = 1; + } + break; +} + +$disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; + +$_style['actionbuttons'] = array( + 'dynamic' => array( + 'document' => '
    +
    +
    + + ' . $_lang['save'] . ' + + + +
    ' . + ($addnew ? ' + + ' . $_lang['duplicate'] . ' + + ' : '') . ' + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + + + ' . $_lang['preview'] . ' + +
    +
    ', + 'user' => '
    +
    +
    + + ' . $_lang['save'] . ' + + + +
    + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + +
    +
    ', + 'element' => '
    +
    +
    + + ' . $_lang['save'] . ' + + + +
    + ' . ($addnew ? ' + + ' . $_lang['duplicate'] . ' + + ' : '') . ' + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + + ' . ($run ? ' + + ' . $_lang['run_module'] . ' + + ' : '') . ' +
    +
    ', + 'newmodule' => ($addnew ? '' : ''), + 'close' => '', + 'save' => '', + 'savedelete' => '', + 'cancel' => '', + 'canceldelete' => '', + ), + 'static' => array( + 'document' => '', + 'cancel' => '', + ) +); diff --git a/manager/processors/cache_sync.class.processor.php b/manager/processors/cache_sync.class.processor.php index 80822ac7b7..cf099037f6 100755 --- a/manager/processors/cache_sync.class.processor.php +++ b/manager/processors/cache_sync.class.processor.php @@ -27,7 +27,7 @@ public function __construct() { $modx = evolutionCMS(); - $this->request_time = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; + $this->request_time = $_SERVER['REQUEST_TIME'] + ($modx->config['server_offset_time'] ?? 0); } /** @@ -83,7 +83,7 @@ public function getParents($id, $path = '') $modx = evolutionCMS(); if (empty($this->aliases)) { $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible"; - $rs = $modx->db->select($f, '[+prefix+]site_content', 'deleted=0'); + $rs = $modx->db->select($f, '[+prefix+]site_content', 'deleted=0 and isfolder=1'); while ($row = $modx->db->getRow($rs)) { $docid = $row['id']; $this->aliases[$docid] = $row['alias']; @@ -265,7 +265,7 @@ public function buildCache($modx) } if (!isset($config['full_aliaslisting']) || $config['full_aliaslisting'] != 1) { - if ($config['aliaslistingfolder'] == 1) { + if (!empty($config['aliaslistingfolder'])) { $f['id'] = 'c.id'; $f['alias'] = "IF( c.alias='', c.id, c.alias)"; $f['parent'] = 'c.parent'; @@ -302,13 +302,6 @@ public function buildCache($modx) $content .= '$d[\'' . $key . '\']=' . $docid . ';'; $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');'; } - - // get content types - $rs = $modx->db->select('id, contentType', '[+prefix+]site_content', "contentType!='text/html'"); - $content .= '$c=&$this->contentTypes;'; - while ($doc = $modx->db->getRow($rs)) { - $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';'; - } } if (!isset($config['disable_chunk_cache']) || $config['disable_chunk_cache'] != 1) { @@ -332,7 +325,7 @@ public function buildCache($modx) $content .= '$s[\'' . $key . '\']=\'return false;\';'; } else { $value = trim($row['snippet']); - if ($modx->config['minifyphp_incache']) { + if (!empty($modx->config['minifyphp_incache'])) { $value = $this->php_strip_whitespace($value); } $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; @@ -357,7 +350,7 @@ public function buildCache($modx) while ($row = $modx->db->getRow($rs)) { $key = $modx->db->escape($row['name']); $value = trim($row['plugincode']); - if ($modx->config['minifyphp_incache']) { + if (!empty($modx->config['minifyphp_incache'])) { $value = $this->php_strip_whitespace($value); } $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; @@ -409,7 +402,7 @@ public function buildCache($modx) } if (!is_file($this->cachePath . '/.htaccess')) { - file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n"); + file_put_contents($this->cachePath . '/.htaccess', "\nRequire all denied\n\n\norder deny,allow\ndeny from all\n\n"); } // invoke OnCacheUpdate event diff --git a/manager/processors/duplicate_content.processor.php b/manager/processors/duplicate_content.processor.php index 68df5e3a36..1b82b10d8f 100755 --- a/manager/processors/duplicate_content.processor.php +++ b/manager/processors/duplicate_content.processor.php @@ -139,6 +139,8 @@ function duplicateDocument($docid, $parent=null, $_toplevel=0) { duplicateDocument($row['id'], $newparent, $_toplevel); // return the new doc id + $modx->clearCache('full'); + return $newparent; } diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php index 5132051dfa..ca878259f6 100755 --- a/manager/processors/login.processor.php +++ b/manager/processors/login.processor.php @@ -1,11 +1,11 @@ db->connect(); $modx->getSettings(); $modx->invokeEvent('OnManagerPageInit'); @@ -17,49 +17,56 @@ extract($modx->config, EXTR_OVERWRITE); // include_once the language file -$_lang = array(); +$_lang = []; include_once("{$core_path}lang/english.inc.php"); -if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) { - include_once("{$core_path}lang/{$manager_language}.inc.php"); +if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) { + include_once("{$core_path}lang/{$manager_language}.inc.php"); } // allow custom language overrides not altered by future EVO-updates -if(is_file("{$core_path}lang/override/{$manager_language}.inc.php")) { - include_once("{$core_path}lang/override/{$manager_language}.inc.php"); +if (is_file("{$core_path}lang/override/{$manager_language}.inc.php")) { + include_once("{$core_path}lang/override/{$manager_language}.inc.php"); } // include the logger include_once("{$core_path}log.class.inc.php"); // Initialize System Alert Message Queque -if(!isset($_SESSION['SystemAlertMsgQueque'])) { - $_SESSION['SystemAlertMsgQueque'] = array(); +if (!isset($_SESSION['SystemAlertMsgQueque'])) { + $_SESSION['SystemAlertMsgQueque'] = []; } $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; // initiate the content manager class // for backward compatibility -$username = isset($_REQUEST['username']) ? $modx->db->escape($modx->htmlspecialchars($_REQUEST['username'], ENT_NOQUOTES)) : ''; -$givenPassword = isset($_POST['password']) ? $modx->htmlspecialchars($_POST['password'], ENT_NOQUOTES) : ''; -$captcha_code = isset($_POST['captcha_code']) ? $_POST['captcha_code'] : ''; -$rememberme = isset($_POST['rememberme']) ? $_POST['rememberme'] : ''; +if (isset($_GET['username']) && is_scalar($_GET['username'])) { + $username = $_GET['username']; +} elseif (isset($_POST['username']) && is_scalar($_POST['username'])) { + $username = $_POST['username']; +} else { + $username = ''; +} +$username = $modx->db->escape($modx->htmlspecialchars($username, ENT_NOQUOTES)); +$givenPassword = $modx->htmlspecialchars($_POST['password'] ?? '', ENT_NOQUOTES); +$captcha_code = $_POST['captcha_code'] ?? ''; +$rememberme = $_POST['rememberme'] ?? ''; $failed_allowed = $modx->config['failed_login_attempts']; // invoke OnBeforeManagerLogin event -$modx->invokeEvent('OnBeforeManagerLogin', array( - 'username' => $username, - 'userpassword' => $givenPassword, - 'rememberme' => $rememberme - )); +$modx->invokeEvent('OnBeforeManagerLogin', [ + 'username' => $username, + 'userpassword' => $givenPassword, + 'rememberme' => $rememberme +]); $fields = 'mu.*, ua.*'; $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua'; $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id"; $rs = $modx->db->select($fields, $from, $where); $limit = $modx->db->getRecordCount($rs); -if($limit == 0 || $limit > 1) { - jsAlert($_lang['login_processor_unknown_user']); - return; +if ($limit == 0 || $limit > 1) { + jsAlert($_lang['login_processor_unknown_user']); + return; } $row = $modx->db->getRow($rs); @@ -78,131 +85,134 @@ $email = $row['email']; // get the user settings from the database -$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''"); -while($row = $modx->db->getRow($rs)) { - extract($row); - ${$setting_name} = $setting_value; +$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', + "user='{$internalKey}' AND setting_value!=''"); +while ($row = $modx->db->getRow($rs)) { + extract($row); + ${$setting_name} = $setting_value; } // blocked due to number of login errors. -if($failedlogins >= $failed_allowed && $blockeduntildate > time()) { - @session_destroy(); - session_unset(); - if($cip = getenv("HTTP_CLIENT_IP")) { - $ip = $cip; - } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) { - $ip = $cip; - } elseif($cip = getenv("REMOTE_ADDR")) { - $ip = $cip; - } else { - $ip = "UNKNOWN"; - } - $log = new logHandler; - $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip); - jsAlert($_lang['login_processor_many_failed_logins']); - return; +if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) { + @session_destroy(); + session_unset(); + if ($cip = getenv("HTTP_CLIENT_IP")) { + $ip = $cip; + } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) { + $ip = $cip; + } elseif ($cip = getenv("REMOTE_ADDR")) { + $ip = $cip; + } else { + $ip = "UNKNOWN"; + } + $log = new logHandler; + $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip); + jsAlert($_lang['login_processor_many_failed_logins']); + return; } // blocked due to number of login errors, but get to try again -if($failedlogins >= $failed_allowed && $blockeduntildate < time()) { - $fields = array(); - $fields['failedlogincount'] = '0'; - $fields['blockeduntil'] = time() - 1; - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); +if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) { + $fields = []; + $fields['failedlogincount'] = '0'; + $fields['blockeduntil'] = time() - 1; + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); } // this user has been blocked by an admin, so no way he's loggin in! -if($blocked == '1') { - @session_destroy(); - session_unset(); - jsAlert($_lang['login_processor_blocked1']); - return; +if ($blocked == '1') { + @session_destroy(); + session_unset(); + jsAlert($_lang['login_processor_blocked1']); + return; } // blockuntil: this user has a block until date -if($blockeduntildate > time()) { - @session_destroy(); - session_unset(); - jsAlert($_lang['login_processor_blocked2']); - return; +if ($blockeduntildate > time()) { + @session_destroy(); + session_unset(); + jsAlert($_lang['login_processor_blocked2']); + return; } // blockafter: this user has a block after date -if($blockedafterdate > 0 && $blockedafterdate < time()) { - @session_destroy(); - session_unset(); - jsAlert($_lang['login_processor_blocked3']); - return; +if ($blockedafterdate > 0 && $blockedafterdate < time()) { + @session_destroy(); + session_unset(); + jsAlert($_lang['login_processor_blocked3']); + return; } // allowed ip -if($allowed_ip) { - if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { - if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { - jsAlert($_lang['login_processor_remotehost_ip']); - return; - } - } - if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { - jsAlert($_lang['login_processor_remote_ip']); - return; - } +if ($allowed_ip) { + if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { + if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { + jsAlert($_lang['login_processor_remotehost_ip']); + return; + } + } + if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { + jsAlert($_lang['login_processor_remote_ip']); + return; + } } // allowed days -if($allowed_days) { - $date = getdate(); - $day = $date['wday'] + 1; - if(!in_array($day,explode(',',$allowed_days))) { - jsAlert($_lang['login_processor_date']); - return; - } +if ($allowed_days) { + $date = getdate(); + $day = $date['wday'] + 1; + if (!in_array($day, explode(',', $allowed_days))) { + jsAlert($_lang['login_processor_date']); + return; + } } // invoke OnManagerAuthentication event -$rt = $modx->invokeEvent('OnManagerAuthentication', array( - 'userid' => $internalKey, - 'username' => $username, - 'userpassword' => $givenPassword, - 'savedpassword' => $dbasePassword, - 'rememberme' => $rememberme - )); +$rt = $modx->invokeEvent('OnManagerAuthentication', [ + 'userid' => $internalKey, + 'username' => $username, + 'userpassword' => $givenPassword, + 'savedpassword' => $dbasePassword, + 'rememberme' => $rememberme +]); // check if plugin authenticated the user $matchPassword = false; -if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) { - // check user password - local authentication - $hashType = $modx->manager->getHashType($dbasePassword); - if($hashType == 'phpass') { - $matchPassword = login($username, $_REQUEST['password'], $dbasePassword); - } elseif($hashType == 'md5') { - $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username); - } elseif($hashType == 'v1') { - $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username); - } else { - $matchPassword = false; - } -} else if($rt === true || (is_array($rt) && in_array(true, $rt))) { - $matchPassword = true; +if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) { + // check user password - local authentication + $hashType = $modx->manager->getHashType($dbasePassword); + if ($hashType == 'phpass') { + $matchPassword = login($username, $_POST['password'], $dbasePassword); + } elseif ($hashType == 'md5') { + $matchPassword = loginMD5($internalKey, $_POST['password'], $dbasePassword, $username); + } elseif ($hashType == 'v1') { + $matchPassword = loginV1($internalKey, $_POST['password'], $dbasePassword, $username); + } else { + $matchPassword = false; + } +} else { + if ($rt === true || (is_array($rt) && in_array(true, $rt))) { + $matchPassword = true; + } } -$blocked_minutes = (int)$modx->config['blocked_minutes']; +$blocked_minutes = (int) $modx->config['blocked_minutes']; -if(!$matchPassword) { - jsAlert($_lang['login_processor_wrong_password']); - incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); - return; +if (!$matchPassword) { + jsAlert($_lang['login_processor_wrong_password']); + incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); + return; } -if($modx->config['use_captcha'] == 1) { - if(!isset ($_SESSION['veriword'])) { - jsAlert($_lang['login_processor_captcha_config']); - return; - } elseif($_SESSION['veriword'] != $captcha_code) { - jsAlert($_lang['login_processor_bad_code']); - incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); - return; - } +if ($modx->config['use_captcha'] == 1) { + if (!isset ($_SESSION['veriword'])) { + jsAlert($_lang['login_processor_captcha_config']); + return; + } elseif ($_SESSION['veriword'] != $captcha_code) { + jsAlert($_lang['login_processor_bad_code']); + incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); + return; + } } $modx->cleanupExpiredLocks(); @@ -226,191 +236,203 @@ $_SESSION['mgrPermissions'] = $modx->db->getRow($rs); // successful login so reset fail count and update key values -$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); +$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", + '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); // get user's document groups $i = 0; $rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug - INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'"); + INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', + "ug.member='{$internalKey}'"); $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs); $_SESSION['mgrToken'] = md5($currentsessionid); -if($rememberme == '1') { - $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime']; - - // Set a cookie separate from the session cookie with the username in it. - // Are we using secure connection? If so, make sure the cookie is secure - global $https_port; - - $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); - if(version_compare(PHP_VERSION, '5.2', '<')) { - setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure); - } else { - setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true); - } +if ($rememberme == '1') { + $_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime']; + + // Set a cookie separate from the session cookie with the username in it. + // Are we using secure connection? If so, make sure the cookie is secure + global $https_port; + + $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); + if (version_compare(PHP_VERSION, '5.2', '<')) { + setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, + '; HttpOnly', $secure); + } else { + setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, null, + $secure, true); + } } else { - $_SESSION['modx.mgr.session.cookie.lifetime'] = 0; + $_SESSION['modx.mgr.session.cookie.lifetime'] = 0; - // Remove the Remember Me cookie - setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL); + // Remove the Remember Me cookie + setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL); } // Check if user already has an active session, if not check if user pressed logout end of last session $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'"); $activeSession = $modx->db->getValue($rs); -if(!$activeSession) { - $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8"); - if($lastHit = $modx->db->getValue($rs)) { - $_SESSION['show_logout_reminder'] = array( - 'type' => 'logout_reminder', - 'lastHit' => $lastHit - ); - } +if (!$activeSession) { + $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), + "internalKey='{$internalKey}' AND action != 8"); + if ($lastHit = $modx->db->getValue($rs)) { + $_SESSION['show_logout_reminder'] = [ + 'type' => 'logout_reminder', + 'lastHit' => $lastHit + ]; + } } $log = new logHandler; $log->initAndWriteLog('Logged in', $modx->getLoginUserID(), $_SESSION['mgrShortname'], '58', '-', 'MODX'); // invoke OnManagerLogin event -$modx->invokeEvent('OnManagerLogin', array( - 'userid' => $internalKey, - 'username' => $username, - 'userpassword' => $givenPassword, - 'rememberme' => $rememberme - )); +$modx->invokeEvent('OnManagerLogin', [ + 'userid' => $internalKey, + 'username' => $username, + 'userpassword' => $givenPassword, + 'rememberme' => $rememberme +]); // check if we should redirect user to a web page -$rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'"); -$id = (int)$modx->db->getValue($rs); -if($id > 0) { - $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full'); - if($_POST['ajax'] == 1) { - echo $header; - } else { - header($header); - } +$rs = $modx->db->select('setting_value', '[+prefix+]user_settings', + "user='{$internalKey}' AND setting_name='manager_login_startup'"); +$id = (int) $modx->db->getValue($rs); +if ($id > 0) { + $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full'); + if ($_POST['ajax'] == 1) { + echo $header; + } else { + header($header); + } } else { - $header = 'Location: ' . MODX_MANAGER_URL; - if($_POST['ajax'] == 1) { - echo $header; - } else { - header($header); - } + $header = 'Location: ' . MODX_MANAGER_URL; + if ($_POST['ajax'] == 1) { + echo $header; + } else { + header($header); + } } /** * show javascript alert * - * @param string $msg + * @param string $msg */ -function jsAlert($msg) { - $modx = evolutionCMS(); - if(isset($_POST['ajax']) && $_POST['ajax'] != 1) { - echo ""; - } else { - echo $msg . "\n"; - } +function jsAlert($msg) +{ + $modx = evolutionCMS(); + if ($_POST['ajax'] != 1) { + echo ""; + } else { + echo $msg . "\n"; + } } /** - * @param string $username - * @param string $givenPassword - * @param string $dbasePassword + * @param string $username + * @param string $givenPassword + * @param string $dbasePassword * @return bool */ -function login($username, $givenPassword, $dbasePassword) { - $modx = evolutionCMS(); - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); +function login($username, $givenPassword, $dbasePassword) +{ + $modx = evolutionCMS(); + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } /** - * @param int $internalKey - * @param string $givenPassword - * @param string $dbasePassword - * @param string $username + * @param int $internalKey + * @param string $givenPassword + * @param string $dbasePassword + * @param string $username * @return bool */ -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); - if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; - } + if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; + } - if($user_algo !== $modx->config['pwd_hash_algo']) { - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; - $modx->config['pwd_hash_algo'] = $user_algo; - } + if ($user_algo !== $modx->config['pwd_hash_algo']) { + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; + $modx->config['pwd_hash_algo'] = $user_algo; + } - if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { - return false; - } + if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { + return false; + } - updateNewHash($username, $givenPassword); + updateNewHash($username, $givenPassword); - return true; + return true; } /** - * @param int $internalKey - * @param string $givenPassword - * @param string $dbasePassword - * @param string $username + * @param int $internalKey + * @param string $givenPassword + * @param string $dbasePassword + * @param string $username * @return bool */ -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); - - if($dbasePassword != md5($givenPassword)) { - return false; - } - updateNewHash($username, $givenPassword); - return true; +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); + + if ($dbasePassword != md5($givenPassword)) { + return false; + } + updateNewHash($username, $givenPassword); + return true; } /** - * @param string $username - * @param string $password + * @param string $username + * @param string $password */ -function updateNewHash($username, $password) { - $modx = evolutionCMS(); +function updateNewHash($username, $password) +{ + $modx = evolutionCMS(); - $field = array(); - $field['password'] = $modx->phpass->HashPassword($password); - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); + $field = []; + $field['password'] = $modx->phpass->HashPassword($password); + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); } /** - * @param int $internalKey - * @param int $failedlogins - * @param int $failed_allowed - * @param int $blocked_minutes + * @param int $internalKey + * @param int $failedlogins + * @param int $failed_allowed + * @param int $blocked_minutes */ -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { - $modx = evolutionCMS(); - - $failedlogins += 1; - - $fields = array('failedlogincount' => $failedlogins); - if($failedlogins >= $failed_allowed) //block user for too many fail attempts - { - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); - } - - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); - - if($failedlogins < $failed_allowed) { - //sleep to help prevent brute force attacks - $sleep = (int) $failedlogins / 2; - if($sleep > 5) { - $sleep = 5; - } - sleep($sleep); - } - @session_destroy(); - session_unset(); - return; +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) +{ + $modx = evolutionCMS(); + + $failedlogins += 1; + + $fields = ['failedlogincount' => $failedlogins]; + if ($failedlogins >= $failed_allowed) //block user for too many fail attempts + { + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); + } + + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); + + if ($failedlogins < $failed_allowed) { + //sleep to help prevent brute force attacks + $sleep = (int) $failedlogins / 2; + if ($sleep > 5) { + $sleep = 5; + } + sleep($sleep); + } + @session_destroy(); + session_unset(); + return; } diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index c0a8c390fd..846afd4a41 100755 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -15,7 +15,12 @@ if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); - +if ($newParentID > 0) { + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "`id`={$newParentID} AND `deleted`=0"); + if (!$modx->db->getValue($rs)) { + $modx->webAlertAndQuit($_lang["error_parent_deleted"]); + } +} $parents = $modx->getParentIds($newParentID); if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index 6883cf8eac..c4c4170bdb 100755 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR


    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_document')) { @@ -14,33 +14,32 @@ $description = $modx->db->escape($_POST['description']); $alias = $modx->db->escape($_POST['alias']); $link_attributes = $modx->db->escape($_POST['link_attributes']); -$isfolder = (int)$_POST['isfolder']; -$richtext = (int)$_POST['richtext']; -$published = (int)$_POST['published']; -$parent = $_POST['parent'] != '' ? (int)$_POST['parent'] : 0; -$template = (int)$_POST['template']; -$menuindex = !empty($_POST['menuindex']) ? (int)$_POST['menuindex'] : 0; -$searchable = (int)$_POST['searchable']; -$cacheable = (int)$_POST['cacheable']; -$syncsite = (int)$_POST['syncsite']; +$isfolder = (int) $_POST['isfolder']; +$richtext = (int) $_POST['richtext']; +$published = (int) $_POST['published']; +$parent = $_POST['parent'] != '' ? (int) $_POST['parent'] : 0; +$template = (int) $_POST['template']; +$menuindex = !empty($_POST['menuindex']) ? (int) $_POST['menuindex'] : 0; +$searchable = (int) $_POST['searchable']; +$cacheable = (int) $_POST['cacheable']; +$syncsite = (int) $_POST['syncsite']; $pub_date = $_POST['pub_date']; $unpub_date = $_POST['unpub_date']; -$document_groups = (isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on') ? array() : $_POST['docgroups']; +$document_groups = (isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on') ? [] : $_POST['docgroups']; $type = $modx->db->escape($_POST['type']); $contentType = $modx->db->escape($_POST['contentType']); -$contentdispo = (int)$_POST['content_dispo']; +$contentdispo = (int) $_POST['content_dispo']; $longtitle = $modx->db->escape($_POST['longtitle']); -$donthit = (int)$_POST['donthit']; +$donthit = (int) $_POST['donthit']; $menutitle = $modx->db->escape($_POST['menutitle']); -$hidemenu = (int)$_POST['hidemenu']; -$aliasvisible = (int)$_POST['alias_visible']; +$hidemenu = (int) $_POST['hidemenu']; +$aliasvisible = (int) $_POST['alias_visible']; /************* webber ********/ -$sd=isset($_POST['dir']) && strtolower($_POST['dir']) === 'asc' ? '&dir=ASC' : '&dir=DESC'; -$sb=isset($_POST['sort'])?'&sort='.html_escape($_POST['sort'], $modx->config['modx_charset']):'&sort=pub_date'; -$pg=isset($_POST['page'])?'&page='.(int)$_POST['page']:''; -$add_path=$sd.$sb.$pg; - +$sd = isset($_POST['dir']) && strtolower($_POST['dir']) === 'asc' ? '&dir=ASC' : '&dir=DESC'; +$sb = isset($_POST['sort']) ? '&sort=' . html_escape($_POST['sort'], $modx->config['modx_charset']) : '&sort=pub_date'; +$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; +$add_path = $sd . $sb . $pg; $no_esc_pagetitle = $_POST['pagetitle']; @@ -53,15 +52,15 @@ } // get table names -$tbl_document_groups = $modx->getFullTableName('document_groups'); -$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); -$tbl_member_groups = $modx->getFullTableName('member_groups'); -$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access'); +$tbl_document_groups = $modx->getFullTableName('document_groups'); +$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); +$tbl_member_groups = $modx->getFullTableName('member_groups'); +$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access'); $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); -$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $actionToTake = "new"; if ($_POST['mode'] == '73' || $_POST['mode'] == '27') { @@ -73,22 +72,26 @@ // auto assign alias if (!$alias && $automatic_alias) { $alias = strtolower($modx->stripAlias(trim($pagetitle))); - if(!$allow_duplicate_alias) { - if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND alias='$alias'")) != 0) { + if (!$allow_duplicate_alias) { + if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, + "id<>'$id' AND alias='$alias'")) != 0) { $cnt = 1; $tempAlias = $alias; - while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND alias='$tempAlias'")) != 0) { + while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, + "id<>'$id' AND alias='$tempAlias'")) != 0) { $tempAlias = $alias; $tempAlias .= $cnt; $cnt++; } $alias = $tempAlias; } - }else{ - if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND parent=$parent AND alias='$alias'")) != 0) { + } else { + if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, + "id<>'$id' AND parent=$parent AND alias='$alias'")) != 0) { $cnt = 1; $tempAlias = $alias; - while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND parent=$parent AND alias='$tempAlias'")) != 0) { + while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, + "id<>'$id' AND parent=$parent AND alias='$tempAlias'")) != 0) { $tempAlias = $alias; $tempAlias .= $cnt; $cnt++; @@ -96,37 +99,38 @@ $alias = $tempAlias; } } - } - - // check for duplicate alias name if not allowed + } // check for duplicate alias name if not allowed elseif ($alias && !$allow_duplicate_alias) { $alias = $modx->stripAlias($alias); if ($use_alias_path) { // only check for duplicates on the same level if alias_path is on - $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1)); + $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, + "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1)); } else { - $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias'", '', 1)); + $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias'", '', + 1)); } if ($docid > 0) { if ($actionToTake == 'edit') { $modx->manager->saveFormValues(27); - $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=27&id={$id}"); + $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), + "index.php?a=27&id={$id}"); } else { $modx->manager->saveFormValues(4); $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=4"); } } - } - - // strip alias of special characters + } // strip alias of special characters elseif ($alias) { $alias = $modx->stripAlias($alias); //webber - $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1)); + $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, + "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1)); if ($docid > 0) { if ($actionToTake == 'edit') { $modx->manager->saveFormValues(27); - $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=27&id={$id}"); + $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), + "index.php?a=27&id={$id}"); } else { $modx->manager->saveFormValues(4); $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=4"); @@ -134,8 +138,7 @@ } //end webber } -} -elseif ($alias) { +} elseif ($alias) { $alias = $modx->stripAlias($alias); } @@ -149,8 +152,7 @@ if ($pub_date < $currentdate) { $published = 1; - } - elseif ($pub_date > $currentdate) { + } elseif ($pub_date > $currentdate) { $published = 0; } } @@ -165,20 +167,21 @@ } // get document groups for current user -$tmplvars = array (); +$tmplvars = []; $docgrp = ''; if ($_SESSION['mgrDocgroups']) { $docgrp = implode(",", $_SESSION['mgrDocgroups']); } // ensure that user has not made this document inaccessible to themselves -if($_SESSION['mgrRole'] != 1 && is_array($document_groups)) { +if ($_SESSION['mgrRole'] != 1 && is_array($document_groups)) { $document_group_list = implode(',', $document_groups); - $document_group_list = implode(',', array_filter(explode(',',$document_group_list), 'is_numeric')); - if(!empty($document_group_list)) { - $rs = $modx->db->select('COUNT(mg.id)', "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg", "mga.membergroup = mg.user_group AND mga.documentgroup IN({$document_group_list}) AND mg.member = {$_SESSION['mgrInternalKey']}"); + $document_group_list = implode(',', array_filter(explode(',', $document_group_list), 'is_numeric')); + if (!empty($document_group_list)) { + $rs = $modx->db->select('COUNT(mg.id)', "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg", + "mga.membergroup = mg.user_group AND mga.documentgroup IN({$document_group_list}) AND mg.member = {$_SESSION['mgrInternalKey']}"); $count = $modx->db->getValue($rs); - if($count == 0) { + if ($count == 0) { if ($actionToTake == 'edit') { $modx->manager->saveFormValues(27); $modx->webAlertAndQuit(sprintf($_lang["resource_permissions_error"]), "index.php?a=27&id={$id}"); @@ -198,46 +201,46 @@ LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", "tv.rank" - ); +); while ($row = $modx->db->getRow($rs)) { $tmplvar = ''; switch ($row['type']) { case 'url': - $tmplvar = $_POST["tv" . $row['id']]; - if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { - $tmplvar = str_replace(array ( + $tmplvar = $_POST["tv" . $row['id']] ?? ''; + if (isset($_POST["tv" . $row['id'] . '_prefix']) && $_POST["tv" . $row['id'] . '_prefix'] != '--') { + $tmplvar = str_replace([ "feed://", "ftp://", "http://", "https://", "mailto:" - ), "", $tmplvar); + ], "", $tmplvar); $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; } - break; + break; case 'file': - $tmplvar = $_POST["tv" . $row['id']]; - break; + $tmplvar = $_POST["tv" . $row['id']] ?? ''; + break; default: - if (is_array($_POST["tv" . $row['id']])) { + if (isset($_POST["tv" . $row['id']]) && is_array($_POST["tv" . $row['id']])) { // handles checkboxes & multiple selects elements - $feature_insert = array (); + $feature_insert = []; $lst = $_POST["tv" . $row['id']]; - foreach($lst as $featureValue => $feature_item) { + foreach ($lst as $featureValue => $feature_item) { $feature_insert[count($feature_insert)] = $feature_item; } $tmplvar = implode("||", $feature_insert); } else { - $tmplvar = $_POST["tv" . $row['id']]; + $tmplvar = $_POST["tv" . $row['id']] ?? ''; } - break; + break; } // save value if it was modified - if (strlen($tmplvar) > 0 && $tmplvar != $row['default_text']) { - $tmplvars[$row['id']] = array ( + if ($tmplvar != '' && $tmplvar != $row['default_text']) { + $tmplvars[$row['id']] = [ $row['id'], $tmplvar - ); + ]; } else { // Mark the variable for deletion $tmplvars[$row['name']] = $row['id']; @@ -257,7 +260,7 @@ // check to see if the user is allowed to save the document in the place he wants to save it in if ($use_udperms == 1) { if ($existingDocument['parent'] != $parent) { - include_once MODX_MANAGER_PATH ."processors/user_documents_permissions.class.php"; + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; $udperms = new udperms(); $udperms->user = $modx->getLoginUserID(); $udperms->document = $parent; @@ -266,10 +269,12 @@ if (!$udperms->checkPermissions()) { if ($actionToTake == 'edit') { $modx->manager->saveFormValues(27); - $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), "index.php?a=27&id={$id}"); + $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), + "index.php?a=27&id={$id}"); } else { $modx->manager->saveFormValues(4); - $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), "index.php?a=4"); + $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), + "index.php?a=4"); } } } @@ -279,8 +284,7 @@ case 'new' : // invoke OnBeforeDocFormSave event - switch($modx->config['docid_incrmnt_method']) - { + switch ($modx->config['docid_incrmnt_method']) { case '1': $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; $where = "T1.id IS NULL"; @@ -288,18 +292,25 @@ $id = $modx->db->getValue($rs); break; case '2': - $rs = $modx->db->select('MAX(id)+1',$tbl_site_content); + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); $id = $modx->db->getValue($rs); - break; + break; default: $id = ''; } - $modx->invokeEvent("OnBeforeDocFormSave", array ( + $modx->invokeEvent("OnBeforeDocFormSave", [ "mode" => "new", - "id" => $id - )); + "id" => $id + ]); + + $deleted = 0; + $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'), + "`id`={$parent} AND `deleted`=0")); + if ($parent > 0 && !$parentNotDeleted) { + $deleted = 1; + } // deny publishing if not permitted if (!$modx->hasPermission('publish_document')) { @@ -311,55 +322,56 @@ $publishedon = ($published ? $currentdate : 0); $publishedby = ($published ? $modx->getLoginUserID() : 0); - if ((!empty($pub_date))&&($published)){ - $publishedon=$pub_date; - } - - $dbInsert = array - ( - "introtext" => $introtext , - "content" => $content , - "pagetitle" => $pagetitle , - "longtitle" => $longtitle , - "type" => $type , - "description" => $description , - "alias" => $alias , - "link_attributes" => $link_attributes , - "isfolder" => $isfolder , - "richtext" => $richtext , - "published" => $published , - "parent" => $parent , - "template" => $template , - "menuindex" => $menuindex , - "searchable" => $searchable , - "cacheable" => $cacheable , - "createdby" => $modx->getLoginUserID() , - "createdon" => $currentdate , - "editedby" => $modx->getLoginUserID() , - "editedon" => $currentdate , - "publishedby" => $publishedby , - "publishedon" => $publishedon , - "pub_date" => $pub_date , - "unpub_date" => $unpub_date , - "contentType" => $contentType , - "content_dispo" => $contentdispo , - "donthit" => $donthit , - "menutitle" => $menutitle , - "hidemenu" => $hidemenu , - "alias_visible" => $aliasvisible - ); - - if ($id != '') + if ((!empty($pub_date)) && ($published)) { + $publishedon = $pub_date; + } + + $dbInsert = [ + "introtext" => $introtext, + "content" => $content, + "pagetitle" => $pagetitle, + "longtitle" => $longtitle, + "type" => $type, + "description" => $description, + "alias" => $alias, + "link_attributes" => $link_attributes, + "isfolder" => $isfolder, + "richtext" => $richtext, + "deleted" => $deleted, + "published" => $published, + "parent" => $parent, + "template" => $template, + "menuindex" => $menuindex, + "searchable" => $searchable, + "cacheable" => $cacheable, + "createdby" => $modx->getLoginUserID(), + "createdon" => $currentdate, + "editedby" => $modx->getLoginUserID(), + "editedon" => $currentdate, + "publishedby" => $publishedby, + "publishedon" => $publishedon, + "pub_date" => $pub_date, + "unpub_date" => $unpub_date, + "contentType" => $contentType, + "content_dispo" => $contentdispo, + "donthit" => $donthit, + "menutitle" => $menutitle, + "hidemenu" => $hidemenu, + "alias_visible" => $aliasvisible + ]; + + if ($id != '') { $dbInsert["id"] = $id; + } - $key = $modx->db->insert( $dbInsert, $tbl_site_content); + $key = $modx->db->insert($dbInsert, $tbl_site_content); - $tvChanges = array(); + $tvChanges = []; foreach ($tmplvars as $field => $value) { if (is_array($value)) { $tvId = $value[0]; $tvVal = $value[1]; - $tvChanges[] = array('tmplvarid' => $tvId, 'contentid' => $key, 'value' => $modx->db->escape($tvVal)); + $tvChanges[] = ['tmplvarid' => $tvId, 'contentid' => $key, 'value' => $modx->db->escape($tvVal)]; } } if (!empty($tvChanges)) { @@ -370,26 +382,28 @@ // document access permissions if ($use_udperms == 1 && is_array($document_groups)) { - $new_groups = array(); + $new_groups = []; foreach ($document_groups as $value_pair) { // first, split the pair (this is a new document, so ignore the second value - list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) - $new_groups[] = '('.(int)$group.','.$key.')'; + [$group] = explode(',', + $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) + $new_groups[] = '(' . (int) $group . ',' . $key . ')'; } $saved = true; if (!empty($new_groups)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', + $new_groups)); } } else { $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - if($use_udperms && !($isManager || $isWeb) && $parent != 0) { + $isWeb = $modx->hasPermission('web_access_permissions'); + if ($use_udperms && !($isManager || $isWeb) && $parent != 0) { // inherit document access permissions $modx->db->insert( - array( - 'document_group' =>'', - 'document' =>'' - ), $tbl_document_groups, // Insert into + [ + 'document_group' => '', + 'document' => '' + ], $tbl_document_groups, // Insert into "document_group, {$key}", $tbl_document_groups, "document = '{$parent}'"); // Copy from } } @@ -397,15 +411,15 @@ // update parent folder status if ($parent != 0) { - $fields = array('isfolder' => 1); + $fields = ['isfolder' => 1]; $modx->db->update($fields, $tbl_site_content, "id='{$_REQUEST['parent']}'"); } // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array ( + $modx->invokeEvent("OnDocFormSave", [ "mode" => "new", - "id" => $key - )); + "id" => $key + ]); // secure web documents - flag as private include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; @@ -426,18 +440,20 @@ // redirect/stay options if ($_POST['stay'] != '') { // weblink - if ($_POST['mode'] == "72") + if ($_POST['mode'] == "72") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; + } // document - if ($_POST['mode'] == "4") + if ($_POST['mode'] == "4") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; + } $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; } else { $header = "Location: index.php?a=3&id=$key&r=1"; } if (headers_sent()) { - $header = str_replace('Location: ','',$header); + $header = str_replace('Location: ', '', $header); echo "\n"; } else { header($header); @@ -465,6 +481,15 @@ $modx->webAlertAndQuit("Document can not be it's own parent!"); } + $deleted = (int) $existingDocument['deleted']; + if ($parent != $oldparent && $parent > 0) { + $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'), + "`id`={$parent} AND `deleted`=0")); + if (!$parentNotDeleted) { + $deleted = 1; + } + } + $parents = $modx->getParentIds($parent); if (in_array($id, $parents)) { $modx->webAlertAndQuit("Document descendant can not be it's parent!"); @@ -491,10 +516,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + } elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { $publishedon = $pub_date; $publishedby = $modx->getLoginUserID(); - }elseif ($was_published && !$published) { + } elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else { @@ -503,10 +528,10 @@ } // invoke OnBeforeDocFormSave event - $modx->invokeEvent("OnBeforeDocFormSave", array ( + $modx->invokeEvent("OnBeforeDocFormSave", [ "mode" => "upd", - "id" => $id - )); + "id" => $id + ]); // update the document $modx->db->update( @@ -520,6 +545,7 @@ . "link_attributes='{$link_attributes}', " . "isfolder={$isfolder}, " . "richtext={$richtext}, " + . "deleted={$deleted}, " . "published={$published}, " . "pub_date={$pub_date}, " . "unpub_date={$unpub_date}, " @@ -542,29 +568,34 @@ // update template variables $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); - $tvIds = array (); + $tvIds = []; while ($row = $modx->db->getRow($rs)) { $tvIds[$row['tmplvarid']] = $row['id']; } - $tvDeletions = array(); - $tvChanges = array(); + $tvDeletions = []; + $tvChanges = []; foreach ($tmplvars as $field => $value) { if (!is_array($value)) { - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; + if (isset($tvIds[$value])) { + $tvDeletions[] = $tvIds[$value]; + } } else { $tvId = $value[0]; $tvVal = $value[1]; if (isset($tvIds[$tvId])) { - $tvChanges[] = array(array('tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)), array('id' => $tvIds[$tvId])); + $tvChanges[] = [ + ['tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)], + ['id' => $tvIds[$tvId]] + ]; } else { - $tvAdded[] = array('tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)); + $tvAdded[] = ['tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)]; } } } if (!empty($tvDeletions)) { - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); } if (!empty($tvAdded)) { @@ -581,40 +612,44 @@ // set document permissions if ($use_udperms == 1 && is_array($document_groups)) { - $new_groups = array(); + $new_groups = []; // process the new input foreach ($document_groups as $value_pair) { - list($group, $link_id) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) + [$group, $link_id] = explode(',', + $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) $new_groups[$group] = $link_id; } // grab the current set of permissions on this document the user can access $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); $rs = $modx->db->select( 'groups_document.id, groups_document.document_group', "{$tbl_document_groups} AS groups_document LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups_document.document_group", - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups_document.document = '{$id}'" - ); - $old_groups = array(); - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; + "((1=" . (int) $isManager . " AND dgn.private_memgroup) OR (1=" . (int) $isWeb . " AND dgn.private_webgroup)) AND groups_document.document = '{$id}'" + ); + $old_groups = []; + while ($row = $modx->db->getRow($rs)) { + $old_groups[$row['document_group']] = $row['id']; + } // update the permissions in the database - $insertions = $deletions = array(); + $insertions = $deletions = []; foreach ($new_groups as $group => $link_id) { if (array_key_exists($group, $old_groups)) { unset($old_groups[$group]); continue; } elseif ($link_id == 'new') { - $insertions[] = '('.(int)$group.','.$id.')'; + $insertions[] = '(' . (int) $group . ',' . $id . ')'; } } if (!empty($insertions)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', + $insertions)); } if (!empty($old_groups)) { - $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); + $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); } // necessary to remove all permissions as document is public if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { @@ -624,7 +659,7 @@ // do the parent stuff if ($parent != 0) { - $fields = array('isfolder' => 1); + $fields = ['isfolder' => 1]; $modx->db->update($fields, $tbl_site_content, "id='{$_REQUEST['parent']}'"); } @@ -633,16 +668,16 @@ $limit = $modx->db->getValue($rs); if ($limit == 0) { - $fields = array('isfolder' => 0); + $fields = ['isfolder' => 0]; $modx->db->update($fields, $tbl_site_content, "id='{$oldparent}'"); } // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array ( + $modx->invokeEvent("OnDocFormSave", [ "mode" => "upd", - "id" => $id - )); + "id" => $id + ]); // secure web documents - flag as private include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; @@ -659,10 +694,9 @@ // empty cache $modx->clearCache('full'); } - - if ($_POST['refresh_preview'] == '1') - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; - else { + if ($_POST['refresh_preview'] == '1') { + $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; + } else { if ($_POST['stay'] != '2' && $id > 0) { $modx->unlockElement(7, $id); } @@ -675,13 +709,13 @@ // document $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; } else { - $header = "Location: index.php?a=3&id=$id&r=1".$add_path; + $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; } } if (headers_sent()) { - $header = str_replace('Location: ','',$header); + $header = str_replace('Location: ', '', $header); echo "\n"; } else { header($header); @@ -690,3 +724,4 @@ default : $modx->webAlertAndQuit("No operation set in request."); } + diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index ada5f818de..6907a5177c 100755 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -10,17 +10,17 @@ $name = $modx->db->escape(trim($_POST['name'])); $description = $modx->db->escape($_POST['description']); $resourcefile = $modx->db->escape($_POST['resourcefile']); -$enable_resource = $_POST['enable_resource'] == 'on' ? 1 : 0; +$enable_resource = isset($_POST['enable_resource']) && $_POST['enable_resource'] == 'on' ? 1 : 0; $icon = $modx->db->escape($_POST['icon']); //$category = (int)$_POST['category']; -$disabled = $_POST['disabled'] == 'on' ? 1 : 0; -$wrap = $_POST['wrap'] == 'on' ? 1 : 0; -$locked = $_POST['locked'] == 'on' ? 1 : 0; +$disabled = isset($_POST['disabled']) && $_POST['disabled'] == 'on' ? 1 : 0; +$wrap = isset($_POST['wrap']) && $_POST['wrap'] == 'on' ? 1 : 0; +$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? 1 : 0; $modulecode = $modx->db->escape($_POST['post']); $properties = $modx->db->escape($_POST['properties']); -$enable_sharedparams = $_POST['enable_sharedparams'] == 'on' ? 1 : 0; +$enable_sharedparams = isset($_POST['enable_sharedparams']) && $_POST['enable_sharedparams'] == 'on' ? 1 : 0; $guid = $modx->db->escape($_POST['guid']); -$parse_docblock = $_POST['parse_docblock'] == "1" ? '1' : '0'; +$parse_docblock = isset($_POST['parse_docblock']) && $_POST['parse_docblock'] == "1" ? '1' : '0'; $currentdate = time() + $modx->config['server_offset_time']; //Kyle Jaebker - added category support @@ -192,7 +192,7 @@ function saveUserGroupAccessPermissons() if ($newid) { $id = $newid; } - $usrgroups = $_POST['usrgroups']; + $usrgroups = $_POST['usrgroups'] ?? []; // check for permission update access if ($use_udperms == 1) { diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index 8d2805ac81..97149d21e2 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -9,13 +9,13 @@ $id = (int)$_POST['id']; $name = $modx->db->escape(trim($_POST['name'])); $description = $modx->db->escape($_POST['description']); -$locked = $_POST['locked'] == 'on' ? '1' : '0'; +$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? '1' : '0'; $plugincode = $modx->db->escape($_POST['post']); $properties = $modx->db->escape($_POST['properties']); -$disabled = $_POST['disabled'] == 'on' ? '1' : '0'; +$disabled = isset($_POST['disabled']) && $_POST['disabled'] == 'on' ? '1' : '0'; $moduleguid = $modx->db->escape($_POST['moduleguid']); -$sysevents = !empty($_POST['sysevents']) ? $_POST['sysevents'] : array(); -$parse_docblock = $_POST['parse_docblock'] == '1' ? '1' : '0'; +$sysevents = !empty($_POST['sysevents']) && is_array($_POST['sysevents']) ? $_POST['sysevents'] : array(); +$parse_docblock = isset($_POST['parse_docblock']) && $_POST['parse_docblock'] == '1' ? '1' : '0'; $currentdate = time() + $modx->config['server_offset_time']; //Kyle Jaebker - added category support @@ -40,7 +40,7 @@ $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; $description = isset($parsed['description']) ? $parsed['description'] : $description; - $version = isset($parsed['version']) ? '' . $parsed['version'] . ' ' : ''; + $version = isset($parsed['version']) ? '' . $parsed['version'] . ' ' : ''; if ($version) { $description = $version . trim(preg_replace('/(.+?)+(<\/b>)/i', '', $description)); } @@ -178,6 +178,7 @@ function saveEventListeners($id, $sysevents, $mode) $formEventList = array(); foreach ($sysevents as $evtId) { if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); + if ($evtId === false) continue; if ($mode == '101') { $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); } else { @@ -216,7 +217,7 @@ function saveEventListeners($id, $sysevents, $mode) /** * @param string $name - * @return string|int + * @return string|int|bool */ function getEventIdByName($name) { @@ -230,6 +231,6 @@ function getEventIdByName($name) $eventIds[$row['name']] = $row['id']; } - return $eventIds[$name]; + return $eventIds[$name] ?? false; } diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 7260cabd83..2c0f49b480 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -16,7 +16,7 @@ $rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; $display = $modx->db->escape($_POST['display']); $params = $modx->db->escape($_POST['params']); -$locked = $_POST['locked'] == 'on' ? 1 : 0; +$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? 1 : 0; $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; $originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; $currentdate = time() + $modx->config['server_offset_time']; @@ -200,7 +200,7 @@ function saveTemplateVarAccess() $modx->db->delete($tbl_site_tmplvar_templates, "tmplvarid = '{$id}'"); if (!empty($templates)) { for ($i = 0; $i < count($templates); $i++) { - $setRank = ($getRankArray[$templates[$i]]) ? $getRankArray[$templates[$i]] : 0; + $setRank = isset($getRankArray[$templates[$i]]) && $getRankArray[$templates[$i]] ? $getRankArray[$templates[$i]] : 0; $modx->db->insert(array( 'tmplvarid' => $id, 'templateid' => $templates[$i], diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index da0ef70e08..eb01a7969e 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -19,7 +19,7 @@ } $id = (int)$input['id']; -$oldusername = $input['oldusername']; +$oldusername = $input['oldusername'] ?? ''; $newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; $esc_newusername = $modx->db->escape($newusername); $fullname = $input['fullname']; @@ -48,7 +48,7 @@ $blocked = !empty($input['blocked']) ? $input['blocked'] : 0; $blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0; $blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0; -$user_groups = $input['user_groups']; +$user_groups = isset($input['user_groups']) && is_array($input['user_groups']) ? $input['user_groups'] : []; // verify password if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { @@ -70,7 +70,7 @@ } // check if the email address already exist - if ($modx->config['allow_multiple_emails'] != 1) { + if ($modx->getConfig('allow_multiple_emails') != 1) { $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); $limit = $modx->db->getValue($rs); if ($limit > 0) { @@ -419,7 +419,7 @@ function saveUserSettings($id) $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); foreach ($settings as $n) { - $vl = $_POST[$n]; + $vl = $_POST[$n] ?? ''; if (is_array($vl)) { $vl = implode(",", $vl); } diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 84cdc95f72..681755fcc3 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -14,7 +14,12 @@ /************ webber ********/ $content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); $pid=($content['parent']==0?$id:$content['parent']); - +if ($content['parent'] > 0) { + $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'), "`id`={$content['parent']} AND `deleted`=0")); + if (!$parentNotDeleted) { + $modx->webAlertAndQuit($_lang["error_parent_deleted"]); + } +} /************** webber *************/ $sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; $sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; diff --git a/vendor/.htaccess b/vendor/.htaccess index ff2beb844b..de8d8a9d42 100755 --- a/vendor/.htaccess +++ b/vendor/.htaccess @@ -1,2 +1,7 @@ -order deny,allow -deny from all + + Require all denied + + + order deny,allow + deny from all +