Completed
Push — master ( 3a6ebc...3a5a05 )
by Michael
04:13
created
xoops_trust_path/libs/altsys/language/french/mypreferences.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('_MD_A_MYPREFERENCES_FORMTITLE', 'Préférences Modules') ;
4
-define('_MD_A_MYPREFERENCES_UPDATED', 'Mise à jour avec succès des préférences') ;
3
+define('_MD_A_MYPREFERENCES_FORMTITLE', 'Préférences Modules');
4
+define('_MD_A_MYPREFERENCES_UPDATED', 'Mise à jour avec succès des préférences');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/language/french/blocks_each.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (defined('FOR_XOOPS_LANG_CHECKER')) {
4
-    $mydirname = 'd3forum' ;
4
+    $mydirname = 'd3forum';
5 5
 }
6
-$constpref = '_MB_' . strtoupper($mydirname) ;
6
+$constpref = '_MB_'.strtoupper($mydirname);
7 7
 
8
-if (defined('FOR_XOOPS_LANG_CHECKER') || ! defined($constpref.'_LOADED')) {
9
-    define($constpref.'_LOADED', 1) ;
8
+if (defined('FOR_XOOPS_LANG_CHECKER') || !defined($constpref.'_LOADED')) {
9
+    define($constpref.'_LOADED', 1);
10 10
 
11 11
 // definitions for displaying blocks 
12 12
 // Since altsys is a singleton moudle, this file has non-sense.
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/language/french/mylangadmin.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('_MYLANGADMIN_H3_MODULE', 'Module cible') ;
4
-define('_MYLANGADMIN_CACHEUPDATED', 'Le fichier de cache a été mis à jour') ;
5
-define('_MYLANGADMIN_BTN_UPDATE', 'Mise à jour') ;
6
-define('_MYLANGADMIN_BTN_RESET', 'réinitialiser') ;
3
+define('_MYLANGADMIN_H3_MODULE', 'Module cible');
4
+define('_MYLANGADMIN_CACHEUPDATED', 'Le fichier de cache a été mis à jour');
5
+define('_MYLANGADMIN_BTN_UPDATE', 'Mise à jour');
6
+define('_MYLANGADMIN_BTN_RESET', 'réinitialiser');
7 7
 
8
-define('_MYLANGADMIN_TH_CONSTANTNAME', 'Nom de la Constante') ;
9
-define('_MYLANGADMIN_TH_DEFAULTVALUE', 'Valeur par défaut') ;
10
-define('_MYLANGADMIN_TH_USERVALUE', 'Valeur de Utilisateur') ;
8
+define('_MYLANGADMIN_TH_CONSTANTNAME', 'Nom de la Constante');
9
+define('_MYLANGADMIN_TH_DEFAULTVALUE', 'Valeur par défaut');
10
+define('_MYLANGADMIN_TH_USERVALUE', 'Valeur de Utilisateur');
11 11
 
12
-define('_MYLANGADMIN_NOTE_ADDEDBYMYLANG', '(constante ajoutée par utilisateur)') ;
13
-define('_MYLANGADMIN_DT_MYLANGFILENAME', 'Reécriture partielle du nom de fichier') ;
12
+define('_MYLANGADMIN_NOTE_ADDEDBYMYLANG', '(constante ajoutée par utilisateur)');
13
+define('_MYLANGADMIN_DT_MYLANGFILENAME', 'Reécriture partielle du nom de fichier');
14 14
 
15
-define('_MYLANGADMIN_DT_CACHEFILENAME', 'Nom du fichier en Cache') ;
16
-define('_MYLANGADMIN_DT_CACHESTATUS', 'Mise en Cache du statut') ;
17
-define('_MYLANGADMIN_CREATED', 'Créé') ;
18
-define('_MYLANGADMIN_NOTCREATED', 'N\'a pas été créé pour l\'instant') ;
15
+define('_MYLANGADMIN_DT_CACHEFILENAME', 'Nom du fichier en Cache');
16
+define('_MYLANGADMIN_DT_CACHESTATUS', 'Mise en Cache du statut');
17
+define('_MYLANGADMIN_CREATED', 'Créé');
18
+define('_MYLANGADMIN_NOTCREATED', 'N\'a pas été créé pour l\'instant');
19 19
 
20
-define('_MYLANGADMIN_ERR_MODNOLANGUAGE', 'Le module sélectionné n\'a pas de dossier de la langue') ;
21
-define('_MYLANGADMIN_ERR_MODLANGINCOMPATIBLE', 'Le module sélectionné a une structure incompatible') ;
22
-define('_MYLANGADMIN_ERR_MODEMPTYLANGDIR', 'Le module sélectionné n\'a pas de fichier langue de reécriture') ;
20
+define('_MYLANGADMIN_ERR_MODNOLANGUAGE', 'Le module sélectionné n\'a pas de dossier de la langue');
21
+define('_MYLANGADMIN_ERR_MODLANGINCOMPATIBLE', 'Le module sélectionné a une structure incompatible');
22
+define('_MYLANGADMIN_ERR_MODEMPTYLANGDIR', 'Le module sélectionné n\'a pas de fichier langue de reécriture');
23 23
 
24
-define('_MYLANGADMIN_MSG_D3LANGMANENABLED', 'Le système de reécriture est activé dès maintenant.') ;
25
-define('_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL', 'Le système de reécriture est désormais désactivé. Pour l\'activer, copiez "%s" dans "%s"') ;
26
-define('_MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2', 'Le système de reécriture ne peut pas fonctionner avec ce noyau de XOOPS, sauf quelques modules D3. Si vous souhaitez l\'activer avec ce noyau, essayez de modifier comme ceci:') ;
27
-define('_MYLANGADMIN_MSG_NOTICE4ALREADYREAD', 'Puisque ce fichier a déjà été lu par le système, cette colonne représente la valeur actuelle') ;
24
+define('_MYLANGADMIN_MSG_D3LANGMANENABLED', 'Le système de reécriture est activé dès maintenant.');
25
+define('_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL', 'Le système de reécriture est désormais désactivé. Pour l\'activer, copiez "%s" dans "%s"');
26
+define('_MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2', 'Le système de reécriture ne peut pas fonctionner avec ce noyau de XOOPS, sauf quelques modules D3. Si vous souhaitez l\'activer avec ce noyau, essayez de modifier comme ceci:');
27
+define('_MYLANGADMIN_MSG_NOTICE4ALREADYREAD', 'Puisque ce fichier a déjà été lu par le système, cette colonne représente la valeur actuelle');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/language/french/compilehookadmin.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('_TPLSADMIN_FMT_MSG_ENCLOSEBYCOMMENT', '%d template caches have been enclosed by tplsadmin comments') ;
4
-define('_TPLSADMIN_DT_ENCLOSEBYCOMMENT', 'Implant comments') ;
5
-define('_TPLSADMIN_DD_ENCLOSEBYCOMMENT', 'Two HTML comments will be implanted in the begging/ending point of each templates. Since this rarely breaks its design, it is recommended to professionals can read HTML itself') ;
6
-define('_TPLSADMIN_CNF_ENCLOSEBYCOMMENT', 'Compiled template caches will be enclosed by tplsadmin comments. Are you OK?') ;
3
+define('_TPLSADMIN_FMT_MSG_ENCLOSEBYCOMMENT', '%d template caches have been enclosed by tplsadmin comments');
4
+define('_TPLSADMIN_DT_ENCLOSEBYCOMMENT', 'Implant comments');
5
+define('_TPLSADMIN_DD_ENCLOSEBYCOMMENT', 'Two HTML comments will be implanted in the begging/ending point of each templates. Since this rarely breaks its design, it is recommended to professionals can read HTML itself');
6
+define('_TPLSADMIN_CNF_ENCLOSEBYCOMMENT', 'Compiled template caches will be enclosed by tplsadmin comments. Are you OK?');
7 7
 
8 8
 
9
-define('_TPLSADMIN_FMT_MSG_ENCLOSEBYBORDEREDDIV', '%d template caches have been enclosed by div tags') ;
10
-define('_TPLSADMIN_DT_ENCLOSEBYBORDEREDDIV', 'Implant div tags') ;
11
-define('_TPLSADMIN_DD_ENCLOSEBYBORDEREDDIV', 'Each templates will be enclosed by black-bordered div tags. A link for editing controller of tplsadmin will be implanted into each templates. Though this often cause destructions in designing, you can edit each templates the most instictively and easily.') ;
12
-define('_TPLSADMIN_CNF_ENCLOSEBYBORDEREDDIV', 'Compiled template caches will be enclosed by div tags. Are you OK?') ;
9
+define('_TPLSADMIN_FMT_MSG_ENCLOSEBYBORDEREDDIV', '%d template caches have been enclosed by div tags');
10
+define('_TPLSADMIN_DT_ENCLOSEBYBORDEREDDIV', 'Implant div tags');
11
+define('_TPLSADMIN_DD_ENCLOSEBYBORDEREDDIV', 'Each templates will be enclosed by black-bordered div tags. A link for editing controller of tplsadmin will be implanted into each templates. Though this often cause destructions in designing, you can edit each templates the most instictively and easily.');
12
+define('_TPLSADMIN_CNF_ENCLOSEBYBORDEREDDIV', 'Compiled template caches will be enclosed by div tags. Are you OK?');
13 13
 
14
-define('_TPLSADMIN_FMT_MSG_HOOKSAVEVARS', '%d template caches have been implanted hooking logics to collect template varibles') ;
15
-define('_TPLSADMIN_DT_HOOKSAVEVARS', 'Implant logics to collect template variables') ;
16
-define('_TPLSADMIN_DD_HOOKSAVEVARS', 'The first step of getting the informations of template variables in your site. The template vars infos will be collected when public sides of your site is displayed. If all templates you want to edit are displayed, get template vars info by underlying buttons.') ;
17
-define('_TPLSADMIN_CNF_HOOKSAVEVARS', 'Compiled template caches will be implanted the logics to collect template variables. Are you OK?') ;
14
+define('_TPLSADMIN_FMT_MSG_HOOKSAVEVARS', '%d template caches have been implanted hooking logics to collect template varibles');
15
+define('_TPLSADMIN_DT_HOOKSAVEVARS', 'Implant logics to collect template variables');
16
+define('_TPLSADMIN_DD_HOOKSAVEVARS', 'The first step of getting the informations of template variables in your site. The template vars infos will be collected when public sides of your site is displayed. If all templates you want to edit are displayed, get template vars info by underlying buttons.');
17
+define('_TPLSADMIN_CNF_HOOKSAVEVARS', 'Compiled template caches will be implanted the logics to collect template variables. Are you OK?');
18 18
 
19
-define('_TPLSADMIN_FMT_MSG_REMOVEHOOKS', '%d template caches have been normalized') ;
20
-define('_TPLSADMIN_DT_REMOVEHOOKS', 'Normalize compiled template caches') ;
21
-define('_TPLSADMIN_DD_REMOVEHOOKS', 'This removes comments/div tags/logics implanted by upper operations from each compiled template caches.') ;
22
-define('_TPLSADMIN_CNF_REMOVEHOOKS', 'Are you OK for normlizing?') ;
19
+define('_TPLSADMIN_FMT_MSG_REMOVEHOOKS', '%d template caches have been normalized');
20
+define('_TPLSADMIN_DT_REMOVEHOOKS', 'Normalize compiled template caches');
21
+define('_TPLSADMIN_DD_REMOVEHOOKS', 'This removes comments/div tags/logics implanted by upper operations from each compiled template caches.');
22
+define('_TPLSADMIN_CNF_REMOVEHOOKS', 'Are you OK for normlizing?');
23 23
 
24 24
 
25
-define('_TPLSADMIN_MSG_CLEARCACHE', 'Template caches are removed') ;
26
-define('_TPLSADMIN_MSG_CREATECOMPILECACHEFIRST', 'There are no compiled template caches. Create complied template caches by displaying public sides of your site, first') ;
25
+define('_TPLSADMIN_MSG_CLEARCACHE', 'Template caches are removed');
26
+define('_TPLSADMIN_MSG_CREATECOMPILECACHEFIRST', 'There are no compiled template caches. Create complied template caches by displaying public sides of your site, first');
27 27
 
28
-define('_TPLSADMIN_CNF_DELETEOK', 'Delete OK?') ;
28
+define('_TPLSADMIN_CNF_DELETEOK', 'Delete OK?');
29 29
 
30 30
 
31
-define('_TPLSADMIN_DT_GETTPLSVARSINFO_DW', 'Get info of template variables as DreamWeaver Extensions') ;
32
-define('_TPLSADMIN_DD_GETTPLSVARSINFO_DW', 'Open Macromedia Extension Manager, first.<br />Extract the download archive.<br />Execute the files which extensions are .mxi and you will meet installing dialogs.<br />The snippets for template variables of your site will be usable after restarting Dream Weaver.') ;
31
+define('_TPLSADMIN_DT_GETTPLSVARSINFO_DW', 'Get info of template variables as DreamWeaver Extensions');
32
+define('_TPLSADMIN_DD_GETTPLSVARSINFO_DW', 'Open Macromedia Extension Manager, first.<br />Extract the download archive.<br />Execute the files which extensions are .mxi and you will meet installing dialogs.<br />The snippets for template variables of your site will be usable after restarting Dream Weaver.');
33 33
 
34
-define('_TPLSADMIN_DT_GETTEMPLATES', 'Download templates') ;
35
-define('_TPLSADMIN_DD_GETTEMPLATES', 'Select a set before pushing either button') ;
34
+define('_TPLSADMIN_DT_GETTEMPLATES', 'Download templates');
35
+define('_TPLSADMIN_DD_GETTEMPLATES', 'Select a set before pushing either button');
36 36
 
37
-define('_TPLSADMIN_FMT_MSG_PUTTEMPLATES', '%d templates are imported.') ;
38
-define('_TPLSADMIN_DT_PUTTEMPLATES', 'Upload templates') ;
39
-define('_TPLSADMIN_DD_PUTTEMPLATES', 'Select a set you want to upload/overwrite before uploading zip/tgz archive including template files (.html). You need not to check depths of the paths in the archive.') ;
37
+define('_TPLSADMIN_FMT_MSG_PUTTEMPLATES', '%d templates are imported.');
38
+define('_TPLSADMIN_DT_PUTTEMPLATES', 'Upload templates');
39
+define('_TPLSADMIN_DD_PUTTEMPLATES', 'Select a set you want to upload/overwrite before uploading zip/tgz archive including template files (.html). You need not to check depths of the paths in the archive.');
40 40
 
41 41
 
42
-define('_TPLSADMIN_ERR_NOTUPLOADED', 'No files are uploaded.') ;
43
-define('_TPLSADMIN_ERR_EXTENSION', 'This extension cannot be recognized.') ;
44
-define('_TPLSADMIN_ERR_INVALIDARCHIVE', 'The archive is not extractable.') ;
45
-define('_TPLSADMIN_ERR_INVALIDTPLSET', 'Invalid set name has been specified.') ;
42
+define('_TPLSADMIN_ERR_NOTUPLOADED', 'No files are uploaded.');
43
+define('_TPLSADMIN_ERR_EXTENSION', 'This extension cannot be recognized.');
44
+define('_TPLSADMIN_ERR_INVALIDARCHIVE', 'The archive is not extractable.');
45
+define('_TPLSADMIN_ERR_INVALIDTPLSET', 'Invalid set name has been specified.');
46 46
 
47
-define('_TPLSADMIN_ERR_NOTPLSVARSINFO', 'There are no template vars info files.') ;
47
+define('_TPLSADMIN_ERR_NOTPLSVARSINFO', 'There are no template vars info files.');
48 48
 
49
-define('_TPLSADMIN_NUMCAP_COMPILEDCACHES', 'Compiled template caches') ;
50
-define('_TPLSADMIN_NUMCAP_TPLSVARS', 'Template vars info files') ;
49
+define('_TPLSADMIN_NUMCAP_COMPILEDCACHES', 'Compiled template caches');
50
+define('_TPLSADMIN_NUMCAP_TPLSVARS', 'Template vars info files');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/language/french/mytplsadmin.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('_MYTPLSADMIN_CREATE_NEW_TPLSET', 'Créer une nouvelle série') ;
4
-define('_MYTPLSADMIN_CAPTION_BASE', 'Base') ;
5
-define('_MYTPLSADMIN_CAPTION_SETNAME', 'nom') ;
6
-define('_MYTPLSADMIN_OPT_BLANKSET', '(vide)') ;
7
-define('_MYTPLSADMIN_CAPTION_COPYTO', 'à') ;
8
-define('_MYTPLSADMIN_BTN_COPY', 'COPIER') ;
9
-define('_MYTPLSADMIN_TITLE_CHECKALL', 'Activer / désactiver toutes les cases de cette ligne') ;
10
-define('_MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES', 'Tous les templates sélectionnés dans l\'ensemble (ligne) seront supprimés. Voulez-vous confirmer?') ;
11
-define('_MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES', 'Tous les templates sélectionnés dans l\'ensemble (ligne) seront copiés/écrasé dans l\'ensemble sélectionné. Voulez-vous confirmer?') ;
12
-define('_MYTPLSADMIN_TH_NAME', 'Nom template name') ;
13
-define('_MYTPLSADMIN_TH_TYPE', 'type') ;
14
-define('_MYTPLSADMIN_TH_FILE', 'fichier source') ;
15
-define('_MYTPLSADMIN_ERR_NOTPLFILE', 'Aucun template sélectionné.') ;
16
-define('_MYTPLSADMIN_ERR_INVALIDTPLSET', "L\'ensemble de destination est le même que la source, ou aucun ensemble de templates n\'a été spécifié.") ;
17
-define('_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT', "Vous ne pouvez pas supprimer l'ensemble 'default'.") ;
18
-define('_MYTPLSADMIN_ERR_DUPLICATEDSETNAME', "Ce nom d'ensemble de templates existe déjà.") ;
19
-define('_MYTPLSADMIN_ERR_INVALIDSETNAME', "un mauvais nom d'ensemble de templates a été spécifié.") ;
3
+define('_MYTPLSADMIN_CREATE_NEW_TPLSET', 'Créer une nouvelle série');
4
+define('_MYTPLSADMIN_CAPTION_BASE', 'Base');
5
+define('_MYTPLSADMIN_CAPTION_SETNAME', 'nom');
6
+define('_MYTPLSADMIN_OPT_BLANKSET', '(vide)');
7
+define('_MYTPLSADMIN_CAPTION_COPYTO', 'à');
8
+define('_MYTPLSADMIN_BTN_COPY', 'COPIER');
9
+define('_MYTPLSADMIN_TITLE_CHECKALL', 'Activer / désactiver toutes les cases de cette ligne');
10
+define('_MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES', 'Tous les templates sélectionnés dans l\'ensemble (ligne) seront supprimés. Voulez-vous confirmer?');
11
+define('_MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES', 'Tous les templates sélectionnés dans l\'ensemble (ligne) seront copiés/écrasé dans l\'ensemble sélectionné. Voulez-vous confirmer?');
12
+define('_MYTPLSADMIN_TH_NAME', 'Nom template name');
13
+define('_MYTPLSADMIN_TH_TYPE', 'type');
14
+define('_MYTPLSADMIN_TH_FILE', 'fichier source');
15
+define('_MYTPLSADMIN_ERR_NOTPLFILE', 'Aucun template sélectionné.');
16
+define('_MYTPLSADMIN_ERR_INVALIDTPLSET', "L\'ensemble de destination est le même que la source, ou aucun ensemble de templates n\'a été spécifié.");
17
+define('_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT', "Vous ne pouvez pas supprimer l'ensemble 'default'.");
18
+define('_MYTPLSADMIN_ERR_DUPLICATEDSETNAME', "Ce nom d'ensemble de templates existe déjà.");
19
+define('_MYTPLSADMIN_ERR_INVALIDSETNAME', "un mauvais nom d'ensemble de templates a été spécifié.");
20 20
 
21
-define('_MYTPLSADMIN_H3_MODULE', 'Module') ;
22
-define('_MYTPLSADMIN_BTN_NEWTPLSET', 'créer') ;
21
+define('_MYTPLSADMIN_H3_MODULE', 'Module');
22
+define('_MYTPLSADMIN_BTN_NEWTPLSET', 'créer');
23 23
 
24
-define('_MYTPLSADMIN_DBUPDATED', 'Mise à jour avec succès des Templates') ;
24
+define('_MYTPLSADMIN_DBUPDATED', 'Mise à jour avec succès des Templates');
25 25
 
26
-define('_MYTPLSADMIN_CUSTOMTEMPLATE', 'Template personnalisé') ;
27
-define('_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE', 'Créer un nouveau template personnalisé') ;
26
+define('_MYTPLSADMIN_CUSTOMTEMPLATE', 'Template personnalisé');
27
+define('_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE', 'Créer un nouveau template personnalisé');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mytplsform.php 1 patch
Spacing   +113 added lines, -113 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 28
 $db = XoopsDatabaseFactory::getDatabaseConnection();
29
-(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ;
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,128 +42,128 @@  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 157
     $tpl_id = (int)$db->getInsertId();
158
-    $sql = 'INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id=$tpl_id,tpl_source='" . addslashes($myts->stripSlashesGPC($_POST['tpl_source'])) . "'" ;
159
-    if (! $db->query($sql)) {
160
-        die('SQL Error'.__LINE__) ;
158
+    $sql = 'INSERT INTO '.$db->prefix('tplsource')." SET tpl_id=$tpl_id,tpl_source='".addslashes($myts->stripSlashesGPC($_POST['tpl_source']))."'";
159
+    if (!$db->query($sql)) {
160
+        die('SQL Error'.__LINE__);
161 161
     }
162
-    altsys_template_touch($tpl_id) ;
162
+    altsys_template_touch($tpl_id);
163 163
 
164 164
     // continue or end ?
165
-    redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED) ;
166
-    exit ;
165
+    redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED);
166
+    exit;
167 167
 }
168 168
 
169 169
 
@@ -171,56 +171,56 @@  discard block
 block discarded – undo
171 171
 //****************//
172 172
 //   FORM stage   //
173 173
 //****************//
174
-xoops_cp_header() ;
175
-$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$mydirname ;
174
+xoops_cp_header();
175
+$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$mydirname;
176 176
 
177 177
 // mymenu
178
-altsys_include_mymenu() ;
178
+altsys_include_mymenu();
179 179
 
180
-echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>"._MD_A_MYTPLSFORM_EDIT . ' : ' . htmlspecialchars($tpl['tpl_type'], ENT_QUOTES) . ' : ' . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES) . ' ('
181
-     . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES) . ")</h3>\n" ;
180
+echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>"._MD_A_MYTPLSFORM_EDIT.' : '.htmlspecialchars($tpl['tpl_type'], ENT_QUOTES).' : '.htmlspecialchars($tpl['tpl_file'], ENT_QUOTES).' ('
181
+     . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES).")</h3>\n";
182 182
 
183 183
 
184 184
 // diff from file to selected DB template
185
-$basefilepath = tplsadmin_get_basefilepath($tpl['tpl_module'], $tpl['tpl_type'], $tpl['tpl_file']) ;
186
-$diff_from_file4disp = '' ;
185
+$basefilepath = tplsadmin_get_basefilepath($tpl['tpl_module'], $tpl['tpl_type'], $tpl['tpl_file']);
186
+$diff_from_file4disp = '';
187 187
 if (file_exists($basefilepath)) {
188
-    $original_error_level = error_reporting() ;
189
-    error_reporting($original_error_level & ~ E_NOTICE & ~ E_WARNING) ;
190
-    $diff = new Text_Diff(file($basefilepath), explode("\n", $tpl['tpl_source'])) ;
188
+    $original_error_level = error_reporting();
189
+    error_reporting($original_error_level & ~ E_NOTICE & ~ E_WARNING);
190
+    $diff = new Text_Diff(file($basefilepath), explode("\n", $tpl['tpl_source']));
191 191
     $renderer = new Text_Diff_Renderer_unified();
192
-    $diff_str = htmlspecialchars($renderer->render($diff), ENT_QUOTES) ;
192
+    $diff_str = htmlspecialchars($renderer->render($diff), ENT_QUOTES);
193 193
     foreach (explode("\n", $diff_str) as $line) {
194 194
         if (ord($line) == 0x2d) {
195
-            $diff_from_file4disp .= "<span style='color:red;'>".$line."</span>\n" ;
195
+            $diff_from_file4disp .= "<span style='color:red;'>".$line."</span>\n";
196 196
         } elseif (ord($line) == 0x2b) {
197
-            $diff_from_file4disp .= "<span style='color:blue;'>".$line."</span>\n" ;
197
+            $diff_from_file4disp .= "<span style='color:blue;'>".$line."</span>\n";
198 198
         } else {
199
-            $diff_from_file4disp .= $line."\n" ;
199
+            $diff_from_file4disp .= $line."\n";
200 200
         }
201 201
     }
202
-    error_reporting($original_error_level) ;
202
+    error_reporting($original_error_level);
203 203
 }
204 204
 
205 205
 // diff from DB-default to selected DB template
206
-$diff_from_default4disp = '' ;
206
+$diff_from_default4disp = '';
207 207
 if ($tpl['tpl_tplset'] != 'default') {
208
-    $original_error_level = error_reporting() ;
209
-    error_reporting($original_error_level & ~ E_NOTICE & ~ E_WARNING) ;
210
-    list($default_source) = $db->fetchRow($db->query('SELECT tpl_source FROM ' . $db->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl['tpl_file']) . "' AND tpl_module='" . addslashes($tpl['tpl_module']) . "'")) ;
211
-    $diff = new Text_Diff(explode("\n", $default_source), explode("\n", $tpl['tpl_source'])) ;
208
+    $original_error_level = error_reporting();
209
+    error_reporting($original_error_level & ~ E_NOTICE & ~ E_WARNING);
210
+    list($default_source) = $db->fetchRow($db->query('SELECT tpl_source FROM '.$db->prefix('tplfile').' NATURAL LEFT JOIN '.$db->prefix('tplsource')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl['tpl_file'])."' AND tpl_module='".addslashes($tpl['tpl_module'])."'"));
211
+    $diff = new Text_Diff(explode("\n", $default_source), explode("\n", $tpl['tpl_source']));
212 212
     $renderer = new Text_Diff_Renderer_unified();
213
-    $diff_str = htmlspecialchars($renderer->render($diff), ENT_QUOTES) ;
213
+    $diff_str = htmlspecialchars($renderer->render($diff), ENT_QUOTES);
214 214
     foreach (explode("\n", $diff_str) as $line) {
215 215
         if (ord($line) == 0x2d) {
216
-            $diff_from_default4disp .= "<span style='color:red;'>".$line."</span>\n" ;
216
+            $diff_from_default4disp .= "<span style='color:red;'>".$line."</span>\n";
217 217
         } elseif (ord($line) == 0x2b) {
218
-            $diff_from_default4disp .= "<span style='color:blue;'>".$line."</span>\n" ;
218
+            $diff_from_default4disp .= "<span style='color:blue;'>".$line."</span>\n";
219 219
         } else {
220
-            $diff_from_default4disp .= $line."\n" ;
220
+            $diff_from_default4disp .= $line."\n";
221 221
         }
222 222
     }
223
-    error_reporting($original_error_level) ;
223
+    error_reporting($original_error_level);
224 224
 }
225 225
 
226 226
 
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 	<form name='diff_form' id='diff_form' action='' method='get'>\n" ;
229 229
 if ($diff_from_file4disp) {
230 230
     echo "<input type='checkbox' name='display_diff2file' value='1' onClick=\"if(this.checked){document.getElementById('diff2file').style.display='block'}else{document.getElementById('diff2file').style.display='none'};\" id='display_diff2file' checked='checked' />&nbsp;<label for='display_diff2file'>diff from file</label>
231
-	<pre id='diff2file' style='display:block;border:1px solid black;'>$diff_from_file4disp</pre>\n" ;
231
+	<pre id='diff2file' style='display:block;border:1px solid black;'>$diff_from_file4disp</pre>\n";
232 232
 }
233 233
 if ($diff_from_default4disp) {
234 234
     echo "<input type='checkbox' name='display_diff2default' value='1' onClick=\"if(this.checked){document.getElementById('diff2default').style.display='block'}else{document.getElementById('diff2default').style.display='none'};\" id='display_diff2default' />&nbsp;<label for='display_diff2default'>diff from default</label>
235
-	<pre id='diff2default' style='display:none;border:1px solid black;'>$diff_from_default4disp</pre>\n" ;
235
+	<pre id='diff2default' style='display:none;border:1px solid black;'>$diff_from_default4disp</pre>\n";
236 236
 }
237 237
 echo "
238 238
 	</form>\n" ;
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
 
241 241
 echo "
242 242
 <a name='altsys_tplsform_top' id='altsys_tplsform_top'></a>
243
-<form name='MainForm' id='altsys_tplsform' action='?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file=".htmlspecialchars($tpl_file, ENT_QUOTES) . '&amp;tpl_tplset='
244
-     . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES) . '&amp;dirname=' . $target_mname . "' method='post'>
243
+<form name='MainForm' id='altsys_tplsform' action='?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file=".htmlspecialchars($tpl_file, ENT_QUOTES).'&amp;tpl_tplset='
244
+     . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES).'&amp;dirname='.$target_mname."' method='post'>
245 245
 	".$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys_tplsform')."
246
-    <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>".htmlspecialchars($tpl['tpl_source'], ENT_QUOTES) . '</textarea>
246
+    <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>".htmlspecialchars($tpl['tpl_source'], ENT_QUOTES).'</textarea>
247 247
 	<br />
248 248
 ';
249 249
 if ($edit_mode == 'create') {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     echo "
252 252
 	<label for='tpl_file'>"._MD_A_MYTPLSFORM_LABEL_TPLFILE."</label>
253 253
 	<input type='text' name='tpl_file' id='tpl_file' value='".htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br />
254
-	<input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n" ;
254
+	<input type='submit' name='do_create' id='do_create' value='"._MD_A_MYTPLSFORM_BTN_CREATE."' />\n";
255 255
 } else {
256 256
     // modify form
257 257
     echo "
@@ -261,4 +261,4 @@  discard block
 block discarded – undo
261 261
 </form>\n" ;
262 262
 }
263 263
 
264
-xoops_cp_footer() ;
264
+xoops_cp_footer();
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/put_templates.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@  discard block
 block discarded – undo
5 5
 //                        GIJOE <http://www.peak.ne.jp/>                     //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-include_once __DIR__.'/include/gtickets.php' ;
9
-include_once __DIR__.'/include/altsys_functions.php' ;
10
-include_once __DIR__.'/include/tpls_functions.php' ;
8
+include_once __DIR__.'/include/gtickets.php';
9
+include_once __DIR__.'/include/altsys_functions.php';
10
+include_once __DIR__.'/include/tpls_functions.php';
11 11
 
12 12
 
13 13
 // this page can be called only from altsys
14 14
 if ($xoopsModule->getVar('dirname') != 'altsys') {
15
-    die('this page can be called only from altsys') ;
15
+    die('this page can be called only from altsys');
16 16
 }
17 17
 
18 18
 
19 19
 // language file
20
-altsys_include_language_file('compilehookadmin') ;
20
+altsys_include_language_file('compilehookadmin');
21 21
 
22 22
 
23
-$db = XoopsDatabaseFactory::getDatabaseConnection() ;
23
+$db = XoopsDatabaseFactory::getDatabaseConnection();
24 24
 
25
-if (empty($_FILES['tplset_archive']['tmp_name']) || ! is_uploaded_file($_FILES['tplset_archive']['tmp_name'])) {
26
-    die(_TPLSADMIN_ERR_NOTUPLOADED) ;
25
+if (empty($_FILES['tplset_archive']['tmp_name']) || !is_uploaded_file($_FILES['tplset_archive']['tmp_name'])) {
26
+    die(_TPLSADMIN_ERR_NOTUPLOADED);
27 27
 }
28 28
 //fix for mb_http_output setting and for add any browsers
29 29
     if (function_exists('mb_http_output')) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 //ob_buffer over flow
33 33
 //HACK by suin & nao-pon 2012/01/06
34 34
     while (ob_get_level() > 0) {
35
-        if (! ob_end_clean()) {
35
+        if (!ob_end_clean()) {
36 36
             break;
37 37
         }
38 38
     }
@@ -41,62 +41,62 @@  discard block
 block discarded – undo
41 41
 // EXTRACT STAGE
42 42
 //
43 43
 
44
-$orig_filename4check = strtolower($_FILES['tplset_archive']['name']) ;
44
+$orig_filename4check = strtolower($_FILES['tplset_archive']['name']);
45 45
 if (strtolower(substr($orig_filename4check, -4)) == '.zip') {
46 46
 
47 47
     // zip
48
-    require_once __DIR__.'/include/Archive_Zip.php' ;
49
-    $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']) ;
50
-    $files = $reader->extract(array( 'extract_as_string' => true )) ;
51
-    if (! is_array(@$files)) {
52
-        die($reader->errorName()) ;
48
+    require_once __DIR__.'/include/Archive_Zip.php';
49
+    $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']);
50
+    $files = $reader->extract(array('extract_as_string' => true));
51
+    if (!is_array(@$files)) {
52
+        die($reader->errorName());
53 53
     }
54
-    $do_upload = true ;
54
+    $do_upload = true;
55 55
 } elseif (substr($orig_filename4check, -4) == '.tgz' || substr($orig_filename4check, -7) == '.tar.gz') {
56 56
 
57 57
     // tar.gz
58
-    require_once XOOPS_ROOT_PATH.'/class/class.tar.php' ;
59
-    $tar = new tar() ;
60
-    $tar->openTAR($_FILES['tplset_archive']['tmp_name']) ;
61
-    $files = array() ;
58
+    require_once XOOPS_ROOT_PATH.'/class/class.tar.php';
59
+    $tar = new tar();
60
+    $tar->openTAR($_FILES['tplset_archive']['tmp_name']);
61
+    $files = array();
62 62
     foreach ($tar->files as $id => $info) {
63 63
         $files[] = array(
64
-            'filename' => $info['name'] ,
65
-            'mtime' => $info['time'] ,
64
+            'filename' => $info['name'],
65
+            'mtime' => $info['time'],
66 66
             'content' => $info['file']
67
-        ) ;
67
+        );
68 68
     }
69 69
     if (empty($files)) {
70
-        die(_TPLSADMIN_ERR_INVALIDARCHIVE) ;
70
+        die(_TPLSADMIN_ERR_INVALIDARCHIVE);
71 71
     }
72
-    $do_upload = true ;
72
+    $do_upload = true;
73 73
 }
74 74
 
75 75
 if (empty($do_upload)) {
76
-    die(_TPLSADMIN_ERR_EXTENSION) ;
76
+    die(_TPLSADMIN_ERR_EXTENSION);
77 77
 }
78 78
 
79 79
 //
80 80
 // IMPORT STAGE
81 81
 //
82 82
 
83
-$tplset = @$_POST['tplset'] ;
84
-if (! preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
85
-    die(_TPLSADMIN_ERR_INVALIDTPLSET) ;
83
+$tplset = @$_POST['tplset'];
84
+if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
85
+    die(_TPLSADMIN_ERR_INVALIDTPLSET);
86 86
 }
87 87
 
88
-$imported = 0 ;
88
+$imported = 0;
89 89
 foreach ($files as $file) {
90
-    if (! empty($file['folder'])) {
91
-        continue ;
90
+    if (!empty($file['folder'])) {
91
+        continue;
92 92
     }
93
-    $pos = strrpos($file['filename'], '/') ;
94
-    $tpl_file = $pos === false ? $file['filename'] : substr($file['filename'], $pos + 1) ;
93
+    $pos = strrpos($file['filename'], '/');
94
+    $tpl_file = $pos === false ? $file['filename'] : substr($file['filename'], $pos + 1);
95 95
 
96 96
     if (tplsadmin_import_data($tplset, $tpl_file, rtrim($file['content']), $file['mtime'])) {
97
-        $imported ++ ;
97
+        $imported++;
98 98
     }
99 99
 }
100 100
 
101
-redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf(_TPLSADMIN_FMT_MSG_PUTTEMPLATES, $imported)) ;
102
-exit ;
101
+redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf(_TPLSADMIN_FMT_MSG_PUTTEMPLATES, $imported));
102
+exit;
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/d3utilities.php 1 patch
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -3,40 +3,40 @@  discard block
 block discarded – undo
3 3
 class d3utilities
4 4
 {
5 5
 
6
-    public $dirname = '' ; // directory name under xoops_trust_path
7
-    public $mydirname = '' ; // each directory name under xoops_root_path
8
-    public $mid = 0 ; // id of each module instance
9
-    public $table = '' ; // table with prefix and dirname
10
-    public $primary_key = '' ; // column for primary_key
11
-    public $cols = array() ; // settings of each columns
12
-    public $form_mode = 'new' ; // 'new','edit' are available
13
-    public $page_name = '' ; // controller's name  eg) page=(controller) in URI
14
-    public $action_base_hiddens = array() ;
6
+    public $dirname = ''; // directory name under xoops_trust_path
7
+    public $mydirname = ''; // each directory name under xoops_root_path
8
+    public $mid = 0; // id of each module instance
9
+    public $table = ''; // table with prefix and dirname
10
+    public $primary_key = ''; // column for primary_key
11
+    public $cols = array(); // settings of each columns
12
+    public $form_mode = 'new'; // 'new','edit' are available
13
+    public $page_name = ''; // controller's name  eg) page=(controller) in URI
14
+    public $action_base_hiddens = array();
15 15
 
16 16
 //HACK by domifara
17 17
 //	public function D3Utilities( $mydirname , $table_body , $primary_key , $cols , $page_name , $action_base_hiddens )
18 18
     public function __construct($mydirname, $table_body, $primary_key, $cols, $page_name, $action_base_hiddens)
19 19
     {
20
-        $db = XoopsDatabaseFactory::getDatabaseConnection() ;
21
-
22
-        $this->dirname = basename(dirname(__DIR__)) ;
23
-        $this->mydirname = $mydirname ;
24
-        $this->table = $db->prefix($mydirname ? $mydirname . '_' . $table_body : $table_body) ;
25
-        $this->primary_key = $primary_key ;
26
-        $this->cols = $cols ;
27
-        $module_handler = xoops_gethandler('module') ;
28
-        $module =& $module_handler->getByDirname($this->mydirname) ;
29
-        if (! empty($module)) {
20
+        $db = XoopsDatabaseFactory::getDatabaseConnection();
21
+
22
+        $this->dirname = basename(dirname(__DIR__));
23
+        $this->mydirname = $mydirname;
24
+        $this->table = $db->prefix($mydirname ? $mydirname.'_'.$table_body : $table_body);
25
+        $this->primary_key = $primary_key;
26
+        $this->cols = $cols;
27
+        $module_handler = xoops_gethandler('module');
28
+        $module = & $module_handler->getByDirname($this->mydirname);
29
+        if (!empty($module)) {
30 30
             $this->mid = (int)$module->getVar('mid');
31 31
         }
32
-        $this->page_name = $page_name ;
33
-        $this->action_base_hiddens = $action_base_hiddens ;
32
+        $this->page_name = $page_name;
33
+        $this->action_base_hiddens = $action_base_hiddens;
34 34
     }
35 35
 
36 36
 
37 37
     public function get_language_constant($name)
38 38
     {
39
-        return constant(strtoupper('_MD_A_' . $this->dirname . '_' . $this->page_name . '_' . $name)) ;
39
+        return constant(strtoupper('_MD_A_'.$this->dirname.'_'.$this->page_name.'_'.$name));
40 40
     }
41 41
 
42 42
 
@@ -46,22 +46,22 @@  discard block
 block discarded – undo
46 46
             case 'text' :
47 47
             case 'blob' :
48 48
                 $length = empty($col['length']) ? 65535 : (int)$col['length'];
49
-                return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'" ;
49
+                return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'";
50 50
             case 'char' :
51 51
             case 'varchar' :
52 52
             case 'string' :
53 53
                 $length = empty($col['length']) ? 255 : (int)$col['length'];
54
-                return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'" ;
54
+                return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'";
55 55
             case 'int' :
56 56
             case 'integer' :
57 57
                 $value = (int)$value;
58
-                if (! empty($col['max'])) {
59
-                    $value = min($value, (int)$col['max']) ;
58
+                if (!empty($col['max'])) {
59
+                    $value = min($value, (int)$col['max']);
60 60
                 }
61
-                if (! empty($col['min'])) {
62
-                    $value = max($value, (int)$col['min']) ;
61
+                if (!empty($col['min'])) {
62
+                    $value = max($value, (int)$col['min']);
63 63
                 }
64
-                return "`{$col['name']}`=$value" ;
64
+                return "`{$col['name']}`=$value";
65 65
         }
66 66
     }
67 67
 
@@ -69,29 +69,29 @@  discard block
 block discarded – undo
69 69
     // single update or insert
70 70
     public function insert()
71 71
     {
72
-        $db = XoopsDatabaseFactory::getDatabaseConnection() ;
72
+        $db = XoopsDatabaseFactory::getDatabaseConnection();
73 73
 
74
-        $id = $this->init_default_values() ;
74
+        $id = $this->init_default_values();
75 75
 
76
-        $set4sql = '' ;
76
+        $set4sql = '';
77 77
         foreach ($this->cols as $col) {
78 78
             if (empty($col['edit_edit'])) {
79
-                continue ;
79
+                continue;
80 80
             }
81 81
             if ($col['name'] == $this->primary_key) {
82
-                continue ;
82
+                continue;
83 83
             }
84
-            $set4sql .= $this->get_set4sql(@$_POST[ $col['name'] ], $col) . ',' ;
84
+            $set4sql .= $this->get_set4sql(@$_POST[$col['name']], $col).',';
85 85
         }
86
-        if (! empty($set4sql)) {
86
+        if (!empty($set4sql)) {
87 87
             if ($id > 0) {
88 88
                 // UPDATE
89
-                $db->queryF("UPDATE $this->table SET ".substr($set4sql, 0, -1)." WHERE $this->primary_key='".addslashes($id)."'") ;
90
-                return array( $id , 'update' ) ;
89
+                $db->queryF("UPDATE $this->table SET ".substr($set4sql, 0, -1)." WHERE $this->primary_key='".addslashes($id)."'");
90
+                return array($id, 'update');
91 91
             } else {
92 92
                 // INSERT
93
-                $db->queryF("INSERT INTO $this->table SET ".substr($set4sql, 0, -1)) ;
94
-                return array( $db->getInsertId() , 'insert' ) ;
93
+                $db->queryF("INSERT INTO $this->table SET ".substr($set4sql, 0, -1));
94
+                return array($db->getInsertId(), 'insert');
95 95
             }
96 96
         }
97 97
     }
@@ -100,156 +100,156 @@  discard block
 block discarded – undo
100 100
     // multiple update
101 101
     public function update()
102 102
     {
103
-        $db = XoopsDatabaseFactory::getDatabaseConnection() ;
103
+        $db = XoopsDatabaseFactory::getDatabaseConnection();
104 104
 
105 105
         // search appropriate column for getting primary_key
106 106
         foreach ($this->cols as $col) {
107
-            if (in_array(@$col['list_edit'], array( 'text', 'textarea', 'hidden' ))) {
108
-                $column4key = $col['name'] ;
109
-                break ;
107
+            if (in_array(@$col['list_edit'], array('text', 'textarea', 'hidden'))) {
108
+                $column4key = $col['name'];
109
+                break;
110 110
             }
111 111
         }
112 112
         if (empty($column4key)) {
113
-            $column4key = $this->cols[0]['name'] ;
113
+            $column4key = $this->cols[0]['name'];
114 114
         }
115 115
 
116
-        $ret = array() ;
116
+        $ret = array();
117 117
         foreach (array_keys($_POST[$column4key]) as $id) {
118
-            $id = (int)$id;    // primary_key should be 'integer'
119
-            $set4sql = '' ;
118
+            $id = (int)$id; // primary_key should be 'integer'
119
+            $set4sql = '';
120 120
             foreach ($this->cols as $col) {
121 121
                 if (empty($col['list_edit'])) {
122
-                    continue ;
122
+                    continue;
123 123
                 }
124 124
                 if ($col['name'] == $this->primary_key) {
125
-                    continue ;
125
+                    continue;
126 126
                 }
127
-                $set4sql .= $this->get_set4sql(@$_POST[ $col['name'] ][$id], $col) . ',' ;
127
+                $set4sql .= $this->get_set4sql(@$_POST[$col['name']][$id], $col).',';
128 128
             }
129
-            if (! empty($set4sql)) {
130
-                $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id") ;
129
+            if (!empty($set4sql)) {
130
+                $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id");
131 131
                 if ($db->getRowsNum($result) == 1) {
132
-                    $db->queryF("UPDATE $this->table SET ".substr($set4sql, 0, -1)." WHERE $this->primary_key=$id") ;
132
+                    $db->queryF("UPDATE $this->table SET ".substr($set4sql, 0, -1)." WHERE $this->primary_key=$id");
133 133
                     if ($db->getAffectedRows() == 1) {
134
-                        $ret[ $id ] = $db->fetchArray($result) ;
134
+                        $ret[$id] = $db->fetchArray($result);
135 135
                     }
136 136
                 }
137 137
             }
138 138
         }
139 139
 
140
-        return $ret ;
140
+        return $ret;
141 141
     }
142 142
 
143 143
 
144 144
     public function delete($delete_comments = false, $delete_notifications = false)
145 145
     {
146
-        $db = XoopsDatabaseFactory::getDatabaseConnection() ;
146
+        $db = XoopsDatabaseFactory::getDatabaseConnection();
147 147
 
148
-        $ret = array() ;
148
+        $ret = array();
149 149
         foreach (array_keys($_POST['admin_main_checkboxes']) as $id) {
150
-            $id = (int)$id;    // primary_key should be 'integer'
151
-            $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id") ;
150
+            $id = (int)$id; // primary_key should be 'integer'
151
+            $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id");
152 152
             if ($db->getRowsNum($result) == 1) {
153
-                $ret[ $id ] = $db->fetchArray($result) ;
153
+                $ret[$id] = $db->fetchArray($result);
154 154
 
155
-                $db->queryF("DELETE FROM $this->table WHERE $this->primary_key=$id") ;
155
+                $db->queryF("DELETE FROM $this->table WHERE $this->primary_key=$id");
156 156
                 if ($delete_comments) {
157 157
                     // remove comments
158
-                    $db->queryF('DELETE FROM ' . $db->prefix('xoopscomments') . " WHERE com_modid=$this->mid AND com_itemid=$id") ;
158
+                    $db->queryF('DELETE FROM '.$db->prefix('xoopscomments')." WHERE com_modid=$this->mid AND com_itemid=$id");
159 159
                 }
160 160
 
161 161
                 if ($delete_notifications) {
162 162
                     // remove notifications
163
-                    $db->queryF('DELETE FROM ' . $db->prefix('xoopsnotifications') . " WHERE not_modid=$this->mid AND not_itemid=$id") ;
163
+                    $db->queryF('DELETE FROM '.$db->prefix('xoopsnotifications')." WHERE not_modid=$this->mid AND not_itemid=$id");
164 164
                 }
165 165
             }
166 166
         }
167 167
 
168
-        return $ret ;
168
+        return $ret;
169 169
     }
170 170
 
171 171
 
172 172
     public function init_default_values()
173 173
     {
174
-        $db = XoopsDatabaseFactory::getDatabaseConnection() ;
174
+        $db = XoopsDatabaseFactory::getDatabaseConnection();
175 175
 
176 176
         if (@$_GET['id']) {
177 177
             $id = (int)$_GET['id'];
178
-            $rs = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id") ;
178
+            $rs = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id");
179 179
             if ($db->getRowsNum($rs) == 1) {
180
-                $row = $db->fetchArray($rs) ;
180
+                $row = $db->fetchArray($rs);
181 181
                 foreach (array_keys($this->cols) as $key) {
182 182
                     if (empty($this->cols[$key]['edit_show'])) {
183
-                        continue ;
183
+                        continue;
184 184
                     }
185
-                    $this->cols[$key]['default_value'] = $row[ $this->cols[$key]['name'] ] ;
185
+                    $this->cols[$key]['default_value'] = $row[$this->cols[$key]['name']];
186 186
                 }
187
-                $this->form_mode = 'edit' ;
188
-                return $id ;
187
+                $this->form_mode = 'edit';
188
+                return $id;
189 189
             }
190 190
         }
191 191
 
192
-        $this->form_mode = 'new' ;
193
-        return 0 ;
192
+        $this->form_mode = 'new';
193
+        return 0;
194 194
     }
195 195
 
196 196
 
197 197
     public function get_view_edit()
198 198
     {
199
-        $id = $this->init_default_values() ;
199
+        $id = $this->init_default_values();
200 200
 
201
-        $lines = array() ;
201
+        $lines = array();
202 202
         foreach ($this->cols as $col) {
203 203
             if (empty($col['edit_show'])) {
204
-                continue ;
204
+                continue;
205 205
             }
206
-            if (! isset($col['default_value'])) {
206
+            if (!isset($col['default_value'])) {
207 207
                 switch ($col['type']) {
208 208
                     case 'int' :
209 209
                     case 'integer' :
210
-                        $col['default_value'] = 0 ;
211
-                        break ;
210
+                        $col['default_value'] = 0;
211
+                        break;
212 212
                     default :
213
-                        $col['default_value'] = '' ;
214
-                        break ;
213
+                        $col['default_value'] = '';
214
+                        break;
215 215
                 }
216 216
             }
217 217
             switch ($col['edit_edit']) {
218 218
                 case 'checkbox' :
219
-                    $checked = empty($col['default_value']) ? '' : "checked='checked'" ;
220
-                    $value = empty($col['checkbox_value']) ? 1 : htmlspecialchars($col['checkbox_value'], ENT_QUOTES) ;
219
+                    $checked = empty($col['default_value']) ? '' : "checked='checked'";
220
+                    $value = empty($col['checkbox_value']) ? 1 : htmlspecialchars($col['checkbox_value'], ENT_QUOTES);
221 221
 
222
-                    $lines[ $col['name'] ] = "<input type='checkbox' name='{$col['name']}' value='$value' $checked />" ;
223
-                    break ;
222
+                    $lines[$col['name']] = "<input type='checkbox' name='{$col['name']}' value='$value' $checked />";
223
+                    break;
224 224
                 case 'text' :
225 225
                 default :
226 226
                     $size = empty($col['edit_size']) ? 32 : (int)$col['edit_size'];
227 227
                     $length = empty($col['length']) ? 255 : (int)$col['length'];
228
-                    $lines[ $col['name'] ] = "<input type='text' name='{$col['name']}' size='$size' maxlength='$length' value='".htmlspecialchars($col['default_value'], ENT_QUOTES)."' />" ;
229
-                    break ;
228
+                    $lines[$col['name']] = "<input type='text' name='{$col['name']}' size='$size' maxlength='$length' value='".htmlspecialchars($col['default_value'], ENT_QUOTES)."' />";
229
+                    break;
230 230
                 case false :
231
-                    $lines[ $col['name'] ] = htmlspecialchars($col['default_value'], ENT_QUOTES) ;
232
-                    break ;
231
+                    $lines[$col['name']] = htmlspecialchars($col['default_value'], ENT_QUOTES);
232
+                    break;
233 233
             }
234 234
         }
235 235
 
236
-        return array( $id , $lines ) ;
236
+        return array($id, $lines);
237 237
     }
238 238
 
239 239
 
240 240
     public function get_control_form($controllers)
241 241
     {
242
-        $hiddens = '' ;
242
+        $hiddens = '';
243 243
         foreach ($this->action_base_hiddens as $key => $val) {
244
-            $key4disp = htmlspecialchars($key, ENT_QUOTES) ;
245
-            $val4disp = htmlspecialchars($val, ENT_QUOTES) ;
246
-            $hiddens .= "<input type='hidden' name='$key4disp' value='$val4disp' />\n" ;
244
+            $key4disp = htmlspecialchars($key, ENT_QUOTES);
245
+            $val4disp = htmlspecialchars($val, ENT_QUOTES);
246
+            $hiddens .= "<input type='hidden' name='$key4disp' value='$val4disp' />\n";
247 247
         }
248 248
 
249
-        $controllers_html = '' ;
249
+        $controllers_html = '';
250 250
         foreach ($controllers as $type => $body) {
251 251
             if ($type == 'num') {
252
-                $controllers_html .= $this->get_select('num', $body, $GLOBALS['num']) ;
252
+                $controllers_html .= $this->get_select('num', $body, $GLOBALS['num']);
253 253
             }
254 254
         }
255 255
 
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 
264 264
     public function get_select($name, $options, $current_value)
265 265
     {
266
-        $ret = "<select name='".htmlspecialchars($name, ENT_QUOTES)."'>\n" ;
266
+        $ret = "<select name='".htmlspecialchars($name, ENT_QUOTES)."'>\n";
267 267
         foreach ($options as $key => $val) {
268 268
             $selected = $val == $current_value ? "selected='selected'" : '';
269
-            $ret .= "<option value='".htmlspecialchars($key, ENT_QUOTES)."' $selected>".htmlspecialchars($val, ENT_QUOTES)."</option>\n" ;
269
+            $ret .= "<option value='".htmlspecialchars($key, ENT_QUOTES)."' $selected>".htmlspecialchars($val, ENT_QUOTES)."</option>\n";
270 270
         }
271
-        $ret .= "</select>\n" ;
271
+        $ret .= "</select>\n";
272 272
 
273
-        return $ret ;
273
+        return $ret;
274 274
     }
275 275
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/MyBlocksAdminForXCL21.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // $Id: MyBlocksAdminForXCL21.class.php ,ver 0.0.7.1 2011/01/27 16:10:00 domifara Exp $
3 3
 
4
-require_once __DIR__.'/MyBlocksAdmin.class.php' ;
4
+require_once __DIR__.'/MyBlocksAdmin.class.php';
5 5
 
6 6
 class MyBlocksAdminForXCL21 extends MyBlocksAdmin
7 7
 {
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     static $instance;
19 19
     if (!isset($instance)) {
20 20
         $instance = new MyBlocksAdminForXCL21();
21
-        $instance->construct() ;
21
+        $instance->construct();
22 22
     }
23 23
     return $instance;
24 24
 }
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 public function renderCell4BlockOptions($block_data)
30 30
 {
31 31
     if ($this->target_dirname && substr($this->target_dirname, 0, 1) != '_') {
32
-        $langman =& D3LanguageManager::getInstance() ;
33
-        $langman->read('admin.php', $this->target_dirname) ;
32
+        $langman = & D3LanguageManager::getInstance();
33
+        $langman->read('admin.php', $this->target_dirname);
34 34
     }
35 35
 
36 36
     $bid = (int)$block_data['bid'];
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 //HACK by domifara
39 39
 //	$block = new XoopsBlock( $bid ) ;
40 40
     $handler = xoops_gethandler('block');
41
-    $block =& $handler->create(false) ;
42
-    $block->load($bid) ;
41
+    $block = & $handler->create(false);
42
+    $block->load($bid);
43 43
 
44
-    $legacy_block =& Legacy_Utils::createBlockProcedure($block) ;
45
-    return $legacy_block->getOptionForm() ;
44
+    $legacy_block = & Legacy_Utils::createBlockProcedure($block);
45
+    return $legacy_block->getOptionForm();
46 46
 }
47 47
 
48 48
     public function checkFck()
49 49
     {
50
-        return (! altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'));
50
+        return (!altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'));
51 51
     }
52 52
 }
Please login to merge, or discard this patch.