@@ -29,30 +29,30 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $op = $_REQUEST['op'] ?? 'main'; |
| 31 | 31 | switch ($op) {
|
| 32 | - default: |
|
| 33 | - case 'main': |
|
| 34 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 35 | - $form = new \XoopsThemeForm(_AM_TOOLS_INDEX, 'updatecache', 'main.php', 'post', true); |
|
| 36 | - $form->addElement(new \XoopsFormLabel(_AM_TOOLS_TIP, _AM_TOOLS_TIPS)); |
|
| 37 | - $checkbox_options = [ |
|
| 38 | - 'updatexoopscache' => _AM_TOOLS_UPDATEXOOPSCACHE, |
|
| 39 | - 'updatesmartycache' => _AM_TOOLS_UPDATESMARTYCACHE, |
|
| 40 | - 'updatesmartycompile' => _AM_TOOLS_UPDATESMARTYCOMPILE, |
|
| 41 | - ]; |
|
| 42 | - $checkbox = new \XoopsFormCheckBox(_AM_TOOLS_OPTIONS, 'options', array_keys($checkbox_options)); |
|
| 43 | - $checkbox->addOptionArray($checkbox_options); |
|
| 44 | - $form->addElement($checkbox); |
|
| 45 | - $form->addElement(new \XoopsFormHidden('op', 'updatecache'));
|
|
| 46 | - $form->addElement(new \XoopsFormHidden('step', '1'));
|
|
| 47 | - $form->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
|
|
| 48 | - $form->display(); |
|
| 49 | - break; |
|
| 50 | - case 'updatecache': |
|
| 51 | - if (1 == $_REQUEST['step']) {
|
|
| 52 | - $options = implode('_', $_REQUEST['options']);
|
|
| 53 | - $url = XOOPS_URL . "/modules/tools/admin/main.php?op=updatecache&step=2&options={$options}";
|
|
| 54 | - $updating = _AM_TOOLS_UPDATING; |
|
| 55 | - $msg = <<<EOF |
|
| 32 | +default: |
|
| 33 | +case 'main': |
|
| 34 | + require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 35 | + $form = new \XoopsThemeForm(_AM_TOOLS_INDEX, 'updatecache', 'main.php', 'post', true); |
|
| 36 | + $form->addElement(new \XoopsFormLabel(_AM_TOOLS_TIP, _AM_TOOLS_TIPS)); |
|
| 37 | + $checkbox_options = [ |
|
| 38 | + 'updatexoopscache' => _AM_TOOLS_UPDATEXOOPSCACHE, |
|
| 39 | + 'updatesmartycache' => _AM_TOOLS_UPDATESMARTYCACHE, |
|
| 40 | + 'updatesmartycompile' => _AM_TOOLS_UPDATESMARTYCOMPILE, |
|
| 41 | + ]; |
|
| 42 | + $checkbox = new \XoopsFormCheckBox(_AM_TOOLS_OPTIONS, 'options', array_keys($checkbox_options)); |
|
| 43 | + $checkbox->addOptionArray($checkbox_options); |
|
| 44 | + $form->addElement($checkbox); |
|
| 45 | + $form->addElement(new \XoopsFormHidden('op', 'updatecache'));
|
|
| 46 | + $form->addElement(new \XoopsFormHidden('step', '1'));
|
|
| 47 | + $form->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
|
|
| 48 | + $form->display(); |
|
| 49 | + break; |
|
| 50 | +case 'updatecache': |
|
| 51 | + if (1 == $_REQUEST['step']) {
|
|
| 52 | + $options = implode('_', $_REQUEST['options']);
|
|
| 53 | + $url = XOOPS_URL . "/modules/tools/admin/main.php?op=updatecache&step=2&options={$options}";
|
|
| 54 | + $updating = _AM_TOOLS_UPDATING; |
|
| 55 | + $msg = <<<EOF |
|
| 56 | 56 | <div class="loading" style="text-align:center"> |
| 57 | 57 | <img src="../assets/images/loader.gif"> |
| 58 | 58 | <p>{$updating}</P>
|
@@ -66,31 +66,31 @@ discard block |
||
| 66 | 66 | <script type="text/JavaScript">setTimeout("redirect('{$url}');", 2000);</script>
|
| 67 | 67 | EOF; |
| 68 | 68 | |
| 69 | - echo $msg; |
|
| 70 | - } elseif (2 == $_REQUEST['step']) {
|
|
| 71 | - $options = explode('_', $_REQUEST['options']);
|
|
| 72 | - foreach ($options as $k) {
|
|
| 73 | - if ('updatexoopscache' === $k) {
|
|
| 74 | - $d = XOOPS_VAR_PATH . '/caches/xoops_cache'; |
|
| 75 | - updatecache($d, 'php'); |
|
| 76 | - updatecache($d, 'html'); |
|
| 77 | - updatecache($d, 'tmp'); |
|
| 78 | - } |
|
| 79 | - if ('updatesmartycache' === $k) {
|
|
| 80 | - $d = XOOPS_VAR_PATH . '/caches/smarty_cache'; |
|
| 81 | - updatecache($d, 'html'); |
|
| 82 | - updatecache($d, 'tmp'); |
|
| 83 | - } |
|
| 84 | - if ('updatesmartycompile' === $k) {
|
|
| 85 | - $d = XOOPS_VAR_PATH . '/caches/smarty_compile'; |
|
| 86 | - updatecache($d, 'php'); |
|
| 87 | - } |
|
| 69 | + echo $msg; |
|
| 70 | + } elseif (2 == $_REQUEST['step']) {
|
|
| 71 | + $options = explode('_', $_REQUEST['options']);
|
|
| 72 | + foreach ($options as $k) {
|
|
| 73 | + if ('updatexoopscache' === $k) {
|
|
| 74 | + $d = XOOPS_VAR_PATH . '/caches/xoops_cache'; |
|
| 75 | + updatecache($d, 'php'); |
|
| 76 | + updatecache($d, 'html'); |
|
| 77 | + updatecache($d, 'tmp'); |
|
| 78 | + } |
|
| 79 | + if ('updatesmartycache' === $k) {
|
|
| 80 | + $d = XOOPS_VAR_PATH . '/caches/smarty_cache'; |
|
| 81 | + updatecache($d, 'html'); |
|
| 82 | + updatecache($d, 'tmp'); |
|
| 83 | + } |
|
| 84 | + if ('updatesmartycompile' === $k) {
|
|
| 85 | + $d = XOOPS_VAR_PATH . '/caches/smarty_compile'; |
|
| 86 | + updatecache($d, 'php'); |
|
| 88 | 87 | } |
| 89 | - |
|
| 90 | - redirect_header('main.php', 3, _AM_TOOLS_UPDATECACHESUCCESS);
|
|
| 91 | 88 | } |
| 92 | 89 | |
| 93 | - break; |
|
| 90 | + redirect_header('main.php', 3, _AM_TOOLS_UPDATECACHESUCCESS);
|
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + break; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |