@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
5 | 5 | } |
6 | 6 | |
7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
8 | -$mydirpath = dirname(__DIR__) ; |
|
7 | +$mydirname = basename(dirname(__DIR__)); |
|
8 | +$mydirpath = dirname(__DIR__); |
|
9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
10 | -$mytrustdirname = 'altsys' ; |
|
10 | +$mytrustdirname = 'altsys'; |
|
11 | 11 | |
12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onuninstall.php' ; |
|
12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onuninstall.php'; |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
5 | 5 | } |
6 | 6 | |
7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
8 | -$mydirpath = dirname(__DIR__) ; |
|
7 | +$mydirname = basename(dirname(__DIR__)); |
|
8 | +$mydirpath = dirname(__DIR__); |
|
9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
10 | -$mytrustdirname = 'altsys' ; |
|
10 | +$mytrustdirname = 'altsys'; |
|
11 | 11 | |
12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/include/Legacy_AltsysAdminRenderSystem.class.php' ; |
|
12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/include/Legacy_AltsysAdminRenderSystem.class.php'; |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
5 | 5 | } |
6 | 6 | |
7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
8 | -$mydirpath = dirname(__DIR__) ; |
|
7 | +$mydirname = basename(dirname(__DIR__)); |
|
8 | +$mydirpath = dirname(__DIR__); |
|
9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
10 | -$mytrustdirname = 'altsys' ; |
|
10 | +$mytrustdirname = 'altsys'; |
|
11 | 11 | |
12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/preload.php' ; |
|
12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/preload.php'; |
@@ -2,13 +2,13 @@ |
||
2 | 2 | if (!defined('XOOPS_ROOT_PATH')) { |
3 | 3 | exit(); |
4 | 4 | } |
5 | -$root =& XCube_Root::getSingleton(); |
|
5 | +$root = & XCube_Root::getSingleton(); |
|
6 | 6 | //admin page |
7 | 7 | if ($root->mController->_mStrategy) { |
8 | 8 | if (strtolower(get_class($root->mController->_mStrategy)) == strtolower('Legacy_AdminControllerStrategy')) { |
9 | - include_once __DIR__.'/include/altsys_functions.php' ; |
|
9 | + include_once __DIR__.'/include/altsys_functions.php'; |
|
10 | 10 | // language file (modinfo.php) |
11 | - altsys_include_language_file('modinfo') ; |
|
11 | + altsys_include_language_file('modinfo'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | // load altsys newly gticket class for other modules |
@@ -5,56 +5,56 @@ discard block |
||
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 |
||
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(); |
@@ -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 |
@@ -5,9 +5,9 @@ discard block |
||
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 |
||
20 | 20 | 'mytplsform', |
21 | 21 | 'put_templates', |
22 | 22 | 'mylangadmin' |
23 | -) ; |
|
23 | +); |
@@ -1,75 +1,75 @@ discard block |
||
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 |
||
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 |
@@ -1,6 +1,6 @@ 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 MyBlocksAdminForX25 extends MyBlocksAdmin |
6 | 6 | { |
@@ -12,9 +12,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |