@@ -9,23 +9,6 @@ |
||
| 9 | 9 | * how to use |
| 10 | 10 | * The following code inserted in the template |
| 11 | 11 | * |
| 12 | - * @param string $module module dirname |
|
| 13 | - * @param string $file block function file |
|
| 14 | - * @param string $show_func show block function |
|
| 15 | - * @param string $options show block function's option |
|
| 16 | - * @param int $cachetime cachetime Unit for seconds |
|
| 17 | - * @param mixed $user Generate cache solution |
|
| 18 | - |
|
| 19 | -<{xoBlkTpl module="ilog" file="ilog_block_tag.php" show_func="ilog_tag_block_cloud_show" options="100|0|100|80" cachetime=5 userid=$xoops_userid}> |
|
| 20 | - <link rel="stylesheet" href="<{$xoops_url}>/modules/tag/templates/style.css" /> |
|
| 21 | - <div class="tag-cloud" style="line-height: 150%; padding: 5px;"> |
|
| 22 | - <{foreach item=tag from=$block.tags}> |
|
| 23 | - <span class="tag-level-<{$tag.level}>" style="font-size: <{$tag.font}>%; display: inline; padding-right: 5px;"> |
|
| 24 | - <a href="<{$xoops_url}>/modules/<{$block.tag_dirname}>/view.tag.php<{$smarty.const.URL_DELIMITER}><{$tag.id}>/" title="<{$tag.term}>"><{$tag.term}></a> |
|
| 25 | - </span> |
|
| 26 | - <{/foreach}> |
|
| 27 | - </div> |
|
| 28 | -<{/xoBlkTpl}> |
|
| 29 | 12 | */ |
| 30 | 13 | function smarty_block_xoBlkTpl ($params, $content, $smarty, &$repeat) { |
| 31 | 14 | static $old_block; |
@@ -9,22 +9,6 @@ |
||
| 9 | 9 | * how to use |
| 10 | 10 | * The following code inserted in the template |
| 11 | 11 | * |
| 12 | - * @param string $module module dirname |
|
| 13 | - * @param string $file block function file |
|
| 14 | - * @param string $show_func show block function |
|
| 15 | - * @param string $options show block function's option |
|
| 16 | - * @param int $cachetime cachetime Unit for seconds |
|
| 17 | - * @param mixed $user Generate cache solution |
|
| 18 | - |
|
| 19 | -<{xoBlk |
|
| 20 | - module="ilog" |
|
| 21 | - file="ilog_block_tag.php" |
|
| 22 | - show_func="ilog_tag_block_cloud_show" |
|
| 23 | - options="100|0|150|80" |
|
| 24 | - template="ilog_tag_block_cloud.html" |
|
| 25 | - cachetime=10 |
|
| 26 | - user=admin |
|
| 27 | -}> |
|
| 28 | 12 | */ |
| 29 | 13 | function smarty_function_xoBlk( $params, $smarty ) |
| 30 | 14 | { |
@@ -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 | /** |