Completed
Push — master ( 0881bb...3a6ebc )
by Michael
04:47
created
xoops_trust_path/libs/altsys/myblocksadmin.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,56 +5,56 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-require_once __DIR__.'/include/gtickets.php' ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
11
-include_once __DIR__.'/include/mygrouppermform.php' ;
12
-include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+include_once __DIR__.'/include/altsys_functions.php';
11
+include_once __DIR__.'/include/mygrouppermform.php';
12
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
13 13
 
14 14
 // language file
15
-altsys_include_language_file('myblocksadmin') ;
15
+altsys_include_language_file('myblocksadmin');
16 16
 
17 17
 // fork by core types
18 18
 switch (altsys_get_core_type()) {
19 19
     case ALTSYS_CORE_TYPE_X22 :
20
-        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php' ;
21
-        $myba =& MyBlocksAdminForX22::getInstance() ;
22
-        break ;
20
+        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php';
21
+        $myba = & MyBlocksAdminForX22::getInstance();
22
+        break;
23 23
     case ALTSYS_CORE_TYPE_X25 :
24
-        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php' ;
25
-        $myba =& MyBlocksAdminForX25::getInstance() ;
26
-        break ;
24
+        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php';
25
+        $myba = & MyBlocksAdminForX25::getInstance();
26
+        break;
27 27
     case ALTSYS_CORE_TYPE_XCL21 :
28
-        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php' ;
29
-        $myba =& MyBlocksAdminForXCL21::getInstance() ;
30
-        break ;
28
+        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php';
29
+        $myba = & MyBlocksAdminForXCL21::getInstance();
30
+        break;
31 31
     case ALTSYS_CORE_TYPE_ICMS :
32
-        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php' ;
33
-        $myba =& MyBlocksAdminForICMS::getInstance() ;
34
-        break ;
32
+        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php';
33
+        $myba = & MyBlocksAdminForICMS::getInstance();
34
+        break;
35 35
     case ALTSYS_CORE_TYPE_X20S :
36 36
     case ALTSYS_CORE_TYPE_X23P :
37
-        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php' ;
38
-        $myba =& MyBlocksAdminForX20S::getInstance() ;
39
-        break ;
37
+        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php';
38
+        $myba = & MyBlocksAdminForX20S::getInstance();
39
+        break;
40 40
     default :
41
-        include_once __DIR__.'/class/MyBlocksAdmin.class.php' ;
42
-        $myba =& MyBlocksAdmin::getInstance() ;
43
-        break ;
41
+        include_once __DIR__.'/class/MyBlocksAdmin.class.php';
42
+        $myba = & MyBlocksAdmin::getInstance();
43
+        break;
44 44
 }
45 45
 // permission
46
-$myba->checkPermission() ;
46
+$myba->checkPermission();
47 47
 
48 48
 // set parameters target_mid , target_dirname etc.
49
-$myba->init($xoopsModule) ;
49
+$myba->init($xoopsModule);
50 50
 
51 51
 
52 52
 //
53 53
 // transaction stage
54 54
 //
55 55
 
56
-if (! empty($_POST)) {
57
-    $myba->processPost() ;
56
+if (!empty($_POST)) {
57
+    $myba->processPost();
58 58
 }
59 59
 
60 60
 //
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 //
63 63
 
64 64
 // header
65
-xoops_cp_header() ;
65
+xoops_cp_header();
66 66
 
67 67
 // mymenu
68
-altsys_include_mymenu() ;
68
+altsys_include_mymenu();
69 69
 
70
-$myba->processGet() ;
70
+$myba->processGet();
71 71
 
72 72
 // footer
73
-xoops_cp_footer() ;
73
+xoops_cp_footer();
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mytplsform.php 1 patch
Spacing   +78 added lines, -89 removed lines patch added patch discarded remove patch
@@ -5,36 +5,36 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-include_once __DIR__."/include/gtickets.php" ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
11
-include_once __DIR__."/include/tpls_functions.php" ;
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
 block discarded – undo
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&amp;lib=altsys&amp;page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN') ;
70
-    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;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&amp;lib=altsys&amp;page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN');
70
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;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&amp;lib=altsys&amp;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&amp;lib=altsys&amp;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&amp;lib=altsys&amp;page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN') ;
105
-        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;dirname='.htmlspecialchars($tpl['tpl_module']), $target_mname) ;
104
+        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN');
105
+        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;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
 block discarded – undo
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
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/controllers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 //$langman->read( 'modinfo.php' , 'altsys' , 'altsys' ) ;
6 6
 
7 7
 if (file_exists(__DIR__.'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php')) {
8
-    include_once __DIR__.'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php' ;
8
+    include_once __DIR__.'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php';
9 9
 } elseif (file_exists(__DIR__.'/language/english/modinfo.php')) {
10
-    include_once __DIR__.'/language/english/modinfo.php' ;
10
+    include_once __DIR__.'/language/english/modinfo.php';
11 11
 }
12 12
 
13 13
 $controllers = array(
@@ -20,4 +20,4 @@  discard block
 block discarded – undo
20 20
     'mytplsform',
21 21
     'put_templates',
22 22
     'mylangadmin'
23
-) ;
23
+);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/onupdate.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,75 +1,75 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , "'.$mydirname.'" ) ; } ') ;
3
+eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , "'.$mydirname.'" ) ; } ');
4 4
 
5 5
 
6
-if (! function_exists('altsys_onupdate_base')) {
6
+if (!function_exists('altsys_onupdate_base')) {
7 7
     function altsys_onupdate_base($module, $mydirname)
8 8
     {
9 9
         // transations on module update
10 10
 
11
-    global $msgs ; // TODO :-D
11
+    global $msgs; // TODO :-D
12 12
 
13 13
     // for Cube 2.1
14 14
     if (defined('XOOPS_CUBE_LEGACY')) {
15
-        $root =& XCube_Root::getSingleton();
16
-        $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onupdate') ;
17
-        $msgs = array() ;
15
+        $root = & XCube_Root::getSingleton();
16
+        $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onupdate');
17
+        $msgs = array();
18 18
     } else {
19
-        if (! is_array($msgs)) {
20
-            $msgs = array() ;
19
+        if (!is_array($msgs)) {
20
+            $msgs = array();
21 21
         }
22 22
     }
23 23
 
24
-        $db =& XoopsDatabaseFactory::getDatabaseConnection() ;
25
-        $mid = $module->getVar('mid') ;
24
+        $db = & XoopsDatabaseFactory::getDatabaseConnection();
25
+        $mid = $module->getVar('mid');
26 26
 
27 27
 
28 28
 
29 29
     // TABLES (write here ALTER TABLE etc. if necessary)
30 30
 
31 31
     // configs (Though I know it is not a recommended way...)
32
-    $check_sql = 'SHOW COLUMNS FROM ' . $db->prefix('config') . " LIKE 'conf_title'" ;
32
+    $check_sql = 'SHOW COLUMNS FROM '.$db->prefix('config')." LIKE 'conf_title'";
33 33
         if (($result = $db->query($check_sql)) && ($myrow = $db->fetchArray($result)) && @$myrow['Type'] == 'varchar(30)') {
34
-            $db->queryF('ALTER TABLE ' . $db->prefix('config') . " MODIFY `conf_title` varchar(255) NOT NULL default '', MODIFY `conf_desc` varchar(255) NOT NULL default ''") ;
34
+            $db->queryF('ALTER TABLE '.$db->prefix('config')." MODIFY `conf_title` varchar(255) NOT NULL default '', MODIFY `conf_desc` varchar(255) NOT NULL default ''");
35 35
         }
36 36
 
37 37
     // 0.4 -> 0.5
38
-    $check_sql = 'SELECT COUNT(*) FROM ' . $db->prefix($mydirname . '_language_constants') ;
39
-        if (! $db->query($check_sql)) {
40
-            $db->queryF('CREATE TABLE ' . $db->prefix($mydirname . '_language_constants') . " (mid smallint(5) unsigned NOT NULL default 0,language varchar(32) NOT NULL default '',name varchar(255) NOT NULL default '',value text,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM") ;
38
+    $check_sql = 'SELECT COUNT(*) FROM '.$db->prefix($mydirname.'_language_constants');
39
+        if (!$db->query($check_sql)) {
40
+            $db->queryF('CREATE TABLE '.$db->prefix($mydirname.'_language_constants')." (mid smallint(5) unsigned NOT NULL default 0,language varchar(32) NOT NULL default '',name varchar(255) NOT NULL default '',value text,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM");
41 41
         }
42 42
 
43 43
 
44 44
     // TEMPLATES (all templates have been already removed by modulesadmin)
45
-    $tplfile_handler =& xoops_gethandler('tplfile') ;
46
-        $tpl_path = __DIR__.'/templates' ;
47
-        if ($handler = @opendir($tpl_path . '/')) {
45
+    $tplfile_handler = & xoops_gethandler('tplfile');
46
+        $tpl_path = __DIR__.'/templates';
47
+        if ($handler = @opendir($tpl_path.'/')) {
48 48
             while (($file = readdir($handler)) !== false) {
49 49
                 if (substr($file, 0, 1) == '.') {
50
-                    continue ;
50
+                    continue;
51 51
                 }
52
-                $file_path = $tpl_path . '/' . $file ;
52
+                $file_path = $tpl_path.'/'.$file;
53 53
                 if (is_file($file_path)) {
54 54
                     $mtime = (int)(@filemtime($file_path));
55
-                    $tplfile =& $tplfile_handler->create() ;
56
-                    $tplfile->setVar('tpl_source', file_get_contents($file_path), true) ;
57
-                    $tplfile->setVar('tpl_refid', $mid) ;
58
-                    $tplfile->setVar('tpl_tplset', 'default') ;
59
-                    $tplfile->setVar('tpl_file', $mydirname . '_' . $file) ;
60
-                    $tplfile->setVar('tpl_desc', '', true) ;
61
-                    $tplfile->setVar('tpl_module', $mydirname) ;
62
-                    $tplfile->setVar('tpl_lastmodified', $mtime) ;
63
-                    $tplfile->setVar('tpl_lastimported', 0) ;
64
-                    $tplfile->setVar('tpl_type', 'module') ;
65
-                    if (! $tplfile_handler->insert($tplfile)) {
55
+                    $tplfile = & $tplfile_handler->create();
56
+                    $tplfile->setVar('tpl_source', file_get_contents($file_path), true);
57
+                    $tplfile->setVar('tpl_refid', $mid);
58
+                    $tplfile->setVar('tpl_tplset', 'default');
59
+                    $tplfile->setVar('tpl_file', $mydirname.'_'.$file);
60
+                    $tplfile->setVar('tpl_desc', '', true);
61
+                    $tplfile->setVar('tpl_module', $mydirname);
62
+                    $tplfile->setVar('tpl_lastmodified', $mtime);
63
+                    $tplfile->setVar('tpl_lastimported', 0);
64
+                    $tplfile->setVar('tpl_type', 'module');
65
+                    if (!$tplfile_handler->insert($tplfile)) {
66 66
                         $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> to the database.</span>';
67 67
                     } else {
68
-                        $tplid = $tplfile->getVar('tpl_id') ;
68
+                        $tplid = $tplfile->getVar('tpl_id');
69 69
                         $msgs[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> added to the database. (ID: <b>'.$tplid.'</b>)';
70 70
                     // generate compiled file
71
-                    require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php' ;
72
-                        altsys_clear_templates_c() ;
71
+                    require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php';
72
+                        altsys_clear_templates_c();
73 73
                     /*include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
74 74
                     if( ! xoops_template_touch( $tplid ) ) {
75 75
                         $msgs[] = '<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b>.</span>';
@@ -79,20 +79,20 @@  discard block
 block discarded – undo
79 79
                     }
80 80
                 }
81 81
             }
82
-            closedir($handler) ;
82
+            closedir($handler);
83 83
         }
84
-        include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
85
-        include_once XOOPS_ROOT_PATH.'/class/template.php' ;
86
-        xoops_template_clear_module_cache($mid) ;
84
+        include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
85
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
86
+        xoops_template_clear_module_cache($mid);
87 87
 
88
-        return true ;
88
+        return true;
89 89
     }
90 90
 
91 91
     function altsys_message_append_onupdate(&$module_obj, &$log)
92 92
     {
93 93
         if (is_array(@$GLOBALS['msgs'])) {
94 94
             foreach ($GLOBALS['msgs'] as $message) {
95
-                $log->add(strip_tags($message)) ;
95
+                $log->add(strip_tags($message));
96 96
             }
97 97
         }
98 98
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/MyBlocksAdmin.class.php' ;
3
+require_once __DIR__.'/MyBlocksAdmin.class.php';
4 4
 
5 5
 class MyBlocksAdminForX25 extends MyBlocksAdmin
6 6
 {
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function construct()
14 14
     {
15
-        parent::construct() ;
15
+        parent::construct();
16 16
 
17
-        @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php' ;
17
+        @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php';
18 18
     }
19 19
 
20 20
 //HACK by domifara for php5.3+
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     static $instance;
25 25
     if (!isset($instance)) {
26 26
         $instance = new MyBlocksAdminForX25();
27
-        $instance->construct() ;
27
+        $instance->construct();
28 28
     }
29 29
     return $instance;
30 30
 }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $sseln = $ssel0 = $ssel1 = $ssel3 = $ssel4 = $ssel5 = $ssel7 = $ssel8 = $ssel9 = '';
41 41
     $scoln = $scol0 = $scol1 = $scol3 = $scol4 = $scol5 = $scol7 = $scol8 = $scol9 = 'unselected';
42 42
     $stextbox = 'unselected';
43
-    $value4extra_side = '' ;
43
+    $value4extra_side = '';
44 44
 
45 45
     if ($visible != 1) {
46 46
         $sseln = " checked='checked'";
@@ -50,39 +50,39 @@  discard block
 block discarded – undo
50 50
         case XOOPS_SIDEBLOCK_LEFT :
51 51
             $ssel0 = " checked='checked'";
52 52
             $scol0 = 'selected';
53
-            break ;
53
+            break;
54 54
         case XOOPS_SIDEBLOCK_RIGHT :
55 55
             $ssel1 = " checked='checked'";
56 56
             $scol1 = 'selected';
57
-            break ;
57
+            break;
58 58
         case XOOPS_CENTERBLOCK_LEFT :
59 59
             $ssel3 = " checked='checked'";
60 60
             $scol3 = 'selected';
61
-            break ;
61
+            break;
62 62
         case XOOPS_CENTERBLOCK_RIGHT :
63 63
             $ssel4 = " checked='checked'";
64 64
             $scol4 = 'selected';
65
-            break ;
65
+            break;
66 66
         case XOOPS_CENTERBLOCK_CENTER :
67 67
             $ssel5 = " checked='checked'";
68 68
             $scol5 = 'selected';
69
-            break ;
69
+            break;
70 70
         case XOOPS_CENTERBLOCK_BOTTOMLEFT :
71 71
             $ssel7 = " checked='checked'";
72 72
             $scol7 = 'selected';
73
-            break ;
73
+            break;
74 74
         case XOOPS_CENTERBLOCK_BOTTOMRIGHT :
75 75
             $ssel8 = " checked='checked'";
76 76
             $scol8 = 'selected';
77
-            break ;
77
+            break;
78 78
         case XOOPS_CENTERBLOCK_BOTTOM :
79 79
             $ssel9 = " checked='checked'";
80 80
             $scol9 = 'selected';
81
-            break ;
81
+            break;
82 82
         default :
83
-            $value4extra_side = $side ;
83
+            $value4extra_side = $side;
84 84
             $stextbox = 'selected';
85
-            break ;
85
+            break;
86 86
     }
87 87
     }
88 88
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 				<div class='blockposition $scoln'>
144 144
 					<input type='radio' name='sides[$bid]' value='-1' class='blockposition' $sseln onclick='document.getElementById(\"extra_side_$bid\").value=-1;' />
145 145
 				</div>
146
-                <div style='float:"._GLOBAL_LEFT.";'>"._NONE . '</div>
146
+                <div style='float:"._GLOBAL_LEFT.";'>"._NONE.'</div>
147 147
 			</td>
148 148
 		</tr>
149 149
 	</table>
@@ -155,53 +155,53 @@  discard block
 block discarded – undo
155 155
         $bid = (int)$bid;
156 156
 
157 157
 //HACK by domifara
158
-    $block = new XoopsBlock($bid) ;
158
+    $block = new XoopsBlock($bid);
159 159
 
160
-        if (! $block->getVar('bid')) {
160
+        if (!$block->getVar('bid')) {
161 161
             // new defaults
162
-        $bid = 0 ;
163
-            $mode = 'new' ;
164
-            $block->setVar('mid', 0) ;
165
-            $block->setVar('block_type', 'C') ;
162
+        $bid = 0;
163
+            $mode = 'new';
164
+            $block->setVar('mid', 0);
165
+            $block->setVar('block_type', 'C');
166 166
         }
167 167
 
168 168
         switch ($mode) {
169 169
         case 'clone' :
170
-            $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM ;
171
-            $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE ;
172
-            $next_op = 'clone_ok' ;
170
+            $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM;
171
+            $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE;
172
+            $next_op = 'clone_ok';
173 173
             // breadcrumbs
174
-            $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
175
-            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM) ;
176
-            break ;
174
+            $breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
175
+            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM);
176
+            break;
177 177
         case 'new' :
178
-            $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM ;
179
-            $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW ;
180
-            $next_op = 'new_ok' ;
178
+            $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM;
179
+            $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW;
180
+            $next_op = 'new_ok';
181 181
             // breadcrumbs
182
-            $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
183
-            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM) ;
184
-            break ;
182
+            $breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
183
+            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM);
184
+            break;
185 185
         case 'edit' :
186 186
         default :
187
-            $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM ;
188
-            $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT ;
189
-            $next_op = 'edit_ok' ;
187
+            $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM;
188
+            $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT;
189
+            $next_op = 'edit_ok';
190 190
             // breadcrumbs
191
-            $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
192
-            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM) ;
193
-            break ;
191
+            $breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
192
+            $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM);
193
+            break;
194 194
     }
195 195
 
196
-        $is_custom = in_array($block->getVar('block_type'), array( 'C', 'E' )) ? true : false ;
197
-        $block_template =& $block->getVar('template', 'n') ;
198
-        $block_template_tplset = '' ;
196
+        $is_custom = in_array($block->getVar('block_type'), array('C', 'E')) ? true : false;
197
+        $block_template = & $block->getVar('template', 'n');
198
+        $block_template_tplset = '';
199 199
 
200
-        if (! $is_custom && $block_template) {
200
+        if (!$is_custom && $block_template) {
201 201
             // find template of the block
202
-        $tplfile_handler =& xoops_gethandler('tplfile');
203
-            $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template) ;
204
-            $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default' ;
202
+        $tplfile_handler = & xoops_gethandler('tplfile');
203
+            $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template);
204
+            $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default';
205 205
         }
206 206
 //HACK by domifara
207 207
 /*
@@ -210,41 +210,41 @@  discard block
 block discarded – undo
210 210
     }
211 211
 */
212 212
     $block_data = $this->preview_request + array(
213
-        'bid' => $bid ,
214
-        'name' => $block->getVar('name', 'n') ,
215
-        'title' => $block->getVar('title', 'n') ,
213
+        'bid' => $bid,
214
+        'name' => $block->getVar('name', 'n'),
215
+        'title' => $block->getVar('title', 'n'),
216 216
             'weight' => (int)$block->getVar('weight'),
217 217
             'bcachetime' => (int)$block->getVar('bcachetime'),
218 218
             'side' => (int)$block->getVar('side'),
219 219
             'visible' => (int)$block->getVar('visible'),
220
-        'template' => $block_template ,
221
-        'template_tplset' => $block_template_tplset ,
222
-        'options' => $block->getVar('options') ,
223
-        'content' => $block->getVar('content', 'n') ,
224
-        'is_custom' => $is_custom ,
225
-        'type' => $block->getVar('block_type') ,
220
+        'template' => $block_template,
221
+        'template_tplset' => $block_template_tplset,
222
+        'options' => $block->getVar('options'),
223
+        'content' => $block->getVar('content', 'n'),
224
+        'is_custom' => $is_custom,
225
+        'type' => $block->getVar('block_type'),
226 226
         'ctype' => $block->getVar('c_type')
227
-    ) ;
227
+    );
228 228
 
229 229
         $block4assign = array(
230
-        'name_raw' => $block_data['name'] ,
231
-        'title_raw' => $block_data['title'] ,
232
-        'content_raw' => $block_data['content'] ,
233
-        'cell_position' => $this->renderCell4BlockPosition($block_data) ,
234
-        'cell_module_link' => $this->renderCell4BlockModuleLink($block_data) ,
235
-        'cell_group_perm' =>  $this->renderCell4BlockReadGroupPerm($block_data) ,
236
-        'cell_options' => $this->renderCell4BlockOptions($block_data) ,
230
+        'name_raw' => $block_data['name'],
231
+        'title_raw' => $block_data['title'],
232
+        'content_raw' => $block_data['content'],
233
+        'cell_position' => $this->renderCell4BlockPosition($block_data),
234
+        'cell_module_link' => $this->renderCell4BlockModuleLink($block_data),
235
+        'cell_group_perm' =>  $this->renderCell4BlockReadGroupPerm($block_data),
236
+        'cell_options' => $this->renderCell4BlockOptions($block_data),
237 237
         'content_preview' => $this->previewContent($block_data)
238
-    ) + $block_data ;
238
+    ) + $block_data;
239 239
 
240 240
     // display
241
-    require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
242
-        $tpl = new D3Tpl() ;
241
+    require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
242
+        $tpl = new D3Tpl();
243 243
 //dhtml
244 244
     include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
245 245
 
246
-        if ($block_data['ctype']=='H' || empty($block_data['ctype'])) {
247
-            $editor_configs=array();
246
+        if ($block_data['ctype'] == 'H' || empty($block_data['ctype'])) {
247
+            $editor_configs = array();
248 248
             $editor_configs['name']   = 'content_block';
249 249
             $editor_configs['value']  = $block_data['content'];
250 250
             $editor_configs['rows']   = 20;
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
             $editor_configs['editor'] = xoops_getModuleOption('blocks_editor', 'system');
255 255
             $form                     = new XoopsFormEditor('', 'textarea_content', $editor_configs);
256 256
             $rendered = $form->render();
257
-            $tpl->assign('altsys_x25_dhtmltextarea', $rendered) ;
257
+            $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
258 258
         } else {
259 259
             $form = new XoopsFormDhtmlTextArea('', 'textarea_content', $block_data['content'], 80, 20);
260 260
             $rendered = $form->render();
261
-            $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">'.str_replace(array( '<textarea', '</textarea><br />' ), array( '</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">' ), $rendered) . '</div>' ;
262
-            $tpl->assign('altsys_x25_dhtmltextarea', $rendered) ;
261
+            $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">'.str_replace(array('<textarea', '</textarea><br />'), array('</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'), $rendered).'</div>';
262
+            $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
263 263
         }
264 264
 
265 265
         $tpl->assign(array(
@@ -274,91 +274,91 @@  discard block
 block discarded – undo
274 274
         'submit_button' => $button_value,
275 275
         'common_fck_installed' => file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'),
276 276
         'gticket_hidden' => $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'myblocksadmin')
277
-    )) ;
277
+    ));
278 278
 //HACK by domifara
279
-    $tpl->display('db:altsys_main_myblocksadmin_edit_4x25.html') ;
279
+    $tpl->display('db:altsys_main_myblocksadmin_edit_4x25.html');
280 280
 
281
-        return ;
281
+        return;
282 282
     }
283 283
     public function fetchRequest4Block($bid)
284 284
     {
285 285
         $bid = (int)$bid;
286
-        (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
286
+        (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance();
287 287
 
288 288
         if (@$_POST['extra_sides'][$bid] > 0) {
289 289
             $_POST['sides'][$bid] = (int)$_POST['extra_sides'][$bid];
290 290
         }
291 291
 
292 292
         if (@$_POST['sides'][$bid] < 0) {
293
-            $visible = 0 ;
294
-            $_POST['sides'][$bid] = -1 ;
293
+            $visible = 0;
294
+            $_POST['sides'][$bid] = -1;
295 295
         } else {
296
-            $visible = 1 ;
296
+            $visible = 1;
297 297
         }
298 298
 
299 299
         return array(
300
-        'bid' => $bid ,
300
+        'bid' => $bid,
301 301
             'side' => (int)(@$_POST['sides'][$bid]),
302 302
             'weight' => (int)(@$_POST['weights'][$bid]),
303
-        'visible' => $visible ,
304
-        'title' => $myts->stripSlashesGPC(@$_POST['titles'][$bid]) ,
305
-        'content' => $myts->stripSlashesGPC(@$_POST['textarea_content']) ,
306
-        'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]) ,
303
+        'visible' => $visible,
304
+        'title' => $myts->stripSlashesGPC(@$_POST['titles'][$bid]),
305
+        'content' => $myts->stripSlashesGPC(@$_POST['textarea_content']),
306
+        'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]),
307 307
             'bcachetime' => (int)(@$_POST['bcachetimes'][$bid]),
308
-        'bmodule' => is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : array( 0 ) ,
309
-        'bgroup' => is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : array() ,
308
+        'bmodule' => is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : array(0),
309
+        'bgroup' => is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : array(),
310 310
         'options' => is_array(@$_POST['options'][$bid]) ? $_POST['options'][$bid] : array()
311
-    ) ;
311
+    );
312 312
     }
313 313
 
314 314
     public function previewContent($block_data)
315 315
     {
316 316
         $bid = (int)$block_data['bid'];
317 317
 
318
-        if (! $block_data['is_custom']) {
319
-            return '' ;
318
+        if (!$block_data['is_custom']) {
319
+            return '';
320 320
         }
321 321
         if (empty($this->preview_request)) {
322
-            return '' ;
322
+            return '';
323 323
         }
324 324
 
325 325
 //HACK by domifara
326 326
 //TODO : need no hook block at this
327
-    $block = new XoopsBlock($bid) ;
327
+    $block = new XoopsBlock($bid);
328 328
 
329 329
         if ($block->getVar('mid')) {
330
-            return '' ;
330
+            return '';
331 331
         }
332 332
 
333
-        $block->setVar('title', $block_data['title']) ;
334
-        $block->setVar('content', $block_data['content']) ;
333
+        $block->setVar('title', $block_data['title']);
334
+        $block->setVar('content', $block_data['content']);
335 335
 
336
-        restore_error_handler() ;
337
-        $original_level = error_reporting(E_ALL) ;
336
+        restore_error_handler();
337
+        $original_level = error_reporting(E_ALL);
338 338
 
339 339
 //	$ret = $block->getContent( 'S' , $block_data['ctype'] ) ;
340 340
 
341 341
     $c_type = $block_data['ctype'];
342 342
         if ($c_type == 'H') {
343
-            $ret = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
343
+            $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N'));
344 344
         } elseif ($c_type == 'P') {
345 345
             ob_start();
346 346
             echo eval($block->getVar('content', 'N'));
347 347
             $content = ob_get_contents();
348 348
             ob_end_clean();
349
-            $ret = str_replace('{X_SITEURL}', XOOPS_URL . '/', $content);
349
+            $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $content);
350 350
         } elseif ($c_type == 'S') {
351
-            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
352
-            $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
351
+            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance();
352
+            $content = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N'));
353 353
             $ret = $myts->displayTarea($content, 1, 1);
354 354
         } else {
355
-            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
356
-            $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
355
+            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance();
356
+            $content = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N'));
357 357
             $ret = $myts->displayTarea($content, 1, 0);
358 358
         }
359 359
 
360
-        error_reporting($original_level) ;
360
+        error_reporting($original_level);
361 361
 
362
-        return $ret ;
362
+        return $ret;
363 363
     }
364 364
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/MyBlocksAdminForX20S.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/MyBlocksAdmin.class.php' ;
3
+require_once __DIR__.'/MyBlocksAdmin.class.php';
4 4
 
5 5
 class MyBlocksAdminForX20S extends MyBlocksAdmin
6 6
 {
7 7
 
8
-    public $block_positions = array() ;
8
+    public $block_positions = array();
9 9
 
10 10
     public function MyBlocksAadminForX20S()
11 11
     {
@@ -14,20 +14,20 @@  discard block
 block discarded – undo
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' ;
19
+        @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php';
20 20
         $this->block_positions = array(
21
-        -1 => _NONE ,
22
-        0 => _AM_SBLEFT ,
23
-        1 => _AM_SBRIGHT ,
24
-        3 => _AM_CBLEFT ,
25
-        4 => _AM_CBRIGHT ,
26
-        5 => _AM_CBCENTER ,
27
-        7 => _AM_CBBOTTOMLEFT ,
28
-        8 => _AM_CBBOTTOMRIGHT ,
21
+        -1 => _NONE,
22
+        0 => _AM_SBLEFT,
23
+        1 => _AM_SBRIGHT,
24
+        3 => _AM_CBLEFT,
25
+        4 => _AM_CBRIGHT,
26
+        5 => _AM_CBCENTER,
27
+        7 => _AM_CBBOTTOMLEFT,
28
+        8 => _AM_CBBOTTOMRIGHT,
29 29
         9 => _AM_CBBOTTOM
30
-    ) ;
30
+    );
31 31
     }
32 32
 
33 33
 //HACK by domifara for php5.3+
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     static $instance;
38 38
     if (!isset($instance)) {
39 39
         $instance = new MyBlocksAdminForX20S();
40
-        $instance->construct() ;
40
+        $instance->construct();
41 41
     }
42 42
     return $instance;
43 43
 }
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
     return "
51 51
 	<table style='width:80px;'>
52 52
 		<tr>
53
-            <td rowspan='2'>".$this->renderRadio4BlockPosition(0, $block_data) . '</td>
54
-            <td>' . $this->renderRadio4BlockPosition(3, $block_data) . '</td>
55
-            <td>' . $this->renderRadio4BlockPosition(5, $block_data) . '</td>
56
-            <td>' . $this->renderRadio4BlockPosition(4, $block_data) . "</td>
57
-            <td rowspan='2'>".$this->renderRadio4BlockPosition(1, $block_data) . '</td>
53
+            <td rowspan='2'>".$this->renderRadio4BlockPosition(0, $block_data).'</td>
54
+            <td>' . $this->renderRadio4BlockPosition(3, $block_data).'</td>
55
+            <td>' . $this->renderRadio4BlockPosition(5, $block_data).'</td>
56
+            <td>' . $this->renderRadio4BlockPosition(4, $block_data)."</td>
57
+            <td rowspan='2'>".$this->renderRadio4BlockPosition(1, $block_data).'</td>
58 58
 		</tr>
59 59
 		<tr>
60
-            <td>' . $this->renderRadio4BlockPosition(7, $block_data) . '</td>
61
-            <td>' . $this->renderRadio4BlockPosition(9, $block_data) . '</td>
62
-            <td>' . $this->renderRadio4BlockPosition(8, $block_data) . "</td>
60
+            <td>' . $this->renderRadio4BlockPosition(7, $block_data).'</td>
61
+            <td>' . $this->renderRadio4BlockPosition(9, $block_data).'</td>
62
+            <td>' . $this->renderRadio4BlockPosition(8, $block_data)."</td>
63 63
 		</tr>
64 64
 		<tr>
65
-            <td colspan='5'>".$this->renderRadio4BlockPosition(-1, $block_data)._NONE . '</td>
65
+            <td colspan='5'>".$this->renderRadio4BlockPosition(-1, $block_data)._NONE.'</td>
66 66
 		</tr>
67 67
     </table>';
68 68
 }
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 {
74 74
     $bid = (int)$block_data['bid'];
75 75
     $visible = (int)$block_data['visible'];
76
-    $current_side = $visible ? (int)$block_data['side'] : -1 ;
76
+    $current_side = $visible ? (int)$block_data['side'] : -1;
77 77
 
78
-    $label4disp = htmlspecialchars($this->block_positions[ $target_side ], ENT_QUOTES) ;
78
+    $label4disp = htmlspecialchars($this->block_positions[$target_side], ENT_QUOTES);
79 79
 
80 80
     if ($current_side == $target_side) {
81
-        $checked = "checked='checked'" ;
81
+        $checked = "checked='checked'";
82 82
         $divstyle = $target_side == -1 ? 'disabled' : 'selected';
83 83
     } else {
84 84
         $checked = '';
85 85
         $divstyle = 'unselected';
86 86
     }
87 87
 
88
-    return "<div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' value='$target_side' class='blockposition' $checked /></div>" ;
88
+    return "<div class='blockposition $divstyle' title='$label4disp'><input type='radio' name='sides[$bid]' value='$target_side' class='blockposition' $checked /></div>";
89 89
 }
90 90
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/MyBlocksAdminForICMS.class.php 1 patch
Spacing   +36 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/altsysUtils.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
     {
6 6
         $names = array();
7 7
         
8
-        if (! class_exists('XCube_Delegate')) {
8
+        if (!class_exists('XCube_Delegate')) {
9 9
             return $names;
10 10
         }
11 11
         
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
                 foreach (array_keys($callbacks) as $priority) {
24 24
                     foreach (array_keys($callbacks[$priority]) as $idx) {
25 25
                         $callback = $callbacks[$priority][$idx][0];
26
-                        $_name = (is_array($callback))? ((is_object($callback[0]))? get_class($callback[0]) : $callback[0]) : $callback;
26
+                        $_name = (is_array($callback)) ? ((is_object($callback[0])) ? get_class($callback[0]) : $callback[0]) : $callback;
27 27
                         $names[$priority] = $_name;
28 28
                     }
29 29
                 }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             return htmlspecialchars($str, $flags, $encoding, $double_encode);
61 61
         } else {
62 62
             $ret = htmlspecialchars($str, $flags, $encoding);
63
-            if (! $double_encode) {
63
+            if (!$double_encode) {
64 64
                 $ret = str_replace('&amp;amp;', '&amp;', $ret);
65 65
             }
66 66
             return $ret;
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 // notification handler for D3 modules
4 4
 
5
-require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
5
+require_once XOOPS_ROOT_PATH.'/include/notification_functions.php';
6 6
 
7 7
 class D3NotificationHandler
8 8
 {
@@ -10,68 +10,68 @@  discard block
 block discarded – undo
10 10
 //function &getInstance( $conn = null )
11 11
 public static function &getInstance($conn = null)
12 12
 {
13
-    static $instance ;
14
-    if (! isset($instance)) {
15
-        $instance = new D3NotificationHandler() ;
13
+    static $instance;
14
+    if (!isset($instance)) {
15
+        $instance = new D3NotificationHandler();
16 16
     }
17
-    return $instance ;
17
+    return $instance;
18 18
 }
19 19
 
20 20
 
21 21
     public function getMailTemplateDir($mydirname, $mytrustdirname = '')
22 22
     {
23
-        global $xoopsConfig ;
23
+        global $xoopsConfig;
24 24
 
25
-        $mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname ;
26
-        $mytrustdirpath = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname ;
27
-        $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'] ;
25
+        $mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname;
26
+        $mytrustdirpath = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname;
27
+        $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'];
28 28
 
29 29
         $search_paths = array(
30
-        "$mydirpath/language/$language/mail_template/" ,
31
-        "$mytrustdirpath/language/$language/mail_template/" ,
32
-        "$mydirpath/language/english/mail_template/" ,
30
+        "$mydirpath/language/$language/mail_template/",
31
+        "$mytrustdirpath/language/$language/mail_template/",
32
+        "$mydirpath/language/english/mail_template/",
33 33
         "$mytrustdirpath/language/english/mail_template/"
34
-    ) ;
34
+    );
35 35
 
36
-        $mail_template_dir = "$mytrustdirpath/language/english/mail_template/" ;
36
+        $mail_template_dir = "$mytrustdirpath/language/english/mail_template/";
37 37
         foreach ($search_paths as $path) {
38 38
             if (file_exists($path)) {
39
-                $mail_template_dir = $path ;
40
-                break ;
39
+                $mail_template_dir = $path;
40
+                break;
41 41
             }
42 42
         }
43 43
 
44
-        return $mail_template_dir ;
44
+        return $mail_template_dir;
45 45
     }
46 46
 
47 47
 
48
-    public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null)
48
+    public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, $extra_tags = array(), $user_list = array(), $omit_user_id = null)
49 49
     {
50
-        $module_hanlder =& xoops_gethandler('module') ;
51
-        $module =& $module_hanlder->getByDirname($mydirname) ;
50
+        $module_hanlder = & xoops_gethandler('module');
51
+        $module = & $module_hanlder->getByDirname($mydirname);
52 52
 
53
-        $notification_handler =& xoops_gethandler('notification') ;
54
-        $mail_template_dir = $this->getMailTemplateDir($mydirname, $mytrustdirname) ;
53
+        $notification_handler = & xoops_gethandler('notification');
54
+        $mail_template_dir = $this->getMailTemplateDir($mydirname, $mytrustdirname);
55 55
 
56 56
     // calling a delegate before
57 57
     if (class_exists('XCube_DelegateUtils')) {
58
-        $force_return = false ;
59
-        XCube_DelegateUtils::raiseEvent('D3NotificationHandler.Trigger', new XCube_Ref($category), new XCube_Ref($event), new XCube_Ref($item_id), new XCube_Ref($extra_tags), new XCube_Ref($module), new XCube_Ref($user_list), new XCube_Ref($omit_user_id), $module->getInfo('notification'), new XCube_Ref($force_return), new XCube_Ref($mail_template_dir), $mydirname, $mytrustdirname) ;
58
+        $force_return = false;
59
+        XCube_DelegateUtils::raiseEvent('D3NotificationHandler.Trigger', new XCube_Ref($category), new XCube_Ref($event), new XCube_Ref($item_id), new XCube_Ref($extra_tags), new XCube_Ref($module), new XCube_Ref($user_list), new XCube_Ref($omit_user_id), $module->getInfo('notification'), new XCube_Ref($force_return), new XCube_Ref($mail_template_dir), $mydirname, $mytrustdirname);
60 60
         if ($force_return) {
61
-            return ;
61
+            return;
62 62
         }
63 63
     }
64 64
 
65
-        $mid = $module->getVar('mid') ;
65
+        $mid = $module->getVar('mid');
66 66
 
67 67
     // Check if event is enabled
68
-    $config_handler =& xoops_gethandler('config');
69
-        $mod_config =& $config_handler->getConfigsByCat(0, $mid);
68
+    $config_handler = & xoops_gethandler('config');
69
+        $mod_config = & $config_handler->getConfigsByCat(0, $mid);
70 70
         if (empty($mod_config['notification_enabled'])) {
71 71
             return false;
72 72
         }
73
-        $category_info =& notificationCategoryInfo($category, $mid);
74
-        $event_info =& notificationEventInfo($category, $event, $mid);
73
+        $category_info = & notificationCategoryInfo($category, $mid);
74
+        $event_info = & notificationEventInfo($category, $event, $mid);
75 75
         if (!in_array(notificationGenerateConfig($category_info, $event_info, 'option_name'), $mod_config['notification_events']) && empty($event_info['invisible'])) {
76 76
             return false;
77 77
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $mode_criteria->add(new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE), 'OR');
95 95
         $mode_criteria->add(new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT), 'OR');
96 96
         $criteria->add($mode_criteria);
97
-        $notifications =& $notification_handler->getObjects($criteria);
97
+        $notifications = & $notification_handler->getObjects($criteria);
98 98
         if (empty($notifications)) {
99 99
             return;
100 100
         }
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
     $tags = array();
104 104
     // {X_ITEM_NAME} {X_ITEM_URL} {X_ITEM_TYPE} from lookup_func are disabled
105 105
     $tags['X_MODULE'] = $module->getVar('name', 'n');
106
-        $tags['X_MODULE_URL'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/';
106
+        $tags['X_MODULE_URL'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/';
107 107
         $tags['X_NOTIFY_CATEGORY'] = $category;
108 108
         $tags['X_NOTIFY_EVENT'] = $event;
109 109
 
110
-        $template = $event_info['mail_template'] . '.tpl';
110
+        $template = $event_info['mail_template'].'.tpl';
111 111
         $subject = $event_info['mail_subject'];
112 112
 
113 113
         if ($user_list) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 // user-specific tags
122 122
             //$tags['X_UNSUBSCRIBE_URL'] = 'TODO';
123 123
             // TODO: don't show unsubscribe link if it is 'one-time' ??
124
-            $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL . '/notifications.php';
124
+            $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL.'/notifications.php';
125 125
                 $tags = array_merge($tags, $extra_tags);
126 126
 
127 127
                 $notification->notifyUser($mail_template_dir, $template, $subject, $tags);
Please login to merge, or discard this patch.