@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -1,29 +1,29 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once dirname(__DIR__).'/include/altsys_functions.php' ; |
|
3 | +require_once dirname(__DIR__).'/include/altsys_functions.php'; |
|
4 | 4 | |
5 | 5 | function b_altsys_admin_menu_show($options) |
6 | 6 | { |
7 | - global $xoopsUser ; |
|
7 | + global $xoopsUser; |
|
8 | 8 | |
9 | - $mydirname = empty($options[0]) ? 'altsys' : $options[0] ; |
|
10 | - $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]) ; |
|
9 | + $mydirname = empty($options[0]) ? 'altsys' : $options[0]; |
|
10 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]); |
|
11 | 11 | |
12 | 12 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
13 | - die('Invalid mydirname') ; |
|
13 | + die('Invalid mydirname'); |
|
14 | 14 | } |
15 | - if (! is_object(@$xoopsUser)) { |
|
16 | - return array() ; |
|
15 | + if (!is_object(@$xoopsUser)) { |
|
16 | + return array(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // coretype |
20 | - $coretype = altsys_get_core_type() ; |
|
20 | + $coretype = altsys_get_core_type(); |
|
21 | 21 | |
22 | 22 | // mid_selected |
23 | 23 | if (is_object(@$GLOBALS['xoopsModule'])) { |
24 | - $mid_selected = $GLOBALS['xoopsModule']->getVar('mid') ; |
|
24 | + $mid_selected = $GLOBALS['xoopsModule']->getVar('mid'); |
|
25 | 25 | // for system->preferences |
26 | -<<<<<<< HEAD |
|
26 | +<< << <<< HEAD |
|
27 | 27 | if ($mid_selected == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) { |
28 | 28 | $mid_selected = intval($_GET['mod']) ; |
29 | 29 | ======= |
@@ -156,5 +156,4 @@ discard block |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -156,5 +156,4 @@ |
||
156 | 156 | <br /> |
157 | 157 | \n" ; |
158 | 158 | |
159 | - return $form; |
|
160 | -} |
|
159 | + return $form |
|
161 | 160 | \ No newline at end of file |
@@ -1085,8 +1085,4 @@ |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -1085,8 +1085,4 @@ |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -1085,8 +1085,4 @@ |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -308,30 +308,30 @@ discard block |
||
308 | 308 | $scoln = 'disabled'; |
309 | 309 | } else { |
310 | 310 | switch ($side) { |
311 | - case XOOPS_SIDEBLOCK_LEFT : |
|
312 | - $ssel0 = " checked='checked'"; |
|
313 | - $scol0 = 'selected'; |
|
314 | - break ; |
|
315 | - case XOOPS_SIDEBLOCK_RIGHT : |
|
316 | - $ssel1 = " checked='checked'"; |
|
317 | - $scol1 = 'selected'; |
|
318 | - break ; |
|
319 | - case XOOPS_CENTERBLOCK_LEFT : |
|
320 | - $ssel2 = " checked='checked'"; |
|
321 | - $scol2 = 'selected'; |
|
322 | - break ; |
|
323 | - case XOOPS_CENTERBLOCK_RIGHT : |
|
324 | - $ssel4 = " checked='checked'"; |
|
325 | - $scol4 = 'selected'; |
|
326 | - break ; |
|
327 | - case XOOPS_CENTERBLOCK_CENTER : |
|
328 | - $ssel3 = " checked='checked'"; |
|
329 | - $scol3 = 'selected'; |
|
330 | - break ; |
|
331 | - default : |
|
332 | - $value4extra_side = $side ; |
|
333 | - $stextbox = 'selected'; |
|
334 | - break ; |
|
311 | + case XOOPS_SIDEBLOCK_LEFT : |
|
312 | + $ssel0 = " checked='checked'"; |
|
313 | + $scol0 = 'selected'; |
|
314 | + break ; |
|
315 | + case XOOPS_SIDEBLOCK_RIGHT : |
|
316 | + $ssel1 = " checked='checked'"; |
|
317 | + $scol1 = 'selected'; |
|
318 | + break ; |
|
319 | + case XOOPS_CENTERBLOCK_LEFT : |
|
320 | + $ssel2 = " checked='checked'"; |
|
321 | + $scol2 = 'selected'; |
|
322 | + break ; |
|
323 | + case XOOPS_CENTERBLOCK_RIGHT : |
|
324 | + $ssel4 = " checked='checked'"; |
|
325 | + $scol4 = 'selected'; |
|
326 | + break ; |
|
327 | + case XOOPS_CENTERBLOCK_CENTER : |
|
328 | + $ssel3 = " checked='checked'"; |
|
329 | + $scol3 = 'selected'; |
|
330 | + break ; |
|
331 | + default : |
|
332 | + $value4extra_side = $side ; |
|
333 | + $stextbox = 'selected'; |
|
334 | + break ; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
@@ -1085,8 +1085,4 @@ discard block |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -4,16 +4,16 @@ discard block |
||
4 | 4 | class MyBlocksAdmin |
5 | 5 | { |
6 | 6 | |
7 | - public $db ; |
|
8 | - public $lang ; |
|
9 | - public $cachetime_options = array() ; |
|
10 | - public $ctype_options = array() ; |
|
11 | - public $type_options = array() ; |
|
12 | - public $target_mid = 0 ; |
|
13 | - public $target_dirname = '' ; |
|
14 | - public $target_mname = '' ; |
|
15 | - public $block_configs = array() ; |
|
16 | - public $preview_request = array() ; |
|
7 | + public $db; |
|
8 | + public $lang; |
|
9 | + public $cachetime_options = array(); |
|
10 | + public $ctype_options = array(); |
|
11 | + public $type_options = array(); |
|
12 | + public $target_mid = 0; |
|
13 | + public $target_dirname = ''; |
|
14 | + public $target_mname = ''; |
|
15 | + public $block_configs = array(); |
|
16 | + public $preview_request = array(); |
|
17 | 17 | |
18 | 18 | public function MyBlocksAadmin() |
19 | 19 | { |
@@ -22,37 +22,37 @@ discard block |
||
22 | 22 | |
23 | 23 | public function construct() |
24 | 24 | { |
25 | - $this->db =& XoopsDatabaseFactory::getDatabaseConnection() ; |
|
26 | - $this->lang = @$GLOBALS['xoopsConfig']['language'] ; |
|
25 | + $this->db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
26 | + $this->lang = @$GLOBALS['xoopsConfig']['language']; |
|
27 | 27 | |
28 | 28 | $this->cachetime_options = array( |
29 | - 0 => _NOCACHE , |
|
30 | - 30 => sprintf(_SECONDS, 30) , |
|
31 | - 60 => _MINUTE , |
|
32 | - 300 => sprintf(_MINUTES, 5) , |
|
33 | - 1800 => sprintf(_MINUTES, 30) , |
|
34 | - 3600 => _HOUR , |
|
35 | - 18000 => sprintf(_HOURS, 5) , |
|
36 | - 86400 => _DAY , |
|
37 | - 259200 => sprintf(_DAYS, 3) , |
|
38 | - 604800 => _WEEK , |
|
29 | + 0 => _NOCACHE, |
|
30 | + 30 => sprintf(_SECONDS, 30), |
|
31 | + 60 => _MINUTE, |
|
32 | + 300 => sprintf(_MINUTES, 5), |
|
33 | + 1800 => sprintf(_MINUTES, 30), |
|
34 | + 3600 => _HOUR, |
|
35 | + 18000 => sprintf(_HOURS, 5), |
|
36 | + 86400 => _DAY, |
|
37 | + 259200 => sprintf(_DAYS, 3), |
|
38 | + 604800 => _WEEK, |
|
39 | 39 | 2592000 => _MONTH |
40 | 40 | ); |
41 | 41 | |
42 | 42 | $this->ctype_options = array( |
43 | - 'H' => _MD_A_MYBLOCKSADMIN_CTYPE_HTML , |
|
44 | - 'T' => _MD_A_MYBLOCKSADMIN_CTYPE_NOSMILE , |
|
45 | - 'S' => _MD_A_MYBLOCKSADMIN_CTYPE_SMILE , |
|
43 | + 'H' => _MD_A_MYBLOCKSADMIN_CTYPE_HTML, |
|
44 | + 'T' => _MD_A_MYBLOCKSADMIN_CTYPE_NOSMILE, |
|
45 | + 'S' => _MD_A_MYBLOCKSADMIN_CTYPE_SMILE, |
|
46 | 46 | 'P' => _MD_A_MYBLOCKSADMIN_CTYPE_PHP |
47 | - ) ; |
|
47 | + ); |
|
48 | 48 | |
49 | 49 | $this->type_options = array( |
50 | - 'C' => 'custom block' , |
|
51 | - 'E' => 'cloned custom block' , |
|
52 | - 'M' => 'module\'s block' , |
|
53 | - 'D' => 'cloned module\'s block' , |
|
50 | + 'C' => 'custom block', |
|
51 | + 'E' => 'cloned custom block', |
|
52 | + 'M' => 'module\'s block', |
|
53 | + 'D' => 'cloned module\'s block', |
|
54 | 54 | 'S' => 'system block' |
55 | - ) ; |
|
55 | + ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | //HACK by domifara for php5.3+ |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | { |
62 | 62 | static $instance; |
63 | 63 | if (!isset($instance)) { |
64 | - $instance = new MyBlocksAdmin() ; |
|
65 | - $instance->construct() ; |
|
64 | + $instance = new MyBlocksAdmin(); |
|
65 | + $instance->construct(); |
|
66 | 66 | } |
67 | 67 | return $instance; |
68 | 68 | } |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | public function checkPermission() |
73 | 73 | { |
74 | 74 | // only groups have 'module_admin' of 'altsys' can do that. |
75 | - $module_handler =& xoops_gethandler('module') ; |
|
76 | - $module =& $module_handler->getByDirname('altsys') ; |
|
77 | - $moduleperm_handler =& xoops_gethandler('groupperm') ; |
|
78 | - if (! is_object(@$GLOBALS['xoopsUser']) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) { |
|
79 | - die('only admin of altsys can access this area') ; |
|
75 | + $module_handler = & xoops_gethandler('module'); |
|
76 | + $module = & $module_handler->getByDirname('altsys'); |
|
77 | + $moduleperm_handler = & xoops_gethandler('groupperm'); |
|
78 | + if (!is_object(@$GLOBALS['xoopsUser']) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) { |
|
79 | + die('only admin of altsys can access this area'); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
@@ -86,53 +86,53 @@ discard block |
||
86 | 86 | // altsys "module" MODE |
87 | 87 | if ($xoopsModule->getVar('dirname') == 'altsys') { |
88 | 88 | // set target_module if specified by $_GET['dirname'] |
89 | - $module_handler =& xoops_gethandler('module'); |
|
90 | - if (! empty($_GET['dirname'])) { |
|
91 | - $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']) ; |
|
92 | - $target_module =& $module_handler->getByDirname($dirname) ; |
|
89 | + $module_handler = & xoops_gethandler('module'); |
|
90 | + if (!empty($_GET['dirname'])) { |
|
91 | + $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']); |
|
92 | + $target_module = & $module_handler->getByDirname($dirname); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | if (is_object(@$target_module)) { |
96 | 96 | // module's blocks |
97 | - $this->target_mid = $target_module->getVar('mid') ; |
|
98 | - $this->target_mname = $target_module->getVar('name') . ' ' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0) ; |
|
99 | - $this->target_dirname = $target_module->getVar('dirname') ; |
|
100 | - $modinfo = $target_module->getInfo() ; |
|
97 | + $this->target_mid = $target_module->getVar('mid'); |
|
98 | + $this->target_mname = $target_module->getVar('name').' '.sprintf('(%2.2f)', $target_module->getVar('version') / 100.0); |
|
99 | + $this->target_dirname = $target_module->getVar('dirname'); |
|
100 | + $modinfo = $target_module->getInfo(); |
|
101 | 101 | // breadcrumbs |
102 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
103 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN') ; |
|
104 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, $this->target_mname) ; |
|
102 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
103 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
104 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, $this->target_mname); |
|
105 | 105 | } else { |
106 | 106 | // custom blocks |
107 | - $this->target_mid = 0 ; |
|
108 | - $this->target_mname = _MI_ALTSYS_MENU_CUSTOMBLOCKS ; |
|
109 | - $this->target_dirname = '__CustomBlocks__' ; |
|
107 | + $this->target_mid = 0; |
|
108 | + $this->target_mname = _MI_ALTSYS_MENU_CUSTOMBLOCKS; |
|
109 | + $this->target_dirname = '__CustomBlocks__'; |
|
110 | 110 | // breadcrumbs |
111 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
112 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN') ; |
|
113 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, '_MI_ALTSYS_MENU_CUSTOMBLOCKS') ; |
|
111 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
112 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
113 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, '_MI_ALTSYS_MENU_CUSTOMBLOCKS'); |
|
114 | 114 | } |
115 | 115 | } else { |
116 | 116 | // myblocksadmin as a library |
117 | - $this->target_mid = $xoopsModule->getVar('mid') ; |
|
118 | - $this->target_mname = $xoopsModule->getVar('name') . ' ' . sprintf('(%2.2f)', $xoopsModule->getVar('version') / 100.0) ; |
|
119 | - $this->target_dirname = $xoopsModule->getVar('dirname') ; |
|
120 | - $mod_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname') ; |
|
121 | - $modinfo = $xoopsModule->getInfo() ; |
|
122 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
123 | - $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $this->target_mname) ; |
|
124 | - $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', _MD_A_MYBLOCKSADMIN_BLOCKADMIN) ; |
|
117 | + $this->target_mid = $xoopsModule->getVar('mid'); |
|
118 | + $this->target_mname = $xoopsModule->getVar('name').' '.sprintf('(%2.2f)', $xoopsModule->getVar('version') / 100.0); |
|
119 | + $this->target_dirname = $xoopsModule->getVar('dirname'); |
|
120 | + $mod_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname'); |
|
121 | + $modinfo = $xoopsModule->getInfo(); |
|
122 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
123 | + $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $this->target_mname); |
|
124 | + $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', _MD_A_MYBLOCKSADMIN_BLOCKADMIN); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | // read xoops_version.php of the target |
128 | - $this->block_configs = $this->get_block_configs() ; |
|
128 | + $this->block_configs = $this->get_block_configs(); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | |
132 | 132 | // virtual |
133 | 133 | public function canEdit($block) |
134 | 134 | { |
135 | - return true ; |
|
135 | + return true; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | { |
142 | 142 | // can delete if it is a cloned block |
143 | 143 | if ($block->getVar('block_type') == 'D' || $block->getVar('block_type') == 'C') { |
144 | - return true ; |
|
144 | + return true; |
|
145 | 145 | } else { |
146 | - return false ; |
|
146 | + return false; |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -156,23 +156,23 @@ discard block |
||
156 | 156 | { |
157 | 157 | // can clone link if it is marked as cloneable block |
158 | 158 | if ($block->getVar('block_type') == 'D' || $block->getVar('block_type') == 'C') { |
159 | - return 2 ; |
|
159 | + return 2; |
|
160 | 160 | } else { |
161 | 161 | // $modversion['blocks'][n]['can_clone'] |
162 | 162 | foreach ($this->block_configs as $bconf) { |
163 | 163 | if ($block->getVar('show_func') == @$bconf['show_func'] && $block->getVar('func_file') == @$bconf['file'] && (empty($bconf['template']) || $block->getVar('template') == @$bconf['template'])) { |
164 | - if (! empty($bconf['can_clone'])) { |
|
165 | - return 2 ; |
|
164 | + if (!empty($bconf['can_clone'])) { |
|
165 | + return 2; |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | - if (! empty($GLOBALS['altsysModuleConfig']['enable_force_clone'])) { |
|
172 | - return 1 ; |
|
171 | + if (!empty($GLOBALS['altsysModuleConfig']['enable_force_clone'])) { |
|
172 | + return 1; |
|
173 | 173 | } |
174 | 174 | |
175 | - return 0 ; |
|
175 | + return 0; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | |
185 | 185 | //HACK by domifara |
186 | 186 | if (defined('XOOPS_CUBE_LEGACY')) { |
187 | - $handler =& xoops_gethandler('block'); |
|
188 | - $block =& $handler->create(false) ; |
|
189 | - $block->load($bid) ; |
|
187 | + $handler = & xoops_gethandler('block'); |
|
188 | + $block = & $handler->create(false); |
|
189 | + $block->load($bid); |
|
190 | 190 | } else { |
191 | - $block = new XoopsBlock($bid) ; |
|
191 | + $block = new XoopsBlock($bid); |
|
192 | 192 | } |
193 | - return $block->getOptions() ; |
|
193 | + return $block->getOptions(); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -203,43 +203,43 @@ discard block |
||
203 | 203 | // get selected targets |
204 | 204 | if (is_array(@$block_data['bmodule'])) { |
205 | 205 | // bmodule origined from request (preview etc.) |
206 | - $selected_mids = $block_data['bmodule'] ; |
|
206 | + $selected_mids = $block_data['bmodule']; |
|
207 | 207 | } else { |
208 | 208 | // origined from the table of `block_module_link` |
209 | - $result = $this->db->query('SELECT module_id FROM ' . $this->db->prefix('block_module_link') . " WHERE block_id='$bid'") ; |
|
209 | + $result = $this->db->query('SELECT module_id FROM '.$this->db->prefix('block_module_link')." WHERE block_id='$bid'"); |
|
210 | 210 | $selected_mids = array(); |
211 | 211 | while (list($selected_mid) = $this->db->fetchRow($result)) { |
212 | 212 | $selected_mids[] = (int)$selected_mid; |
213 | 213 | } |
214 | 214 | if (empty($selected_mids)) { |
215 | - $selected_mids = array( 0 ) ; |
|
215 | + $selected_mids = array(0); |
|
216 | 216 | } // all pages |
217 | 217 | } |
218 | 218 | |
219 | 219 | // get all targets |
220 | - $module_handler =& xoops_gethandler('module'); |
|
220 | + $module_handler = & xoops_gethandler('module'); |
|
221 | 221 | $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); |
222 | 222 | $criteria->add(new Criteria('isactive', 1)); |
223 | 223 | $module_list = $module_handler->getList($criteria); |
224 | - $module_list= array( -1 => _MD_A_MYBLOCKSADMIN_TOPPAGE , 0 => _MD_A_MYBLOCKSADMIN_ALLPAGES ) + $module_list ; |
|
224 | + $module_list = array( -1 => _MD_A_MYBLOCKSADMIN_TOPPAGE, 0 => _MD_A_MYBLOCKSADMIN_ALLPAGES ) + $module_list; |
|
225 | 225 | |
226 | 226 | // build options |
227 | - $module_options = '' ; |
|
227 | + $module_options = ''; |
|
228 | 228 | foreach ($module_list as $mid => $mname) { |
229 | - $mname = htmlspecialchars($mname) ; |
|
229 | + $mname = htmlspecialchars($mname); |
|
230 | 230 | if (in_array($mid, $selected_mids)) { |
231 | - $module_options .= "<option value='$mid' selected='selected'>$mname</option>\n" ; |
|
231 | + $module_options .= "<option value='$mid' selected='selected'>$mname</option>\n"; |
|
232 | 232 | } else { |
233 | - $module_options .= "<option value='$mid'>$mname</option>\n" ; |
|
233 | + $module_options .= "<option value='$mid'>$mname</option>\n"; |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | 237 | $ret = " |
238 | 238 | <select name='bmodules[$bid][]' size='5' multiple='multiple'> |
239 | 239 | $module_options |
240 | - </select>" ; |
|
240 | + </select>"; |
|
241 | 241 | |
242 | - return $ret ; |
|
242 | + return $ret; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -252,41 +252,41 @@ discard block |
||
252 | 252 | // get selected targets |
253 | 253 | if (is_array(@$block_data['bgroup'])) { |
254 | 254 | // bgroup origined from request (preview etc.) |
255 | - $selected_gids = $block_data['bgroup'] ; |
|
255 | + $selected_gids = $block_data['bgroup']; |
|
256 | 256 | } else { |
257 | 257 | // origined from the table of `group_perm` |
258 | - $result = $this->db->query('SELECT gperm_groupid FROM ' . $this->db->prefix('group_permission') . " WHERE gperm_itemid='$bid' AND gperm_name='block_read'") ; |
|
258 | + $result = $this->db->query('SELECT gperm_groupid FROM '.$this->db->prefix('group_permission')." WHERE gperm_itemid='$bid' AND gperm_name='block_read'"); |
|
259 | 259 | $selected_gids = array(); |
260 | 260 | while (list($selected_gid) = $this->db->fetchRow($result)) { |
261 | 261 | $selected_gids[] = (int)$selected_gid; |
262 | 262 | } |
263 | 263 | if ($bid == 0 && empty($selected_gids)) { |
264 | - $selected_gids = $GLOBALS['xoopsUser']->getGroups() ; |
|
264 | + $selected_gids = $GLOBALS['xoopsUser']->getGroups(); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | 268 | // get all targets |
269 | - $group_handler =& xoops_gethandler('group'); |
|
270 | - $groups = $group_handler->getObjects() ; |
|
269 | + $group_handler = & xoops_gethandler('group'); |
|
270 | + $groups = $group_handler->getObjects(); |
|
271 | 271 | |
272 | 272 | // build options |
273 | - $group_options = '' ; |
|
273 | + $group_options = ''; |
|
274 | 274 | foreach ($groups as $group) { |
275 | - $gid = $group->getVar('groupid') ; |
|
276 | - $gname = $group->getVar('name', 's') ; |
|
275 | + $gid = $group->getVar('groupid'); |
|
276 | + $gname = $group->getVar('name', 's'); |
|
277 | 277 | if (in_array($gid, $selected_gids)) { |
278 | - $group_options .= "<option value='$gid' selected='selected'>$gname</option>\n" ; |
|
278 | + $group_options .= "<option value='$gid' selected='selected'>$gname</option>\n"; |
|
279 | 279 | } else { |
280 | - $group_options .= "<option value='$gid'>$gname</option>\n" ; |
|
280 | + $group_options .= "<option value='$gid'>$gname</option>\n"; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
284 | 284 | $ret = " |
285 | 285 | <select name='bgroups[$bid][]' size='5' multiple='multiple'> |
286 | 286 | $group_options |
287 | - </select>" ; |
|
287 | + </select>"; |
|
288 | 288 | |
289 | - return $ret ; |
|
289 | + return $ret; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = ''; |
302 | 302 | $scoln = $scol0 = $scol1 = $scol2 = $scol3 = $scol4 = 'unselected'; |
303 | 303 | $stextbox = 'unselected'; |
304 | - $value4extra_side = '' ; |
|
304 | + $value4extra_side = ''; |
|
305 | 305 | |
306 | 306 | if ($visible != 1) { |
307 | 307 | $sseln = " checked='checked'"; |
@@ -311,27 +311,27 @@ discard block |
||
311 | 311 | case XOOPS_SIDEBLOCK_LEFT : |
312 | 312 | $ssel0 = " checked='checked'"; |
313 | 313 | $scol0 = 'selected'; |
314 | - break ; |
|
314 | + break; |
|
315 | 315 | case XOOPS_SIDEBLOCK_RIGHT : |
316 | 316 | $ssel1 = " checked='checked'"; |
317 | 317 | $scol1 = 'selected'; |
318 | - break ; |
|
318 | + break; |
|
319 | 319 | case XOOPS_CENTERBLOCK_LEFT : |
320 | 320 | $ssel2 = " checked='checked'"; |
321 | 321 | $scol2 = 'selected'; |
322 | - break ; |
|
322 | + break; |
|
323 | 323 | case XOOPS_CENTERBLOCK_RIGHT : |
324 | 324 | $ssel4 = " checked='checked'"; |
325 | 325 | $scol4 = 'selected'; |
326 | - break ; |
|
326 | + break; |
|
327 | 327 | case XOOPS_CENTERBLOCK_CENTER : |
328 | 328 | $ssel3 = " checked='checked'"; |
329 | 329 | $scol3 = 'selected'; |
330 | - break ; |
|
330 | + break; |
|
331 | 331 | default : |
332 | - $value4extra_side = $side ; |
|
332 | + $value4extra_side = $side; |
|
333 | 333 | $stextbox = 'selected'; |
334 | - break ; |
|
334 | + break; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | <div class='blockposition $scoln'> |
362 | 362 | <input type='radio' name='sides[$bid]' value='-1' class='blockposition' $sseln onclick='document.getElementById(\"extra_side_$bid\").value=-1;' /> |
363 | 363 | </div> |
364 | - <div style='float:"._GLOBAL_LEFT.";'>"._NONE . '</div> |
|
364 | + <div style='float:"._GLOBAL_LEFT.";'>"._NONE.'</div> |
|
365 | 365 | '; |
366 | 366 | } |
367 | 367 | |
@@ -369,58 +369,58 @@ discard block |
||
369 | 369 | // public |
370 | 370 | public function list_blocks() |
371 | 371 | { |
372 | - global $xoopsGTicket ; |
|
372 | + global $xoopsGTicket; |
|
373 | 373 | |
374 | 374 | // main query |
375 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newblocks') . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight" ; |
|
376 | - $result = $this->db->query($sql) ; |
|
377 | - $block_arr = array() ; |
|
375 | + $sql = 'SELECT * FROM '.$this->db->prefix('newblocks')." WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
376 | + $result = $this->db->query($sql); |
|
377 | + $block_arr = array(); |
|
378 | 378 | //HACK by domifara |
379 | 379 | if (defined('XOOPS_CUBE_LEGACY')) { |
380 | - $handler =& xoops_gethandler('block');//add |
|
380 | + $handler = & xoops_gethandler('block'); //add |
|
381 | 381 | } |
382 | 382 | while ($myrow = $this->db->fetchArray($result)) { |
383 | 383 | |
384 | 384 | //HACK by domifara |
385 | 385 | if (defined('XOOPS_CUBE_LEGACY')) { |
386 | - $block_one =& $handler->create(false) ; |
|
386 | + $block_one = & $handler->create(false); |
|
387 | 387 | $block_one->assignVars($myrow); |
388 | - $block_arr[] =& $block_one ; |
|
388 | + $block_arr[] = & $block_one; |
|
389 | 389 | } else { |
390 | - $block_arr[] = new XoopsBlock($myrow) ; |
|
390 | + $block_arr[] = new XoopsBlock($myrow); |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | if (empty($block_arr)) { |
394 | - return ; |
|
394 | + return; |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | // blocks rendering loop |
398 | - $blocks4assign = array() ; |
|
398 | + $blocks4assign = array(); |
|
399 | 399 | foreach ($block_arr as $i => $block) { |
400 | 400 | $block_data = array( |
401 | 401 | 'bid' => (int)$block->getVar('bid'), |
402 | - 'name' => $block->getVar('name', 'n') , |
|
403 | - 'title' => $block->getVar('title', 'n') , |
|
402 | + 'name' => $block->getVar('name', 'n'), |
|
403 | + 'title' => $block->getVar('title', 'n'), |
|
404 | 404 | 'weight' => (int)$block->getVar('weight'), |
405 | 405 | 'bcachetime' => (int)$block->getVar('bcachetime'), |
406 | 406 | 'side' => (int)$block->getVar('side'), |
407 | 407 | 'visible' => (int)$block->getVar('visible'), |
408 | - 'can_edit' => $this->canEdit($block) , |
|
409 | - 'can_delete' => $this->canDelete($block) , |
|
408 | + 'can_edit' => $this->canEdit($block), |
|
409 | + 'can_delete' => $this->canDelete($block), |
|
410 | 410 | 'can_clone' => $this->canClone($block) |
411 | - ) ; |
|
411 | + ); |
|
412 | 412 | $blocks4assign[] = array( |
413 | - 'name_raw' => $block_data['name'] , |
|
414 | - 'title_raw' => $block_data['title'] , |
|
415 | - 'cell_position' => $this->renderCell4BlockPosition($block_data) , |
|
416 | - 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data) , |
|
413 | + 'name_raw' => $block_data['name'], |
|
414 | + 'title_raw' => $block_data['title'], |
|
415 | + 'cell_position' => $this->renderCell4BlockPosition($block_data), |
|
416 | + 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), |
|
417 | 417 | 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data) |
418 | - ) + $block_data ; |
|
418 | + ) + $block_data; |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | // display |
422 | - require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ; |
|
423 | - $tpl = new D3Tpl() ; |
|
422 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
423 | + $tpl = new D3Tpl(); |
|
424 | 424 | $tpl->assign(array( |
425 | 425 | 'target_mid' => $this->target_mid, |
426 | 426 | 'target_dirname' => $this->target_dirname, |
@@ -429,22 +429,22 @@ discard block |
||
429 | 429 | 'cachetime_options' => $this->cachetime_options, |
430 | 430 | 'blocks' => $blocks4assign, |
431 | 431 | 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') |
432 | - )) ; |
|
433 | - $tpl->display('db:altsys_main_myblocksadmin_list.html') ; |
|
432 | + )); |
|
433 | + $tpl->display('db:altsys_main_myblocksadmin_list.html'); |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | |
437 | 437 | public function get_block_configs() |
438 | 438 | { |
439 | 439 | if ($this->target_mid <= 0) { |
440 | - return array() ; |
|
440 | + return array(); |
|
441 | 441 | } |
442 | - include XOOPS_ROOT_PATH.'/modules/'.$this->target_dirname.'/xoops_version.php' ; |
|
442 | + include XOOPS_ROOT_PATH.'/modules/'.$this->target_dirname.'/xoops_version.php'; |
|
443 | 443 | |
444 | 444 | if (empty($modversion['blocks'])) { |
445 | - return array() ; |
|
445 | + return array(); |
|
446 | 446 | } else { |
447 | - return $modversion['blocks'] ; |
|
447 | + return $modversion['blocks']; |
|
448 | 448 | } |
449 | 449 | } |
450 | 450 | |
@@ -452,51 +452,51 @@ discard block |
||
452 | 452 | public function list_groups() |
453 | 453 | { |
454 | 454 | // query for getting blocks |
455 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newblocks') . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight" ; |
|
456 | - $result = $this->db->query($sql) ; |
|
457 | - $block_arr = array() ; |
|
455 | + $sql = 'SELECT * FROM '.$this->db->prefix('newblocks')." WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
456 | + $result = $this->db->query($sql); |
|
457 | + $block_arr = array(); |
|
458 | 458 | //HACK by domifara |
459 | 459 | if (defined('XOOPS_CUBE_LEGACY')) { |
460 | - $handler =& xoops_gethandler('block');//add |
|
460 | + $handler = & xoops_gethandler('block'); //add |
|
461 | 461 | } |
462 | 462 | while ($myrow = $this->db->fetchArray($result)) { |
463 | 463 | //HACK by domifara |
464 | 464 | if (defined('XOOPS_CUBE_LEGACY')) { |
465 | - $block_one =& $handler->create(false) ; |
|
465 | + $block_one = & $handler->create(false); |
|
466 | 466 | $block_one->assignVars($myrow); |
467 | - $block_arr[] =& $block_one ; |
|
467 | + $block_arr[] = & $block_one; |
|
468 | 468 | } else { |
469 | - $block_arr[] = new XoopsBlock($myrow) ; |
|
469 | + $block_arr[] = new XoopsBlock($myrow); |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 | |
473 | - $item_list = array() ; |
|
473 | + $item_list = array(); |
|
474 | 474 | foreach (array_keys($block_arr) as $i) { |
475 | - $item_list[ $block_arr[$i]->getVar('bid') ] = $block_arr[$i]->getVar('title') ; |
|
475 | + $item_list[$block_arr[$i]->getVar('bid')] = $block_arr[$i]->getVar('title'); |
|
476 | 476 | } |
477 | 477 | |
478 | - $form = new MyXoopsGroupPermForm(_MD_A_MYBLOCKSADMIN_PERMFORM, 1, 'block_read', '') ; |
|
478 | + $form = new MyXoopsGroupPermForm(_MD_A_MYBLOCKSADMIN_PERMFORM, 1, 'block_read', ''); |
|
479 | 479 | // skip system (TODO) |
480 | 480 | if ($this->target_mid > 1) { |
481 | - $form->addAppendix('module_admin', $this->target_mid, $this->target_mname . ' ' . _MD_A_MYBLOCKSADMIN_PERM_MADMIN) ; |
|
482 | - $form->addAppendix('module_read', $this->target_mid, $this->target_mname .' ' . _MD_A_MYBLOCKSADMIN_PERM_MREAD) ; |
|
481 | + $form->addAppendix('module_admin', $this->target_mid, $this->target_mname.' '._MD_A_MYBLOCKSADMIN_PERM_MADMIN); |
|
482 | + $form->addAppendix('module_read', $this->target_mid, $this->target_mname.' '._MD_A_MYBLOCKSADMIN_PERM_MREAD); |
|
483 | 483 | } |
484 | 484 | foreach ($item_list as $item_id => $item_name) { |
485 | - $form->addItem($item_id, $item_name) ; |
|
485 | + $form->addItem($item_id, $item_name); |
|
486 | 486 | } |
487 | - echo $form->render() ; |
|
487 | + echo $form->render(); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | |
491 | - public function update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options=array()) |
|
491 | + public function update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options = array()) |
|
492 | 492 | { |
493 | 493 | global $xoopsConfig; |
494 | 494 | |
495 | 495 | //HACK by domifara |
496 | 496 | if (defined('XOOPS_CUBE_LEGACY')) { |
497 | - $handler =& xoops_gethandler('block'); |
|
498 | - $block =& $handler->create(false) ; |
|
499 | - $block->load($bid) ; |
|
497 | + $handler = & xoops_gethandler('block'); |
|
498 | + $block = & $handler->create(false); |
|
499 | + $block->load($bid); |
|
500 | 500 | } else { |
501 | 501 | $block = new XoopsBlock($bid); |
502 | 502 | } |
@@ -515,10 +515,10 @@ discard block |
||
515 | 515 | } |
516 | 516 | $block->setVar('bcachetime', $bcachetime); |
517 | 517 | if (is_array($options) && count($options) > 0) { |
518 | - $block->setVar('options', implode('|', $options)) ; |
|
518 | + $block->setVar('options', implode('|', $options)); |
|
519 | 519 | } |
520 | 520 | if ($block->getVar('block_type') == 'C') { |
521 | - $name = $this->get_blockname_from_ctype($block->getVar('c_type')) ; |
|
521 | + $name = $this->get_blockname_from_ctype($block->getVar('c_type')); |
|
522 | 522 | $block->setVar('name', $name); |
523 | 523 | } |
524 | 524 | $msg = _MD_A_MYBLOCKSADMIN_DBUPDATED; |
@@ -542,14 +542,14 @@ discard block |
||
542 | 542 | } else { |
543 | 543 | $msg = 'Failed update of block. ID:'.$bid; |
544 | 544 | } |
545 | - return $msg ; |
|
545 | + return $msg; |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | |
549 | 549 | // virtual |
550 | 550 | public function updateBlockModuleLink($bid, $bmodules) |
551 | 551 | { |
552 | -<<<<<<< HEAD |
|
552 | +<< << <<< HEAD |
|
553 | 553 | $bid = intval($bid) ; |
554 | 554 | $table = $this->db->prefix('block_module_link') ; |
555 | 555 | ======= |
@@ -1085,8 +1085,4 @@ discard block |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -1085,8 +1085,4 @@ |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -1085,8 +1085,4 @@ |
||
1085 | 1085 | // the first form (blocks) |
1086 | 1086 | $this->list_blocks() ; |
1087 | 1087 | // the second form (groups) |
1088 | - $this->list_groups() ; |
|
1089 | - break ; |
|
1090 | - } |
|
1091 | - } |
|
1092 | -} |
|
1088 | + $this->list_groups |
|
1093 | 1089 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'/MyBlocksAdmin.class.php' ; |
|
3 | +require_once __DIR__.'/MyBlocksAdmin.class.php'; |
|
4 | 4 | |
5 | 5 | class MyBlocksAdminForICMS extends MyBlocksAdmin |
6 | 6 | { |
7 | 7 | |
8 | - public $block_positions = array() ; |
|
8 | + public $block_positions = array(); |
|
9 | 9 | |
10 | 10 | public function MyBlocksAadminForICMS() |
11 | 11 | { |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | |
15 | 15 | public function construct() |
16 | 16 | { |
17 | - parent::construct() ; |
|
17 | + parent::construct(); |
|
18 | 18 | |
19 | - @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php' ; |
|
20 | - $result = $this->db->query('SELECT id,pname,title FROM ' . $this->db->prefix('block_positions')) ; |
|
19 | + @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php'; |
|
20 | + $result = $this->db->query('SELECT id,pname,title FROM '.$this->db->prefix('block_positions')); |
|
21 | 21 | while (list($id, $pname, $title) = $this->db->fetchRow($result)) { |
22 | - $this->block_positions[ $id ] = defined($title) ? constant($title) : $title ; |
|
22 | + $this->block_positions[$id] = defined($title) ? constant($title) : $title; |
|
23 | 23 | } |
24 | - $this->block_positions[ -1 ] = _NONE ; |
|
24 | + $this->block_positions[ -1] = _NONE; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | //HACK by domifara for php5.3+ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | static $instance; |
32 | 32 | if (!isset($instance)) { |
33 | 33 | $instance = new MyBlocksAdminForICMS(); |
34 | - $instance->construct() ; |
|
34 | + $instance->construct(); |
|
35 | 35 | } |
36 | 36 | return $instance; |
37 | 37 | } |
@@ -46,23 +46,23 @@ discard block |
||
46 | 46 | // get selected targets |
47 | 47 | if (is_array(@$block_data['bmodule'])) { |
48 | 48 | // bmodule origined from request (preview etc.) |
49 | - $selected_pages = $block_data['bmodule'] ; |
|
49 | + $selected_pages = $block_data['bmodule']; |
|
50 | 50 | } else { |
51 | 51 | // origined from the table of `block_module_link` |
52 | - $result = $this->db->query('SELECT module_id,page_id FROM ' . $this->db->prefix('block_module_link') . " WHERE block_id='$bid'") ; |
|
52 | + $result = $this->db->query('SELECT module_id,page_id FROM '.$this->db->prefix('block_module_link')." WHERE block_id='$bid'"); |
|
53 | 53 | $selected_pages = array(); |
54 | 54 | while (list($mid, $pid) = $this->db->fetchRow($result)) { |
55 | - $selected_pages[] = (int)$mid . '-' . (int)$pid; |
|
55 | + $selected_pages[] = (int)$mid.'-'.(int)$pid; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - $page_handler =& xoops_gethandler('page'); |
|
59 | + $page_handler = & xoops_gethandler('page'); |
|
60 | 60 | $ret = " |
61 | 61 | <select name='bmodules[$bid][]' size='5' multiple='multiple'> |
62 | - ".$page_handler->getPageSelOptions($selected_pages) . ' |
|
62 | + ".$page_handler->getPageSelOptions($selected_pages).' |
|
63 | 63 | </select>'; |
64 | 64 | |
65 | - return $ret ; |
|
65 | + return $ret; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | return " |
74 | 74 | <table> |
75 | 75 | <tr> |
76 | - <td rowspan='2'>".$this->renderRadio4BlockPosition(1, $block_data) . '</td> |
|
77 | - <td>' . $this->renderRadio4BlockPosition(3, $block_data) . '</td> |
|
78 | - <td>' . $this->renderRadio4BlockPosition(4, $block_data) . '</td> |
|
79 | - <td>' . $this->renderRadio4BlockPosition(5, $block_data) . "</td> |
|
80 | - <td rowspan='2'>".$this->renderRadio4BlockPosition(2, $block_data) . '</td> |
|
76 | + <td rowspan='2'>".$this->renderRadio4BlockPosition(1, $block_data).'</td> |
|
77 | + <td>' . $this->renderRadio4BlockPosition(3, $block_data).'</td> |
|
78 | + <td>' . $this->renderRadio4BlockPosition(4, $block_data).'</td> |
|
79 | + <td>' . $this->renderRadio4BlockPosition(5, $block_data)."</td> |
|
80 | + <td rowspan='2'>".$this->renderRadio4BlockPosition(2, $block_data).'</td> |
|
81 | 81 | </tr> |
82 | 82 | <tr> |
83 | - <td>' . $this->renderRadio4BlockPosition(6, $block_data) . '</td> |
|
84 | - <td>' . $this->renderRadio4BlockPosition(7, $block_data) . '</td> |
|
85 | - <td>' . $this->renderRadio4BlockPosition(8, $block_data) . "</td> |
|
83 | + <td>' . $this->renderRadio4BlockPosition(6, $block_data).'</td> |
|
84 | + <td>' . $this->renderRadio4BlockPosition(7, $block_data).'</td> |
|
85 | + <td>' . $this->renderRadio4BlockPosition(8, $block_data)."</td> |
|
86 | 86 | </tr> |
87 | 87 | <tr> |
88 | - <td colspan='5'>".$this->renderRadio4BlockPositions($block_data, array(1, 2, 3, 4, 5, 6, 7, 8)) . '</td> |
|
88 | + <td colspan='5'>".$this->renderRadio4BlockPositions($block_data, array(1, 2, 3, 4, 5, 6, 7, 8)).'</td> |
|
89 | 89 | </tr> |
90 | 90 | </table>'; |
91 | 91 | } |
@@ -96,19 +96,19 @@ discard block |
||
96 | 96 | { |
97 | 97 | $bid = (int)$block_data['bid']; |
98 | 98 | $visible = (int)$block_data['visible']; |
99 | - $current_side = $visible ? (int)$block_data['side'] : -1 ; |
|
99 | + $current_side = $visible ? (int)$block_data['side'] : -1; |
|
100 | 100 | |
101 | - $label4disp = htmlspecialchars($this->block_positions[ $target_side ], ENT_QUOTES) ; |
|
101 | + $label4disp = htmlspecialchars($this->block_positions[$target_side], ENT_QUOTES); |
|
102 | 102 | |
103 | 103 | if ($current_side == $target_side) { |
104 | - $checked = "checked='checked'" ; |
|
104 | + $checked = "checked='checked'"; |
|
105 | 105 | $divstyle = $target_side == -1 ? 'disabled' : 'selected'; |
106 | 106 | } else { |
107 | 107 | $checked = ''; |
108 | 108 | $divstyle = 'unselected'; |
109 | 109 | } |
110 | 110 | |
111 | - return "<div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' value='$target_side' class='blockposition' $checked /></div>" ; |
|
111 | + return "<div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' value='$target_side' class='blockposition' $checked /></div>"; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
@@ -117,35 +117,35 @@ discard block |
||
117 | 117 | { |
118 | 118 | $bid = (int)$block_data['bid']; |
119 | 119 | $visible = (int)$block_data['visible']; |
120 | - $current_side = $visible ? (int)$block_data['side'] : -1 ; |
|
120 | + $current_side = $visible ? (int)$block_data['side'] : -1; |
|
121 | 121 | |
122 | - $ret = '' ; |
|
122 | + $ret = ''; |
|
123 | 123 | foreach ($this->block_positions as $target_side => $label) { |
124 | 124 | if (in_array($target_side, $skip_sides)) { |
125 | - continue ; |
|
125 | + continue; |
|
126 | 126 | } |
127 | 127 | |
128 | - $label4disp = htmlspecialchars($label, ENT_QUOTES) ; |
|
128 | + $label4disp = htmlspecialchars($label, ENT_QUOTES); |
|
129 | 129 | |
130 | 130 | if ($current_side == $target_side) { |
131 | - $checked = "checked='checked'" ; |
|
131 | + $checked = "checked='checked'"; |
|
132 | 132 | $divstyle = $target_side == -1 ? 'disabled' : 'selected'; |
133 | 133 | } else { |
134 | 134 | $checked = ''; |
135 | 135 | $divstyle = 'unselected'; |
136 | 136 | } |
137 | 137 | |
138 | - $ret .= "<div style='clear:both;'><div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' id='sides_{$bid}_{$target_side}' value='$target_side' class='blockposition' $checked /></div><label for='sides_{$bid}_{$target_side}'>$label4disp</label></label></div>" ; |
|
138 | + $ret .= "<div style='clear:both;'><div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' id='sides_{$bid}_{$target_side}' value='$target_side' class='blockposition' $checked /></div><label for='sides_{$bid}_{$target_side}'>$label4disp</label></label></div>"; |
|
139 | 139 | } |
140 | 140 | |
141 | - return $ret ; |
|
141 | + return $ret; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
145 | 145 | // virtual |
146 | 146 | public function updateBlockModuleLink($bid, $bmodules) |
147 | 147 | { |
148 | -<<<<<<< HEAD |
|
148 | +<< << <<< HEAD |
|
149 | 149 | $bid = intval($bid) ; |
150 | 150 | $table = $this->db->prefix('block_module_link') ; |
151 | 151 | ======= |
@@ -160,7 +160,4 @@ discard block |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -160,7 +160,4 @@ |
||
160 | 160 | $module_id = (int)(@$regs[0]); |
161 | 161 | $page_id = (int)(@$regs[1]); |
162 | 162 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`,`page_id`) VALUES ($bid,$module_id,$page_id)" ; |
163 | - $this->db->query($sql) ; |
|
164 | - } |
|
165 | -} |
|
166 | -} |
|
163 | + $this->db->query($sql |
|
167 | 164 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
30 | 30 | // ------------------------------------------------------------------------ // |
31 | 31 | |
32 | -require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php' ; |
|
32 | +require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php'; |
|
33 | 33 | include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
34 | 34 | |
35 | 35 | $xoopsOption['theme_use_smarty'] = 1; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | $xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', 'xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); |
44 | 44 | // Meta tags |
45 | - $config_handler =& xoops_gethandler('config'); |
|
45 | + $config_handler = & xoops_gethandler('config'); |
|
46 | 46 | $criteria = new CriteriaCompo(new Criteria('conf_modid', 0)); |
47 | 47 | $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER)); |
48 | 48 | $config = $config_handler->getConfigs($criteria, true); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | //HACK by domifara |
59 | 59 | if (defined('XOOPS_CUBE_LEGACY')) { |
60 | - $handler =& xoops_gethandler('block'); |
|
61 | - $xoopsblock =& $handler->create(false) ; |
|
60 | + $handler = & xoops_gethandler('block'); |
|
61 | + $xoopsblock = & $handler->create(false); |
|
62 | 62 | } else { |
63 | 63 | $xoopsblock = new XoopsBlock(); |
64 | 64 | } |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | if (is_object($xoopsUser)) { |
69 | 69 | $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin)); |
70 | 70 | if (is_object(@$xoopsModule)) { |
71 | - if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) { |
|
72 | - $module_handler =& xoops_gethandler('module') ; |
|
73 | -<<<<<<< HEAD |
|
71 | + if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && !empty($_GET['mod'])) { |
|
72 | + $module_handler = & xoops_gethandler('module'); |
|
73 | +<< << <<< HEAD |
|
74 | 74 | $target_module = $module_handler->get(intval($_GET['mod'])) ; |
75 | 75 | ======= |
76 | 76 | $target_module = $module_handler->get((int)$_GET['mod']) ; |
@@ -268,4 +268,4 @@ discard block |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -268,4 +268,4 @@ |
||
268 | 268 | $xoopsTpl->assign('xoops_showcblock', 0); |
269 | 269 | } |
270 | 270 | |
271 | - $xoopsTpl->xoops_setCaching(0); |
|
271 | + $xoopsTpl->xoops_setCaching |
|
272 | 272 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -1,26 +1,26 @@ discard block |
||
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 modules |
8 | 8 | // $tplsadmin_autoupdate_path = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/templates' ; |
9 | 9 | |
10 | -if (! is_array(@$tplsadmin_autoupdate_dirnames)) { |
|
11 | - return ; |
|
10 | +if (!is_array(@$tplsadmin_autoupdate_dirnames)) { |
|
11 | + return; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | foreach ($tplsadmin_autoupdate_dirnames as $dirname) { |
15 | - $dirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $dirname) ; |
|
16 | - $tplsadmin_autoupdate_path = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/templates' ; |
|
15 | + $dirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $dirname); |
|
16 | + $tplsadmin_autoupdate_path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates'; |
|
17 | 17 | |
18 | 18 | // modules |
19 | - if ($handler = @opendir($tplsadmin_autoupdate_path . '/')) { |
|
19 | + if ($handler = @opendir($tplsadmin_autoupdate_path.'/')) { |
|
20 | 20 | while (($file = readdir($handler)) !== false) { |
21 | - $file_path = $tplsadmin_autoupdate_path . '/' . $file ; |
|
21 | + $file_path = $tplsadmin_autoupdate_path.'/'.$file; |
|
22 | 22 | if (is_file($file_path) && substr($file, -5) == '.html') { |
23 | -<<<<<<< HEAD |
|
23 | +<< << <<< HEAD |
|
24 | 24 | $mtime = intval(@filemtime($file_path)) ; |
25 | 25 | 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")) ; |
26 | 26 | ======= |
@@ -49,9 +49,4 @@ discard block |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -49,9 +49,4 @@ |
||
49 | 49 | >>>>>>> feature/intval |
50 | 50 | if ($count <= 0) { |
51 | 51 | include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
52 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | -} |
|
52 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime |
|
58 | 53 | \ No newline at end of file |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -1,17 +1,17 @@ discard block |
||
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 |
||
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 |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -20,8 +20,4 @@ |
||
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 |
@@ -251,6 +251,7 @@ |
||
251 | 251 | |
252 | 252 | /** |
253 | 253 | * Constructor |
254 | + * @param string $name |
|
254 | 255 | */ |
255 | 256 | public function __construct($caption, $name, $groupId, $values = null) |
256 | 257 | { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
360 | 360 | { |
361 | 361 | $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' |
362 | - . $option['id'] . "]\" onclick=\""; |
|
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. |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $tree .= ' checked="checked"'; |
381 | 381 | } |
382 | 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"; |
|
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']); |
@@ -29,8 +29,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
180 | 180 | // GIJ start |
181 | 181 | $jstray = new XoopsFormElementTray(' '); |
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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']); |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -5,63 +5,63 @@ discard block |
||
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') . ' ' . 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').' '.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 |
||
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 |
||
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 |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -398,14 +398,4 @@ |
||
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 |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -5,36 +5,36 @@ discard block |
||
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" ; |
|
12 | -include_once __DIR__.'/include/Text_Diff.php' ; |
|
13 | -include_once __DIR__.'/include/Text_Diff_Renderer.php' ; |
|
14 | -include_once __DIR__.'/include/Text_Diff_Renderer_unified.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 | +include_once __DIR__.'/include/Text_Diff.php'; |
|
13 | +include_once __DIR__.'/include/Text_Diff_Renderer.php'; |
|
14 | +include_once __DIR__.'/include/Text_Diff_Renderer_unified.php'; |
|
15 | 15 | |
16 | 16 | |
17 | 17 | // only groups have 'module_admin' of 'altsys' can do that. |
18 | -$module_handler =& xoops_gethandler('module') ; |
|
19 | -$module =& $module_handler->getByDirname('altsys') ; |
|
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') ; |
|
18 | +$module_handler = & xoops_gethandler('module'); |
|
19 | +$module = & $module_handler->getByDirname('altsys'); |
|
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 | //$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ; |
26 | 26 | |
27 | 27 | // initials |
28 | -$db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
29 | -(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ; |
|
28 | +$db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
29 | +(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance(); |
|
30 | 30 | |
31 | 31 | // language file |
32 | -altsys_include_language_file('mytplsform') ; |
|
33 | -altsys_include_language_file('mytplsadmin') ; |
|
32 | +altsys_include_language_file('mytplsform'); |
|
33 | +altsys_include_language_file('mytplsadmin'); |
|
34 | 34 | |
35 | 35 | // check $xoopsModule |
36 | -if (! is_object($xoopsModule)) { |
|
37 | - redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM) ; |
|
36 | +if (!is_object($xoopsModule)) { |
|
37 | + redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | // check access right (needs system_admin of tplset) |
@@ -42,119 +42,119 @@ discard block |
||
42 | 42 | //if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_TPLSET, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ; |
43 | 43 | |
44 | 44 | // tpl_file from $_GET |
45 | -$tpl_tplset = $myts->stripSlashesGPC(@$_GET['tpl_tplset']) ; |
|
46 | -if (! $tpl_tplset) { |
|
47 | - $tpl_tplset = $xoopsConfig['template_set'] ; |
|
45 | +$tpl_tplset = $myts->stripSlashesGPC(@$_GET['tpl_tplset']); |
|
46 | +if (!$tpl_tplset) { |
|
47 | + $tpl_tplset = $xoopsConfig['template_set']; |
|
48 | 48 | } |
49 | -$tpl_tplset4sql = addslashes($tpl_tplset) ; |
|
49 | +$tpl_tplset4sql = addslashes($tpl_tplset); |
|
50 | 50 | |
51 | 51 | if (empty($_GET['tpl_file']) || $_GET['tpl_file'] == '_custom') { |
52 | - $edit_mode = 'create' ; |
|
53 | - $tpl_file = '_custom' ; |
|
52 | + $edit_mode = 'create'; |
|
53 | + $tpl_file = '_custom'; |
|
54 | 54 | $tpl = array( |
55 | - 'tpl_id' => 0 , |
|
56 | - 'tpl_refid' => 0 , |
|
57 | - 'tpl_module' => '_custom' , |
|
58 | - 'tpl_tplset' => $tpl_tplset , |
|
59 | - 'tpl_file' => '_custom_'.substr(date('YmdHis'), 2, -2).'.html' , |
|
60 | - 'tpl_desc' => '' , |
|
61 | - 'tpl_lastmodified' => 0 , |
|
62 | - 'tpl_lastimported' => 0 , |
|
63 | - 'tpl_type' => 'custom' , |
|
55 | + 'tpl_id' => 0, |
|
56 | + 'tpl_refid' => 0, |
|
57 | + 'tpl_module' => '_custom', |
|
58 | + 'tpl_tplset' => $tpl_tplset, |
|
59 | + 'tpl_file' => '_custom_'.substr(date('YmdHis'), 2, -2).'.html', |
|
60 | + 'tpl_desc' => '', |
|
61 | + 'tpl_lastmodified' => 0, |
|
62 | + 'tpl_lastimported' => 0, |
|
63 | + 'tpl_type' => 'custom', |
|
64 | 64 | 'tpl_source' => '' |
65 | - ) ; |
|
65 | + ); |
|
66 | 66 | |
67 | 67 | // breadcrumbs |
68 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
69 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN') ; |
|
70 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE) ; |
|
71 | - $breadcrumbsObj->appendPath('', '_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE') ; |
|
68 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
69 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
70 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE); |
|
71 | + $breadcrumbsObj->appendPath('', '_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE'); |
|
72 | 72 | $target_mname = _MYTPLSADMIN_CUSTOMTEMPLATE; |
73 | 73 | } else { |
74 | 74 | // tpl_file from $_GET |
75 | - $edit_mode = 'modify' ; |
|
76 | - $tpl_file = $myts->stripSlashesGPC(@$_GET['tpl_file']) ; |
|
77 | - $tpl_file = str_replace('db:', '', $tpl_file) ; |
|
78 | - $tpl_file4sql = addslashes($tpl_file) ; |
|
75 | + $edit_mode = 'modify'; |
|
76 | + $tpl_file = $myts->stripSlashesGPC(@$_GET['tpl_file']); |
|
77 | + $tpl_file = str_replace('db:', '', $tpl_file); |
|
78 | + $tpl_file4sql = addslashes($tpl_file); |
|
79 | 79 | |
80 | 80 | // get information from tplfile table |
81 | - $sql = 'SELECT * FROM ' . $db->prefix('tplfile') . ' f NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC" ; |
|
82 | - $tpl = $db->fetchArray($db->query($sql)) ; |
|
81 | + $sql = 'SELECT * FROM '.$db->prefix('tplfile').' f NATURAL LEFT JOIN '.$db->prefix('tplsource')." s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC"; |
|
82 | + $tpl = $db->fetchArray($db->query($sql)); |
|
83 | 83 | |
84 | 84 | // get module info |
85 | 85 | if ($tpl['tpl_module'] == '_custom') { |
86 | - $target_module = null ; |
|
87 | - $target_mname = _MYTPLSADMIN_CUSTOMTEMPLATE ; |
|
86 | + $target_module = null; |
|
87 | + $target_mname = _MYTPLSADMIN_CUSTOMTEMPLATE; |
|
88 | 88 | } else { |
89 | - $module_handler =& xoops_gethandler('module') ; |
|
90 | - $target_module =& $module_handler->getByDirname($tpl['tpl_module']) ; |
|
91 | - $target_mname = is_object($target_module) ? $target_module->getVar('name') : '' ; |
|
89 | + $module_handler = & xoops_gethandler('module'); |
|
90 | + $target_module = & $module_handler->getByDirname($tpl['tpl_module']); |
|
91 | + $target_mname = is_object($target_module) ? $target_module->getVar('name') : ''; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // breadcrumbs |
95 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
95 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
96 | 96 | if ($mydirname != 'altsys' && is_object($target_module)) { |
97 | 97 | // mytplsform in each modules |
98 | - $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname') ; |
|
99 | - $modinfo = $target_module->getInfo() ; |
|
100 | - $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $target_mname) ; |
|
101 | - $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN) ; |
|
98 | + $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname'); |
|
99 | + $modinfo = $target_module->getInfo(); |
|
100 | + $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $target_mname); |
|
101 | + $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN); |
|
102 | 102 | } else { |
103 | 103 | // mytplsform in altsys |
104 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN') ; |
|
105 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.htmlspecialchars($tpl['tpl_module']), $target_mname) ; |
|
104 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
105 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.htmlspecialchars($tpl['tpl_module']), $target_mname); |
|
106 | 106 | } |
107 | - $breadcrumbsObj->appendPath('', _MD_A_MYTPLSFORM_EDIT) ; |
|
107 | + $breadcrumbsObj->appendPath('', _MD_A_MYTPLSFORM_EDIT); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | // error in specifying tpl_file |
111 | 111 | if (empty($tpl)) { |
112 | 112 | if (strncmp($tpl_file, 'file:', 5) === 0) { |
113 | - die('Not DB template') ; |
|
113 | + die('Not DB template'); |
|
114 | 114 | } else { |
115 | - die('Invalid tpl_file.') ; |
|
115 | + die('Invalid tpl_file.'); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | 119 | //****************// |
120 | 120 | // TRANSACT stage // |
121 | 121 | //****************// |
122 | -if (! empty($_POST['do_modifycont']) || ! empty($_POST['do_modify'])) { |
|
122 | +if (!empty($_POST['do_modifycont']) || !empty($_POST['do_modify'])) { |
|
123 | 123 | // Ticket Check |
124 | - if (! $xoopsGTicket->check(true, 'altsys_tplsform')) { |
|
124 | + if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
|
125 | 125 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
126 | 126 | } |
127 | 127 | |
128 | - $result = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='" . addslashes($tpl['tpl_tplset']) . "'") ; |
|
128 | + $result = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='".addslashes($tpl['tpl_tplset'])."'"); |
|
129 | 129 | while (list($tpl_id) = $db->fetchRow($result)) { |
130 | - $sql = 'UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($myts->stripSlashesGPC($_POST['tpl_source'])) . "' WHERE tpl_id=$tpl_id" ; |
|
131 | - if (! $db->query($sql)) { |
|
132 | - die('SQL Error') ; |
|
130 | + $sql = 'UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($myts->stripSlashesGPC($_POST['tpl_source']))."' WHERE tpl_id=$tpl_id"; |
|
131 | + if (!$db->query($sql)) { |
|
132 | + die('SQL Error'); |
|
133 | 133 | } |
134 | - $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id") ; |
|
135 | - altsys_template_touch($tpl_id) ; |
|
134 | + $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id"); |
|
135 | + altsys_template_touch($tpl_id); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | // continue or end ? |
139 | - if (! empty($_POST['do_modifycont'])) { |
|
140 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file='.$tpl_file.'&tpl_tplset='.$tpl_tplset.'&dirname='.$tpl['tpl_module'].'#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED) ; |
|
139 | + if (!empty($_POST['do_modifycont'])) { |
|
140 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file='.$tpl_file.'&tpl_tplset='.$tpl_tplset.'&dirname='.$tpl['tpl_module'].'#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED); |
|
141 | 141 | } else { |
142 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED) ; |
|
142 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED); |
|
143 | 143 | } |
144 | - exit ; |
|
144 | + exit; |
|
145 | 145 | } |
146 | 146 | |
147 | -if (! empty($_POST['do_create'])) { |
|
147 | +if (!empty($_POST['do_create'])) { |
|
148 | 148 | // Ticket Check |
149 | - if (! $xoopsGTicket->check(true, 'altsys_tplsform')) { |
|
149 | + if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
|
150 | 150 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
151 | 151 | } |
152 | 152 | |
153 | - $sql = 'INSERT INTO ' . $db->prefix('tplfile') . " SET tpl_file='" . addslashes($myts->stripSlashesGPC($_POST['tpl_file'])) . "',tpl_refid=0,tpl_module='" . addslashes($tpl['tpl_module']) . "',tpl_tplset='" . addslashes($tpl['tpl_tplset']) . "',tpl_lastmodified=UNIX_TIMESTAMP(),tpl_type='" . addslashes($tpl['tpl_type']) . "'" ; |
|
154 | - if (! $db->query($sql)) { |
|
155 | - die('SQL Error'.__LINE__) ; |
|
153 | + $sql = 'INSERT INTO '.$db->prefix('tplfile')." SET tpl_file='".addslashes($myts->stripSlashesGPC($_POST['tpl_file']))."',tpl_refid=0,tpl_module='".addslashes($tpl['tpl_module'])."',tpl_tplset='".addslashes($tpl['tpl_tplset'])."',tpl_lastmodified=UNIX_TIMESTAMP(),tpl_type='".addslashes($tpl['tpl_type'])."'"; |
|
154 | + if (!$db->query($sql)) { |
|
155 | + die('SQL Error'.__LINE__); |
|
156 | 156 | } |
157 | -<<<<<<< HEAD |
|
157 | +<< << <<< HEAD |
|
158 | 158 | $tpl_id = intval($db->getInsertId()) ; |
159 | 159 | $sql = 'INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id=$tpl_id,tpl_source='" . addslashes($myts->stripSlashesGPC($_POST['tpl_source'])) . "'" ; |
160 | 160 | ======= |
@@ -255,15 +255,4 @@ discard block |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |
@@ -255,15 +255,4 @@ |
||
255 | 255 | // create form |
256 | 256 | echo " |
257 | 257 | <label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
258 | - <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
259 | - <input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ; |
|
260 | -} else { |
|
261 | - // modify form |
|
262 | - echo " |
|
263 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='"._MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
264 | - <input type='submit' name='do_modify' id='do_modify' value='"._MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
265 | - <input type='reset' name='reset' value='"._MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
266 | -</form>\n" ; |
|
267 | -} |
|
268 | - |
|
269 | -xoops_cp_footer() ; |
|
258 | + <input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl[ |
|
270 | 259 | \ No newline at end of file |