XoopsModules25x /
oledrion
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 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 {@link http://xoops.org/ XOOPS Project} |
||
| 16 | * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
||
| 17 | * @author Hervé Thouzard (http://www.herve-thouzard.com/) |
||
| 18 | */ |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Affichage du contenu d'une liste |
||
| 22 | * |
||
| 23 | * @param integer list_id Identifiant de la liste |
||
| 24 | */ |
||
| 25 | require __DIR__ . '/header.php'; |
||
| 26 | $GLOBALS['current_category'] = -1; |
||
| 27 | $GLOBALS['xoopsOption']['template_main'] = 'oledrion_list.tpl'; |
||
| 28 | require_once XOOPS_ROOT_PATH . '/header.php'; |
||
| 29 | |||
| 30 | if (isset($_GET['list_id'])) { |
||
| 31 | $list_id = (int)$_GET['list_id']; |
||
| 32 | } else { |
||
| 33 | Oledrion_utils::redirect(_OLEDRION_ERROR21, 'index.php', 5); |
||
| 34 | } |
||
| 35 | $handlers = OledrionHandler::getInstance(); |
||
| 36 | |||
| 37 | // La liste existe ? |
||
| 38 | $list = null; |
||
| 39 | $list = $handlers->h_oledrion_lists->get($list_id); |
||
|
0 ignored issues
–
show
|
|||
| 40 | if (!is_object($list)) { |
||
| 41 | Oledrion_utils::redirect(_OLEDRION_ERROR21, 'index.php', 5); |
||
| 42 | } |
||
| 43 | |||
| 44 | // Vérification du type de liste (publique/privée) |
||
| 45 | if (!$list->isSuitableForCurrentUser()) { |
||
| 46 | Oledrion_utils::redirect(_OLEDRION_ERROR22, 'index.php', 5); |
||
| 47 | } |
||
| 48 | $xoopsTpl->assign('mod_pref', $mod_pref); // Préférences du module |
||
| 49 | $xoopsTpl->assign('columnsCount', Oledrion_utils::getModuleOption('catagory_colums')); |
||
| 50 | $xoopsTpl->assign('list', $list->toArray()); |
||
| 51 | |||
| 52 | // TVA |
||
| 53 | $vatArray = array(); |
||
| 54 | $vatArray = $h_oledrion_vat->getAllVats(new Oledrion_parameters()); |
||
| 55 | |||
| 56 | // Recherche des produits de la liste |
||
| 57 | $products = $handlers->h_oledrion_lists->getListProducts($list); |
||
|
0 ignored issues
–
show
The property
h_oledrion_lists does not exist on object<OledrionHandler>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 58 | if (count($products) > 0) { |
||
| 59 | foreach ($products as $product) { |
||
| 60 | $xoopsTpl->append('products', $product->toArray()); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | // Mise à jour du compte de vues |
||
| 65 | $handlers->h_oledrion_lists->incrementListViews($list); |
||
|
0 ignored issues
–
show
The property
h_oledrion_lists does not exist on object<OledrionHandler>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 66 | |||
| 67 | // Recherce des autres listes de cet utilisateur |
||
| 68 | if ($handlers->h_oledrion_lists->getRecentListsCount(OLEDRION_LISTS_ALL_PUBLIC, Oledrion_utils::getCurrentUserID()) > 1) { |
||
|
0 ignored issues
–
show
The property
h_oledrion_lists does not exist on object<OledrionHandler>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 69 | $otherUserLists = $handlers->h_oledrion_lists->getRecentLists(new Oledrion_parameters(array( |
||
|
0 ignored issues
–
show
The property
h_oledrion_lists does not exist on object<OledrionHandler>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 70 | 'start' => 0, |
||
| 71 | 'limit' => 0, |
||
| 72 | 'sort' => 'list_date', |
||
| 73 | 'order' => 'DESC', |
||
| 74 | 'idAsKey' => true, |
||
| 75 | 'listType' => OLEDRION_LISTS_ALL_PUBLIC, |
||
| 76 | 'list_uid' => Oledrion_utils::getCurrentUserID() |
||
| 77 | ))); |
||
| 78 | if (count($otherUserLists) > 0) { |
||
| 79 | foreach ($otherUserLists as $oneOtherList) { |
||
| 80 | $xoopsTpl->append('otherUserLists', $oneOtherList->toArray()); |
||
| 81 | } |
||
| 82 | } |
||
| 83 | } |
||
| 84 | |||
| 85 | Oledrion_utils::setCSS(); |
||
| 86 | Oledrion_utils::setLocalCSS($xoopsConfig['language']); |
||
| 87 | Oledrion_utils::loadLanguageFile('modinfo.php'); |
||
| 88 | |||
| 89 | $breadcrumb = array( |
||
| 90 | OLEDRION_URL . 'all-lists.php' => _MI_OLEDRION_SMNAME11, |
||
| 91 | OLEDRION_URL . basename(__FILE__) => $list->getVar('list_title') |
||
| 92 | ); |
||
| 93 | $xoopsTpl->assign('breadcrumb', Oledrion_utils::breadcrumb($breadcrumb)); |
||
| 94 | |||
| 95 | $title = $list->getVar('list_title') . ' - ' . Oledrion_utils::getModuleName(); |
||
| 96 | Oledrion_utils::setMetas($title, $title, Oledrion_utils::createMetaKeywords($list->getVar('list_description', 'n') . ' ' . $list->getVar('list_title', 'n'))); |
||
| 97 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||
| 98 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.