Completed
Pull Request — master (#2)
by Michael
02:01
created
class/smarty/xoops_plugins/function.xoBlk.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,18 +27,18 @@
 block discarded – undo
27 27
     user=admin
28 28
 }>
29 29
 */
30
-function smarty_function_xoBlk( $params, $smarty )
30
+function smarty_function_xoBlk($params, $smarty)
31 31
 {
32 32
     /** @var Smarty $smarty */
33 33
     $old_caching = $smarty->caching;
34 34
     $old_cache_lifetime = $smarty->cache_lifetime;
35 35
     if (isset($params['cachetime'])) {
36 36
         $smarty->caching = 2;
37
-        $smarty->cache_lifetime = (int)$params['cachetime'];
37
+        $smarty->cache_lifetime = (int) $params['cachetime'];
38 38
     } else {
39 39
         $smarty->caching = 0;
40 40
     }
41
-    $tplName = 'db:' . $params['template'];
41
+    $tplName = 'db:'.$params['template'];
42 42
     $params['cacheid'] = isset($params['cacheid']) ? $params['cacheid'] : 'xoBlk_'.md5(var_export($params, true));
43 43
     if (!isset($params['cachetime']) || !$smarty->is_cached($tplName, $params['cacheid'])) {
44 44
         $myBlock = array(
Please login to merge, or discard this patch.
class/smarty/xoops_plugins/block.xoBlkTpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     </div>
28 28
 <{/xoBlkTpl}>
29 29
 */
30
-function smarty_block_xoBlkTpl ($params, $content, $smarty, &$repeat) {
30
+function smarty_block_xoBlkTpl($params, $content, $smarty, &$repeat) {
31 31
     static $old_block;
32 32
     /** @var Smarty $smarty */
33 33
     if (empty($content)) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             $var = $xoBlk->buildBlock();
45 45
         }
46 46
         if (isset($params['cachetime'])) {
47
-            XoopsCache::write($cache_key, $var, (int)$params['cachetime']);
47
+            XoopsCache::write($cache_key, $var, (int) $params['cachetime']);
48 48
         }
49 49
         $old_block = $smarty->get_template_vars('block');
50 50
         $smarty->assign('block', $var);
Please login to merge, or discard this patch.
modules/tools/include/blockform.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
  * @author          Susheng Yang <[email protected]>
17 17
  */
18 18
 
19
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
20
-$form = new XoopsForm(_EDIT . _AM_TOOLS_BC_BLOCK, 'form', 'blockscall.php', 'post', true);
19
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
20
+$form = new XoopsForm(_EDIT._AM_TOOLS_BC_BLOCK, 'form', 'blockscall.php', 'post', true);
21 21
 $form->addElement(new XoopsFormLabel(_AM_TOOLS_BC_NAME, $block_data['name']));
22 22
 $form->addElement(new XoopsFormText(_AM_TOOLS_BC_DESCRIPTION, 'desc', 60, 255, $block_data['desciption']));
23 23
 if ($block_data['template'] != '') {
24
-    $form->addElement(new XoopsFormLabel(_AM_TOOLS_BC_CONTENT, '<a href="blockscall.php?op=edittpl&amp;bid=' . $block_data['bid'] . '">' . _AM_TOOLS_BC_EDITTPL . '</a>'));
24
+    $form->addElement(new XoopsFormLabel(_AM_TOOLS_BC_CONTENT, '<a href="blockscall.php?op=edittpl&amp;bid='.$block_data['bid'].'">'._AM_TOOLS_BC_EDITTPL.'</a>'));
25 25
 }
26 26
 if ($block_data['edit_form'] !== false) {
27 27
     $form->addElement(new XoopsFormLabel(_AM_TOOLS_BC_OPTIONS, $block_data['edit_form']));
Please login to merge, or discard this patch.
modules/tools/class/blockscall.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@
 block discarded – undo
55 55
         if (!$edit_func) {
56 56
             return false;
57 57
         }
58
-        if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) {
59
-            if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/blocks.php')) {
60
-                require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/blocks.php';
61
-            } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/english/blocks.php')) {
62
-                require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/english/blocks.php';
58
+        if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'))) {
59
+            if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/'.$xoopsConfig['language'].'/blocks.php')) {
60
+                require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/'.$xoopsConfig['language'].'/blocks.php';
61
+            } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/english/blocks.php')) {
62
+                require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/english/blocks.php';
63 63
             }
64
-            require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file');
64
+            require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file');
65 65
             $options   = explode('|', $this->getVar('options'));
66 66
             $edit_form = $edit_func($options);
67 67
             if (!$edit_form) {
Please login to merge, or discard this patch.
modules/tools/xoops_version.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
 // database tables, not applicable for this module
47 47
 $modversion['sqlfile']['mysql'] = 'sql/sql.sql';
48 48
 $modversion['tables']           = array(
49
-    $moduleDirName . '_' . 'blocks',
49
+    $moduleDirName.'_'.'blocks',
50 50
 );
51 51
 
52 52
 // Admin things, not applicable for this module
53
-$modversion['system_menu']         = 1;
54
-$modversion['hasAdmin']   = 1;
53
+$modversion['system_menu'] = 1;
54
+$modversion['hasAdmin'] = 1;
55 55
 // Main Menu
56 56
 $modversion['hasMain'] = 0;
57 57
 
Please login to merge, or discard this patch.
modules/tools/admin/blockscall.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 
20
-include __DIR__ . '/header.php';
21
-$GLOBALS['xoopsOption']['template_main']   = 'tools_admin_blockscall.tpl';
20
+include __DIR__.'/header.php';
21
+$GLOBALS['xoopsOption']['template_main'] = 'tools_admin_blockscall.tpl';
22 22
 xoops_cp_header();
23 23
 //loadModuleAdminMenu(2, '');
24 24
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             '604800'  => _WEEK,
57 57
             '2592000' => _MONTH
58 58
         );
59
-        $cachemodel      = array('0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER);
59
+        $cachemodel = array('0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER);
60 60
         foreach ($blockscall_data as $k => $v) {
61 61
             $blockscall_data[$k]['mname']         = $generator_list[$v['mid']];
62 62
             $blockscall_data[$k]['bcachetime']    = $cachetime[$v['bcachetime']];
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         unset($criteria);
77 77
         $generator_list[-1] = _AM_TOOLS_BC_ALLTYPES;
78 78
         ksort($generator_list);
79
-        $selgen = isset($_GET['selgen']) ? (int)$_GET['selgen'] : -1;
79
+        $selgen = isset($_GET['selgen']) ? (int) $_GET['selgen'] : -1;
80 80
 
81 81
         //get blocks
82 82
         $criteria = new CriteriaCompo(new Criteria('mid', 0, '!='));
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $xoopsTpl->assign('selgen', $selgen);
96 96
         $xoopsTpl->assign('modules', $generator_list);
97 97
         $xoopsTpl->assign('blocks', $blocks_array);
98
-        $GLOBALS['xoopsOption']['template_main']= 'tools_admin_blockscall_new.tpl';
98
+        $GLOBALS['xoopsOption']['template_main'] = 'tools_admin_blockscall_new.tpl';
99 99
 //        xoops_cp_header();
100 100
         break;
101 101
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 
143 143
     case 'edit':
144 144
 
145
-        $blocksCallObj          = $blocksCallHandler->get($_GET['bid']);
145
+        $blocksCallObj = $blocksCallHandler->get($_GET['bid']);
146 146
         $block_data              = $blocksCallObj->getValues(null, 'n');
147 147
         $block_data['edit_form'] = $blocksCallObj->getOptions();
148 148
 
149 149
         $blockoption = !empty($block_data['options']) ? "options=\"{$block_data['options']}\"" : '';
150
-        $cachetime   = $block_data['bcachetime'] != 0 ? ' cachetime=' . $block_data['bcachetime'] : '';
150
+        $cachetime   = $block_data['bcachetime'] != 0 ? ' cachetime='.$block_data['bcachetime'] : '';
151 151
         if ($cachetime) {
152 152
             switch ($block_data['bcachemodel']) {
153 153
                 case 0:
@@ -169,16 +169,16 @@  discard block
 block discarded – undo
169 169
 {$block_data['tpl_content']}
170 170
 <{/xoBlkTpl}>
171 171
 EOF;
172
-        $xoblk    = <<<EOF
172
+        $xoblk = <<<EOF
173 173
 <{xoblk module="{$block_data['dirname']}" file="{$block_data['func_file']}" show_func="{$block_data['show_func']}" $blockoption template="{$block_data['template']}"$cachetime $cachemodel}>
174 174
 EOF;
175 175
 
176
-        include __DIR__ . '/../include/blockform.php';
176
+        include __DIR__.'/../include/blockform.php';
177 177
 
178 178
         $xoopsTpl->assign('xoBlkTpl', $xoblktpl);
179 179
         $xoopsTpl->assign('xoblk', $xoblk);
180 180
 
181
-        $GLOBALS['xoopsOption']['template_main']= 'tools_admin_blockscall_edit.tpl';
181
+        $GLOBALS['xoopsOption']['template_main'] = 'tools_admin_blockscall_edit.tpl';
182 182
 //        xoops_cp_header();
183 183
         break;
184 184
 
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
 
217 217
     case 'edittpl':
218 218
         $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']);
219
-        $block_data     = $blocksCallObj->getValues(null, 'n');
220
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
219
+        $block_data = $blocksCallObj->getValues(null, 'n');
220
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
221 221
         $form = new XoopsThemeForm(_AM_TOOLS_BC_EDITTPL, 'form', 'blockscall.php', 'post', true);
222 222
         $form->addElement(new XoopsFormLabel(_AM_TOOLS_BC_BLOCK, $block_data['name']));
223 223
         $form->addElement(new XoopsFormTextArea(_AM_TOOLS_BC_TPLSOURCES, 'tpl_content', $block_data['tpl_content'], 10, 80));
@@ -247,6 +247,6 @@  discard block
 block discarded – undo
247 247
         break;
248 248
 }
249 249
 //xoops_cp_header();
250
-$css = '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/modules/tools/templates/style.css" />';
250
+$css = '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/tools/templates/style.css" />';
251 251
 $xoopsTpl->assign('css', $css);
252
-include __DIR__ . '/footer.php';
252
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
modules/tools/admin/index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @author          Susheng Yang <[email protected]>
17 17
  */
18 18
 
19
-include __DIR__ . '/header.php';
19
+include __DIR__.'/header.php';
20 20
 xoops_cp_header();
21 21
 
22 22
 //loadModuleAdminMenu(1, '');
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 switch ($op) {
26 26
     default:
27 27
     case 'index':
28
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
28
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29 29
         $form = new XoopsThemeForm(_AM_TOOLS_INDEX, 'updatecache', 'index.php', 'post', true);
30 30
         $form->addElement(new XoopsFormLabel(_AM_TOOLS_TIP, _AM_TOOLS_TIPS));
31 31
         $checkbox_options = array(
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             'updatesmartycache'   => _AM_TOOLS_UPDATESMARTYCACHE,
34 34
             'updatesmartycompile' => _AM_TOOLS_UPDATESMARTYCOMPILE
35 35
         );
36
-        $checkbox         = new XoopsFormCheckBox(_AM_TOOLS_OPTIONS, 'options', array_keys($checkbox_options));
36
+        $checkbox = new XoopsFormCheckBox(_AM_TOOLS_OPTIONS, 'options', array_keys($checkbox_options));
37 37
         $checkbox->addOptionArray($checkbox_options);
38 38
         $form->addElement($checkbox);
39 39
         $form->addElement(new XoopsFormHidden('op', 'updatecache'));
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     case 'updatecache':
45 45
         if ($_REQUEST['step'] == 1) {
46 46
             $options  = implode('_', $_REQUEST['options']);
47
-            $url      = XOOPS_URL . "/modules/tools/admin/index.php?op=updatecache&step=2&options={$options}";
47
+            $url      = XOOPS_URL."/modules/tools/admin/index.php?op=updatecache&step=2&options={$options}";
48 48
             $updating = _AM_TOOLS_UPDATING;
49 49
             $msg      = <<<EOF
50 50
     <div class="loading" style="text-align:center;">
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
65 65
             $options = explode('_', $_REQUEST['options']);
66 66
             foreach ($options as $k) {
67 67
                 if ($k === 'updatexoopscache') {
68
-                    $d = XOOPS_VAR_PATH . '/caches/xoops_cache';
68
+                    $d = XOOPS_VAR_PATH.'/caches/xoops_cache';
69 69
                     updatecache($d, 'php');
70 70
                     updatecache($d, 'html');
71 71
                     updatecache($d, 'tmp');
72 72
                 }
73 73
                 if ($k === 'updatesmartycache') {
74
-                    $d = XOOPS_VAR_PATH . '/caches/smarty_cache';
74
+                    $d = XOOPS_VAR_PATH.'/caches/smarty_cache';
75 75
                     updatecache($d, 'html');
76 76
                     updatecache($d, 'tmp');
77 77
                 }
78 78
                 if ($k === 'updatesmartycompile') {
79
-                    $d = XOOPS_VAR_PATH . '/caches/smarty_compile';
79
+                    $d = XOOPS_VAR_PATH.'/caches/smarty_compile';
80 80
                     updatecache($d, 'php');
81 81
                 }
82 82
             }
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
     $d = dir($cacheDir);
98 98
     while (false !== ($entry = $d->read())) {
99 99
         if (preg_match("/.*\.{$type}$/", $entry)) {
100
-            unlink($cacheDir . '/' . $entry);
100
+            unlink($cacheDir.'/'.$entry);
101 101
         }
102 102
     }
103 103
     $d->close();
104 104
 }
105 105
 
106
-include __DIR__ . '/footer.php';
106
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
modules/tools/admin/header.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
  * @author          Susheng Yang <[email protected]>
17 17
  */
18 18
 
19
-require_once __DIR__ . '/../../../include/cp_header.php';
19
+require_once __DIR__.'/../../../include/cp_header.php';
20 20
 
21 21
 if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
22
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
22
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
23 23
     $xoopsTpl = new XoopsTpl();
24 24
 }
25 25
 
26
-if (!@ require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php'):
26
+if (!@ require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php'):
27 27
 
28 28
     /**
29 29
      * @param        $currentoption
@@ -37,18 +37,18 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         $breadcrumb  = empty($breadcrumb) ? $adminmenu[$currentoption]['title'] : $breadcrumb;
40
-        $module_link = XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/';
41
-        $image_link  = XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/images';
40
+        $module_link = XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname').'/';
41
+        $image_link  = XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname').'/images';
42 42
 
43 43
         $adminMenu_text = '
44 44
     <style type="text/css">
45 45
     <!--
46 46
     #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0;}
47
-    #buttonbar { float:left; width:100%; background: #e7e7e7 url("' . $image_link . '/modadminbg.gif") repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;}
47
+    #buttonbar { float:left; width:100%; background: #e7e7e7 url("' . $image_link.'/modadminbg.gif") repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;}
48 48
     #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }
49 49
     #buttonbar li { display:inline; margin:0; padding:0; }
50
-    #buttonbar a { float:left; background:url("' . $image_link . '/left_both.gif") no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
51
-    #buttonbar a span { float:left; display:block; background:url("' . $image_link . '/right_both.gif") no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
50
+    #buttonbar a { float:left; background:url("' . $image_link.'/left_both.gif") no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
51
+    #buttonbar a span { float:left; display:block; background:url("' . $image_link.'/right_both.gif") no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
52 52
     /* Commented Backslash Hack hides rule from IE5-Mac \*/
53 53
     #buttonbar a span {float:none;}
54 54
     /* End IE5-Mac hack */
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
      <table style="width: 100%; padding: 0; " cellspacing="0">
64 64
          <tr>
65 65
              <td style="width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;">
66
-                 <a href="../index.php">' . $GLOBALS['xoopsModule']->getVar('name') . '</a>
66
+                 <a href="../index.php">' . $GLOBALS['xoopsModule']->getVar('name').'</a>
67 67
              </td>
68 68
              <td style="width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;">
69
-                 <strong>' . $GLOBALS['xoopsModule']->getVar('name') . '</strong>&nbsp;' . $breadcrumb . '
69
+                 <strong>' . $GLOBALS['xoopsModule']->getVar('name').'</strong>&nbsp;'.$breadcrumb.'
70 70
              </td>
71 71
          </tr>
72 72
      </table>
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
      <ul>
76 76
     ';
77 77
         foreach (array_keys($adminObject) as $key) {
78
-            $adminMenu_text .= (($currentoption == $key) ? '<li class="current">' : '<li>') . '<a href="' . $module_link . $adminmenu[$key]['link'] . '"><span>' . $adminmenu[$key]['title'] . '</span></a></li>';
78
+            $adminMenu_text .= (($currentoption == $key) ? '<li class="current">' : '<li>').'<a href="'.$module_link.$adminmenu[$key]['link'].'"><span>'.$adminmenu[$key]['title'].'</span></a></li>';
79 79
         }
80
-        $adminMenu_text .= '<li><a href="' . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $GLOBALS['xoopsModule']->getVar('mid') . '"><span>' . _PREFERENCES . '</span></a></li>';
80
+        $adminMenu_text .= '<li><a href="'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$GLOBALS['xoopsModule']->getVar('mid').'"><span>'._PREFERENCES.'</span></a></li>';
81 81
         $adminMenu_text .= '
82 82
      </ul>
83 83
     </div>
Please login to merge, or discard this patch.