Adds additional parameters to a node.
public addNodeParams ( string $id, array $params = [] ) | ||
$id | string | The unique node id. |
$params | array | Parameters to set (key/value pairs). |
/** * Constructor. * * @param array $opts Optional parameters: * - abbrev: (boolean) Abbreviate long mailbox names by replacing the * middle of the name with '...'? * DEFAULT: Yes * - basename: (boolean) Use raw basename instead of abbreviated label? * DEFAULT: false * - heading: (string) The label for an empty-value option at the top of * the list. * DEFAULT: '' * - inc_notepads: (boolean) Include user's editable notepads in list? * DEFAULT: No * - inc_tasklists: (boolean) Include user's editable tasklists in list? * DEFAULT: No * - inc_vfolder: (boolean) Include user's virtual folders in list? * DEFAULT: No * - iterator: (Iterator) Tree iterator to use. * - new_mbox: (boolean) Display an option to create a new mailbox? * DEFAULT: No * - optgroup: (boolean) Whether to use <optgroup> elements to group * mailbox types. * DEFAULT: false * - selected: (string) The mailbox to have selected by default. * DEFAULT: None */ public function __construct(array $opts = array()) { global $injector; $this->_tree = $injector->getInstance('IMP_Ftree')->createTree(strval(new Horde_Support_Randomid()), array('basename' => !empty($opts['basename']), 'iterator' => empty($opts['iterator']) ? null : $opts['iterator'], 'render_type' => 'IMP_Tree_Flist')); if (!empty($opts['selected'])) { $this->_tree->addNodeParams(IMP_Mailbox::formTo($opts['selected']), array('selected' => true)); } $this->_tree->setOption($opts); }
/** * Adds additional parameters to a node. * * @param string $id The unique node id. * @param array $params Parameters to set (key/value pairs). */ public function addNodeParams($id, $params = array()) { $this->_tree->addNodeParams($id, $params); }