From 71003281168583e6d0d8edd01be81223b5971a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Nov 2019 21:25:12 +0100 Subject: [PATCH] doxygen menubase class --- htdocs/core/class/menubase.class.php | 95 +++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index d47146abc64..3af8d3924a8 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * 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 @@ -45,17 +45,32 @@ class Menubase public $errors = array(); /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; + /** + * @var string Menu handler + */ public $menu_handler; + + /** + * @var string Module name if record is added by a module + */ public $module; + + /** + * @var string Menu top or left + */ public $type; + + /** + * @var string Name family/module for top menu (home, companies, ...) + */ public $mainmenu; /** - * @var int ID + * @var int 0 or Id of mother menu line, or -1 if we use fk_mainmenu and fk_leftmenu */ public $fk_menu; @@ -70,23 +85,71 @@ class Menubase public $fk_leftmenu; /** - * @var int position + * @var int Sort order of entry */ public $position; + + /** + * @var string Relative (or absolute) url to go + */ public $url; + + /** + * @var string Target of Url link + */ public $target; + + /** + * @var string Key for menu translation + * @deprecated + * @see title + */ public $titre; + + /** + * @var string Key for menu translation + */ + public $title; + + /** + * @var string Lang file to load for translation + */ public $langs; + + /** + * @var string Not used + * @deprecated + */ public $level; - public $leftmenu; //langs=trim($this->langs); $this->perms=trim($this->perms); $this->enabled=trim($this->enabled); - $this->user=trim($this->user); + $this->user = (int) $this->user; if (empty($this->position)) $this->position=0; if (! $this->level) $this->level=0; @@ -246,7 +309,7 @@ class Menubase */ public function update($user = null, $notrigger = 0) { - global $conf, $langs; + //global $conf, $langs; // Clean parameters $this->rowid=trim($this->rowid); @@ -265,7 +328,7 @@ class Menubase $this->langs=trim($this->langs); $this->perms=trim($this->perms); $this->enabled=trim($this->enabled); - $this->user=trim($this->user); + $this->user = (int) $this->user; // Check parameters // Put here code to add control on parameters values @@ -311,7 +374,7 @@ class Menubase */ public function fetch($id, $user = null) { - global $langs; + //global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -385,7 +448,7 @@ class Menubase */ public function delete($user) { - global $conf, $langs; + //global $conf, $langs; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE rowid=".$this->id;