/** * Tests getHtmlForControlButtons() method * * @return void * @test */ public function testGetHtmlForControlButtons() { $parent = NodeFactory::getInstance('NodeDatabase', 'parent'); $parent->addChild($this->object); $this->object->expects($this->once())->method('getItemType')->will($this->returnValue('itemType')); $html = $this->object->getHtmlForControlButtons(); $this->assertStringStartsWith('<span class="navItemControls">', $html); $this->assertStringEndsWith('</span>', $html); $this->assertContains('<a href="navigation.php' . PMA_URL_getCommon() . '&hideNavItem=true&itemType=itemType&itemName=child' . '&dbName=parent" class="hideNavItem ajax">', $html); }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA\libraries\Util::getImage('b_events.png'); $this->links = array('text' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&edit_item=1', 'icon' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&export_item=1'); $this->classes = 'event'; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA\libraries\Util::getImage('b_routines.png', __('Function')); $this->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' . '&edit_item=1&token=' . $_SESSION[' PMA_token '], 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' . '&execute_dialog=1&token=' . $_SESSION[' PMA_token ']); $this->classes = 'function'; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA\libraries\Util::getImage('b_props.png', __('View')); $this->links = array('text' => 'sql.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&pos=0', 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s'); $this->classes = 'view'; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA\libraries\Util::getImage('b_routines.png', __('Procedure')); $this->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' . '&edit_item=1', 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' . '&execute_dialog=1'); $this->classes = 'procedure'; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = array(); $this->_addIcon(Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table')); $this->_addIcon(Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table')); $title = Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']); $this->title = $title; $script_name = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); $this->links = array('text' => $script_name . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&pos=0&token=' . $_SESSION[' PMA_token '], 'icon' => array(Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table') . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $_SESSION[' PMA_token '], Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table') . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $_SESSION[' PMA_token ']), 'title' => $this->title); $this->classes = 'table'; }