Server IP : 195.201.23.43 / Your IP : 18.119.140.150 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/libraries/src/Menu/ |
Upload File : |
<?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Menu; defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * A Node for MenuTree * * @see Tree * @since 3.8.0 * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ class Node { /** * Node Id * * @var string * * @since 3.8.0 */ protected $id = null; /** * CSS Class for node * * @var string * * @since 3.8.0 */ protected $class = null; /** * Whether this node is active * * @var bool * * @since 3.8.0 */ protected $active = false; /** * Additional custom node params * * @var Registry * * @since 3.8.0 */ protected $params; /** * Parent node object * * @var Node * * @since 3.8.0 */ protected $parent = null; /** * Array of Children node objects * * @var Node[] * * @since 3.8.0 */ protected $children = array(); /** * Constructor * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function __construct() { $this->params = new Registry; } /** * Add child to this node * * If the child already has a parent, the link is unset * * @param Node $child The child to be added * * @return Node The new added child * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function addChild(Node $child) { $hash = spl_object_hash($child); if (isset($child->parent)) { $child->parent->removeChild($child); } $child->parent = $this; $this->children[$hash] = $child; return $child; } /** * Remove a child from this node * * If the child exists it is unset * * @param Node $child The child to be added * * @return void * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function removeChild(Node $child) { $hash = spl_object_hash($child); if (isset($this->children[$hash])) { $child->parent = null; unset($this->children[$hash]); } } /** * Test if this node has a parent * * @return boolean True if there is a parent * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function hasParent() { return isset($this->parent); } /** * Get the parent of this node * * @return Node The Node object's parent or null for no parent * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function getParent() { return $this->parent; } /** * Test if this node has children * * @return boolean * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function hasChildren() { return count($this->children) > 0; } /** * Get the children of this node * * @return Node[] The children * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function getChildren() { return $this->children; } /** * Find the current node depth in the tree hierarchy * * @return integer The node level in the hierarchy, where ROOT == 0, First level menu item == 1, and so on. * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function getLevel() { return $this->hasParent() ? $this->getParent()->getLevel() + 1 : 0; } /** * Check whether the object instance node is the root node * * @return boolean * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function isRoot() { return !$this->hasParent(); } /** * Set the active state on or off * * @param bool $active The new active state * * @return void * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function setActive($active) { $this->active = (bool) $active; } /** * set the params array * * @param Registry $params The params attributes * * @return void * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function setParams(Registry $params) { $this->params = $params; } /** * Get the param value from the node params * * @param string $key The param name * * @return mixed * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function getParam($key) { return isset($this->params[$key]) ? $this->params[$key] : null; } /** * Get an attribute value * * @param string $name The attribute name * * @return mixed * * @since 3.8.0 * * @deprecated 4.0 Use Joomla\CMS\Menu\MenuItem */ public function get($name) { switch ($name) { case 'id': case 'class': case 'active': case 'params': return $this->$name; } return null; } }Private