Merge pull request #9783 from frederic34/patch-18
Update menubase.class.php
This commit is contained in:
commit
b6cb16a457
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -59,15 +60,18 @@ class Menubase
|
||||
public $fk_menu;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string fk_mainmenu
|
||||
*/
|
||||
public $fk_mainmenu;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string fk_leftmenu
|
||||
*/
|
||||
public $fk_leftmenu;
|
||||
|
||||
/**
|
||||
* @var int position
|
||||
*/
|
||||
public $position;
|
||||
public $url;
|
||||
public $target;
|
||||
@ -111,10 +115,10 @@ class Menubase
|
||||
$this->type=trim($this->type);
|
||||
$this->mainmenu=trim($this->mainmenu);
|
||||
$this->leftmenu=trim($this->leftmenu);
|
||||
$this->fk_menu=trim($this->fk_menu); // If -1, fk_mainmenu and fk_leftmenu must be defined
|
||||
$this->fk_menu = (int) $this->fk_menu; // If -1, fk_mainmenu and fk_leftmenu must be defined
|
||||
$this->fk_mainmenu=trim($this->fk_mainmenu);
|
||||
$this->fk_leftmenu=trim($this->fk_leftmenu);
|
||||
$this->position=trim($this->position);
|
||||
$this->position = (int) $this->position;
|
||||
$this->url=trim($this->url);
|
||||
$this->target=trim($this->target);
|
||||
$this->titre=trim($this->titre);
|
||||
@ -155,7 +159,7 @@ class Menubase
|
||||
$sql = "SELECT count(*)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu";
|
||||
$sql.= " WHERE menu_handler = '".$this->db->escape($this->menu_handler)."'";
|
||||
$sql.= " AND fk_menu = ".((int) $this->db->escape($this->fk_menu));
|
||||
$sql.= " AND fk_menu = ".((int) $this->fk_menu);
|
||||
$sql.= " AND position = ".((int) $this->position);
|
||||
$sql.= " AND url = '".$this->db->escape($this->url)."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@ -252,10 +256,10 @@ class Menubase
|
||||
$this->type=trim($this->type);
|
||||
$this->mainmenu=trim($this->mainmenu);
|
||||
$this->leftmenu=trim($this->leftmenu);
|
||||
$this->fk_menu=trim($this->fk_menu);
|
||||
$this->fk_menu = (int) $this->fk_menu;
|
||||
$this->fk_mainmenu=trim($this->fk_mainmenu);
|
||||
$this->fk_leftmenu=trim($this->fk_leftmenu);
|
||||
$this->position=trim($this->position);
|
||||
$this->position = (int) $this->position;
|
||||
$this->url=trim($this->url);
|
||||
$this->target=trim($this->target);
|
||||
$this->titre=trim($this->titre);
|
||||
@ -274,7 +278,7 @@ class Menubase
|
||||
$sql.= " type='".$this->db->escape($this->type)."',";
|
||||
$sql.= " mainmenu='".$this->db->escape($this->mainmenu)."',";
|
||||
$sql.= " leftmenu='".$this->db->escape($this->leftmenu)."',";
|
||||
$sql.= " fk_menu='".$this->db->escape($this->fk_menu)."',";
|
||||
$sql.= " fk_menu=".$this->fk_menu.",";
|
||||
$sql.= " fk_mainmenu=".($this->fk_mainmenu?"'".$this->db->escape($this->fk_mainmenu)."'":"null").",";
|
||||
$sql.= " fk_leftmenu=".($this->fk_leftmenu?"'".$this->db->escape($this->fk_leftmenu)."'":"null").",";
|
||||
$sql.= " position=".($this->position > 0 ? $this->position : 0).",";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user