Completed
Push — master ( 0881bb...3a6ebc )
by Michael
04:47
created
xoops_trust_path/libs/altsys/include/mygrouppermform.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 // Project: The XOOPS Project                                                //
30 30
 // ------------------------------------------------------------------------- //
31 31
 
32
-if (! defined('XOOPS_ROOT_PATH')) {
33
-    exit ;
32
+if (!defined('XOOPS_ROOT_PATH')) {
33
+    exit;
34 34
 }
35 35
 
36 36
 require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * Tree structure of items
61 61
      * @var array
62 62
      */
63
-    public $_itemTree = array() ;
63
+    public $_itemTree = array();
64 64
     /**
65 65
      * Name of permission
66 66
      * @var string
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * Appendix
76 76
      * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
77 77
      */
78
-    public $_appendix = array() ;
78
+    public $_appendix = array();
79 79
 
80 80
     /**
81 81
      * Constructor
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function addAppendix($permName, $itemId, $itemName)
117 117
     {
118
-        $this->_appendix[] = array('permname'=>$permName,'itemid'=>$itemId,'itemname'=>$itemName,'selected'=>false);
118
+        $this->_appendix[] = array('permname'=>$permName, 'itemid'=>$itemId, 'itemname'=>$itemName, 'selected'=>false);
119 119
     }
120 120
 
121 121
     /**
@@ -149,15 +149,15 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function render()
151 151
     {
152
-        global $xoopsGTicket ;
152
+        global $xoopsGTicket;
153 153
 
154 154
         // load all child ids for javascript codes
155 155
         foreach (array_keys($this->_itemTree) as $item_id) {
156 156
             $this->_itemTree[$item_id]['allchild'] = array();
157 157
             $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
158 158
         }
159
-        $gperm_handler =& xoops_gethandler('groupperm');
160
-        $member_handler =& xoops_gethandler('member');
159
+        $gperm_handler = & xoops_gethandler('groupperm');
160
+        $member_handler = & xoops_gethandler('member');
161 161
         $glist = $member_handler->getGroupList();
162 162
         foreach (array_keys($glist) as $i) {
163 163
             // get selected item id(s) for each group
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
             $ele->setOptionTree($this->_itemTree);
167 167
 
168 168
             // GIJ start
169
-            $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">') ;
169
+            $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">');
170 170
             // GIJ_end
171 171
 
172 172
             foreach ($this->_appendix as $key => $append) {
173
-                $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid) ;
173
+                $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid);
174 174
             }
175 175
             $ele->setAppendix($this->_appendix);
176 176
             $this->addElement($ele);
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
         // GIJ start
181 181
         $jstray = new XoopsFormElementTray(' &nbsp; ');
182 182
         $jsuncheckbutton = new XoopsFormButton('', 'none', _NONE, 'button');
183
-        $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"") ;
183
+        $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"");
184 184
         $jscheckbutton = new XoopsFormButton('', 'all', _ALL, 'button');
185
-        $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"") ;
186
-        $jstray->addElement($jsuncheckbutton) ;
187
-        $jstray->addElement($jscheckbutton) ;
185
+        $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"");
186
+        $jstray->addElement($jsuncheckbutton);
187
+        $jstray->addElement($jscheckbutton);
188 188
         $this->addElement($jstray);
189 189
         // GIJ end
190 190
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />';
197 197
         $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n";
198
-        $elements =& $this->getElements();
198
+        $elements = & $this->getElements();
199 199
         foreach (array_keys($elements) as $i) {
200 200
             if (!is_object($elements[$i])) {
201 201
                 $ret .= $elements[$i];
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 $ret .= $elements[$i]->render();
212 212
             }
213 213
         }
214
-        $ret .= '</table>' . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') . '</form>';
214
+        $ret .= '</table>'.$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin').'</form>';
215 215
         return $ret;
216 216
     }
217 217
 }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      * Appendix
248 248
      * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
249 249
      */
250
-    public $_appendix = array() ;
250
+    public $_appendix = array();
251 251
 
252 252
     /**
253 253
      * Constructor
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     public function setOptionTree(&$optionTree)
289 289
     {
290
-        $this->_optionTree =& $optionTree;
290
+        $this->_optionTree = & $optionTree;
291 291
     }
292 292
 
293 293
     /**
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
      */
298 298
     public function setAppendix($appendix)
299 299
     {
300
-        $this->_appendix = $appendix ;
300
+        $this->_appendix = $appendix;
301 301
     }
302 302
 
303 303
     /**
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function render()
310 310
     {
311
-        $ret = '' ;
311
+        $ret = '';
312 312
 
313 313
         if (count($this->_appendix) > 0) {
314 314
             $ret .= '<table class="outer"><tr>';
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
                     $ret .= '</tr><tr>';
319 319
                     $cols = 1;
320 320
                 }
321
-                $checked = $append['selected'] ? 'checked="checked"' : '' ;
322
-                $name = 'perms['.$append['permname'].']' ;
323
-                $itemid = $append['itemid'] ;
324
-                $itemid = $append['itemid'] ;
325
-                $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>" ;
321
+                $checked = $append['selected'] ? 'checked="checked"' : '';
322
+                $name = 'perms['.$append['permname'].']';
323
+                $itemid = $append['itemid'];
324
+                $itemid = $append['itemid'];
325
+                $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>";
326 326
                 $cols++;
327 327
             }
328 328
             $ret .= '</tr></table>';
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         $ret .= '<table class="outer"><tr>';
332 332
         $cols = 1;
333
-        if (! empty($this->_optionTree[0]['children'])) {
333
+        if (!empty($this->_optionTree[0]['children'])) {
334 334
             foreach ($this->_optionTree[0]['children'] as $topitem) {
335 335
                 if ($cols > 4) {
336 336
                     $ret .= '</tr><tr>';
@@ -358,8 +358,8 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
360 360
     {
361
-        $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . ']['
362
-                 . $option['id'] . "]\" onclick=\"";
361
+        $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" id=\"".$this->getName().'[groups]['.$this->_groupId.']['
362
+                 . $option['id']."]\" onclick=\"";
363 363
         // If there are parent elements, add javascript that will
364 364
         // make them selecteded when this element is checked to make
365 365
         // sure permissions to parent items are added as well.
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
         if (isset($this->_value) && in_array($option['id'], $this->_value)) {
380 380
             $tree .= ' checked="checked"';
381 381
         }
382
-        $tree .= ' />' . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . '[parents][' . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" . $this->getName() . '[itemname]['
383
-                 . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']) . "\" /><br />\n";
382
+        $tree .= ' />'.$option['name']."<input type=\"hidden\" name=\"".$this->getName().'[parents]['.$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName().'[itemname]['
383
+                 . $option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n";
384 384
         if (isset($option['children'])) {
385 385
             foreach ($option['children'] as $child) {
386 386
                 array_push($parentIds, $option['id']);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php 1 patch
Spacing   +7 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! $xoopsConfig['theme_fromfile']) {
4
-    return ;
3
+if (!$xoopsConfig['theme_fromfile']) {
4
+    return;
5 5
 }
6 6
 
7 7
 // templates/ under the theme
8
-$tplsadmin_autoupdate_path = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/templates' ;
8
+$tplsadmin_autoupdate_path = XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/templates';
9 9
 
10
-if ($handler = @opendir($tplsadmin_autoupdate_path . '/')) {
10
+if ($handler = @opendir($tplsadmin_autoupdate_path.'/')) {
11 11
     while (($file = readdir($handler)) !== false) {
12
-        $file_path = $tplsadmin_autoupdate_path . '/' . $file ;
12
+        $file_path = $tplsadmin_autoupdate_path.'/'.$file;
13 13
         if (is_file($file_path) && substr($file, -5) == '.html') {
14
-<<<<<<< HEAD
14
+<< << <<< HEAD
15 15
             $mtime = intval(@filemtime($file_path)) ;
16 16
             list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($xoopsConfig['template_set']) . "' AND tpl_file='" . addslashes($file) . "' AND tpl_lastmodified >= $mtime")) ;
17 17
 =======
@@ -20,8 +20,4 @@  discard block
 block discarded – undo
20 20
 >>>>>>> feature/intval
21 21
             if ($count <= 0) {
22 22
                 include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ;
23
-                tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ;
24
-            }
25
-        }
26
-    }
27
-}
23
+                tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime
28 24
\ No newline at end of file
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/adminmenu_functions.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once dirname(__DIR__).'/class/altsysUtils.class.php' ;
2
+require_once dirname(__DIR__).'/class/altsysUtils.class.php';
3 3
 
4
-define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php') ;
5
-define('ALTSYS_ADMINMENU_HACK_NONE', 0) ;
6
-define('ALTSYS_ADMINMENU_HACK_2COL', 1) ;
7
-define('ALTSYS_ADMINMENU_HACK_NOIMG', 2) ;
8
-define('ALTSYS_ADMINMENU_HACK_XCSTY', 3) ;
4
+define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php');
5
+define('ALTSYS_ADMINMENU_HACK_NONE', 0);
6
+define('ALTSYS_ADMINMENU_HACK_2COL', 1);
7
+define('ALTSYS_ADMINMENU_HACK_NOIMG', 2);
8
+define('ALTSYS_ADMINMENU_HACK_XCSTY', 3);
9 9
 
10 10
 
11 11
 //
@@ -13,73 +13,73 @@  discard block
 block discarded – undo
13 13
 //
14 14
 function altsys_adminmenu_insert_mymenu(&$module)
15 15
 {
16
-    global $altsysModuleConfig ;
16
+    global $altsysModuleConfig;
17 17
 
18 18
     if (empty($altsysModuleConfig['adminmenu_insert_mymenu'])) {
19
-        return ;
19
+        return;
20 20
     }
21 21
 
22 22
     if (altsys_get_core_type() < ALTSYS_CORE_TYPE_ORE) {
23
-        altsys_adminmenu_insert_mymenu_x20($module) ;
23
+        altsys_adminmenu_insert_mymenu_x20($module);
24 24
     }
25 25
 }
26 26
 
27 27
 function altsys_adminmenu_insert_mymenu_x20(&$module)
28 28
 {
29 29
     // read
30
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
31
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
32
-        exit ;
30
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
31
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
32
+        exit;
33 33
     }
34
-    $not_inside_cp_functions = true ;
35
-    include ALTSYS_ADMINMENU_FILE ;
34
+    $not_inside_cp_functions = true;
35
+    include ALTSYS_ADMINMENU_FILE;
36 36
 
37
-    $dirname = $module->getVar('dirname') ;
38
-    $mid = $module->getVar('mid') ;
39
-    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->' ;
37
+    $dirname = $module->getVar('dirname');
38
+    $mid = $module->getVar('mid');
39
+    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->';
40 40
 
41 41
     // fetch popup_no
42 42
     if (empty($xoops_admin_menu_ft[$mid])) {
43
-        return ;
43
+        return;
44 44
     }
45
-    if (! preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
-        return ;
45
+    if (!preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
+        return;
47 47
     }
48 48
     $popup_no = (int)$regs[1];
49 49
 
50 50
     // replace
51
-    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'' ;
52
-    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'' ;
51
+    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'';
52
+    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'';
53 53
 
54 54
     // do replacement
55
-    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv) ;
55
+    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv);
56 56
 
57 57
     if ($xoops_admin_menu_dv == $new_xoops_admin_menu_dv) {
58
-        return ;
58
+        return;
59 59
     }
60
-    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv ;
60
+    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv;
61 61
 
62
-    $insert = '' ;
62
+    $insert = '';
63 63
 
64 64
     // insert blocksadmin
65 65
     if ($dirname != 'altsys') {
66
-        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ;
67
-        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n" ;
66
+        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin';
67
+        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n";
68 68
     }
69 69
 
70 70
     // insert tplsadmin
71
-    $db =& XoopsDatabaseFactory::getDatabaseConnection() ;
72
-    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$dirname'")) ;
71
+    $db = & XoopsDatabaseFactory::getDatabaseConnection();
72
+    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$dirname'"));
73 73
     if ($count > 0) {
74
-        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ;
75
-        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert ;
74
+        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin';
75
+        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert;
76 76
     }
77 77
 
78 78
     // do insertion
79
-    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv) ;
79
+    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv);
80 80
 
81 81
     // write back
82
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true )) ;
82
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true));
83 83
 }
84 84
 
85 85
 //
@@ -87,184 +87,184 @@  discard block
 block discarded – undo
87 87
 //
88 88
 function altsys_adminmenu_hack_ft()
89 89
 {
90
-    global $altsysModuleConfig ;
90
+    global $altsysModuleConfig;
91 91
 
92 92
     if (altsys_get_core_type() >= ALTSYS_CORE_TYPE_ORE) {
93
-        return ;
93
+        return;
94 94
     }
95 95
     if (empty($altsysModuleConfig['adminmenu_hack_ft'])) {
96
-        return ;
96
+        return;
97 97
     }
98 98
 
99 99
     if ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_2COL) {
100
-        altsys_adminmenu_hack_ft_2col_x20() ;
100
+        altsys_adminmenu_hack_ft_2col_x20();
101 101
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_NOIMG) {
102
-        altsys_adminmenu_hack_ft_noimg_x20() ;
102
+        altsys_adminmenu_hack_ft_noimg_x20();
103 103
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_XCSTY) {
104
-        altsys_adminmenu_hack_ft_xcsty_x20() ;
104
+        altsys_adminmenu_hack_ft_xcsty_x20();
105 105
     }
106 106
 }
107 107
 
108 108
 function altsys_adminmenu_hack_ft_2col_x20()
109 109
 {
110 110
     // read
111
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
112
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
113
-        exit ;
111
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
112
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
113
+        exit;
114 114
     }
115
-    $not_inside_cp_functions = true ;
116
-    include ALTSYS_ADMINMENU_FILE ;
115
+    $not_inside_cp_functions = true;
116
+    include ALTSYS_ADMINMENU_FILE;
117 117
 
118 118
     // check previous hack
119
-    if (! empty($altsys_adminmenu_ft_hacked)) {
119
+    if (!empty($altsys_adminmenu_ft_hacked)) {
120 120
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_2COL) {
121 121
             // skip
122
-            return ;
122
+            return;
123 123
         } else {
124 124
             // rebuild adminmenu
125
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
126
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
125
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
126
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
127 127
             // backup $xoops_admin_menu_dv
128
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
128
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
129 129
             // include new adminmenu
130
-            include ALTSYS_ADMINMENU_FILE ;
130
+            include ALTSYS_ADMINMENU_FILE;
131 131
             // restore $xoops_admin_menu_dv
132
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
132
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
133 133
         }
134 134
     }
135 135
 
136
-    $search  = ' alt=\'\' /></a><br />' ;
137
-    $replace_fmt = ' alt="%s" /></a>' ;
136
+    $search  = ' alt=\'\' /></a><br />';
137
+    $replace_fmt = ' alt="%s" /></a>';
138 138
 
139
-    $is_left = true ;
140
-    $module_handler =& xoops_gethandler('module') ;
141
-    $mids = array_keys($xoops_admin_menu_ft) ;
142
-    $last_mid = $mids[count($mids) - 1 ] ;
139
+    $is_left = true;
140
+    $module_handler = & xoops_gethandler('module');
141
+    $mids = array_keys($xoops_admin_menu_ft);
142
+    $last_mid = $mids[count($mids) - 1];
143 143
     foreach ($mids as $mid) {
144
-        $module =& $module_handler->get($mid) ;
145
-        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]) ;
144
+        $module = & $module_handler->get($mid);
145
+        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]);
146 146
         if ($is_left) {
147 147
             if ($mid == $last_mid) {
148
-                $xoops_admin_menu_ft[$mid] = $new_menu_ft . '</td><td>' ;
148
+                $xoops_admin_menu_ft[$mid] = $new_menu_ft.'</td><td>';
149 149
             } else {
150
-                $left_body = $new_menu_ft ;
151
-                $left_key = $mid ;
152
-                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]) ;
150
+                $left_body = $new_menu_ft;
151
+                $left_key = $mid;
152
+                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]);
153 153
             }
154 154
         } else {
155
-            $xoops_admin_menu_ft[$mid] = $left_body . '</td><td>' . $new_menu_ft ;
156
-            unset($xoops_admin_menu_ft[$left_key]) ;
157
-            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]) ;
155
+            $xoops_admin_menu_ft[$mid] = $left_body.'</td><td>'.$new_menu_ft;
156
+            unset($xoops_admin_menu_ft[$left_key]);
157
+            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]);
158 158
         }
159
-        $is_left = ! $is_left ;
159
+        $is_left = !$is_left;
160 160
     }
161 161
 
162 162
     // write back
163
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL )) ;
163
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL));
164 164
 }
165 165
 
166 166
 
167 167
 function altsys_adminmenu_hack_ft_noimg_x20()
168 168
 {
169 169
     // read
170
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
171
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
172
-        exit ;
170
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
171
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
172
+        exit;
173 173
     }
174
-    $not_inside_cp_functions = true ;
175
-    include ALTSYS_ADMINMENU_FILE ;
174
+    $not_inside_cp_functions = true;
175
+    include ALTSYS_ADMINMENU_FILE;
176 176
 
177 177
     // check previous hack
178
-    if (! empty($altsys_adminmenu_ft_hacked)) {
178
+    if (!empty($altsys_adminmenu_ft_hacked)) {
179 179
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_NOIMG) {
180 180
             // skip
181
-            return ;
181
+            return;
182 182
         } else {
183 183
             // rebuild adminmenu
184
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
185
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
184
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
185
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
186 186
             // backup $xoops_admin_menu_dv
187
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
187
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
188 188
             // include new adminmenu
189
-            include ALTSYS_ADMINMENU_FILE ;
189
+            include ALTSYS_ADMINMENU_FILE;
190 190
             // restore $xoops_admin_menu_dv
191
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
191
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
192 192
         }
193 193
     }
194 194
 
195
-    $module_handler =& xoops_gethandler('module') ;
196
-    $mids = array_keys($xoops_admin_menu_ft) ;
195
+    $module_handler = & xoops_gethandler('module');
196
+    $mids = array_keys($xoops_admin_menu_ft);
197 197
     foreach ($mids as $mid) {
198
-        $module =& $module_handler->get($mid) ;
199
-        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]) ;
200
-        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>' ;
201
-        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]) ;
198
+        $module = & $module_handler->get($mid);
199
+        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]);
200
+        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>';
201
+        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]);
202 202
     }
203 203
 
204 204
     // write back
205
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG )) ;
205
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG));
206 206
 }
207 207
 
208 208
 
209 209
 function altsys_adminmenu_hack_ft_xcsty_x20()
210 210
 {
211 211
     // read
212
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
213
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
214
-        exit ;
212
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
213
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
214
+        exit;
215 215
     }
216
-    $not_inside_cp_functions = true ;
217
-    include ALTSYS_ADMINMENU_FILE ;
216
+    $not_inside_cp_functions = true;
217
+    include ALTSYS_ADMINMENU_FILE;
218 218
 
219 219
     // check previous hack
220
-    if (! empty($altsys_adminmenu_ft_hacked)) {
220
+    if (!empty($altsys_adminmenu_ft_hacked)) {
221 221
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_XCSTY && empty($altsys_adminmenu_dv_updated)) {
222 222
             // skip
223
-            return ;
223
+            return;
224 224
         } else {
225 225
             // rebuild adminmenu
226
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
227
-            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
228
-            fwrite($fp, xoops_module_get_admin_menu()) ;
229
-            fclose($fp) ;
226
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
227
+            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
228
+            fwrite($fp, xoops_module_get_admin_menu());
229
+            fclose($fp);
230 230
             // backup $xoops_admin_menu_dv
231
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
231
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
232 232
             // include new adminmenu
233
-            include ALTSYS_ADMINMENU_FILE ;
233
+            include ALTSYS_ADMINMENU_FILE;
234 234
             // restore $xoops_admin_menu_dv
235
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
235
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
236 236
         }
237 237
     }
238 238
 
239
-    $module_handler =& xoops_gethandler('module') ;
240
-    $mids = array_keys($xoops_admin_menu_ft) ;
239
+    $module_handler = & xoops_gethandler('module');
240
+    $mids = array_keys($xoops_admin_menu_ft);
241 241
     foreach ($mids as $mid) {
242
-        $module =& $module_handler->get($mid) ;
243
-        $submenuitems = array() ;
242
+        $module = & $module_handler->get($mid);
243
+        $submenuitems = array();
244 244
         if (preg_match('/popUpL\d+/', $xoops_admin_menu_ft[$mid], $regs)) {
245
-            $popup = $regs[0] ;
246
-            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs) ;
245
+            $popup = $regs[0];
246
+            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs);
247 247
             foreach ($regs[0] as $submenuitem) {
248
-                $submenuitems[] = str_replace($popup.'();', '', $submenuitem) ;
248
+                $submenuitems[] = str_replace($popup.'();', '', $submenuitem);
249 249
             }
250 250
         } else {
251
-            return ;
251
+            return;
252 252
         }
253 253
         // module icon
254 254
         if (preg_match('#\<img .*/\>#U', $xoops_admin_menu_ft[$mid], $regs)) {
255
-            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]) ;
255
+            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]);
256 256
         } else {
257
-            $icon_img = '' ;
257
+            $icon_img = '';
258 258
         }
259 259
         // version number
260
-        $icon_img .= '<span class="version" style="">' . sprintf('%.2f', $module->getVar('version') / 100.0) . '</span>' ;
261
-        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]) ;
262
-        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>' ;
260
+        $icon_img .= '<span class="version" style="">'.sprintf('%.2f', $module->getVar('version') / 100.0).'</span>';
261
+        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]);
262
+        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>';
263 263
         foreach ($submenuitems as $submenuitem) {
264
-            $newline .= '<li>'.$submenuitem.'</li>' ;
264
+            $newline .= '<li>'.$submenuitem.'</li>';
265 265
         }
266
-        $newline .= '</ul>'.$icon_img.'</div>' ;
267
-        $xoops_admin_menu_ft[$mid] = $newline ;
266
+        $newline .= '</ul>'.$icon_img.'</div>';
267
+        $xoops_admin_menu_ft[$mid] = $newline;
268 268
     }
269 269
 
270 270
     $xoops_admin_menu_js = "
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	}" ;
281 281
 
282 282
     // write back
283
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY )) ;
283
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY));
284 284
 }
285 285
 
286 286
 
@@ -291,18 +291,18 @@  discard block
 block discarded – undo
291 291
 function altsys_adminmenu_save_x20($xoops_admin_vars)
292 292
 {
293 293
     // variable definitions
294
-    ob_start() ;
295
-    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n" ;
294
+    ob_start();
295
+    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n";
296 296
     foreach ($xoops_admin_vars as $key => $val) {
297
-        echo '$' . $key . " = \n" ;
298
-        @var_export($val) ;
299
-        echo " ;\n" ;
297
+        echo '$'.$key." = \n";
298
+        @var_export($val);
299
+        echo " ;\n";
300 300
     }
301
-    $output = ob_get_contents() ;
302
-    ob_end_clean() ;
301
+    $output = ob_get_contents();
302
+    ob_end_clean();
303 303
 
304 304
     // embedding logics
305
-    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array( ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY ))) {
305
+    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array(ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY))) {
306 306
         $output .= '
307 307
 
308 308
 if( is_object( @$GLOBALS["xoopsModule"] ) && empty( $not_inside_cp_functions ) ) {
@@ -317,13 +317,13 @@  discard block
 block discarded – undo
317 317
     }
318 318
 
319 319
     // termination
320
-    $output .= "\n\n?>" ;
320
+    $output .= "\n\n?>";
321 321
 
322 322
     // replace into XOOPS_URL
323
-    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output) ;
323
+    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output);
324 324
 
325 325
     // output
326
-    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
327
-    fwrite($fp, $output) ;
328
-    fclose($fp) ;
326
+    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
327
+    fwrite($fp, $output);
328
+    fclose($fp);
329 329
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/blocks.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$mytrustdirname = basename(__DIR__) ;
4
-$mytrustdirpath = __DIR__ ;
3
+$mytrustdirname = basename(__DIR__);
4
+$mytrustdirpath = __DIR__;
5 5
 
6 6
 // language files
7
-$language = empty($GLOBALS['xoopsConfig']['language']) ? 'english' : $GLOBALS['xoopsConfig']['language'] ;
7
+$language = empty($GLOBALS['xoopsConfig']['language']) ? 'english' : $GLOBALS['xoopsConfig']['language'];
8 8
 if (file_exists("$mydirpath/language/$language/blocks.php")) {
9 9
     // user customized language file (already read by class/xoopsblock.php etc)
10 10
     // include_once "$mydirpath/language/$language/blocks.php" ;
11 11
 } elseif (file_exists("$mytrustdirpath/language/$language/blocks_common.php")) {
12 12
     // default language file
13
-    include_once "$mytrustdirpath/language/$language/blocks_common.php" ;
14
-    include "$mytrustdirpath/language/$language/blocks_each.php" ;
13
+    include_once "$mytrustdirpath/language/$language/blocks_common.php";
14
+    include "$mytrustdirpath/language/$language/blocks_each.php";
15 15
 } else {
16 16
     // fallback english
17
-    include_once "$mytrustdirpath/language/english/blocks_common.php" ;
18
-    include "$mytrustdirpath/language/english/blocks_each.php" ;
17
+    include_once "$mytrustdirpath/language/english/blocks_common.php";
18
+    include "$mytrustdirpath/language/english/blocks_each.php";
19 19
 }
20 20
 
21
-require_once "$mytrustdirpath/blocks/block_functions.php" ;
21
+require_once "$mytrustdirpath/blocks/block_functions.php";
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/compilehookadmin.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-include_once __DIR__.'/include/gtickets.php' ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+include_once __DIR__.'/include/gtickets.php';
10
+include_once __DIR__.'/include/altsys_functions.php';
11 11
 
12 12
 
13 13
 // this page can be called only from altsys
14 14
 // if( $xoopsModule->getVar('dirname') != 'altsys' ) die( 'this page can be called only from altsys' ) ;
15 15
 
16 16
 // language file
17
-altsys_include_language_file('compilehookadmin') ;
17
+altsys_include_language_file('compilehookadmin');
18 18
 
19 19
 //
20 20
 // DEFINITIONS
@@ -23,46 +23,46 @@  discard block
 block discarded – undo
23 23
 $compile_hooks = array(
24 24
 
25 25
     'enclosebycomment' => array(
26
-        'pre' => '<!-- begin altsys_tplsadmin %s -->' ,
27
-        'post' => '<!-- end altsys_tplsadmin %s -->' ,
28
-        'success_msg' => _TPLSADMIN_FMT_MSG_ENCLOSEBYCOMMENT ,
29
-        'dt' => _TPLSADMIN_DT_ENCLOSEBYCOMMENT ,
30
-        'dd' => _TPLSADMIN_DD_ENCLOSEBYCOMMENT ,
31
-        'conf_msg' => _TPLSADMIN_CNF_ENCLOSEBYCOMMENT ,
26
+        'pre' => '<!-- begin altsys_tplsadmin %s -->',
27
+        'post' => '<!-- end altsys_tplsadmin %s -->',
28
+        'success_msg' => _TPLSADMIN_FMT_MSG_ENCLOSEBYCOMMENT,
29
+        'dt' => _TPLSADMIN_DT_ENCLOSEBYCOMMENT,
30
+        'dd' => _TPLSADMIN_DD_ENCLOSEBYCOMMENT,
31
+        'conf_msg' => _TPLSADMIN_CNF_ENCLOSEBYCOMMENT,
32 32
         'skip_theme' => true
33
-    ) ,
33
+    ),
34 34
 
35 35
     'enclosebybordereddiv' => array(
36
-        'pre' => '<div class="altsys_tplsadmin_frame" style="border:1px solid black;word-wrap:break-word;">' ,
37
-        'post' => '<br /><a href="'.XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file=%1$s" style="color:red;">Edit:<br />%1$s</a></div>' ,
38
-        'success_msg' => _TPLSADMIN_FMT_MSG_ENCLOSEBYBORDEREDDIV ,
39
-        'dt' => _TPLSADMIN_DT_ENCLOSEBYBORDEREDDIV ,
40
-        'dd' => _TPLSADMIN_DD_ENCLOSEBYBORDEREDDIV ,
41
-        'conf_msg' => _TPLSADMIN_CNF_ENCLOSEBYBORDEREDDIV ,
36
+        'pre' => '<div class="altsys_tplsadmin_frame" style="border:1px solid black;word-wrap:break-word;">',
37
+        'post' => '<br /><a href="'.XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file=%1$s" style="color:red;">Edit:<br />%1$s</a></div>',
38
+        'success_msg' => _TPLSADMIN_FMT_MSG_ENCLOSEBYBORDEREDDIV,
39
+        'dt' => _TPLSADMIN_DT_ENCLOSEBYBORDEREDDIV,
40
+        'dd' => _TPLSADMIN_DD_ENCLOSEBYBORDEREDDIV,
41
+        'conf_msg' => _TPLSADMIN_CNF_ENCLOSEBYBORDEREDDIV,
42 42
         'skip_theme' => true
43
-    ) ,
43
+    ),
44 44
 
45 45
     'hooksavevars' => array(
46
-        'pre' => '<?php include_once "'.XOOPS_TRUST_PATH.'/libs/altsys/include/compilehook.inc.php" ; tplsadmin_save_tplsvars(\'%s\',$this) ; ?>' ,
47
-        'post' => '' ,
48
-        'success_msg' => _TPLSADMIN_FMT_MSG_HOOKSAVEVARS ,
49
-        'dt' => _TPLSADMIN_DT_HOOKSAVEVARS ,
50
-        'dd' => _TPLSADMIN_DD_HOOKSAVEVARS ,
51
-        'conf_msg' => _TPLSADMIN_CNF_HOOKSAVEVARS ,
46
+        'pre' => '<?php include_once "'.XOOPS_TRUST_PATH.'/libs/altsys/include/compilehook.inc.php" ; tplsadmin_save_tplsvars(\'%s\',$this) ; ?>',
47
+        'post' => '',
48
+        'success_msg' => _TPLSADMIN_FMT_MSG_HOOKSAVEVARS,
49
+        'dt' => _TPLSADMIN_DT_HOOKSAVEVARS,
50
+        'dd' => _TPLSADMIN_DD_HOOKSAVEVARS,
51
+        'conf_msg' => _TPLSADMIN_CNF_HOOKSAVEVARS,
52 52
         'skip_theme' => false
53
-    ) ,
53
+    ),
54 54
 
55 55
     'removehooks' => array(
56
-        'pre' => '' ,
57
-        'post' => '' ,
58
-        'success_msg' => _TPLSADMIN_FMT_MSG_REMOVEHOOKS ,
59
-        'dt' => _TPLSADMIN_DT_REMOVEHOOKS ,
60
-        'dd' => _TPLSADMIN_DD_REMOVEHOOKS ,
61
-        'conf_msg' => _TPLSADMIN_CNF_REMOVEHOOKS ,
56
+        'pre' => '',
57
+        'post' => '',
58
+        'success_msg' => _TPLSADMIN_FMT_MSG_REMOVEHOOKS,
59
+        'dt' => _TPLSADMIN_DT_REMOVEHOOKS,
60
+        'dd' => _TPLSADMIN_DD_REMOVEHOOKS,
61
+        'conf_msg' => _TPLSADMIN_CNF_REMOVEHOOKS,
62 62
         'skip_theme' => false
63 63
     )
64 64
 
65
-) ;
65
+);
66 66
 
67 67
 
68 68
 //
@@ -70,115 +70,115 @@  discard block
 block discarded – undo
70 70
 //
71 71
 
72 72
 // clearing files in templates_c/
73
-if (! empty($_POST['clearcache']) || ! empty($_POST['cleartplsvars'])) {
73
+if (!empty($_POST['clearcache']) || !empty($_POST['cleartplsvars'])) {
74 74
     // Ticket Check
75
-    if (! $xoopsGTicket->check()) {
75
+    if (!$xoopsGTicket->check()) {
76 76
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
77 77
     }
78 78
 
79
-    if ($handler = opendir(XOOPS_COMPILE_PATH . '/')) {
79
+    if ($handler = opendir(XOOPS_COMPILE_PATH.'/')) {
80 80
         while (($file = readdir($handler)) !== false) {
81
-            if (! empty($_POST['clearcache'])) {
81
+            if (!empty($_POST['clearcache'])) {
82 82
                 // judging template cache '*.php'
83 83
                 if (substr($file, -4) !== '.php') {
84
-                    continue ;
84
+                    continue;
85 85
                 }
86 86
             } else {
87 87
                 // judging tplsvars cache 'tplsvars_*'
88 88
                 if (substr($file, 0, 9) !== 'tplsvars_') {
89
-                    continue ;
89
+                    continue;
90 90
                 }
91 91
             }
92 92
 
93
-            $file_path = XOOPS_COMPILE_PATH . '/' . $file ;
94
-            @unlink($file_path) ;
93
+            $file_path = XOOPS_COMPILE_PATH.'/'.$file;
94
+            @unlink($file_path);
95 95
         }
96
-        redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 1, _TPLSADMIN_MSG_CLEARCACHE) ;
97
-        exit ;
96
+        redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 1, _TPLSADMIN_MSG_CLEARCACHE);
97
+        exit;
98 98
     } else {
99
-        die('XOOPS_COMPILE_PATH cannot be opened') ;
99
+        die('XOOPS_COMPILE_PATH cannot be opened');
100 100
     }
101 101
 }
102 102
 
103 103
 // append hooking commands
104 104
 foreach ($compile_hooks as $command => $compile_hook) {
105
-    if (! empty($_POST[$command])) {
105
+    if (!empty($_POST[$command])) {
106 106
         // Ticket Check
107
-        if (! $xoopsGTicket->check()) {
107
+        if (!$xoopsGTicket->check()) {
108 108
             redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
109 109
         }
110 110
 
111
-        if ($handler = opendir(XOOPS_COMPILE_PATH . '/')) {
112
-            $file_count = 0 ;
111
+        if ($handler = opendir(XOOPS_COMPILE_PATH.'/')) {
112
+            $file_count = 0;
113 113
             while (($file = readdir($handler)) !== false) {
114 114
 
115 115
                 // skip /. /.. and hidden files
116 116
                 if ($file{0} == '.') {
117
-                    continue ;
117
+                    continue;
118 118
                 }
119 119
 
120 120
                 // skip if the extension is not .html.php
121 121
                 if (substr($file, -9) != '.html.php') {
122
-                    continue ;
122
+                    continue;
123 123
                 }
124 124
 
125 125
                 // skip theme.html when comment-mode or div-mode
126 126
                 if ($compile_hook['skip_theme'] && substr($file, -15) == '%theme.html.php') {
127
-                    $skip_mode = true ;
127
+                    $skip_mode = true;
128 128
                 } else {
129
-                    $skip_mode = false ;
129
+                    $skip_mode = false;
130 130
                 }
131 131
 
132
-                $file_path = XOOPS_COMPILE_PATH . '/' . $file ;
133
-                $file_bodies = file($file_path) ;
132
+                $file_path = XOOPS_COMPILE_PATH.'/'.$file;
133
+                $file_bodies = file($file_path);
134 134
 
135 135
                 // remove lines inserted by compilehookadmin
136 136
                 if (strstr($file_bodies[0], 'altsys')) {
137
-                    array_shift($file_bodies) ;
137
+                    array_shift($file_bodies);
138 138
                 }
139
-                if (strstr($file_bodies[count($file_bodies)-1], 'altsys')) {
140
-                    array_pop($file_bodies) ;
141
-                    $file_bodies[count($file_bodies)-1] = rtrim($file_bodies[count($file_bodies)-1]) ;
139
+                if (strstr($file_bodies[count($file_bodies) - 1], 'altsys')) {
140
+                    array_pop($file_bodies);
141
+                    $file_bodies[count($file_bodies) - 1] = rtrim($file_bodies[count($file_bodies) - 1]);
142 142
                 }
143 143
 
144 144
                 // get the name of the source template from Smarty's comment
145 145
                 if (preg_match('/compiled from (\S+)/', $file_bodies[1], $regs)) {
146
-                    $tpl_name = $regs[1] ;
146
+                    $tpl_name = $regs[1];
147 147
                 } else {
148
-                    $tpl_name = '__FILE__' ;
148
+                    $tpl_name = '__FILE__';
149 149
                 }
150 150
 
151
-                $fw = fopen($file_path, 'w') ;
151
+                $fw = fopen($file_path, 'w');
152 152
 
153 153
                 // insert "pre" command before the compiled cache
154
-                if ($compile_hook['pre'] && ! $skip_mode) {
155
-                    fwrite($fw, sprintf($compile_hook['pre'], htmlspecialchars($tpl_name, ENT_QUOTES)) . "\r\n") ;
154
+                if ($compile_hook['pre'] && !$skip_mode) {
155
+                    fwrite($fw, sprintf($compile_hook['pre'], htmlspecialchars($tpl_name, ENT_QUOTES))."\r\n");
156 156
                 }
157 157
 
158 158
                 // rest of template cache
159 159
                 foreach ($file_bodies as $line) {
160
-                    fwrite($fw, $line) ;
160
+                    fwrite($fw, $line);
161 161
                 }
162 162
 
163 163
                 // insert "post" command after the compiled cache
164
-                if ($compile_hook['post'] && ! $skip_mode) {
165
-                    fwrite($fw, "\r\n" . sprintf($compile_hook['post'], htmlspecialchars($tpl_name, ENT_QUOTES))) ;
164
+                if ($compile_hook['post'] && !$skip_mode) {
165
+                    fwrite($fw, "\r\n".sprintf($compile_hook['post'], htmlspecialchars($tpl_name, ENT_QUOTES)));
166 166
                 }
167 167
 
168
-                fclose($fw) ;
168
+                fclose($fw);
169 169
 
170
-                $file_count ++ ;
170
+                $file_count++;
171 171
             }
172 172
 
173 173
             if ($file_count > 0) {
174
-                redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf($compile_hook['success_msg'], $file_count)) ;
175
-                exit ;
174
+                redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf($compile_hook['success_msg'], $file_count));
175
+                exit;
176 176
             } else {
177
-                redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, _TPLSADMIN_MSG_CREATECOMPILECACHEFIRST) ;
178
-                exit ;
177
+                redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, _TPLSADMIN_MSG_CREATECOMPILECACHEFIRST);
178
+                exit;
179 179
             }
180 180
         } else {
181
-            die('XOOPS_COMPILE_PATH cannot be opened') ;
181
+            die('XOOPS_COMPILE_PATH cannot be opened');
182 182
         }
183 183
     }
184 184
 }
@@ -190,25 +190,25 @@  discard block
 block discarded – undo
190 190
 //
191 191
 
192 192
 // count template vars & compiled caches
193
-$compiledcache_num = 0 ;
194
-$tplsvars_num = 0 ;
195
-if ($handler = opendir(XOOPS_COMPILE_PATH . '/')) {
193
+$compiledcache_num = 0;
194
+$tplsvars_num = 0;
195
+if ($handler = opendir(XOOPS_COMPILE_PATH.'/')) {
196 196
     while (($file = readdir($handler)) !== false) {
197 197
         if (strncmp($file, 'tplsvars_', 9) === 0) {
198
-            $tplsvars_num ++ ;
198
+            $tplsvars_num++;
199 199
         } elseif (substr($file, -4) === '.php') {
200
-            $compiledcache_num ++ ;
200
+            $compiledcache_num++;
201 201
         }
202 202
     }
203 203
 }
204 204
 
205 205
 // get tplsets
206
-$sql = 'SELECT tplset_name,COUNT(distinct tpl_file) FROM ' . $xoopsDB->prefix('tplset') . ' LEFT JOIN ' . $xoopsDB->prefix('tplfile') . " ON tplset_name=tpl_tplset GROUP BY tpl_tplset ORDER BY tpl_tplset='default' DESC,tpl_tplset" ;
206
+$sql = 'SELECT tplset_name,COUNT(distinct tpl_file) FROM '.$xoopsDB->prefix('tplset').' LEFT JOIN '.$xoopsDB->prefix('tplfile')." ON tplset_name=tpl_tplset GROUP BY tpl_tplset ORDER BY tpl_tplset='default' DESC,tpl_tplset";
207 207
 $srs = $xoopsDB->query($sql);
208
-$tplset_options = "<option value=''>----</option>\n" ;
208
+$tplset_options = "<option value=''>----</option>\n";
209 209
 while (list($tplset, $tpl_count) = $xoopsDB->fetchRow($srs)) {
210
-    $tplset4disp = htmlspecialchars($tplset, ENT_QUOTES) ;
211
-    $tplset_options .= "<option value='$tplset4disp'>$tplset4disp ($tpl_count)</option>\n" ;
210
+    $tplset4disp = htmlspecialchars($tplset, ENT_QUOTES);
211
+    $tplset_options .= "<option value='$tplset4disp'>$tplset4disp ($tpl_count)</option>\n";
212 212
 }
213 213
 
214 214
 
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 // FORM STAGE
219 219
 //
220 220
 
221
-xoops_cp_header() ;
221
+xoops_cp_header();
222 222
 
223 223
 // mymenu
224
-altsys_include_mymenu() ;
224
+altsys_include_mymenu();
225 225
 
226 226
 // breadcrumbs
227
-$breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
228
-$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=compilehookadmin', _MI_ALTSYS_MENU_COMPILEHOOKADMIN) ;
227
+$breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
228
+$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=compilehookadmin', _MI_ALTSYS_MENU_COMPILEHOOKADMIN);
229 229
 
230 230
 echo "
231 231
 	<style>
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				</dd>
251 251
 			</dl>
252 252
 		</p>
253
-	\n" ;
253
+	\n";
254 254
 }
255 255
 
256 256
 echo "
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 		<p>
272 272
 			<dl>
273 273
 				<dt>
274
-                    "._TPLSADMIN_DT_GETTPLSVARSINFO_DW . '
274
+                    "._TPLSADMIN_DT_GETTPLSVARSINFO_DW.'
275 275
 				</dt>
276 276
 				<dd>
277
-                    ' . _TPLSADMIN_DD_GETTPLSVARSINFO_DW . "
277
+                    ' . _TPLSADMIN_DD_GETTPLSVARSINFO_DW."
278 278
 					<br />
279 279
 					<input type='submit' name='as_dw_extension_zip' value='zip' />
280 280
 					<input type='submit' name='as_dw_extension_tgz' value='tar.gz' />
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 		<p>
288 288
 			<dl>
289 289
 				<dt>
290
-                    "._TPLSADMIN_DT_GETTEMPLATES . '
290
+                    "._TPLSADMIN_DT_GETTEMPLATES.'
291 291
 				</dt>
292 292
 				<dd>
293
-                    ' . _TPLSADMIN_DD_GETTEMPLATES . "
293
+                    ' . _TPLSADMIN_DD_GETTEMPLATES."
294 294
 					<br />
295 295
 					<select name='tplset'>$tplset_options</select>
296 296
 					<input type='submit' name='download_zip' value='zip' />
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
 		<p>
305 305
 			<dl>
306 306
 				<dt>
307
-                    "._TPLSADMIN_DT_PUTTEMPLATES . '
307
+                    "._TPLSADMIN_DT_PUTTEMPLATES.'
308 308
 				</dt>
309 309
 				<dd>
310
-                    ' . _TPLSADMIN_DD_PUTTEMPLATES . "
310
+                    ' . _TPLSADMIN_DD_PUTTEMPLATES."
311 311
 					<br />
312 312
 					<select name='tplset'>$tplset_options</select>
313 313
 					<input type='file' name='tplset_archive' size='60' />
@@ -319,4 +319,4 @@  discard block
 block discarded – undo
319 319
 \n" ;
320 320
 
321 321
 
322
-xoops_cp_footer() ;
322
+xoops_cp_footer();
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/get_templates.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-error_reporting(0) ;
8
+error_reporting(0);
9 9
 
10
-include_once __DIR__.'/include/gtickets.php' ;
11
-include_once __DIR__.'/include/altsys_functions.php' ;
10
+include_once __DIR__.'/include/gtickets.php';
11
+include_once __DIR__.'/include/altsys_functions.php';
12 12
 
13 13
 
14 14
 // this page can be called only from altsys
15 15
 if ($xoopsModule->getVar('dirname') != 'altsys') {
16
-    die('this page can be called only from altsys') ;
16
+    die('this page can be called only from altsys');
17 17
 }
18 18
 
19 19
 
20 20
 // language file
21
-altsys_include_language_file('compilehookadmin') ;
21
+altsys_include_language_file('compilehookadmin');
22 22
 
23
-if (! empty($_POST['download_zip'])) {
24
-    require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php' ;
23
+if (!empty($_POST['download_zip'])) {
24
+    require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php';
25 25
     $downloader = new XoopsZipDownloader();
26
-    $do_download = true ;
27
-} elseif (! empty($_POST['download_tgz'])) {
28
-    require_once XOOPS_ROOT_PATH.'/class/tardownloader.php' ;
26
+    $do_download = true;
27
+} elseif (!empty($_POST['download_tgz'])) {
28
+    require_once XOOPS_ROOT_PATH.'/class/tardownloader.php';
29 29
     $downloader = new XoopsTarDownloader();
30
-    $do_download = true ;
30
+    $do_download = true;
31 31
 }
32 32
 if (empty($do_download)) {
33
-    exit ;
33
+    exit;
34 34
 }
35 35
 
36
-$tplset = @$_POST['tplset'] ;
37
-if (! preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
38
-    die(_TPLSADMIN_ERR_INVALIDTPLSET) ;
36
+$tplset = @$_POST['tplset'];
37
+if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
38
+    die(_TPLSADMIN_ERR_INVALIDTPLSET);
39 39
 }
40 40
 
41 41
 //fix for mb_http_output setting and for add any browsers
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 //ob_buffer over flow
46 46
 //HACK by suin & nao-pon 2012/01/06
47 47
     while (ob_get_level() > 0) {
48
-        if (! ob_end_clean()) {
48
+        if (!ob_end_clean()) {
49 49
             break;
50 50
         }
51 51
     }
52
-$trs = $xoopsDB->query('SELECT distinct tpl_file,tpl_source,tpl_lastmodified FROM ' . $xoopsDB->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $xoopsDB->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset) . "' ORDER BY tpl_file") ;
52
+$trs = $xoopsDB->query('SELECT distinct tpl_file,tpl_source,tpl_lastmodified FROM '.$xoopsDB->prefix('tplfile').' NATURAL LEFT JOIN '.$xoopsDB->prefix('tplsource')." WHERE tpl_tplset='".addslashes($tplset)."' ORDER BY tpl_file");
53 53
 if ($xoopsDB->getRowsNum($trs) <= 0) {
54
-    die(_TPLSADMIN_ERR_INVALIDTPLSET) ;
54
+    die(_TPLSADMIN_ERR_INVALIDTPLSET);
55 55
 }
56 56
 
57 57
 while (list($tpl_file, $tpl_source, $tpl_lastmodified) = $xoopsDB->fetchRow($trs)) {
58
-    $downloader->addFileData($tpl_source, $tplset.'/'.$tpl_file, $tpl_lastmodified) ;
58
+    $downloader->addFileData($tpl_source, $tplset.'/'.$tpl_file, $tpl_lastmodified);
59 59
 }
60 60
 //bugfix by nao-pon ,echo is not necessary for downloader
61
-$downloader->download('template_'.$tplset, true) ;
61
+$downloader->download('template_'.$tplset, true);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mytplsadmin.php 1 patch
Spacing   +81 added lines, -91 removed lines patch added patch discarded remove patch
@@ -5,63 +5,63 @@  discard block
 block discarded – undo
5 5
 //                      GIJOE <http://www.peak.ne.jp/>                       //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-include_once __DIR__."/include/gtickets.php" ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
11
-include_once __DIR__."/include/tpls_functions.php" ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+include_once __DIR__."/include/gtickets.php";
10
+include_once __DIR__.'/include/altsys_functions.php';
11
+include_once __DIR__."/include/tpls_functions.php";
12 12
 
13 13
 
14 14
 // only groups have 'module_admin' of 'altsys' can do that.
15
-$module_handler =& xoops_gethandler('module') ;
16
-$module =& $module_handler->getByDirname('altsys') ;
17
-if (! is_object($module)) {
18
-    die('install altsys') ;
15
+$module_handler = & xoops_gethandler('module');
16
+$module = & $module_handler->getByDirname('altsys');
17
+if (!is_object($module)) {
18
+    die('install altsys');
19 19
 }
20
-$moduleperm_handler =& xoops_gethandler('groupperm') ;
21
-if (! is_object(@$xoopsUser) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) {
22
-    die('only admin of altsys can access this area') ;
20
+$moduleperm_handler = & xoops_gethandler('groupperm');
21
+if (!is_object(@$xoopsUser) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) {
22
+    die('only admin of altsys can access this area');
23 23
 }
24 24
 
25 25
 
26 26
 // initials
27
-$db =& XoopsDatabaseFactory::getDatabaseConnection();
28
-(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
27
+$db = & XoopsDatabaseFactory::getDatabaseConnection();
28
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance();
29 29
 
30 30
 // language file
31
-altsys_include_language_file('mytplsadmin') ;
31
+altsys_include_language_file('mytplsadmin');
32 32
 
33 33
 // check $xoopsModule
34
-if (! is_object($xoopsModule)) {
35
-    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM) ;
34
+if (!is_object($xoopsModule)) {
35
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
36 36
 }
37 37
 
38 38
 // set target_module if specified by $_GET['dirname']
39
-$module_handler =& xoops_gethandler('module');
40
-if (! empty($_GET['dirname'])) {
41
-    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']) ;
42
-    $target_module =& $module_handler->getByDirname($dirname) ;
39
+$module_handler = & xoops_gethandler('module');
40
+if (!empty($_GET['dirname'])) {
41
+    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']);
42
+    $target_module = & $module_handler->getByDirname($dirname);
43 43
 }
44 44
 
45
-if (! empty($target_module) && is_object($target_module)) {
45
+if (!empty($target_module) && is_object($target_module)) {
46 46
     // specified by dirname (for tplsadmin as an independent module)
47
-    $target_mid = $target_module->getVar('mid') ;
48
-    $target_dirname = $target_module->getVar('dirname') ;
49
-    $target_dirname4sql = addslashes($target_dirname) ;
50
-    $target_mname = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0) ;
47
+    $target_mid = $target_module->getVar('mid');
48
+    $target_dirname = $target_module->getVar('dirname');
49
+    $target_dirname4sql = addslashes($target_dirname);
50
+    $target_mname = $target_module->getVar('name').'&nbsp;'.sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
51 51
     //$query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ;
52 52
 } elseif (@$_GET['dirname'] == '_custom') {
53 53
     // custom template
54
-    $target_mid = 0 ;
55
-    $target_dirname = '_custom' ;
56
-    $target_dirname4sql = '_custom' ;
57
-    $target_mname = _MYTPLSADMIN_CUSTOMTEMPLATE ;
54
+    $target_mid = 0;
55
+    $target_dirname = '_custom';
56
+    $target_dirname4sql = '_custom';
57
+    $target_mname = _MYTPLSADMIN_CUSTOMTEMPLATE;
58 58
     //$query4redirect = '' ;
59 59
 } else {
60 60
     // not specified by dirname (for 3rd party modules as mytplsadmin)
61
-    $target_mid = $xoopsModule->getVar('mid') ;
62
-    $target_dirname = $xoopsModule->getVar('dirname') ;
63
-    $target_dirname4sql = addslashes($target_dirname) ;
64
-    $target_mname = $xoopsModule->getVar('name') ;
61
+    $target_mid = $xoopsModule->getVar('mid');
62
+    $target_dirname = $xoopsModule->getVar('dirname');
63
+    $target_dirname4sql = addslashes($target_dirname);
64
+    $target_mname = $xoopsModule->getVar('name');
65 65
     //$query4redirect = '' ;
66 66
 }
67 67
 
@@ -71,120 +71,120 @@  discard block
 block discarded – undo
71 71
 //**************//
72 72
 
73 73
 // Create new template set (blank or clone)
74
-if (! empty($_POST['clone_tplset_do']) && ! empty($_POST['clone_tplset_from']) && ! empty($_POST['clone_tplset_to'])) {
74
+if (!empty($_POST['clone_tplset_do']) && !empty($_POST['clone_tplset_from']) && !empty($_POST['clone_tplset_to'])) {
75 75
     // Ticket Check
76
-    if (! $xoopsGTicket->check()) {
76
+    if (!$xoopsGTicket->check()) {
77 77
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
78 78
     }
79 79
 
80
-    $tplset_from = $myts->stripSlashesGPC($_POST['clone_tplset_from']) ;
81
-    $tplset_to = $myts->stripSlashesGPC($_POST['clone_tplset_to']) ;
80
+    $tplset_from = $myts->stripSlashesGPC($_POST['clone_tplset_from']);
81
+    $tplset_to = $myts->stripSlashesGPC($_POST['clone_tplset_to']);
82 82
     // check tplset_name "from" and "to"
83
-    if (! preg_match('/^[0-9A-Za-z_-]{1,16}$/', $_POST['clone_tplset_from'])) {
84
-        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDSETNAME, $target_dirname) ;
83
+    if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $_POST['clone_tplset_from'])) {
84
+        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDSETNAME, $target_dirname);
85 85
     }
86
-    if (! preg_match('/^[0-9A-Za-z_-]{1,16}$/', $_POST['clone_tplset_to'])) {
87
-        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDSETNAME, $target_dirname) ;
86
+    if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $_POST['clone_tplset_to'])) {
87
+        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDSETNAME, $target_dirname);
88 88
     }
89
-    list($is_exist) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "'")) ;
89
+    list($is_exist) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."'"));
90 90
     if ($is_exist) {
91
-        tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname) ;
91
+        tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname);
92 92
     }
93
-    list($is_exist) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplset') . " WHERE tplset_name='" . addslashes($tplset_to) . "'")) ;
93
+    list($is_exist) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplset')." WHERE tplset_name='".addslashes($tplset_to)."'"));
94 94
     if ($is_exist) {
95
-        tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname) ;
95
+        tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname);
96 96
     }
97 97
     // insert tplset table
98
-    $db->query('INSERT INTO ' . $db->prefix('tplset') . " SET tplset_name='" . addslashes($tplset_to) . "', tplset_desc='Created by tplsadmin', tplset_created=UNIX_TIMESTAMP()") ;
99
-    tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_module='$target_dirname4sql'") ;
100
-    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED) ;
101
-    exit ;
98
+    $db->query('INSERT INTO '.$db->prefix('tplset')." SET tplset_name='".addslashes($tplset_to)."', tplset_desc='Created by tplsadmin', tplset_created=UNIX_TIMESTAMP()");
99
+    tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_module='$target_dirname4sql'");
100
+    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
101
+    exit;
102 102
 }
103 103
 
104 104
 // DB to DB template copy (checked templates)
105 105
 if (is_array(@$_POST['copy_do'])) {
106 106
     foreach ($_POST['copy_do'] as $tplset_from_tmp => $val) {
107
-        if (! empty($val)) {
107
+        if (!empty($val)) {
108 108
             // Ticket Check
109
-    if (! $xoopsGTicket->check()) {
109
+    if (!$xoopsGTicket->check()) {
110 110
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
111 111
     }
112 112
 
113
-            $tplset_from = $myts->stripSlashesGPC($tplset_from_tmp) ;
113
+            $tplset_from = $myts->stripSlashesGPC($tplset_from_tmp);
114 114
             if (empty($_POST['copy_to'][$tplset_from]) || $_POST['copy_to'][$tplset_from] == $tplset_from) {
115
-                tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDTPLSET, $target_dirname) ;
115
+                tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDTPLSET, $target_dirname);
116 116
             }
117 117
             if (empty($_POST["{$tplset_from}_check"])) {
118
-                tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname) ;
118
+                tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname);
119 119
             }
120
-            $tplset_to = $myts->stripSlashesGPC($_POST['copy_to'][$tplset_from]) ;
120
+            $tplset_to = $myts->stripSlashesGPC($_POST['copy_to'][$tplset_from]);
121 121
             foreach ($_POST["{$tplset_from}_check"] as $tplfile_tmp => $val) {
122 122
                 if (empty($val)) {
123
-                    continue ;
123
+                    continue;
124 124
                 }
125
-                $tplfile = $myts->stripSlashesGPC($tplfile_tmp) ;
126
-                tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_file='".addslashes($tplfile)."'") ;
125
+                $tplfile = $myts->stripSlashesGPC($tplfile_tmp);
126
+                tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_file='".addslashes($tplfile)."'");
127 127
             }
128
-            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED) ;
129
-            exit ;
128
+            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
129
+            exit;
130 130
         }
131 131
     }
132 132
 }
133 133
 
134 134
 // File to DB template copy (checked templates)
135
-if (! empty($_POST['copyf2db_do'])) {
135
+if (!empty($_POST['copyf2db_do'])) {
136 136
     // Ticket Check
137
-    if (! $xoopsGTicket->check()) {
137
+    if (!$xoopsGTicket->check()) {
138 138
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
139 139
     }
140 140
 
141 141
     if (empty($_POST['copyf2db_to'])) {
142
-        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDTPLSET, $target_dirname) ;
142
+        tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDTPLSET, $target_dirname);
143 143
     }
144 144
     if (empty($_POST['basecheck'])) {
145
-        tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname) ;
145
+        tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname);
146 146
     }
147
-    $tplset_to = $myts->stripSlashesGPC($_POST['copyf2db_to']) ;
147
+    $tplset_to = $myts->stripSlashesGPC($_POST['copyf2db_to']);
148 148
     foreach ($_POST['basecheck'] as $tplfile_tmp => $val) {
149 149
         if (empty($val)) {
150
-            continue ;
150
+            continue;
151 151
         }
152
-        $tplfile = $myts->stripSlashesGPC($tplfile_tmp) ;
153
-        tplsadmin_copy_templates_f2db($tplset_to, "tpl_file='".addslashes($tplfile)."'") ;
152
+        $tplfile = $myts->stripSlashesGPC($tplfile_tmp);
153
+        tplsadmin_copy_templates_f2db($tplset_to, "tpl_file='".addslashes($tplfile)."'");
154 154
     }
155
-    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED) ;
156
-    exit ;
155
+    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
156
+    exit;
157 157
 }
158 158
 
159 159
 // DB template remove (checked templates)
160 160
 if (is_array(@$_POST['del_do'])) {
161 161
     foreach ($_POST['del_do'] as $tplset_from_tmp => $val) {
162
-        if (! empty($val)) {
162
+        if (!empty($val)) {
163 163
             // Ticket Check
164
-    if (! $xoopsGTicket->check()) {
164
+    if (!$xoopsGTicket->check()) {
165 165
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
166 166
     }
167 167
 
168
-            $tplset_from = $myts->stripSlashesGPC($tplset_from_tmp) ;
168
+            $tplset_from = $myts->stripSlashesGPC($tplset_from_tmp);
169 169
             if ($tplset_from == 'default' && $target_dirname != '_custom') {
170
-                tplsadmin_die(_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT, $target_dirname) ;
170
+                tplsadmin_die(_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT, $target_dirname);
171 171
             }
172 172
             if (empty($_POST["{$tplset_from}_check"])) {
173
-                tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname) ;
173
+                tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname);
174 174
             }
175 175
 
176
-            require_once XOOPS_ROOT_PATH.'/class/template.php' ;
176
+            require_once XOOPS_ROOT_PATH.'/class/template.php';
177 177
             $tpl = new XoopsTpl();
178 178
             $tpl->force_compile = true;
179 179
 
180 180
             foreach ($_POST["{$tplset_from}_check"] as $tplfile_tmp => $val) {
181 181
                 if (empty($val)) {
182
-                    continue ;
182
+                    continue;
183 183
                 }
184
-                $tplfile = $myts->stripSlashesGPC($tplfile_tmp) ;
185
-                $result = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_from) . "' AND tpl_file='" . addslashes($tplfile) . "'") ;
184
+                $tplfile = $myts->stripSlashesGPC($tplfile_tmp);
185
+                $result = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_from)."' AND tpl_file='".addslashes($tplfile)."'");
186 186
                 while (list($tpl_id) = $db->fetchRow($result)) {
187
-<<<<<<< HEAD
187
+<< << <<< HEAD
188 188
                     $tpl_id = intval($tpl_id) ;
189 189
                     $db->query('DELETE FROM ' . $db->prefix('tplfile') . " WHERE tpl_id=$tpl_id") ;
190 190
                     $db->query('DELETE FROM ' . $db->prefix('tplsource') . " WHERE tpl_id=$tpl_id") ;
@@ -398,14 +398,4 @@  discard block
 block discarded – undo
398 398
 			<select name='copy_to[{$tplset4disp}]'>
399 399
 				".str_replace('<option value=\''.$tplset4disp.'\'>'.$tplset4disp.'</option>', '', $tplset_options)."
400 400
 			</select>
401
-			<input name='copy_do[{$tplset4disp}]' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return altsys_mytpladmin_check_copy_submit(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\", \"{$tplset4disp}_\", true);' />
402
-		</td>\n" ;
403
-    }
404
-
405
-echo "	</tr>\n" ;
406
-
407
-
408
-echo '</table></form>';
409
-// end of table & form
410
-
411
-xoops_cp_footer() ;
401
+			<input name='copy_do[{$tplset4disp}]' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return altsys_mytpladmin_check_copy_submit(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\", \"{$tplset4disp}
412 402
\ No newline at end of file
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/get_tplsvarsinfo.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -5,26 +5,26 @@  discard block
 block discarded – undo
5 5
 //                        GIJOE <http://www.peak.ne.jp/>                     //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-error_reporting(0) ;
8
+error_reporting(0);
9 9
 
10
-include_once __DIR__.'/include/gtickets.php' ;
11
-include_once __DIR__.'/include/altsys_functions.php' ;
10
+include_once __DIR__.'/include/gtickets.php';
11
+include_once __DIR__.'/include/altsys_functions.php';
12 12
 
13 13
 
14 14
 // this page can be called only from altsys
15 15
 if ($xoopsModule->getVar('dirname') != 'altsys') {
16
-    die('this page can be called only from altsys') ;
16
+    die('this page can be called only from altsys');
17 17
 }
18 18
 
19 19
 
20 20
 // language file
21
-altsys_include_language_file('compilehookadmin') ;
21
+altsys_include_language_file('compilehookadmin');
22 22
 
23 23
 
24
-$dw_snippets_dirname = 'files' ;
25
-$site_name = @$_SERVER['HTTP_HOST'] ;
26
-if (! preg_match('/^[0-9A-Za-z._-]+$/', $site_name)) {
27
-    $site_name = 'xoops_site' ;
24
+$dw_snippets_dirname = 'files';
25
+$site_name = @$_SERVER['HTTP_HOST'];
26
+if (!preg_match('/^[0-9A-Za-z._-]+$/', $site_name)) {
27
+    $site_name = 'xoops_site';
28 28
 }
29 29
 
30 30
 
@@ -38,36 +38,36 @@  discard block
 block discarded – undo
38 38
         case 'array' :
39 39
             foreach ($var_value as $key => $val) {
40 40
                 if (gettype($key) == 'integer') {
41
-                    $GLOBALS[ $sum_array_name ][ $var_name ] = '(array)' ;
42
-                    continue ;
41
+                    $GLOBALS[$sum_array_name][$var_name] = '(array)';
42
+                    continue;
43 43
                 }
44
-                convert_array2info_recursive($var_name.'.'.$key, $val, $sum_array_name) ;
44
+                convert_array2info_recursive($var_name.'.'.$key, $val, $sum_array_name);
45 45
             }
46
-            return ;
46
+            return;
47 47
         case 'string' :
48
-            $GLOBALS[ $sum_array_name ][ $var_name ] = $var_value ;
49
-            return ;
48
+            $GLOBALS[$sum_array_name][$var_name] = $var_value;
49
+            return;
50 50
         case 'boolean' :
51 51
         case 'integer' :
52 52
         case 'float' :
53 53
         case 'double' :
54
-            $GLOBALS[ $sum_array_name ][ $var_name ] = (string)$var_value ;
55
-            return ;
54
+            $GLOBALS[$sum_array_name][$var_name] = (string)$var_value;
55
+            return;
56 56
         case 'null' :
57
-            $GLOBALS[ $sum_array_name ][ $var_name ] = '(null)' ;
58
-            return ;
57
+            $GLOBALS[$sum_array_name][$var_name] = '(null)';
58
+            return;
59 59
         case 'object' :
60
-            $GLOBALS[ $sum_array_name ][ $var_name ] = '(object)' ;
61
-            return ;
60
+            $GLOBALS[$sum_array_name][$var_name] = '(object)';
61
+            return;
62 62
         default :
63
-            return ;
63
+            return;
64 64
     }
65 65
 }
66 66
 
67 67
 
68 68
 function get_mxi_body($mxi_name, $file_entries)
69 69
 {
70
-    global $site_name ;
70
+    global $site_name;
71 71
 
72 72
     return '<macromedia-extension name="XOOPS-'.$site_name.' '.$mxi_name.'" version="1.0" type="Suite" requires-restart="true">
73 73
 	<products>
@@ -108,44 +108,44 @@  discard block
 block discarded – undo
108 108
 // TOTAL STAGE
109 109
 //
110 110
 
111
-$tplsvarsinfo_mod_tpl = array() ;
112
-$tplsvarsinfo_total = array() ;
111
+$tplsvarsinfo_mod_tpl = array();
112
+$tplsvarsinfo_total = array();
113 113
 
114
-if ($handler = opendir(XOOPS_COMPILE_PATH . '/')) {
114
+if ($handler = opendir(XOOPS_COMPILE_PATH.'/')) {
115 115
     while (($file = readdir($handler)) !== false) {
116 116
 
117 117
         // skip files other than tplsvars_* files
118 118
         if (substr($file, 0, 9) !== 'tplsvars_') {
119
-            continue ;
119
+            continue;
120 120
         }
121 121
 
122 122
         // 'tplsvars_'.(randomized 4byte).'_'.(tpl_file)
123
-        $tpl_name = substr($file, 14) ;
124
-        if (! preg_match('/^[%0-9A-Za-z._-]+$/', $tpl_name)) {
125
-            continue ;
123
+        $tpl_name = substr($file, 14);
124
+        if (!preg_match('/^[%0-9A-Za-z._-]+$/', $tpl_name)) {
125
+            continue;
126 126
         }
127
-        $file_path = XOOPS_COMPILE_PATH . '/' . $file ;
128
-        $file_body = implode('', file($file_path)) ;
129
-        $tplsvars = @unserialize($file_body) ;
130
-        if (! is_array($tplsvars)) {
131
-            $tplsvars = array() ;
127
+        $file_path = XOOPS_COMPILE_PATH.'/'.$file;
128
+        $file_body = implode('', file($file_path));
129
+        $tplsvars = @unserialize($file_body);
130
+        if (!is_array($tplsvars)) {
131
+            $tplsvars = array();
132 132
         }
133
-        $GLOBALS['tplsvarsinfo'] = array() ;
134
-        convert_array2info_recursive('', $tplsvars, 'tplsvarsinfo') ;
133
+        $GLOBALS['tplsvarsinfo'] = array();
134
+        convert_array2info_recursive('', $tplsvars, 'tplsvarsinfo');
135 135
         if (strstr($tpl_name, '%')) {
136
-            $mod_name = 'theme_etc' ;
136
+            $mod_name = 'theme_etc';
137 137
         } else {
138
-            list($mod_name) = explode('_', $tpl_name) ;
138
+            list($mod_name) = explode('_', $tpl_name);
139 139
         }
140
-        $tplsvarsinfo_mod_tpl[$mod_name][$tpl_name] = $tplsvarsinfo ;
141
-        $tplsvarsinfo_total = array_merge($tplsvarsinfo_total, $tplsvarsinfo) ;
140
+        $tplsvarsinfo_mod_tpl[$mod_name][$tpl_name] = $tplsvarsinfo;
141
+        $tplsvarsinfo_total = array_merge($tplsvarsinfo_total, $tplsvarsinfo);
142 142
     }
143 143
 } else {
144
-    die('XOOPS_COMPILE_PATH cannot be opened') ;
144
+    die('XOOPS_COMPILE_PATH cannot be opened');
145 145
 }
146 146
 
147 147
 if (empty($tplsvarsinfo_total)) {
148
-    die(_TPLSADMIN_ERR_NOTPLSVARSINFO) ;
148
+    die(_TPLSADMIN_ERR_NOTPLSVARSINFO);
149 149
 }
150 150
 
151 151
 //
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 </snippet>' ;
163 163
 
164 164
 
165
-if (! empty($_POST['as_dw_extension_zip'])) {
166
-    require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php' ;
165
+if (!empty($_POST['as_dw_extension_zip'])) {
166
+    require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php';
167 167
     $downloader = new XoopsZipDownloader();
168
-    $do_download = true ;
169
-} elseif (! empty($_POST['as_dw_extension_tgz'])) {
170
-    require_once XOOPS_ROOT_PATH.'/class/tardownloader.php' ;
168
+    $do_download = true;
169
+} elseif (!empty($_POST['as_dw_extension_tgz'])) {
170
+    require_once XOOPS_ROOT_PATH.'/class/tardownloader.php';
171 171
     $downloader = new XoopsTarDownloader();
172
-    $do_download = true ;
172
+    $do_download = true;
173 173
 }
174 174
 
175
-if (! empty($do_download)) {
175
+if (!empty($do_download)) {
176 176
     //fix for mb_http_output setting and for add any browsers
177 177
     if (function_exists('mb_http_output')) {
178 178
         mb_http_output('pass');
@@ -180,33 +180,33 @@  discard block
 block discarded – undo
180 180
     //ob_buffer over flow
181 181
 //HACK by suin & nao-pon 2012/01/06
182 182
     while (ob_get_level() > 0) {
183
-        if (! ob_end_clean()) {
183
+        if (!ob_end_clean()) {
184 184
             break;
185 185
         }
186 186
     }
187 187
     // make files for each tplsvars
188 188
     foreach ($tplsvarsinfo_total as $key => $val) {
189
-        $name = substr($key, 1) ;
190
-        $description = htmlspecialchars(xoops_utf8_encode(xoops_substr($val, 0, 256)), ENT_QUOTES) ;
191
-        $snippet_body = sprintf($snippet_format, $name, $description) ;
189
+        $name = substr($key, 1);
190
+        $description = htmlspecialchars(xoops_utf8_encode(xoops_substr($val, 0, 256)), ENT_QUOTES);
191
+        $snippet_body = sprintf($snippet_format, $name, $description);
192 192
 
193
-        $file_name = strtr($key, '.', '_') . '.csn' ;
194
-        $downloader->addFileData($snippet_body, $dw_snippets_dirname.'/'.$file_name) ;
193
+        $file_name = strtr($key, '.', '_').'.csn';
194
+        $downloader->addFileData($snippet_body, $dw_snippets_dirname.'/'.$file_name);
195 195
     }
196 196
 
197 197
     // make a mxi file per module
198 198
     foreach ($tplsvarsinfo_mod_tpl as $mod_name => $tplsvarsinfo_tpl) {
199
-        $file_entries = '' ;
199
+        $file_entries = '';
200 200
         foreach ($tplsvarsinfo_tpl as $tpl_name => $tplsvarsinfo) {
201 201
             foreach ($tplsvarsinfo as $key => $val) {
202
-                $name = substr($key, 1) ;
203
-                $file_name = strtr($key, '.', '_') . '.csn' ;
204
-                $file_entries .= "\t\t".'<file name="'.$dw_snippets_dirname.'/'.$file_name.'" destination="$Dreamweaver/Configuration/Snippets/XOOPS-'.$site_name.'/'.$tpl_name.'" />'."\n" ;
202
+                $name = substr($key, 1);
203
+                $file_name = strtr($key, '.', '_').'.csn';
204
+                $file_entries .= "\t\t".'<file name="'.$dw_snippets_dirname.'/'.$file_name.'" destination="$Dreamweaver/Configuration/Snippets/XOOPS-'.$site_name.'/'.$tpl_name.'" />'."\n";
205 205
             }
206 206
         }
207
-        $mxi_body = get_mxi_body($mod_name, $file_entries) ;
208
-        $downloader->addFileData($mxi_body, $mod_name.'.mxi') ;
207
+        $mxi_body = get_mxi_body($mod_name, $file_entries);
208
+        $downloader->addFileData($mxi_body, $mod_name.'.mxi');
209 209
     }
210 210
 //bugfix by nao-pon ,echo is not necessary for downloader
211
-    $downloader->download('tplsvarsinfo', true) ;
211
+    $downloader->download('tplsvarsinfo', true);
212 212
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/language/persian/mytplsadmin.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@
 block discarded – undo
14 14
 define('_MYTPLSADMIN_CUSTOMTEMPLATE', 'الگوی شخصی');
15 15
 define('_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE', 'یک الگوی شخصی بسازید');
16 16
 
17
-define('_MYTPLSADMIN_CREATE_NEW_TPLSET', 'ساخت مجموعه‌ی جدید') ;
18
-define('_MYTPLSADMIN_CAPTION_BASE', 'پایگاه') ;
19
-define('_MYTPLSADMIN_CAPTION_SETNAME', 'نام') ;
20
-define('_MYTPLSADMIN_OPT_BLANKSET', '(فاصله)') ;
21
-define('_MYTPLSADMIN_CAPTION_COPYTO', 'بسوی') ;
22
-define('_MYTPLSADMIN_BTN_COPY', 'کپی') ;
23
-define('_MYTPLSADMIN_TITLE_CHECKALL', 'خاموش /روشن کردن تمام چک باکس‌ها در این خط') ;
24
-define('_MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES', 'تمام الگو‌های انتخاب شده در این دسته پاک خواهند شد. آیا شما موافقید؟') ;
25
-define('_MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES', 'تمام الگو‌های انتخاب شده در این دسته در  در دسته ی انتخاب شده کپی/بازچسبانی میشوند. آیا شما موافقید؟') ;
26
-define('_MYTPLSADMIN_TH_NAME', 'نام الگو') ;
27
-define('_MYTPLSADMIN_TH_TYPE', 'نوع') ;
28
-define('_MYTPLSADMIN_TH_FILE', 'پرونده‌ی پایگاه') ;
29
-define('_MYTPLSADMIN_ERR_NOTPLFILE', 'هیچ الگوی چک نشده') ;
30
-define('_MYTPLSADMIN_ERR_INVALIDTPLSET', 'جایگاه مقصد باید دقیقا مانند جایگاه پرونده درون بسته باشد در غیر این صورت هیچ الگویی مجاز شناخته نخواهد شد') ;
31
-define('_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT', 'شما میتوانید الگو پیش فرض را پاک کنید.') ;
32
-define('_MYTPLSADMIN_ERR_DUPLICATEDSETNAME', 'نام مجموعه قبلا وجود داشته.') ;
33
-define('_MYTPLSADMIN_ERR_INVALIDSETNAME', 'خطا: نام مجموعه پیشتر تعیین شده است.') ;
17
+define('_MYTPLSADMIN_CREATE_NEW_TPLSET', 'ساخت مجموعه‌ی جدید');
18
+define('_MYTPLSADMIN_CAPTION_BASE', 'پایگاه');
19
+define('_MYTPLSADMIN_CAPTION_SETNAME', 'نام');
20
+define('_MYTPLSADMIN_OPT_BLANKSET', '(فاصله)');
21
+define('_MYTPLSADMIN_CAPTION_COPYTO', 'بسوی');
22
+define('_MYTPLSADMIN_BTN_COPY', 'کپی');
23
+define('_MYTPLSADMIN_TITLE_CHECKALL', 'خاموش /روشن کردن تمام چک باکس‌ها در این خط');
24
+define('_MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES', 'تمام الگو‌های انتخاب شده در این دسته پاک خواهند شد. آیا شما موافقید؟');
25
+define('_MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES', 'تمام الگو‌های انتخاب شده در این دسته در  در دسته ی انتخاب شده کپی/بازچسبانی میشوند. آیا شما موافقید؟');
26
+define('_MYTPLSADMIN_TH_NAME', 'نام الگو');
27
+define('_MYTPLSADMIN_TH_TYPE', 'نوع');
28
+define('_MYTPLSADMIN_TH_FILE', 'پرونده‌ی پایگاه');
29
+define('_MYTPLSADMIN_ERR_NOTPLFILE', 'هیچ الگوی چک نشده');
30
+define('_MYTPLSADMIN_ERR_INVALIDTPLSET', 'جایگاه مقصد باید دقیقا مانند جایگاه پرونده درون بسته باشد در غیر این صورت هیچ الگویی مجاز شناخته نخواهد شد');
31
+define('_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT', 'شما میتوانید الگو پیش فرض را پاک کنید.');
32
+define('_MYTPLSADMIN_ERR_DUPLICATEDSETNAME', 'نام مجموعه قبلا وجود داشته.');
33
+define('_MYTPLSADMIN_ERR_INVALIDSETNAME', 'خطا: نام مجموعه پیشتر تعیین شده است.');
34 34
 
35
-define('_MYTPLSADMIN_H3_MODULE', 'ماژول') ;
36
-define('_MYTPLSADMIN_BTN_NEWTPLSET', 'ساختن') ;
35
+define('_MYTPLSADMIN_H3_MODULE', 'ماژول');
36
+define('_MYTPLSADMIN_BTN_NEWTPLSET', 'ساختن');
37 37
 
38
-define('_MYTPLSADMIN_DBUPDATED', 'الگو‌ها با موفقیت به روز شدند') ;
38
+define('_MYTPLSADMIN_DBUPDATED', 'الگو‌ها با موفقیت به روز شدند');
Please login to merge, or discard this patch.