Completed
Push — master ( 369c90...324e29 )
by Michael
04:57
created
language/english/modinfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
 //Help
92 92
 define('_MI_REFERENCES_DIRNAME', basename(dirname(dirname(__DIR__))));
93
-define('_MI_REFERENCES_HELP_HEADER', __DIR__ . '/help/helpheader.html');
93
+define('_MI_REFERENCES_HELP_HEADER', __DIR__.'/help/helpheader.html');
94 94
 define('_MI_REFERENCES_BACK_2_ADMIN', 'Back to Administration of ');
95 95
 define('_MI_REFERENCES_HELP_OVERVIEW', 'Overview');
96 96
 
Please login to merge, or discard this patch.
include/common.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -24,32 +24,32 @@  discard block
 block discarded – undo
24 24
 
25 25
 if (!defined('REFERENCES_DIRNAME')) {
26 26
     define('REFERENCES_DIRNAME', 'references');
27
-    define('REFERENCES_URL', XOOPS_URL . '/modules/' . REFERENCES_DIRNAME . '/');
28
-    define('REFERENCES_PATH', XOOPS_ROOT_PATH . '/modules/' . REFERENCES_DIRNAME . '/');
29
-    define('REFERENCES_IMAGES_URL', REFERENCES_URL . 'assets/images/');        // Les images du module (l'url)
30
-    define('REFERENCES_IMAGES_PATH', REFERENCES_PATH . 'assets/images/');    // Les images du module (le chemin)
31
-    define('REFERENCES_CLASS_PATH', REFERENCES_PATH . 'class/');
32
-    define('REFERENCES_PLUGINS_PATH', REFERENCES_PATH . 'plugins/');
33
-    define('REFERENCES_PLUGINS_URL', REFERENCES_URL . 'plugins/');
34
-    define('REFERENCES_JS_URL', REFERENCES_URL . 'js/');
27
+    define('REFERENCES_URL', XOOPS_URL.'/modules/'.REFERENCES_DIRNAME.'/');
28
+    define('REFERENCES_PATH', XOOPS_ROOT_PATH.'/modules/'.REFERENCES_DIRNAME.'/');
29
+    define('REFERENCES_IMAGES_URL', REFERENCES_URL.'assets/images/'); // Les images du module (l'url)
30
+    define('REFERENCES_IMAGES_PATH', REFERENCES_PATH.'assets/images/'); // Les images du module (le chemin)
31
+    define('REFERENCES_CLASS_PATH', REFERENCES_PATH.'class/');
32
+    define('REFERENCES_PLUGINS_PATH', REFERENCES_PATH.'plugins/');
33
+    define('REFERENCES_PLUGINS_URL', REFERENCES_URL.'plugins/');
34
+    define('REFERENCES_JS_URL', REFERENCES_URL.'js/');
35 35
     define('REFERENCES_TEXTFILE1', 'references_index.tpl');
36
-    define('REFERENCES_PERM_READ', 'references_view');    // Nom de la permission de lire
36
+    define('REFERENCES_PERM_READ', 'references_view'); // Nom de la permission de lire
37 37
 }
38 38
 
39 39
 // Chargement des handler et des autres classes
40
-require REFERENCES_PATH . 'config.php';
40
+require REFERENCES_PATH.'config.php';
41 41
 
42 42
 // La classe paramètres
43
-require_once REFERENCES_CLASS_PATH . 'references_parameters.php';
43
+require_once REFERENCES_CLASS_PATH.'references_parameters.php';
44 44
 
45 45
 // Les classes pour les plugins
46
-require_once REFERENCES_CLASS_PATH . 'references_plugins.php';    // Classe principale
47
-require_once REFERENCES_PLUGINS_PATH . 'models' . DIRECTORY_SEPARATOR . 'references_action.php';
48
-require_once REFERENCES_PLUGINS_PATH . 'models' . DIRECTORY_SEPARATOR . 'references_filter.php';
46
+require_once REFERENCES_CLASS_PATH.'references_plugins.php'; // Classe principale
47
+require_once REFERENCES_PLUGINS_PATH.'models'.DIRECTORY_SEPARATOR.'references_action.php';
48
+require_once REFERENCES_PLUGINS_PATH.'models'.DIRECTORY_SEPARATOR.'references_filter.php';
49 49
 
50
-require_once REFERENCES_CLASS_PATH . 'references_utils.php';
51
-require_once REFERENCES_CLASS_PATH . 'PEAR.php';
52
-require_once REFERENCES_CLASS_PATH . 'references_handlers.php';
50
+require_once REFERENCES_CLASS_PATH.'references_utils.php';
51
+require_once REFERENCES_CLASS_PATH.'PEAR.php';
52
+require_once REFERENCES_CLASS_PATH.'references_handlers.php';
53 53
 
54 54
 $h_references_articles   = xoops_getModuleHandler('references_articles', REFERENCES_DIRNAME);
55 55
 $h_references_categories = xoops_getModuleHandler('references_categories', REFERENCES_DIRNAME);
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 // Définition des images
59 59
 if (!defined('_REFERENCES_EDIT')) {
60 60
     global $xoopsConfig;
61
-    if (isset($xoopsConfig) && file_exists(REFERENCES_PATH . 'language/' . $xoopsConfig['language'] . '/main.php')) {
62
-        require REFERENCES_PATH . 'language/' . $xoopsConfig['language'] . '/main.php';
61
+    if (isset($xoopsConfig) && file_exists(REFERENCES_PATH.'language/'.$xoopsConfig['language'].'/main.php')) {
62
+        require REFERENCES_PATH.'language/'.$xoopsConfig['language'].'/main.php';
63 63
     } else {
64
-        require REFERENCES_PATH . 'language/english/main.php';
64
+        require REFERENCES_PATH.'language/english/main.php';
65 65
     }
66 66
 
67 67
     $icones = array(
68
-        'edit'   => "<img src='" . REFERENCES_IMAGES_URL . "edit.gif' alt='" . _REFERENCES_EDIT . "' align='middle' />",
69
-        'delete' => "<img src='" . REFERENCES_IMAGES_URL . "delete.gif' alt='" . _REFERENCES_DELETE . "' align='middle' />"
68
+        'edit'   => "<img src='".REFERENCES_IMAGES_URL."edit.gif' alt='"._REFERENCES_EDIT."' align='middle' />",
69
+        'delete' => "<img src='".REFERENCES_IMAGES_URL."delete.gif' alt='"._REFERENCES_DELETE."' align='middle' />"
70 70
     );
71 71
 }
Please login to merge, or discard this patch.
include/notification.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 function references_notify_iteminfo($category, $item_id)
29 29
 {
30 30
     global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
31
-    $item_id = (int)$item_id;
31
+    $item_id = (int) $item_id;
32 32
 
33 33
     if (empty($xoopsModule) || $xoopsModule->getVar('dirname') !== 'references') {
34 34
         $module_handler = xoops_getHandler('module');
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
         $config_handler = xoops_getHandler('config');
37 37
         $config         = $config_handler->getConfigsByCat(0, $module->getVar('mid'));
38 38
     } else {
39
-        $module =& $xoopsModule;
40
-        $config =& $xoopsModuleConfig;
39
+        $module = & $xoopsModule;
40
+        $config = & $xoopsModuleConfig;
41 41
     }
42 42
 
43 43
     if ($category === 'global') {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     }
49 49
 
50 50
     if ($category === 'new_article') {
51
-        include REFERENCES_PATH . ' include/common.php';
51
+        include REFERENCES_PATH.' include/common.php';
52 52
         $article = null;
53 53
         $article = $h_references_articles->get($item_id);
54 54
         if (is_object($article)) {
Please login to merge, or discard this patch.
include/plugin.tag.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
     $items_id = array();
26 26
     foreach (array_keys($items) as $cat_id) {
27 27
         foreach (array_keys($items[$cat_id]) as $item_id) {
28
-            $items_id[] = (int)$item_id;
28
+            $items_id[] = (int) $item_id;
29 29
         }
30 30
     }
31
-    include XOOPS_ROOT_PATH . '/modules/references/include/common.php';
31
+    include XOOPS_ROOT_PATH.'/modules/references/include/common.php';
32 32
     $items_obj = $h_references_articles->getItemsFromIds($items_id);
33 33
 
34 34
     foreach (array_keys($items) as $cat_id) {
35 35
         foreach (array_keys($items[$cat_id]) as $item_id) {
36
-            $item_obj                 =& $items_obj[$item_id];
36
+            $item_obj                 = & $items_obj[$item_id];
37 37
             /** @noinspection SenselessCommaInArrayDefinitionInspection */
38 38
             $items[$cat_id][$item_id] = array(
39 39
                 'title'   => $item_obj->getVar('article_title'),
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 
63 63
     /* clear tag-item links */
64 64
     if ($link_handler->mysql_major_version() >= 4):
65
-        $sql = " DELETE FROM {$link_handler->table}" . '   WHERE ' . "       tag_modid = {$mid}" . '       AND ' . '       ( tag_itemid NOT IN ' . "           ( SELECT DISTINCT {$item_handler_keyName} " . "               FROM {$item_handler_table} " . "               WHERE $where" . '           ) '
65
+        $sql = " DELETE FROM {$link_handler->table}".'   WHERE '."       tag_modid = {$mid}".'       AND '.'       ( tag_itemid NOT IN '."           ( SELECT DISTINCT {$item_handler_keyName} "."               FROM {$item_handler_table} "."               WHERE $where".'           ) '
66 66
                . '       )';
67 67
     else:
68
-        $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" . "   LEFT JOIN {$item_handler_table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler_keyName} " . '   WHERE ' . "       tag_modid = {$mid}" . '       AND ' . "       ( aa.{$item_handler_keyName} IS NULL"
69
-               . "           OR $where1" . '       )';
68
+        $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}"."   LEFT JOIN {$item_handler_table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler_keyName} ".'   WHERE '."       tag_modid = {$mid}".'       AND '."       ( aa.{$item_handler_keyName} IS NULL"
69
+               . "           OR $where1".'       )';
70 70
     endif;
71 71
     if (!$link_handler->db->queryF($sql)) {
72 72
         trigger_error($link_handler->db->error());
Please login to merge, or discard this patch.
include/search.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,19 +25,19 @@  discard block
 block discarded – undo
25 25
 function references_search($queryarray, $andor, $limit, $offset, $userid)
26 26
 {
27 27
     global $xoopsDB;
28
-    include XOOPS_ROOT_PATH . '/modules/references/include/common.php';
28
+    include XOOPS_ROOT_PATH.'/modules/references/include/common.php';
29 29
 
30 30
     // Recherche dans les articles
31
-    $sql = 'SELECT article_id, article_title, article_text, article_timestamp, article_author FROM ' . $xoopsDB->prefix('references_articles') . ' WHERE (article_online = ' . REFERENCES_STATUS_ONLINE . ')';
31
+    $sql = 'SELECT article_id, article_title, article_text, article_timestamp, article_author FROM '.$xoopsDB->prefix('references_articles').' WHERE (article_online = '.REFERENCES_STATUS_ONLINE.')';
32 32
     // Permissions
33 33
     $handlers    = references_handler::getInstance();
34 34
     $permissions = $handlers->h_references_articles->getPermissionsCategoriesCriteria()->renderWhere();
35
-    $sql .= ' AND (' . trim(str_replace('WHERE ', '', $permissions)) . ')';
35
+    $sql .= ' AND ('.trim(str_replace('WHERE ', '', $permissions)).')';
36 36
     // *****
37 37
 
38 38
     // Auteur
39 39
     if ($userid != 0) {
40
-        $sql .= ' AND (article_author = ' . $userid . ') ';
40
+        $sql .= ' AND (article_author = '.$userid.') ';
41 41
     }
42 42
 
43 43
     $tmpObject = new references_articles();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             if ($cnt == 0) {
50 50
                 $tblFields[] = $key;
51 51
             } else {
52
-                $tblFields[] = ' OR ' . $key;
52
+                $tblFields[] = ' OR '.$key;
53 53
             }
54 54
             ++$cnt;
55 55
         }
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
         $more = ')';
64 64
         foreach ($queryarray as $oneQuery) {
65 65
             $sql .= '(';
66
-            $cond = " LIKE '%" . $oneQuery . "%' ";
67
-            $sql .= implode($cond, $tblFields) . $cond . ')';
66
+            $cond = " LIKE '%".$oneQuery."%' ";
67
+            $sql .= implode($cond, $tblFields).$cond.')';
68 68
             ++$cnt;
69 69
             if ($cnt != $count) {
70
-                $sql .= ' ' . $andor . ' ';
70
+                $sql .= ' '.$andor.' ';
71 71
             }
72 72
         }
73 73
     }
74
-    $sql .= $more . ' ORDER BY article_timestamp DESC';
74
+    $sql .= $more.' ORDER BY article_timestamp DESC';
75 75
     $i      = 0;
76 76
     $ret    = array();
77 77
     $myts   = MyTextSanitizer::getInstance();
78 78
     $result = $xoopsDB->query($sql, $limit, $offset);
79 79
     while ($myrow = $xoopsDB->fetchArray($result)) {
80 80
         $ret[$i]['image'] = 'assets/images/newspaper.png';
81
-        $ret[$i]['link']  = REFERENCES_URL . 'reference.php?article_id=' . $myrow['article_id'];
81
+        $ret[$i]['link']  = REFERENCES_URL.'reference.php?article_id='.$myrow['article_id'];
82 82
         $ret[$i]['title'] = $myts->htmlSpecialChars($myrow['article_title']);
83 83
         $ret[$i]['time']  = $myrow['article_timestamp'];
84 84
         $ret[$i]['uid']   = $myrow['article_author'];
Please login to merge, or discard this patch.
xoops_version.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $modversion['blocks'][$cptb]['description'] = '';
82 82
 $modversion['blocks'][$cptb]['show_func']   = 'b_references_last_news_show';
83 83
 $modversion['blocks'][$cptb]['edit_func']   = 'b_references_last_news_edit';
84
-$modversion['blocks'][$cptb]['options']     = '10|';    // Nombre d'articles � afficher, cat�gories � afficher
84
+$modversion['blocks'][$cptb]['options']     = '10|'; // Nombre d'articles � afficher, cat�gories � afficher
85 85
 $modversion['blocks'][$cptb]['template']    = 'references_block_last_new.tpl';
86 86
 
87 87
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 $modversion['blocks'][$cptb]['description'] = '';
94 94
 $modversion['blocks'][$cptb]['show_func']   = 'b_references_random_news_show';
95 95
 $modversion['blocks'][$cptb]['edit_func']   = 'b_references_random_news_edit';
96
-$modversion['blocks'][$cptb]['options']     = '5|';    // Number of items, categories to show
96
+$modversion['blocks'][$cptb]['options']     = '5|'; // Number of items, categories to show
97 97
 $modversion['blocks'][$cptb]['template']    = 'references_block_random_news.tpl';
98 98
 
99 99
 /*
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
 $cptm = 0;
163 163
 
164
-require_once XOOPS_ROOT_PATH . '/modules/references/class/references_utils.php';
164
+require_once XOOPS_ROOT_PATH.'/modules/references/class/references_utils.php';
165 165
 if (references_utils::getModuleOption('use_rss')) {
166 166
     ++$cptm;
167 167
     $modversion['sub'][$cptm]['name'] = _MI_REFERENCES_SMENU1;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     _MI_REFERENCES_SORT_DATE   => 'article_timestamp',
376 376
     _MI_REFERENCES_SORT_WEIGHT => 'article_weight'
377 377
 );
378
-$modversion['config'][$cpto]['default']     = 'article_timestamp';
378
+$modversion['config'][$cpto]['default'] = 'article_timestamp';
379 379
 
380 380
 /**
381 381
  * Sens du tri
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
     _MI_REFERENCES_SORT_ASC  => 'ASC',
391 391
     _MI_REFERENCES_SORT_DESC => 'DESC'
392 392
 );
393
-$modversion['config'][$cpto]['default']     = 'DESC';
393
+$modversion['config'][$cpto]['default'] = 'DESC';
394 394
 
395 395
 /**
396 396
  * Area to use to sort the references in admin
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     _MI_REFERENCES_SORT_WEIGHT => 'article_weight',
407 407
     _MI_REFERENCES_SORT_TITLE  => 'article_title'
408 408
 );
409
-$modversion['config'][$cpto]['default']     = 'article_weight';
409
+$modversion['config'][$cpto]['default'] = 'article_weight';
410 410
 
411 411
 /**
412 412
  * Sens du tri
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     _MI_REFERENCES_SORT_ASC  => 'ASC',
422 422
     _MI_REFERENCES_SORT_DESC => 'DESC'
423 423
 );
424
-$modversion['config'][$cpto]['default']     = 'ASC';
424
+$modversion['config'][$cpto]['default'] = 'ASC';
425 425
 
426 426
 // ****************************************************************************
427 427
 // Comments *******************************************************************
Please login to merge, or discard this patch.
admin/main.php 1 patch
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
  * ****************************************************************************
20 20
  */
21 21
 
22
-include_once __DIR__ . '/admin_header.php';
23
-require_once __DIR__ . '/../../../include/cp_header.php';
24
-require_once __DIR__ . '/../include/common.php';
22
+include_once __DIR__.'/admin_header.php';
23
+require_once __DIR__.'/../../../include/cp_header.php';
24
+require_once __DIR__.'/../include/common.php';
25 25
 
26
-require_once REFERENCES_PATH . 'admin/functions.php';
27
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
29
-require_once REFERENCES_PATH . 'class/references_listFilter.php';
30
-require_once REFERENCES_PATH . 'admin/dbupdate.php';
26
+require_once REFERENCES_PATH.'admin/functions.php';
27
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29
+require_once REFERENCES_PATH.'class/references_listFilter.php';
30
+require_once REFERENCES_PATH.'admin/dbupdate.php';
31 31
 
32 32
 if (!isset($op)) {
33 33
     $op = 'default';
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 references_utils::prepareFolder(references_utils::getModuleOption('images_path'));
48 48
 
49 49
 // Lecture de certains param???tres de l'application ********************************************************************
50
-$limit            = references_utils::getModuleOption('items_admin_page');    // Nombre maximum d'???l???ments ??? afficher
51
-$baseurl          = REFERENCES_URL . 'admin/' . basename(__FILE__);    // URL de ce script
50
+$limit            = references_utils::getModuleOption('items_admin_page'); // Nombre maximum d'???l???ments ??? afficher
51
+$baseurl          = REFERENCES_URL.'admin/'.basename(__FILE__); // URL de ce script
52 52
 $conf_msg         = references_utils::javascriptLinkConfirm(_AM_REFERENCES_CONF_DELITEM);
53 53
 $defaultSortField = references_utils::getModuleOption('admin_sort_field');
54 54
 $defaultSortOrder = references_utils::getModuleOption('admin_sort_order');
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         $objet = 'articles';
86 86
         $items = array();
87 87
         if (isset($_GET['move'])) {
88
-            $id    = isset($_GET['id']) ? (int)$_GET['id'] : 0;
89
-            $ordre = isset($_GET['ordre']) ? (int)$_GET['ordre'] : 0;
88
+            $id    = isset($_GET['id']) ? (int) $_GET['id'] : 0;
89
+            $ordre = isset($_GET['ordre']) ? (int) $_GET['ordre'] : 0;
90 90
             if ($_GET['move'] === 'up' && $id > 0) {
91 91
                 $handlers->h_references_articles->moveUp($id, $ordre);
92 92
             }
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
                 $handlers->h_references_articles->moveDown($id, $ordre);
95 95
             }
96 96
         }
97
-        $form = "<form method='post' action='$baseurl' name='frmadd$objet' id='frmadd$objet'><input type='hidden' name='op' id='op' value='add$objet' /><input type='submit' name='btngo' id='btngo' value='" . _AM_REFERENCES_ADD_ITEM . "' /></form>";
97
+        $form = "<form method='post' action='$baseurl' name='frmadd$objet' id='frmadd$objet'><input type='hidden' name='op' id='op' value='add$objet' /><input type='submit' name='btngo' id='btngo' value='"._AM_REFERENCES_ADD_ITEM."' /></form>";
98 98
         echo $form;
99 99
         $categoriesList = $h_references_categories->getListArray();
100 100
         $upText         = _AM_REFERENCES_UP;
101 101
         $downText       = _AM_REFERENCES_DOWN;
102
-        $upImg          = "<a href='$baseurl?op=articles&move=up&id=%d&ordre=%d' title=\"$upText\"><img src='" . REFERENCES_IMAGES_URL . "up.png' alt=\"$upText\" /></a>";
103
-        $downImg        = "<a href='$baseurl?op=articles&move=down&id=%d&ordre=%d' title=\"$downText\"><img src='" . REFERENCES_IMAGES_URL . "down.png' alt=\"$downText\" /></a>";
102
+        $upImg          = "<a href='$baseurl?op=articles&move=up&id=%d&ordre=%d' title=\"$upText\"><img src='".REFERENCES_IMAGES_URL."up.png' alt=\"$upText\" /></a>";
103
+        $downImg        = "<a href='$baseurl?op=articles&move=down&id=%d&ordre=%d' title=\"$downText\"><img src='".REFERENCES_IMAGES_URL."down.png' alt=\"$downText\" /></a>";
104 104
 
105 105
         $referencesFilter = new references_listFilter($h_references_articles, 'op', 'articles', 'start', $limit, $baseurl, $defaultSortField, $defaultSortOrder, true, REFERENCES_JS_URL);
106 106
         $referencesFilter->initFilter('article_id', array('dataType' => references_listFilter::FILTER_DATA_NUMERIC, 'fieldType' => references_listFilter::FILTER_FIELD_TEXT, 'size' => 5, 'maxLength' => 10));
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $referencesFilter->filter();
116 116
         $itemsCount = $referencesFilter->getCount();
117
-        references_utils::htitle(_MI_REFERENCES_ADMENU0 . ' (' . $itemsCount . ')', 4);
117
+        references_utils::htitle(_MI_REFERENCES_ADMENU0.' ('.$itemsCount.')', 4);
118 118
 
119 119
         if ($itemsCount > $limit) {
120 120
             $pagenav = $referencesFilter->getPager();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
128 128
         echo "<tr>\n";
129 129
         echo "<form method='post' action='$baseurl'>\n";
130
-        echo "<td colspan='4' align='right'>" . $referencesFilter->getSortPlaceHolderHtmlCode();
130
+        echo "<td colspan='4' align='right'>".$referencesFilter->getSortPlaceHolderHtmlCode();
131 131
         echo $referencesFilter->getClearFilterbutton();
132 132
         echo "</td>\n";
133 133
         echo "<td colspan='2' align='right'>";
@@ -136,28 +136,28 @@  discard block
 block discarded – undo
136 136
         }
137 137
         echo "</td>\n</tr>\n";
138 138
 
139
-        echo "<th align='center'>" . _AM_REFERENCES_ID . "</th><th align='center'>" . _AM_REFERENCES_TITLE . "</th><th align='center'>" . _AM_REFERENCES_WEIGHT . "</th><th align='center'>" . _AM_REFERENCES_CATEGORY . "</th><th align='center'>" . _AM_REFERENCES_ONLINE . "</th><th align='center'>"
140
-             . _AM_REFERENCES_MANUAL_DATE . "</th><th align='center'>" . _AM_REFERENCES_ACTION . '</th></tr>';
139
+        echo "<th align='center'>"._AM_REFERENCES_ID."</th><th align='center'>"._AM_REFERENCES_TITLE."</th><th align='center'>"._AM_REFERENCES_WEIGHT."</th><th align='center'>"._AM_REFERENCES_CATEGORY."</th><th align='center'>"._AM_REFERENCES_ONLINE."</th><th align='center'>"
140
+             . _AM_REFERENCES_MANUAL_DATE."</th><th align='center'>"._AM_REFERENCES_ACTION.'</th></tr>';
141 141
         // Filtres ****************************************
142 142
         echo "<tr>\n";
143
-        echo "<th align='center'>" . $referencesFilter->getFilterField('article_id') . "</th>\n";
144
-        echo "<th align='center'>" . $referencesFilter->getFilterField('article_title') . "</th>\n";
145
-        echo "<th align='center'>" . $referencesFilter->getFilterField('article_weight') . "</th>\n";
146
-        echo "<th align='center'>" . $referencesFilter->getFilterField('article_category_id') . "</th>\n";
147
-        echo "<th align='center'>" . $referencesFilter->getFilterField('article_online') . "</th>\n";
143
+        echo "<th align='center'>".$referencesFilter->getFilterField('article_id')."</th>\n";
144
+        echo "<th align='center'>".$referencesFilter->getFilterField('article_title')."</th>\n";
145
+        echo "<th align='center'>".$referencesFilter->getFilterField('article_weight')."</th>\n";
146
+        echo "<th align='center'>".$referencesFilter->getFilterField('article_category_id')."</th>\n";
147
+        echo "<th align='center'>".$referencesFilter->getFilterField('article_online')."</th>\n";
148 148
         echo "<th align='center'>&nbsp;</th>\n";
149
-        echo "<th align='center'>" . $referencesFilter->getGoButton() . "</th></form></tr>\n";
149
+        echo "<th align='center'>".$referencesFilter->getGoButton()."</th></form></tr>\n";
150 150
         // ************************************************
151 151
         $class = '';
152 152
         foreach ($items as $item) {
153 153
             ++$counter;
154 154
             $class         = ($class === 'even') ? 'odd' : 'even';
155 155
             $id            = $item->getVar('article_id');
156
-            $action_edit   = "<a href='$baseurl?op=edit" . $objet . '&id=' . $id . "' title='" . _EDIT . "'>" . $icones['edit'] . '</a>';
157
-            $action_delete = "<a href='$baseurl?op=delete" . $objet . '&id=' . $id . "' title='" . _DELETE . "'" . $conf_msg . '>' . $icones['delete'] . '</a>';
156
+            $action_edit   = "<a href='$baseurl?op=edit".$objet.'&id='.$id."' title='"._EDIT."'>".$icones['edit'].'</a>';
157
+            $action_delete = "<a href='$baseurl?op=delete".$objet.'&id='.$id."' title='"._DELETE."'".$conf_msg.'>'.$icones['delete'].'</a>';
158 158
             $category      = isset($categories[$item->getVar('article_category_id')]) ? $categories[$item->getVar('article_category_id')] : '';
159 159
             $up            = $down = '';
160
-            echo "<tr class='" . $class . "'>\n";
160
+            echo "<tr class='".$class."'>\n";
161 161
             $ordre = $item->getVar('article_weight');
162 162
             if ($counter == 1 && $visibleCountItems > 1) { // Premier ???l???ment
163 163
                 $down = sprintf($downImg, $id, $ordre);
@@ -165,36 +165,36 @@  discard block
 block discarded – undo
165 165
             if ($counter == $visibleCountItems && $visibleCountItems > 1) { // Dernier ???l???ment
166 166
                 $up = sprintf($upImg, $id, $ordre);
167 167
             }
168
-            if ($counter > 1 & $counter < $visibleCountItems && $visibleCountItems > 1) { // Element dans le milieu
168
+            if ($counter > 1&$counter < $visibleCountItems && $visibleCountItems > 1) { // Element dans le milieu
169 169
                 $up   = sprintf($upImg, $id, $ordre);
170 170
                 $down = sprintf($downImg, $id, $ordre);
171 171
             }
172 172
 
173
-            echo "<td align='center'>" . $id . '</td>';
174
-            echo "<td align='left'><a target='_blank' href='" . $item->getUrl() . "'>" . $item->getVar('article_title') . '</a></td>';
175
-            echo "<td align='center'>" . $item->getVar('article_weight') . " $up $down</td>";
176
-            echo "<td align='center'>" . $category . '</td>';
173
+            echo "<td align='center'>".$id.'</td>';
174
+            echo "<td align='left'><a target='_blank' href='".$item->getUrl()."'>".$item->getVar('article_title').'</a></td>';
175
+            echo "<td align='center'>".$item->getVar('article_weight')." $up $down</td>";
176
+            echo "<td align='center'>".$category.'</td>';
177 177
             if ($item->isArticleOnline()) {
178
-                $statusLink = "<a href='$baseurl?op=offline&id=$id' title='" . _AM_REFERENCES_GO_OFFLINE . "'><img src='" . REFERENCES_IMAGES_URL . "status_online.png' alt='" . _AM_REFERENCES_GO_OFFLINE . "' /></a>";
178
+                $statusLink = "<a href='$baseurl?op=offline&id=$id' title='"._AM_REFERENCES_GO_OFFLINE."'><img src='".REFERENCES_IMAGES_URL."status_online.png' alt='"._AM_REFERENCES_GO_OFFLINE."' /></a>";
179 179
             } else {
180
-                $statusLink = "<a href='$baseurl?op=online&id=$id' title='" . _AM_REFERENCES_GO_ONLINE . "'><img src='" . REFERENCES_IMAGES_URL . "status_offline.png' alt='" . _AM_REFERENCES_GO_ONLINE . "' /></a>";
180
+                $statusLink = "<a href='$baseurl?op=online&id=$id' title='"._AM_REFERENCES_GO_ONLINE."'><img src='".REFERENCES_IMAGES_URL."status_offline.png' alt='"._AM_REFERENCES_GO_ONLINE."' /></a>";
181 181
             }
182
-            echo "<td align='center'>" . $statusLink . '</td>';
183
-            echo "<td align='center'>" . $item->getVar('article_date') . '</td>';
184
-            echo "<td align='center'>" . $action_edit . ' ' . $action_delete . "</td>\n";
182
+            echo "<td align='center'>".$statusLink.'</td>';
183
+            echo "<td align='center'>".$item->getVar('article_date').'</td>';
184
+            echo "<td align='center'>".$action_edit.' '.$action_delete."</td>\n";
185 185
             echo "<tr>\n";
186 186
         }
187 187
         $class = ($class === 'even') ? 'odd' : 'even';
188
-        echo "<tr class='" . $class . "'>\n";
189
-        echo "<td colspan='7' align='center'>" . $form . "</td>\n";
188
+        echo "<tr class='".$class."'>\n";
189
+        echo "<td colspan='7' align='center'>".$form."</td>\n";
190 190
         echo "</tr>\n";
191 191
         echo "</table>\n";
192 192
         echo $referencesFilter->getJavascriptInitCode();
193 193
         if (isset($pagenav) && is_object($pagenav)) {
194
-            echo "<div align='center'>" . $pagenav->renderNav() . '</div>';
194
+            echo "<div align='center'>".$pagenav->renderNav().'</div>';
195 195
         }
196 196
         echo "<br><br>\n";
197
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
197
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
198 198
         break;
199 199
 
200 200
     // ****************************************************************************************************************
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
         xoops_cp_header();
205 205
         // references_adminMenu(0);
206 206
         $object = 'articles';
207
-        if ($op == 'edit' . $object) {
207
+        if ($op == 'edit'.$object) {
208 208
             $title = _AM_REFERENCES_EDIT_ARTICLE;
209
-            $id    = isset($_GET['id']) ? (int)$_GET['id'] : 0;
209
+            $id    = isset($_GET['id']) ? (int) $_GET['id'] : 0;
210 210
             if (empty($id)) {
211 211
                 references_utils::redirect(_AM_REFERENCES_ERROR_1, $baseurl, 5);
212 212
             }
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
             $label_submit = _AM_REFERENCES_ADD;
229 229
             $edit         = false;
230 230
         }
231
-        $sform = new XoopsThemeForm($title, 'frmadd' . $object, $baseurl);
231
+        $sform = new XoopsThemeForm($title, 'frmadd'.$object, $baseurl);
232 232
         $sform->setExtra('enctype="multipart/form-data"');
233
-        $sform->addElement(new XoopsFormHidden('op', 'saveedit' . $object));
233
+        $sform->addElement(new XoopsFormHidden('op', 'saveedit'.$object));
234 234
         $sform->addElement(new XoopsFormHidden('article_id', $item->getVar('article_id')));
235 235
         $categories     = $h_references_categories->getListArray();
236 236
         $categoriesList = new XoopsFormSelect(_AM_REFERENCES_CATEGORY, 'article_category_id', $item->getVar('article_category_id', 'e'));
@@ -255,29 +255,29 @@  discard block
 block discarded – undo
255 255
         }
256 256
 
257 257
         if (references_utils::getModuleOption('use_tags') && references_utils::tagModuleExists()) {
258
-            require_once XOOPS_ROOT_PATH . '/modules/tag/include/formtag.php';
258
+            require_once XOOPS_ROOT_PATH.'/modules/tag/include/formtag.php';
259 259
             $sform->addElement(new XoopsFormTag('item_tag', 60, 255, $item->getVar('article_id'), 0));
260 260
         }
261 261
         // Images
262 262
         for ($i = 1; $i <= 10; ++$i) {
263
-            if ($op == 'edit' . $object && $item->pictureExists($i)) {
264
-                $pictureTray = new XoopsFormElementTray(_AM_REFERENCES_CURRENT_PICTURE . ' ' . $i, '<br>');
265
-                $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl($i) . "' alt='' border='0' />"));
266
-                $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture' . $i);
263
+            if ($op == 'edit'.$object && $item->pictureExists($i)) {
264
+                $pictureTray = new XoopsFormElementTray(_AM_REFERENCES_CURRENT_PICTURE.' '.$i, '<br>');
265
+                $pictureTray->addElement(new XoopsFormLabel('', "<img src='".$item->getPictureUrl($i)."' alt='' border='0' />"));
266
+                $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture'.$i);
267 267
                 $deleteCheckbox->addOption(1, _DELETE);
268 268
                 $pictureTray->addElement($deleteCheckbox);
269 269
                 $sform->addElement($pictureTray);
270 270
                 unset($pictureTray, $deleteCheckbox);
271 271
             }
272
-            $sform->addElement(new XoopsFormFile(_AM_REFERENCES_IMAGE . ' ' . $i, 'attachedfile' . $i, references_utils::getModuleOption('maxuploadsize')), false);
273
-            $fieldName = 'article_picture' . $i . '_text';
274
-            $sform->addElement(new XoopsFormText(_AM_REFERENCES_PICTURE_TEXT . ' ' . $i, $fieldName, 50, 255, $item->getVar($fieldName)), false);
272
+            $sform->addElement(new XoopsFormFile(_AM_REFERENCES_IMAGE.' '.$i, 'attachedfile'.$i, references_utils::getModuleOption('maxuploadsize')), false);
273
+            $fieldName = 'article_picture'.$i.'_text';
274
+            $sform->addElement(new XoopsFormText(_AM_REFERENCES_PICTURE_TEXT.' '.$i, $fieldName, 50, 255, $item->getVar($fieldName)), false);
275 275
         }
276 276
 
277 277
         // Fichier attach???
278
-        if ($op == 'edit' . $object && $item->attachmentExists()) {
278
+        if ($op == 'edit'.$object && $item->attachmentExists()) {
279 279
             $attachedTray = new XoopsFormElementTray(_AM_REFERENCES_ATTACHED_FILE, '<br>');
280
-            $attachedTray->addElement(new XoopsFormLabel('', "<a href='" . $item->getAttachmentUrl() . "' target='_blank'>" . $item->getVar('article_attached_file') . '</a>'));
280
+            $attachedTray->addElement(new XoopsFormLabel('', "<a href='".$item->getAttachmentUrl()."' target='_blank'>".$item->getVar('article_attached_file').'</a>'));
281 281
             $deleteCheckbox = new XoopsFormCheckBox('', 'delattach');
282 282
             $deleteCheckbox->addOption(1, _DELETE);
283 283
             $attachedTray->addElement($deleteCheckbox);
@@ -292,14 +292,14 @@  discard block
 block discarded – undo
292 292
         $sform->addElement($button_tray);
293 293
         $sform = references_utils::formMarkRequiredFields($sform);
294 294
         $sform->display();
295
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
295
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
296 296
         break;
297 297
 
298 298
     // ****************************************************************************************************************
299 299
     case 'saveeditarticles':    // Sauvegarde d'un article
300 300
         // ****************************************************************************************************************
301 301
         xoops_cp_header();
302
-        $id         = isset($_POST['article_id']) ? (int)$_POST['article_id'] : 0;
302
+        $id         = isset($_POST['article_id']) ? (int) $_POST['article_id'] : 0;
303 303
         $opRedirect = 'articles';
304 304
         if (!empty($id)) {
305 305
             $edit = true;
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 
318 318
         // Images
319 319
         for ($i = 1; $i <= 10; ++$i) {
320
-            if (isset($_POST['delpicture' . $i]) && (int)$_POST['delpicture' . $i] == 1) {
320
+            if (isset($_POST['delpicture'.$i]) && (int) $_POST['delpicture'.$i] == 1) {
321 321
                 $item->deletePicture($i);
322
-                $item->setVar('article_picture' . $i, '');
322
+                $item->setVar('article_picture'.$i, '');
323 323
             }
324 324
 
325 325
             // Upload de l'image et cr???ation de la vignette
@@ -327,13 +327,13 @@  discard block
 block discarded – undo
327 327
             $return   = references_utils::uploadFile($i - 1, references_utils::getModuleOption('images_path'));
328 328
             if ($return === true) {
329 329
                 if (references_utils::getModuleOption('images_width') > 0 && references_utils::getModuleOption('images_height') > 0) {
330
-                    references_utils::createThumb(references_utils::getModuleOption('images_path') . '/' . basename($destname), references_utils::getModuleOption('images_path') . '/' . basename($destname), references_utils::getModuleOption('images_width'),
330
+                    references_utils::createThumb(references_utils::getModuleOption('images_path').'/'.basename($destname), references_utils::getModuleOption('images_path').'/'.basename($destname), references_utils::getModuleOption('images_width'),
331 331
                                                   references_utils::getModuleOption('images_height'), true);
332 332
                 }
333
-                $newDestName = references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . basename($destname);
334
-                $retval      = references_utils::resizePicture(references_utils::getModuleOption('images_path') . '/' . basename($destname), $newDestName, $thumbs_width, $thumbs_height, true);
333
+                $newDestName = references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.basename($destname);
334
+                $retval      = references_utils::resizePicture(references_utils::getModuleOption('images_path').'/'.basename($destname), $newDestName, $thumbs_width, $thumbs_height, true);
335 335
                 if ($retval == 1 || $retval == 3) {
336
-                    $item->setVar('article_picture' . $i, $destname);
336
+                    $item->setVar('article_picture'.$i, $destname);
337 337
                 }
338 338
             } else {
339 339
                 if ($return !== false) {
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             }
343 343
         }
344 344
 
345
-        $timestamp = mktime(0, 0, 0, (int)substr($_POST['article_timestamp'], 5, 2), (int)substr($_POST['article_timestamp'], 8, 2), (int)substr($_POST['article_timestamp'], 0, 4));
345
+        $timestamp = mktime(0, 0, 0, (int) substr($_POST['article_timestamp'], 5, 2), (int) substr($_POST['article_timestamp'], 8, 2), (int) substr($_POST['article_timestamp'], 0, 4));
346 346
         $item->setVar('article_timestamp', $timestamp);
347 347
 
348 348
         if (!$edit) {
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         }
351 351
 
352 352
         // Suppression ???ventuelle du fichier attach???
353
-        if (isset($_POST['delattach']) && (int)$_POST['delattach'] == 1) {
353
+        if (isset($_POST['delattach']) && (int) $_POST['delattach'] == 1) {
354 354
             $item->deleteAttachment();
355 355
         }
356 356
 
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
                 $h_references_articles->notifyNewArticle($item);
376 376
             }
377 377
             references_utils::updateCache();
378
-            references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
378
+            references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op='.$opRedirect, 2);
379 379
         } else {
380
-            references_utils::redirect(_AM_REFERENCES_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
380
+            references_utils::redirect(_AM_REFERENCES_SAVE_PB, $baseurl.'?op='.$opRedirect, 5);
381 381
         }
382 382
         break;
383 383
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     case 'online':    // Mise en ligne d'un article
387 387
         // ****************************************************************************************************************
388 388
         xoops_cp_header();
389
-        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
389
+        $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
390 390
         if (empty($id)) {
391 391
             references_utils::redirect(_AM_REFERENCES_ERROR_1, $baseurl, 5);
392 392
         }
@@ -401,17 +401,17 @@  discard block
 block discarded – undo
401 401
             }
402 402
             if ($res) {
403 403
                 references_utils::updateCache();
404
-                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
404
+                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op='.$opRedirect, 2);
405 405
             }
406 406
         }
407
-        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
407
+        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl.'?op='.$opRedirect, 5);
408 408
         break;
409 409
 
410 410
     // ****************************************************************************************************************
411 411
     case 'deletearticles':    // Suppression d'un article
412 412
         // ****************************************************************************************************************
413 413
         xoops_cp_header();
414
-        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
414
+        $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
415 415
         if (empty($id)) {
416 416
             references_utils::redirect(_AM_REFERENCES_ERROR_1, $baseurl, 5);
417 417
         }
@@ -422,27 +422,27 @@  discard block
 block discarded – undo
422 422
             $res = $h_references_articles->deleteArticle($item, true);
423 423
             if ($res) {
424 424
                 references_utils::updateCache();
425
-                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
425
+                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op='.$opRedirect, 2);
426 426
             }
427 427
         }
428
-        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
428
+        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl.'?op='.$opRedirect, 5);
429 429
         break;
430 430
 
431 431
     // ****************************************************************************************************************
432
-    case 'instant-zero';    // Publicit???
432
+    case 'instant-zero'; // Publicit???
433 433
         // ****************************************************************************************************************
434 434
         xoops_cp_header();
435 435
         // references_adminMenu(4);
436 436
         echo "<iframe src='http://www.instant-zero.com/modules/liaise/?form_id=2' width='100%' height='600' frameborder='0'></iframe>";
437
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
437
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
438 438
         break;
439 439
 
440 440
     // ****************************************************************************************************************
441
-    case 'perms';    // Permissions
441
+    case 'perms'; // Permissions
442 442
         // ****************************************************************************************************************
443 443
         xoops_cp_header();
444 444
         // references_adminMenu(3);
445
-        require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
445
+        require_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
446 446
         $categories      = $handlers->h_references_categories->getCategories();
447 447
         $permissionsForm = new XoopsGroupPermForm(_AM_REFERENCES_VIEWFORM, $xoopsModule->getVar('mid'), REFERENCES_PERM_READ, _AM_REFERENCES_VIEWFORM_DESC, 'admin/index.php?op=perms', 'true');
448 448
         foreach ($categories as $category) {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         echo $permissionsForm->render();
452 452
         echo "<br><br><br><br>\n";
453 453
         unset($permissionsForm);
454
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
454
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
455 455
         break;
456 456
 
457 457
     // ****************************************************************************************************************
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         // ****************************************************************************************************************
460 460
         xoops_cp_header();
461 461
         // references_adminMenu(2);
462
-        require_once REFERENCES_PATH . 'class/registryfile.php';
462
+        require_once REFERENCES_PATH.'class/registryfile.php';
463 463
         $registry = new references_registryfile();
464 464
 
465 465
         $sform = new XoopsThemeForm(_MI_REFERENCES_ADMENU1, 'frmatxt', $baseurl);
@@ -475,19 +475,19 @@  discard block
 block discarded – undo
475 475
         $sform->addElement($button_tray);
476 476
         $sform = references_utils::formMarkRequiredFields($sform);
477 477
         $sform->display();
478
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
478
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
479 479
         break;
480 480
 
481 481
     // ****************************************************************************************************************
482 482
     case 'savetexts':        // Sauvegarde des textes
483 483
         // ****************************************************************************************************************
484 484
         xoops_cp_header();
485
-        require_once REFERENCES_PATH . 'class/registryfile.php';
485
+        require_once REFERENCES_PATH.'class/registryfile.php';
486 486
         $registry = new references_registryfile();
487 487
         $myts     = MyTextSanitizer::getInstance();
488 488
         $registry->savefile($myts->stripSlashesGPC($_POST['text1']), REFERENCES_TEXTFILE1);
489 489
         references_utils::updateCache();
490
-        references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=texts', 2);
490
+        references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op=texts', 2);
491 491
         break;
492 492
 
493 493
     // ****************************************************************************************************************
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
         // ****************************************************************************************************************
505 505
         xoops_cp_header();
506 506
         // references_adminMenu(1);
507
-        $start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
507
+        $start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
508 508
         $objet = 'categories';
509 509
         $items = array();
510
-        $form  = "<form method='post' action='$baseurl' name='frmadd$objet' id='frmadd$objet'><input type='hidden' name='op' id='op' value='add$objet' /><input type='submit' name='btngo' id='btngo' value='" . _AM_REFERENCES_ADD_ITEM . "' /></form>";
510
+        $form  = "<form method='post' action='$baseurl' name='frmadd$objet' id='frmadd$objet'><input type='hidden' name='op' id='op' value='add$objet' /><input type='submit' name='btngo' id='btngo' value='"._AM_REFERENCES_ADD_ITEM."' /></form>";
511 511
         echo $form;
512 512
         references_utils::htitle(_MI_REFERENCES_ADMENU2, 4);
513 513
 
@@ -518,36 +518,36 @@  discard block
 block discarded – undo
518 518
 
519 519
         $items = $h_references_categories->getCategories($start, $limit);
520 520
         if (isset($pagenav) && is_object($pagenav)) {
521
-            echo "<div align='right'>" . $pagenav->renderNav() . '</div>';
521
+            echo "<div align='right'>".$pagenav->renderNav().'</div>';
522 522
         }
523 523
         echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
524 524
 
525
-        echo "<tr><th align='center'>" . _AM_REFERENCES_ID . "</th><th align='center'>" . _AM_REFERENCES_TITLE . "</th><th align='center'>" . _AM_REFERENCES_CATEGORY_WEIGHT . "</th><th align='center'>" . _AM_REFERENCES_ACTION . '</th></tr>';
525
+        echo "<tr><th align='center'>"._AM_REFERENCES_ID."</th><th align='center'>"._AM_REFERENCES_TITLE."</th><th align='center'>"._AM_REFERENCES_CATEGORY_WEIGHT."</th><th align='center'>"._AM_REFERENCES_ACTION.'</th></tr>';
526 526
 
527 527
         $class = '';
528 528
         foreach ($items as $item) {
529 529
             $class         = ($class === 'even') ? 'odd' : 'even';
530 530
             $id            = $item->getVar('category_id');
531
-            $action_edit   = "<a href='$baseurl?op=edit" . $objet . '&id=' . $id . "' title='" . _EDIT . "'>" . $icones['edit'] . '</a>';
532
-            $action_delete = "<a href='$baseurl?op=delete" . $objet . '&id=' . $id . "' title='" . _DELETE . "'" . $conf_msg . '>' . $icones['delete'] . '</a>';
533
-
534
-            echo "<tr class='" . $class . "'>\n";
535
-            echo "<td align='center'>" . $id . '</td>';
536
-            echo "<td align='left'><a target='_blank' href='" . $item->getUrl() . "'>" . $item->getVar('category_title') . '</a></td>';
537
-            echo "<td align='right'>" . $item->getVar('category_weight') . '</td>';
538
-            echo "<td align='center'>" . $action_edit . ' ' . $action_delete . "</td>\n";
531
+            $action_edit   = "<a href='$baseurl?op=edit".$objet.'&id='.$id."' title='"._EDIT."'>".$icones['edit'].'</a>';
532
+            $action_delete = "<a href='$baseurl?op=delete".$objet.'&id='.$id."' title='"._DELETE."'".$conf_msg.'>'.$icones['delete'].'</a>';
533
+
534
+            echo "<tr class='".$class."'>\n";
535
+            echo "<td align='center'>".$id.'</td>';
536
+            echo "<td align='left'><a target='_blank' href='".$item->getUrl()."'>".$item->getVar('category_title').'</a></td>';
537
+            echo "<td align='right'>".$item->getVar('category_weight').'</td>';
538
+            echo "<td align='center'>".$action_edit.' '.$action_delete."</td>\n";
539 539
             echo "<tr>\n";
540 540
         }
541 541
         $class = ($class === 'even') ? 'odd' : 'even';
542
-        echo "<tr class='" . $class . "'>\n";
543
-        echo "<td colspan='4' align='center'>" . $form . "</td>\n";
542
+        echo "<tr class='".$class."'>\n";
543
+        echo "<td colspan='4' align='center'>".$form."</td>\n";
544 544
         echo "</tr>\n";
545 545
         echo "</table>\n";
546 546
         if (isset($pagenav) && is_object($pagenav)) {
547
-            echo "<div align='center'>" . $pagenav->renderNav() . '</div>';
547
+            echo "<div align='center'>".$pagenav->renderNav().'</div>';
548 548
         }
549 549
         echo "<br><br>\n";
550
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
550
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
551 551
         break;
552 552
 
553 553
     // ****************************************************************************************************************
@@ -557,9 +557,9 @@  discard block
 block discarded – undo
557 557
         xoops_cp_header();
558 558
         // references_adminMenu(1);
559 559
         $object = 'categories';
560
-        if ($op == 'edit' . $object) {
560
+        if ($op == 'edit'.$object) {
561 561
             $title = _AM_REFERENCES_EDIT_CATEGORY;
562
-            $id    = isset($_GET['id']) ? (int)$_GET['id'] : 0;
562
+            $id    = isset($_GET['id']) ? (int) $_GET['id'] : 0;
563 563
             if (empty($id)) {
564 564
                 references_utils::redirect(_AM_REFERENCES_ERROR_1, $baseurl, 5);
565 565
             }
@@ -577,8 +577,8 @@  discard block
 block discarded – undo
577 577
             $label_submit = _AM_REFERENCES_ADD;
578 578
             $edit         = false;
579 579
         }
580
-        $sform = new XoopsThemeForm($title, 'frmadd' . $object, $baseurl);
581
-        $sform->addElement(new XoopsFormHidden('op', 'saveedit' . $object));
580
+        $sform = new XoopsThemeForm($title, 'frmadd'.$object, $baseurl);
581
+        $sform->addElement(new XoopsFormHidden('op', 'saveedit'.$object));
582 582
         $sform->addElement(new XoopsFormHidden('category_id', $item->getVar('category_id')));
583 583
         $sform->addElement(new XoopsFormText(_AM_REFERENCES_TITLE, 'category_title', 50, 255, $item->getVar('category_title', 'e')), true);
584 584
         $sform->addElement(new XoopsFormText(_AM_REFERENCES_CATEGORY_WEIGHT, 'category_weight', 10, 10, $item->getVar('category_weight', 'e')), true);
@@ -611,14 +611,14 @@  discard block
 block discarded – undo
611 611
         $sform->addElement($button_tray);
612 612
         $sform = references_utils::formMarkRequiredFields($sform);
613 613
         $sform->display();
614
-        include_once __DIR__ . '/admin_footer.php';  //show_footer();
614
+        include_once __DIR__.'/admin_footer.php'; //show_footer();
615 615
         break;
616 616
 
617 617
     // ****************************************************************************************************************
618 618
     case 'saveeditcategories':    // Sauvegarde d'une cat???gorie
619 619
         // ****************************************************************************************************************
620 620
         xoops_cp_header();
621
-        $id         = isset($_POST['category_id']) ? (int)$_POST['category_id'] : 0;
621
+        $id         = isset($_POST['category_id']) ? (int) $_POST['category_id'] : 0;
622 622
         $opRedirect = 'categories';
623 623
         if (!empty($id)) {
624 624
             $edit = true;
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
                 $h_references_categories->notifyNewCategory($item);
656 656
             }
657 657
             references_utils::updateCache();
658
-            references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
658
+            references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op='.$opRedirect, 2);
659 659
         } else {
660
-            references_utils::redirect(_AM_REFERENCES_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
660
+            references_utils::redirect(_AM_REFERENCES_SAVE_PB, $baseurl.'?op='.$opRedirect, 5);
661 661
         }
662 662
         break;
663 663
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
     case 'deletecategories':    // Suppression d'une cat???gorie
666 666
         // ****************************************************************************************************************
667 667
         xoops_cp_header();
668
-        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
668
+        $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
669 669
         if (empty($id)) {
670 670
             references_utils::redirect(_AM_REFERENCES_ERROR_1, $baseurl, 5);
671 671
         }
@@ -676,10 +676,10 @@  discard block
 block discarded – undo
676 676
             $res = $h_references_categories->delete($item, true);
677 677
             if ($res) {
678 678
                 references_utils::updateCache();
679
-                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
679
+                references_utils::redirect(_AM_REFERENCES_SAVE_OK, $baseurl.'?op='.$opRedirect, 2);
680 680
             }
681 681
         }
682
-        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
682
+        references_utils::redirect(_AM_REFERENCES_NOT_FOUND, $baseurl.'?op='.$opRedirect, 5);
683 683
         break;
684 684
 
685 685
     // ****************************************************************************************************************
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,44 +28,44 @@  discard block
 block discarded – undo
28 28
 
29 29
 $moduleHandler = xoops_getHandler('module');
30 30
 $module        = $moduleHandler->getByDirname($moduleDirName);
31
-$pathIcon32    = '../../' . $module->getInfo('sysicons32');
32
-$pathModIcon32 = './' . $module->getInfo('modicons32');
31
+$pathIcon32    = '../../'.$module->getInfo('sysicons32');
32
+$pathModIcon32 = './'.$module->getInfo('modicons32');
33 33
 xoops_loadLanguage('modinfo', $module->dirname());
34 34
 
35
-$xoopsModuleAdminPath = XOOPS_ROOT_PATH . '/' . $module->getInfo('dirmoduleadmin');
36
-if (!file_exists($fileinc = $xoopsModuleAdminPath . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) {
37
-    $fileinc = $xoopsModuleAdminPath . '/language/english/main.php';
35
+$xoopsModuleAdminPath = XOOPS_ROOT_PATH.'/'.$module->getInfo('dirmoduleadmin');
36
+if (!file_exists($fileinc = $xoopsModuleAdminPath.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.'main.php')) {
37
+    $fileinc = $xoopsModuleAdminPath.'/language/english/main.php';
38 38
 }
39 39
 include_once $fileinc;
40 40
 
41 41
 $adminmenu[] = array(
42 42
     'title' => _AM_MODULEADMIN_HOME,
43 43
     'link'  => 'admin/index.php',
44
-    'icon'  => $pathIcon32 . '/home.png'
44
+    'icon'  => $pathIcon32.'/home.png'
45 45
 );
46 46
 
47 47
 $adminmenu[] = array(
48 48
     'title' => _MI_REFERENCES_ADMENU0,
49 49
     'link'  => 'admin/main.php',
50
-    'icon'  => $pathIcon32 . '/index.png'
50
+    'icon'  => $pathIcon32.'/index.png'
51 51
 );
52 52
 
53 53
 $adminmenu[] = array(
54 54
     'title' => _MI_REFERENCES_ADMENU2,
55 55
     'link'  => 'admin/main.php?op=categories',
56
-    'icon'  => $pathIcon32 . '/category.png'
56
+    'icon'  => $pathIcon32.'/category.png'
57 57
 );
58 58
 
59 59
 $adminmenu[] = array(
60 60
     'title' => _MI_REFERENCES_ADMENU1,
61 61
     'link'  => 'admin/main.php?op=texts',
62
-    'icon'  => $pathIcon32 . '/manage.png'
62
+    'icon'  => $pathIcon32.'/manage.png'
63 63
 );
64 64
 
65 65
 $adminmenu[] = array(
66 66
     'title' => _MI_REFERENCES_ADMENU3,
67 67
     'link'  => 'admin/main.php?op=perms',
68
-    'icon'  => $pathIcon32 . '/permissions.png'
68
+    'icon'  => $pathIcon32.'/permissions.png'
69 69
 );
70 70
 
71 71
 //$adminmenu[] = array(
@@ -77,6 +77,6 @@  discard block
 block discarded – undo
77 77
 $adminmenu[] = array(
78 78
     'title' => _AM_MODULEADMIN_ABOUT,
79 79
     'link'  => 'admin/about.php',
80
-    'icon'  => $pathIcon32 . '/about.png'
80
+    'icon'  => $pathIcon32.'/about.png'
81 81
 );
82 82
 
Please login to merge, or discard this patch.
admin/dbupdate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 $tableName = $xoopsDB->prefix('references_articles');
25 25
 if (!references_utils::fieldExists('article_weight', $tableName)) {
26 26
     references_utils::addField('`article_weight` MEDIUMINT( 8 ) UNSIGNED NOT NULL AFTER `article_timestamp`', $tableName);
27
-    $xoopsDB->queryF('ALTER TABLE ' . $tableName . ' ADD INDEX ( `article_weight` )');
27
+    $xoopsDB->queryF('ALTER TABLE '.$tableName.' ADD INDEX ( `article_weight` )');
28 28
     $wasUpdated = true;
29 29
 }
30 30
 
Please login to merge, or discard this patch.