1
|
|
|
<?php |
|
|
|
|
2
|
|
|
/* |
3
|
|
|
You may not change or alter any portion of this comment or credits |
4
|
|
|
of supporting developers from this source code or any supporting source code |
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* oledrion |
14
|
|
|
* |
15
|
|
|
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ |
16
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
17
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com/) |
18
|
|
|
* @version $Id: my-lists.php 12290 2014-02-07 11:05:17Z beckmi $ |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Liste des listes de l'utilisateur |
23
|
|
|
*/ |
24
|
|
|
require 'header.php'; |
25
|
|
|
$GLOBALS['current_category'] = -1; |
26
|
|
|
$xoopsOption['template_main'] = 'oledrion_mylists.tpl'; |
27
|
|
|
require_once XOOPS_ROOT_PATH . '/header.php'; |
28
|
|
|
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
29
|
|
|
|
30
|
|
|
$uid = oledrion_utils::getCurrentUserID(); |
31
|
|
|
if ($uid == 0) { |
32
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR23, XOOPS_URL . '/register.php', 4); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
$baseurl = OLEDRION_URL . basename(__FILE__); // URL de ce script |
36
|
|
|
$handlers = oledrion_handler::getInstance(); |
37
|
|
View Code Duplication |
if (isset($_GET['op'])) { |
|
|
|
|
38
|
|
|
$op = $_GET['op']; |
39
|
|
|
} elseif (isset($_POST['op'])) { |
40
|
|
|
$op = $_POST['op']; |
41
|
|
|
} else { |
42
|
|
|
$op = 'default'; |
43
|
|
|
} |
44
|
|
|
$xoopsTpl->assign('baseurl', $baseurl); |
45
|
|
|
oledrion_utils::loadLanguageFile('modinfo.php'); |
46
|
|
|
oledrion_utils::loadLanguageFile('admin.php'); |
47
|
|
|
$breadcrumb = ''; |
48
|
|
|
|
49
|
|
|
function listForm($op, $product_id = 0) |
|
|
|
|
50
|
|
|
{ |
51
|
|
|
global $handlers, $baseurl; |
|
|
|
|
52
|
|
|
if ($op == 'edit') { |
53
|
|
|
$title = _OLEDRION_EDIT_LIST; |
54
|
|
|
$label_submit = _AM_OLEDRION_MODIFY; |
|
|
|
|
55
|
|
|
$list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : 0; |
56
|
|
|
if (empty($list_id)) { |
57
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_ERROR_21, $baseurl, 5); |
58
|
|
|
} |
59
|
|
|
$item = null; |
|
|
|
|
60
|
|
|
$item = $handlers->h_oledrion_lists->get($list_id); |
61
|
|
|
if (!is_object($item)) { |
62
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); |
63
|
|
|
} |
64
|
|
|
// Vérification, est-ce que l'utilisateur courant est bien le propriétaire de cette liste ? |
65
|
|
|
if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) { |
66
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8); |
67
|
|
|
} |
68
|
|
|
$edit = true; |
69
|
|
|
$label_submit = _AM_OLEDRION_MODIFY; |
70
|
|
|
} else { |
71
|
|
|
$title = _OLEDRION_ADD_LIST; |
72
|
|
|
$label_submit = _AM_OLEDRION_ADD; |
73
|
|
|
$item = $handlers->h_oledrion_lists->create(true); |
74
|
|
|
$edit = false; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
$sform = new XoopsThemeForm($title, 'frmList', $baseurl); |
78
|
|
|
$sform->addElement(new XoopsFormHidden('op', 'save')); |
79
|
|
|
$sform->addElement(new XoopsFormHidden('list_id', $item->getVar('list_id'))); |
80
|
|
|
$sform->addElement(new XoopsFormText(_AM_OLEDRION_TITLE, 'list_title', 50, 255, $item->getVar('list_title', 'e')), true); |
81
|
|
|
//$sform->addElement(new XoopsFormText(_OLEDRION_LIST_PASSWORD, 'list_password', 50, 50, $item->getVar('list_password','e')), false); |
|
|
|
|
82
|
|
|
$selectTypes = oledrion_lists::getTypesArray(); |
83
|
|
|
$selectType = new XoopsFormSelect(_OLEDRION_LIST_TYPE, 'list_type', $item->getVar('list_type', 'e')); |
84
|
|
|
$selectType->addOptionArray($selectTypes); |
85
|
|
|
$sform->addElement($selectType, true); |
86
|
|
|
$sform->addElement(new XoopsFormTextArea(_OLEDRION_DESCRIPTION, 'list_description', $item->getVar('list_description', 'e'), 7, 60), false); |
87
|
|
|
$listProducts = array(); |
|
|
|
|
88
|
|
|
if ($edit) { |
89
|
|
|
$listProducts = $handlers->h_oledrion_lists->getListProducts($item); |
90
|
|
|
if (count($listProducts) > 0) { |
91
|
|
|
$productsTray = new XoopsFormElementTray(_OLEDRION_PROD_IN_THIS_LIST, '<br />'); |
92
|
|
|
$productsTray->addElement(new XoopsFormLabel(_OLEDRION_CHECK_PRODUCTS), false); |
93
|
|
|
foreach ($listProducts as $product) { |
94
|
|
|
$caption = "<a target='_blank' href='" . $product->getLink() . "'>" . $product->getVar('product_title') . '</a>'; |
95
|
|
|
$checkbox = new XoopsFormCheckBox($caption, 'productsList[]'); |
96
|
|
|
$checkbox->addOption($product->getVar('product_id'), _DELETE); |
97
|
|
|
$productsTray->addElement($checkbox); |
98
|
|
|
unset($caption, $checkbox); |
99
|
|
|
} |
100
|
|
|
$sform->addElement($productsTray, false); |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
if ($product_id > 0) { |
104
|
|
|
$product = null; |
|
|
|
|
105
|
|
|
$product = $handlers->h_oledrion_products->get($product_id); |
106
|
|
|
if (is_object($product) && $product->isProductVisible()) { |
107
|
|
|
$content = "<a target='_blank' href='" . $product->getLink() . "'>" . $product->getVar('product_title') . '</a>'; |
108
|
|
|
$sform->addElement(new XoopsFormLabel(_OLEDRION_PRODUCT_DO_ADD, $content)); |
109
|
|
|
$sform->addElement(new XoopsFormHidden('product_id', $product_id)); |
110
|
|
|
} |
111
|
|
|
} |
112
|
|
|
$button_tray = new XoopsFormElementTray('', ''); |
113
|
|
|
$submit_btn = new XoopsFormButton('', 'post', $label_submit, 'submit'); |
114
|
|
|
$button_tray->addElement($submit_btn); |
115
|
|
|
$sform->addElement($button_tray); |
116
|
|
|
|
117
|
|
|
$sform = oledrion_utils::formMarkRequiredFields($sform); |
118
|
|
|
|
119
|
|
|
return $sform; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
switch ($op) { |
123
|
|
|
// ************************************************************************ |
124
|
|
|
case 'default': // Liste de toutes les listes de l'utilisateur ************ |
125
|
|
|
// ************************************************************************ |
126
|
|
|
$xoopsTpl->assign('op', $op); |
127
|
|
|
$lists = array(); |
128
|
|
|
$start = $limit = 0; |
129
|
|
|
$idAsKey = true; |
130
|
|
|
$lists = $handlers->h_oledrion_lists->getRecentLists(new oledrion_parameters(array('start' => $start, 'limit' => $limit, 'sort' => 'list_title', 'order' => 'ASC', 'idAsKey' => $idAsKey, 'listType' => OLEDRION_LISTS_ALL, 'list_uid' => $uid))); |
|
|
|
|
131
|
|
|
if (count($lists) > 0) { |
132
|
|
|
foreach ($lists as $list) { |
133
|
|
|
$xoopsTpl->append('lists', $list->toArray()); |
134
|
|
|
} |
135
|
|
|
} |
136
|
|
|
$breadcrumb = array(OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME10); |
137
|
|
|
break; |
138
|
|
|
|
139
|
|
|
// ************************************************************************ |
140
|
|
|
case 'addProduct': // Ajout d'un produit à une liste ********************* |
141
|
|
|
// ************************************************************************ |
142
|
|
|
$xoopsTpl->assign('op', $op); |
143
|
|
|
$product_id = isset($_GET['product_id']) ? intval($_GET['product_id']) : 0; |
144
|
|
|
if ($product_id == 0) { |
145
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR14, $baseurl, 4); |
146
|
|
|
} |
147
|
|
|
$userListsCount = $handlers->h_oledrion_lists->getRecentListsCount(OLEDRION_LISTS_ALL, $uid); |
|
|
|
|
148
|
|
|
$xoopsTpl->assign('userListsCount', $userListsCount); |
149
|
|
|
$xoopsTpl->assign('product_id', $product_id); |
150
|
|
|
if ($userListsCount > 0) { |
151
|
|
|
$userLists = $handlers->h_oledrion_lists->getRecentLists(new oledrion_parameters(array('start' => 0, 'limit' => 0, 'sort' => 'list_title', 'order' => 'ASC', 'idAsKey' => true, 'listType' => OLEDRION_LISTS_ALL, 'list_uid' => $uid))); |
|
|
|
|
152
|
|
|
foreach ($userLists as $list) { |
153
|
|
|
$xoopsTpl->append('lists', $list->toArray()); |
154
|
|
|
} |
155
|
|
|
$breadcrumb = array(OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME10, OLEDRION_URL => _OLEDRION_ADD_PRODUCT_LIST); |
156
|
|
|
$product = null; |
157
|
|
|
$product = $handlers->h_oledrion_products->get($product_id); |
|
|
|
|
158
|
|
View Code Duplication |
if (is_object($product) && $product->isProductVisible()) { |
|
|
|
|
159
|
|
|
$xoopsTpl->assign('product', $product->toArray()); |
160
|
|
|
} else { |
161
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR1, $baseurl, 4); |
162
|
|
|
} |
163
|
|
|
} else { |
164
|
|
|
$sform = listForm('addList', $product_id); |
165
|
|
|
$title = _OLEDRION_ADD_LIST; |
166
|
|
|
$breadcrumb = array(OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME10, OLEDRION_URL => $title); |
167
|
|
|
$xoopsTpl->assign('form', $sform->render()); |
168
|
|
|
} |
169
|
|
|
break; |
170
|
|
|
|
171
|
|
|
// ************************************************************************ |
172
|
|
|
case 'addProductToList': // Ajout d'un produit à une liste, sélection de la liste |
173
|
|
|
// ************************************************************************ |
174
|
|
|
$xoopsTpl->assign('op', $op); |
175
|
|
|
$product_id = isset($_POST['product_id']) ? intval($_POST['product_id']) : 0; |
176
|
|
|
if ($product_id == 0) { |
177
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR14, $baseurl, 4); |
178
|
|
|
} |
179
|
|
|
$product = null; |
180
|
|
|
$product = $handlers->h_oledrion_products->get($product_id); |
|
|
|
|
181
|
|
View Code Duplication |
if (is_object($product) && $product->isProductVisible()) { |
|
|
|
|
182
|
|
|
$xoopsTpl->assign('product', $product->toArray()); |
183
|
|
|
} else { |
184
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR1, $baseurl, 4); |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
$list_id = isset($_POST['list_id']) ? intval($_POST['list_id']) : 0; |
188
|
|
|
if ($list_id == 0) { // Ajouter à une nouvelle liste |
189
|
|
|
$sform = listForm('addList', $product_id); |
190
|
|
|
$title = _OLEDRION_ADD_LIST; |
191
|
|
|
$breadcrumb = array(OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME10, OLEDRION_URL => $title); |
192
|
|
|
$xoopsTpl->assign('form', $sform->render()); |
193
|
|
|
$xoopsTpl->assign('op', 'addList'); |
194
|
|
|
} else { // Ajouter à une liste existante |
195
|
|
|
if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) { |
|
|
|
|
196
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8); |
197
|
|
|
} |
198
|
|
|
if ($handlers->h_oledrion_products_list->isProductAlreadyInList($list_id, $product_id)) { |
|
|
|
|
199
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR26, $baseurl . '?op=addProduct&product_id=' . $product_id, 4); |
200
|
|
|
} else { |
201
|
|
|
$res = $handlers->h_oledrion_products_list->addProductToUserList($list_id, $product_id); |
|
|
|
|
202
|
|
|
if ($res) { |
203
|
|
|
$list = null; |
204
|
|
|
$list = $handlers->h_oledrion_lists->get($list_id); |
|
|
|
|
205
|
|
|
if (is_object($list)) { |
206
|
|
|
$handlers->h_oledrion_lists->incrementListProductsCount($list); |
|
|
|
|
207
|
|
|
} |
208
|
|
|
oledrion_utils::updateCache(); |
209
|
|
|
oledrion_utils::redirect(_OLEDRION_PRODUCT_LIST_ADD_OK, $product->getLink(), 2); |
210
|
|
|
} else { |
211
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR27, $product->getLink(), 4); |
212
|
|
|
} |
213
|
|
|
} |
214
|
|
|
} |
215
|
|
|
break; |
216
|
|
|
|
217
|
|
|
// ************************************************************************ |
218
|
|
|
case 'delete': // Suppression d'une liste ******************************** |
219
|
|
|
// ************************************************************************ |
220
|
|
|
$xoopsTpl->assign('op', $op); |
221
|
|
|
$list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : 0; |
222
|
|
|
if ($list_id == 0) { |
223
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR21, $baseurl, 4); |
224
|
|
|
} |
225
|
|
|
// Vérification, est-ce que l'utilisateur courant est bien le propriétaire de cette liste ? |
226
|
|
|
if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) { |
|
|
|
|
227
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8); |
228
|
|
|
} |
229
|
|
|
$item = $handlers->h_oledrion_lists->get($list_id); |
|
|
|
|
230
|
|
|
if (!is_object($item)) { |
231
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); |
232
|
|
|
} |
233
|
|
|
xoops_confirm(array('op' => 'reallyDelete', 'list_id' => $list_id), $baseurl, _OLEDRION_DELETE_LIST . '<br />' . $item->getVar('list_title')); |
234
|
|
|
break; |
235
|
|
|
|
236
|
|
|
// ************************************************************************ |
237
|
|
|
case 'reallyDelete': // Suppression effective d'une liste ************** |
238
|
|
|
// ************************************************************************ |
239
|
|
|
$list_id = isset($_POST['list_id']) ? intval($_POST['list_id']) : 0; |
240
|
|
|
if ($list_id == 0) { |
241
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR21, $baseurl, 4); |
242
|
|
|
} |
243
|
|
|
// Vérification, est-ce que l'utilisateur courant est bien le propriétaire de cette liste ? |
244
|
|
|
if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) { |
|
|
|
|
245
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8); |
246
|
|
|
} |
247
|
|
|
$item = $handlers->h_oledrion_lists->get($list_id); |
|
|
|
|
248
|
|
|
if (!is_object($item)) { |
249
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); |
250
|
|
|
} |
251
|
|
|
if ($handlers->h_oledrion_lists->deleteList($item)) { |
|
|
|
|
252
|
|
|
oledrion_utils::updateCache(); |
253
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl, 2); |
254
|
|
|
} else { |
255
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl, 5); |
256
|
|
|
} |
257
|
|
|
break; |
258
|
|
|
|
259
|
|
|
// ************************************************************************ |
260
|
|
|
case 'save': // Sauvegarde d'une liste ********************************* |
261
|
|
|
// ************************************************************************ |
262
|
|
|
$list_id = isset($_POST['list_id']) ? intval($_POST['list_id']) : 0; |
263
|
|
|
if (!empty($list_id)) { |
264
|
|
|
// Vérification, est-ce que l'utilisateur courant est bien le propriétaire de cette liste ? |
265
|
|
|
if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) { |
|
|
|
|
266
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8); |
267
|
|
|
} |
268
|
|
|
$edit = true; |
269
|
|
|
$item = $handlers->h_oledrion_lists->get($list_id); |
|
|
|
|
270
|
|
|
if (!is_object($item)) { |
271
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); |
272
|
|
|
} |
273
|
|
|
$item->unsetNew(); |
274
|
|
|
$edit = true; |
275
|
|
|
} else { |
276
|
|
|
$item = $handlers->h_oledrion_lists->create(true); |
|
|
|
|
277
|
|
|
$edit = false; |
278
|
|
|
} |
279
|
|
|
// Contrôle sur le titre |
280
|
|
|
if (!isset($_POST['list_title']) || (isset($_POST['list_title']) && xoops_trim($_POST['list_title']) == '')) { |
281
|
|
|
oledrion_utils::redirect(_OLEDRION_ERROR24, $baseurl, 5); |
282
|
|
|
} |
283
|
|
|
$item->setVars($_POST); |
284
|
|
|
if (!$edit) { |
285
|
|
|
$item->setVar('list_date', time()); |
286
|
|
|
$item->setVar('list_uid', $uid); |
287
|
|
|
} |
288
|
|
|
if (isset($_POST['productsList'])) { |
289
|
|
|
$productsDeletedCount = 0; |
290
|
|
|
foreach ($_POST['productsList'] as $productId) { |
291
|
|
|
$res = $handlers->h_oledrion_products_list->deleteProductFromList($list_id, intval($productId)); |
|
|
|
|
292
|
|
|
if ($res) { |
293
|
|
|
$productsDeletedCount++; |
294
|
|
|
} |
295
|
|
|
} |
296
|
|
|
if ($productsDeletedCount > 0) { |
297
|
|
|
$handlers->h_oledrion_products_list->decrementListProductsCount($productsDeletedCount); |
|
|
|
|
298
|
|
|
} |
299
|
|
|
} |
300
|
|
|
$res = $handlers->h_oledrion_lists->insert($item); |
|
|
|
|
301
|
|
|
if ($res) { |
302
|
|
|
if (isset($_POST['product_id'])) { |
303
|
|
|
$product_id = intval($_POST['product_id']); |
304
|
|
|
if ($product_id > 0) { |
305
|
|
|
$product = null; |
306
|
|
|
$product = $handlers->h_oledrion_products->get($product_id); |
|
|
|
|
307
|
|
|
if (is_object($product) && $product->isProductVisible()) { // On peut ajouter le produit à cette nouvelle liste |
308
|
|
|
$res = $handlers->h_oledrion_products_list->addProductToUserList($item->getVar('list_id'), $product_id); |
|
|
|
|
309
|
|
|
if ($res) { // Mise à jour du nombre de produits de la liste |
310
|
|
|
$handlers->h_oledrion_lists->incrementListProductsCount($item); |
|
|
|
|
311
|
|
|
oledrion_utils::updateCache(); |
312
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $product->getLink(), 2); |
313
|
|
|
} |
314
|
|
|
} |
315
|
|
|
} |
316
|
|
|
} |
317
|
|
|
oledrion_utils::updateCache(); |
318
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl, 2); |
319
|
|
|
} else { |
320
|
|
|
oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl, 5); |
321
|
|
|
} |
322
|
|
|
break; |
323
|
|
|
|
324
|
|
|
// ************************************************************************ |
325
|
|
|
case 'edit': // Edition d'une liste *************************************** |
326
|
|
|
case 'addList': // Ajout d'une liste ************************************** |
327
|
|
|
// ************************************************************************ |
328
|
|
|
$xoopsTpl->assign('op', $op); |
329
|
|
|
$sform = listForm($op, 0); |
330
|
|
|
if ($op == 'edit') { |
331
|
|
|
$title = _OLEDRION_EDIT_LIST; |
332
|
|
|
} else { |
333
|
|
|
$title = _OLEDRION_ADD_LIST; |
334
|
|
|
} |
335
|
|
|
$breadcrumb = array(OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, |
336
|
|
|
OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME10, |
337
|
|
|
OLEDRION_URL => $title); |
338
|
|
|
|
339
|
|
|
$xoopsTpl->assign('form', $sform->render()); |
340
|
|
|
break; |
341
|
|
|
} |
342
|
|
|
|
343
|
|
|
oledrion_utils::setCSS(); |
344
|
|
|
oledrion_utils::setLocalCSS($xoopsConfig['language']); |
345
|
|
|
|
346
|
|
|
$xoopsTpl->assign('mod_pref', $mod_pref); |
347
|
|
|
$xoopsTpl->assign('breadcrumb', oledrion_utils::breadcrumb($breadcrumb)); |
|
|
|
|
348
|
|
|
|
349
|
|
|
$title = _MI_OLEDRION_SMNAME10 . ' - ' . oledrion_utils::getModuleName(); |
350
|
|
|
oledrion_utils::setMetas($title, $title); |
351
|
|
|
require_once XOOPS_ROOT_PATH . '/footer.php'; |
352
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.