| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- <?php return array (
- 'cf1ffbc0d08d65667a1338cc666f85b9' =>
- array (
- 'criteria' =>
- array (
- 'name' => 'upgrademodx',
- ),
- 'object' =>
- array (
- 'name' => 'upgrademodx',
- 'path' => '{core_path}components/upgrademodx/',
- 'assets_path' => '{assets_path}components/upgrademodx/',
- ),
- ),
- 'fa5bf96394c881bfc1d16b348e9ff20d' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_verbose',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_verbose',
- 'value' => '1',
- 'xtype' => 'combo-boolean',
- 'namespace' => 'upgrademodx',
- 'area' => 'GitHub',
- 'editedon' => '2019-01-16 14:42:23',
- ),
- ),
- 'dd58afda7eaddb1778700fadf9ef2ab5' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_versionlist_api_url',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_versionlist_api_url',
- 'value' => '//api.github.com/repos/modxcms/revolution/tags',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => NULL,
- ),
- ),
- '4796fe12c0192320d81fef3462ae0a8a' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_temp_dir',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_temp_dir',
- 'value' => '{base_path}ugmtemp/',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => NULL,
- ),
- ),
- '6c48d2b4c21cb2e299dc13819cc62f54' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_cert_path',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_cert_path',
- 'value' => '',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'GitHub',
- 'editedon' => NULL,
- ),
- ),
- 'a6aa30ad1045aea4fc1881bf45e85019' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_file_version',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_file_version',
- 'value' => '',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => NULL,
- ),
- ),
- 'ceba60a930ab9b8fa6005ae5080d23f3' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_force_pcl_zip',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_force_pcl_zip',
- 'value' => '0',
- 'xtype' => 'combo-boolean',
- 'namespace' => 'upgrademodx',
- 'area' => 'Download',
- 'editedon' => NULL,
- ),
- ),
- '67fbc94224b00bd3e30bed096e2e92dc' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_modx_timeout',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_modx_timeout',
- 'value' => '6',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Download',
- 'editedon' => NULL,
- ),
- ),
- '5c186deeee7fb6957dd2f5dbb731b2f9' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_ssl_verify_peer',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_ssl_verify_peer',
- 'value' => '0',
- 'xtype' => 'combo-boolean',
- 'namespace' => 'upgrademodx',
- 'area' => 'Download',
- 'editedon' => '2019-01-09 12:19:58',
- ),
- ),
- 'fec373d24443729a5661471e57a58851' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_language',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_language',
- 'value' => 'en',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Form',
- 'editedon' => NULL,
- ),
- ),
- '837b94550ee6fe63d5e38b0b2486f374' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_pl_only',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_pl_only',
- 'value' => '1',
- 'xtype' => 'combo-boolean',
- 'namespace' => 'upgrademodx',
- 'area' => 'Form',
- 'editedon' => NULL,
- ),
- ),
- '66d0c6907c42a6c3d400bd75017d2a35' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_github_username',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_github_username',
- 'value' => '',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'GitHub',
- 'editedon' => '2019-01-16 14:47:38',
- ),
- ),
- '873c90b97eec6840ba3bac13fced36fe' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_github_token',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_github_token',
- 'value' => '',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'GitHub',
- 'editedon' => '2019-01-16 14:47:35',
- ),
- ),
- 'ea24bb9594824c5dc0f2d2ec9d881f39' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_github_timeout',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_github_timeout',
- 'value' => '6',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'GitHub',
- 'editedon' => NULL,
- ),
- ),
- '7044de863da29f9c729548abaf70b3b6' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_versions_to_show',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_versions_to_show',
- 'value' => '5',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Form',
- 'editedon' => NULL,
- ),
- ),
- '3c9479116c58e5aadcd4eca66259dbca' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_groups',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_groups',
- 'value' => 'Administrator',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Security',
- 'editedon' => NULL,
- ),
- ),
- '375ee837f936b7b6a0792813ffcba157' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_interval',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_interval',
- 'value' => '1 hour',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => '2019-01-16 14:35:22',
- ),
- ),
- '642c901f2aa3a6ee3ef914dbf78e4a63' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_last_check',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_last_check',
- 'value' => '2019-01-16 14:42:31',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => '2019-01-16 14:42:31',
- ),
- ),
- 'ad783e06b01c5806537bcd56f4e58cb2' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_latest_version',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_latest_version',
- 'value' => '',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => '2018-11-11 20:39:27',
- ),
- ),
- 'b3f83ba974e3e9fc265a41e6ca5f2171' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_hide_when_no_upgrade',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_hide_when_no_upgrade',
- 'value' => '0',
- 'xtype' => 'combo-boolean',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => '2019-01-09 12:22:52',
- ),
- ),
- 'e6511b2d991103ccd186bbb3f06b44f1' =>
- array (
- 'criteria' =>
- array (
- 'key' => 'ugm_version_list_path',
- ),
- 'object' =>
- array (
- 'key' => 'ugm_version_list_path',
- 'value' => '{core_path}cache/upgrademodx/',
- 'xtype' => 'textfield',
- 'namespace' => 'upgrademodx',
- 'area' => 'Widget',
- 'editedon' => NULL,
- ),
- ),
- '93d5c9e8b3de922ca1551fd849fd0546' =>
- array (
- 'criteria' =>
- array (
- 'name' => 'Upgrade MODX',
- ),
- 'object' =>
- array (
- 'id' => 7,
- 'name' => 'Upgrade MODX',
- 'description' => 'Upgrade MODX Widget',
- 'type' => 'snippet',
- 'content' => 'UpgradeMODXWidget',
- 'namespace' => 'upgrademodx',
- 'lexicon' => 'upgrademodx:default',
- 'size' => 'half',
- 'name_trans' => 'Upgrade MODX',
- 'description_trans' => 'Upgrade MODX Widget',
- ),
- ),
- 'be905b2e7814eb80b8bac56f674d1c97' =>
- array (
- 'criteria' =>
- array (
- 'category' => 'UpgradeMODX',
- ),
- 'object' =>
- array (
- 'id' => 17,
- 'parent' => 0,
- 'category' => 'UpgradeMODX',
- 'rank' => 0,
- ),
- ),
- 'e91af180a87f45e65e06191756cd359f' =>
- array (
- 'criteria' =>
- array (
- 'name' => 'UpgradeMODXTpl',
- ),
- 'object' =>
- array (
- 'id' => 55,
- 'source' => 0,
- 'property_preprocess' => 0,
- 'name' => 'UpgradeMODXTpl',
- 'description' => 'Tpl chunk for alert widget',
- 'editor_type' => 0,
- 'category' => 17,
- 'cache_type' => 0,
- 'snippet' => '<div id="Upgrade_modx">
- <h3 style="color:[[+ugm_notice_color]]">[[+ugm_notice]]</h3>
- <br/>[[+ugm_current_version_caption]]: [[+ugm_current_version]]
- <br/>[[+ugm_latest_version_caption]]: [[+ugm_latest_version]]
- [[+ugm_version_form]]
- <div id="ugm_errors">[[+ugm_errors]]</div>
- </div>
- <script src="[[+ugm_assets_url]]js/classie.js"></script>
- <script src="[[+ugm_assets_url]]js/progressButton.js"></script>
- <script src="[[+ugm_assets_url]]js/ugm-bottom.js"></script>
- <p> </p>
- ',
- 'locked' => 0,
- 'properties' => 'a:0:{}',
- 'static' => 0,
- 'static_file' => '',
- 'content' => '<div id="Upgrade_modx">
- <h3 style="color:[[+ugm_notice_color]]">[[+ugm_notice]]</h3>
- <br/>[[+ugm_current_version_caption]]: [[+ugm_current_version]]
- <br/>[[+ugm_latest_version_caption]]: [[+ugm_latest_version]]
- [[+ugm_version_form]]
- <div id="ugm_errors">[[+ugm_errors]]</div>
- </div>
- <script src="[[+ugm_assets_url]]js/classie.js"></script>
- <script src="[[+ugm_assets_url]]js/progressButton.js"></script>
- <script src="[[+ugm_assets_url]]js/ugm-bottom.js"></script>
- <p> </p>
- ',
- ),
- ),
- 'ed07d9bb8ee2fe68fff664cc91088ceb' =>
- array (
- 'criteria' =>
- array (
- 'name' => 'UpgradeMODXWidget',
- ),
- 'object' =>
- array (
- 'id' => 49,
- 'source' => 0,
- 'property_preprocess' => 0,
- 'name' => 'UpgradeMODXWidget',
- 'description' => 'Upgrade MODX Dashboard widget',
- 'editor_type' => 0,
- 'category' => 17,
- 'cache_type' => 0,
- 'snippet' => '/**
- * UpgradeMODXWidget snippet for UpgradeMODX extra
- *
- * Copyright 2015-2018 Bob Ray <https://bobsguides.com>
- * Created on 08-16-2015
- *
- * UpgradeMODX is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * UpgradeMODX is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * UpgradeMODX; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package upgrademodx
- */
- /**
- * Description
- * -----------
- * UpgradeMODX Dashboard widget
- * This package was inspired by the work of a number of people and I have borrowed some of their code.
- * Dmytro Lukianenko (dmi3yy) is the original author of the MODX install script. Susan Sottwell, Sharapov,
- * Bumkaka, Inreti, Zaigham Rana, frischnetz, and AgelxNash, also contributed and I\'d like to thank all
- * of them for laying the groundwork.
- *
- * Variables
- * ---------
- * @var $modx modX
- * @var $scriptProperties array
- *
- * @package upgrademodx
- **/
- /* Properties
- * @property &groups textfield -- group, or comma-separated list of groups, who will see the widget; Default: (empty)..
- * @property &hideWhenNoUpgrade combo-boolean -- Hide widget when no upgrade is available; Default: No.
- * @property &interval textfield -- Interval between checks -- Examples: 1 week, 3 days, 6 hours; Default: 1 week.
- * @property &language textfield -- Two-letter code of language to user; Default: en.
- * @property &lastCheck textfield -- Date and time of last check -- set automatically; Default: (empty)..
- * @property &latestVersion textfield -- Latest version (at last check) -- set automatically; Default: (empty)..
- * @property &plOnly combo-boolean -- Show only pl (stable) versions; Default: yes.
- * @property &versionsToShow textfield -- Number of versions to show in upgrade form (not widget); Default: 5.
- */
- /* Initialize */
- /* This will execute when in MODX */
- $language = $modx->getOption(\'ugm_language\', null, $modx->getOption(\'manager_language\'), true);
- $language = empty($language) ? \'en\' : $language;
- $props = $scriptProperties;
- $modx->lexicon->load($language . \':upgrademodx:default\');
- $devMode = $modx->getOption(\'ugm.devMode\', null, false, true);
- $groups = $modx->getOption(\'ugm_groups\', null, \'Administrator\', true);
- /* Return empty string if user shouldn\'t see widget */
- if (strpos($groups, \',\') !== false) {
- $groups = explode(\',\', $groups);
- }
- if (! $modx->user->isMember($groups)) {
- return \'\';
- }
- $corePath = $modx->getOption(\'ugm.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/upgrademodx/\');
- $assetsUrl = $modx->getOption(\'ugm.assets_url\', null, $modx->getOption(\'assets_url\', null, MODX_ASSETS_URL) . \'components/upgrademodx/\');
- require_once($corePath . \'model/upgrademodx/upgrademodx.class.php\');
- $upgrade = new UpgradeMODX($modx);
- $upgrade->init();
- $props[\'ugm_setup_url\'] = MODX_SITE_URL . \'setup/index.php\';
- unset($props[\'controller\']); // remove trash from scriptProperties
- $modx->regClientStartupScript(\'<script>
- var ugmConnectorUrl = "\' . $assetsUrl . \'connector.php";
- var ugm_config = \' . $modx->toJSON($props) . \';
- var ugm_setup_url = "\' . MODX_SITE_URL . \'setup/index.php";
- </script>\'
- );
- $modx->regClientCSS($assetsUrl . \'css/progress.css\');
- $modx->regClientStartupScript("//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js");
- $modx->regClientStartupScript($assetsUrl . \'js/modernizr.custom.js\');
- $hideWhenNoUpgrade = $modx->getOption(\'ugm_hide_when_no_upgrade\', null, false, true);
- $settingsVersion = $modx->getOption(\'settings_version\');
- /* Set Placeholders */
- $placeholders = array();
- $placeholders[\'[[+ugm_assets_url]]\'] = $assetsUrl;
- $placeholders[\'[[+ugm_current_version]]\'] = $settingsVersion;
- $placeholders[\'[[+ugm_current_version_caption]]\'] = $modx->lexicon(\'ugm_current_version_caption\');
- $placeholders[\'[[+ugm_latest_version_caption]]\'] = $modx->lexicon(\'ugm_latest_version_caption\');
- $upgradeAvailable = $upgrade->upgradeAvailable($settingsVersion);
- $placeholders[\'[[+ugm_latest_version]]\'] = $upgrade->getLatestVersion();
- if ($devMode) {
- $upgradeAvailable = true;
- }
- if ($upgradeAvailable) {
- $versionForm = $upgrade->createVersionForm($modx);
- }
- $errors = $upgrade->getErrors();
- if (!empty($errors)) {
- $msg = \'\';
- foreach ($errors as $error) {
- $msg .= \'<br/><span style="color:red">\' . $modx->lexicon(\'ugm_error\') .
- \': \' . $error . \'</span>\';
- }
- return $msg;
- }
- /* Process */
- /* See if there\'s a new version */
- if ($upgradeAvailable) {
- $placeholders[\'[[+ugm_notice]]\'] = $modx->lexicon(\'ugm_upgrade_available\');
- $placeholders[\'[[+ugm_notice_color]]\'] = \'green\';
- $placeholders[\'[[+ugm_version_form]]\'] = $versionForm;
- } else {
- if ($hideWhenNoUpgrade) {
- return \'\';
- } else {
- $placeholders[\'[[+ugm_notice]]\'] = $modx->lexicon(\'ugm_modx_up_to_date\');
- $placeholders[\'[[+ugm_notice_color]]\'] = \'gray\';
- }
- }
- /* Get Tpl */
- $tpl = $modx->getChunk(\'UpgradeMODXTpl\');
- /* Do the replacements */
- $tpl = str_replace(array_keys($placeholders), array_values($placeholders), $tpl);
- /*if (php_sapi_name() === \'cli\') {
- echo $tpl;
- }*/
- return $tpl;',
- 'locked' => 0,
- 'properties' => 'a:0:{}',
- 'moduleguid' => '',
- 'static' => 0,
- 'static_file' => '',
- 'content' => '/**
- * UpgradeMODXWidget snippet for UpgradeMODX extra
- *
- * Copyright 2015-2018 Bob Ray <https://bobsguides.com>
- * Created on 08-16-2015
- *
- * UpgradeMODX is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * UpgradeMODX is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * UpgradeMODX; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package upgrademodx
- */
- /**
- * Description
- * -----------
- * UpgradeMODX Dashboard widget
- * This package was inspired by the work of a number of people and I have borrowed some of their code.
- * Dmytro Lukianenko (dmi3yy) is the original author of the MODX install script. Susan Sottwell, Sharapov,
- * Bumkaka, Inreti, Zaigham Rana, frischnetz, and AgelxNash, also contributed and I\'d like to thank all
- * of them for laying the groundwork.
- *
- * Variables
- * ---------
- * @var $modx modX
- * @var $scriptProperties array
- *
- * @package upgrademodx
- **/
- /* Properties
- * @property &groups textfield -- group, or comma-separated list of groups, who will see the widget; Default: (empty)..
- * @property &hideWhenNoUpgrade combo-boolean -- Hide widget when no upgrade is available; Default: No.
- * @property &interval textfield -- Interval between checks -- Examples: 1 week, 3 days, 6 hours; Default: 1 week.
- * @property &language textfield -- Two-letter code of language to user; Default: en.
- * @property &lastCheck textfield -- Date and time of last check -- set automatically; Default: (empty)..
- * @property &latestVersion textfield -- Latest version (at last check) -- set automatically; Default: (empty)..
- * @property &plOnly combo-boolean -- Show only pl (stable) versions; Default: yes.
- * @property &versionsToShow textfield -- Number of versions to show in upgrade form (not widget); Default: 5.
- */
- /* Initialize */
- /* This will execute when in MODX */
- $language = $modx->getOption(\'ugm_language\', null, $modx->getOption(\'manager_language\'), true);
- $language = empty($language) ? \'en\' : $language;
- $props = $scriptProperties;
- $modx->lexicon->load($language . \':upgrademodx:default\');
- $devMode = $modx->getOption(\'ugm.devMode\', null, false, true);
- $groups = $modx->getOption(\'ugm_groups\', null, \'Administrator\', true);
- /* Return empty string if user shouldn\'t see widget */
- if (strpos($groups, \',\') !== false) {
- $groups = explode(\',\', $groups);
- }
- if (! $modx->user->isMember($groups)) {
- return \'\';
- }
- $corePath = $modx->getOption(\'ugm.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/upgrademodx/\');
- $assetsUrl = $modx->getOption(\'ugm.assets_url\', null, $modx->getOption(\'assets_url\', null, MODX_ASSETS_URL) . \'components/upgrademodx/\');
- require_once($corePath . \'model/upgrademodx/upgrademodx.class.php\');
- $upgrade = new UpgradeMODX($modx);
- $upgrade->init();
- $props[\'ugm_setup_url\'] = MODX_SITE_URL . \'setup/index.php\';
- unset($props[\'controller\']); // remove trash from scriptProperties
- $modx->regClientStartupScript(\'<script>
- var ugmConnectorUrl = "\' . $assetsUrl . \'connector.php";
- var ugm_config = \' . $modx->toJSON($props) . \';
- var ugm_setup_url = "\' . MODX_SITE_URL . \'setup/index.php";
- </script>\'
- );
- $modx->regClientCSS($assetsUrl . \'css/progress.css\');
- $modx->regClientStartupScript("//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js");
- $modx->regClientStartupScript($assetsUrl . \'js/modernizr.custom.js\');
- $hideWhenNoUpgrade = $modx->getOption(\'ugm_hide_when_no_upgrade\', null, false, true);
- $settingsVersion = $modx->getOption(\'settings_version\');
- /* Set Placeholders */
- $placeholders = array();
- $placeholders[\'[[+ugm_assets_url]]\'] = $assetsUrl;
- $placeholders[\'[[+ugm_current_version]]\'] = $settingsVersion;
- $placeholders[\'[[+ugm_current_version_caption]]\'] = $modx->lexicon(\'ugm_current_version_caption\');
- $placeholders[\'[[+ugm_latest_version_caption]]\'] = $modx->lexicon(\'ugm_latest_version_caption\');
- $upgradeAvailable = $upgrade->upgradeAvailable($settingsVersion);
- $placeholders[\'[[+ugm_latest_version]]\'] = $upgrade->getLatestVersion();
- if ($devMode) {
- $upgradeAvailable = true;
- }
- if ($upgradeAvailable) {
- $versionForm = $upgrade->createVersionForm($modx);
- }
- $errors = $upgrade->getErrors();
- if (!empty($errors)) {
- $msg = \'\';
- foreach ($errors as $error) {
- $msg .= \'<br/><span style="color:red">\' . $modx->lexicon(\'ugm_error\') .
- \': \' . $error . \'</span>\';
- }
- return $msg;
- }
- /* Process */
- /* See if there\'s a new version */
- if ($upgradeAvailable) {
- $placeholders[\'[[+ugm_notice]]\'] = $modx->lexicon(\'ugm_upgrade_available\');
- $placeholders[\'[[+ugm_notice_color]]\'] = \'green\';
- $placeholders[\'[[+ugm_version_form]]\'] = $versionForm;
- } else {
- if ($hideWhenNoUpgrade) {
- return \'\';
- } else {
- $placeholders[\'[[+ugm_notice]]\'] = $modx->lexicon(\'ugm_modx_up_to_date\');
- $placeholders[\'[[+ugm_notice_color]]\'] = \'gray\';
- }
- }
- /* Get Tpl */
- $tpl = $modx->getChunk(\'UpgradeMODXTpl\');
- /* Do the replacements */
- $tpl = str_replace(array_keys($placeholders), array_values($placeholders), $tpl);
- /*if (php_sapi_name() === \'cli\') {
- echo $tpl;
- }*/
- return $tpl;',
- ),
- ),
- );
|