/**
  * Tests getHtmlForControlButtons() method
  *
  * @return void
  * @test
  */
 public function testGetHtmlForControlButtons()
 {
     $parent = PMA_NodeFactory::getInstance('Node_Database', '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);
 }
Example #2
0
 /**
  * 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
  *
  * @return Node_Table
  */
 public function __construct($name, $type = Node::OBJECT, $is_group = false)
 {
     parent::__construct($name, $type, $is_group);
     $this->icon = array();
     $this->_addIcon($GLOBALS['cfg']['NavigationTreeDefaultTabTable']);
     $this->_addIcon($GLOBALS['cfg']['NavigationTreeDefaultTabTable2']);
     switch ($GLOBALS['cfg']['DefaultTabTable']) {
         case 'tbl_structure.php':
             $this->title = __('Structure');
             break;
         case 'tbl_select.php':
             $this->title = __('Search');
             break;
         case 'tbl_change.php':
             $this->title = __('Insert');
             break;
         case 'tbl_sql.php':
             $this->title = __('SQL');
             break;
         case 'sql.php':
             $this->title = __('Browse');
             break;
     }
     $this->links = array('text' => $GLOBALS['cfg']['DefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;pos=0&amp;token=' . $_SESSION[' PMA_token '], 'icon' => array($GLOBALS['cfg']['NavigationTreeDefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $_SESSION[' PMA_token '], $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $_SESSION[' PMA_token ']), 'title' => $this->title);
     $this->classes = 'table';
 }
 /**
  * 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_Util::getImage('b_props.png', __('View'));
     $this->links = array('text' => 'sql.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;pos=0' . '&amp;token=' . $_SESSION[' PMA_token '], 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;token=' . $_SESSION[' PMA_token ']);
     $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
  *
  * @return Node_Procedure
  */
 public function __construct($name, $type = Node::OBJECT, $is_group = false)
 {
     parent::__construct($name, $type, $is_group);
     $this->icon = PMA_Util::getImage('b_routines.png', __('Procedure'));
     $this->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=PROCEDURE' . '&amp;execute_dialog=1&amp;token=' . $GLOBALS['token'], 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=PROCEDURE' . '&amp;edit_item=1&amp;token=' . $GLOBALS['token']);
     $this->classes = 'procedure';
 }
Example #5
0
 /**
  * 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
  *
  * @return Node_Event
  */
 public function __construct($name, $type = Node::OBJECT, $is_group = false)
 {
     parent::__construct($name, $type, $is_group);
     $this->icon = PMA_Util::getImage('b_events.png');
     $this->links = array('text' => 'db_events.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;edit_item=1' . '&amp;token=' . $_SESSION[' PMA_token '], 'icon' => 'db_events.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;export_item=1' . '&amp;token=' . $_SESSION[' PMA_token ']);
     $this->classes = 'event';
 }
 /**
  * Initialises the class by setting the common variables
  *
  * @param string $name An identifier for the new node
  * @param int    $type Type of node, may be one of CONTAINER or OBJECT
  */
 public function __construct($name, $type = Node::OBJECT)
 {
     parent::__construct($name, $type);
     if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']) {
         $this->separator = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
         $this->separator_depth = (int) $GLOBALS['cfg']['NavigationTreeTableLevel'];
     }
 }
Example #7
0
 /**
  * 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
  *
  * @return Node_Table
  */
 public function __construct($name, $type = Node::OBJECT, $is_group = false)
 {
     parent::__construct($name, $type, $is_group);
     $this->icon = array();
     $this->_addIcon(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table'));
     $this->_addIcon(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table'));
     $title = PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']);
     $this->title = $title;
     $script_name = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
     $this->links = array('text' => $script_name . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;pos=0&amp;token=' . $_SESSION[' PMA_token '], 'icon' => array(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table') . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $_SESSION[' PMA_token '], PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table') . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $_SESSION[' PMA_token ']), 'title' => $this->title);
     $this->classes = 'table';
 }
Example #8
0
 /**
  * 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
  *
  * @return Node_Table
  */
 public function __construct($name, $type = Node::OBJECT, $is_group = false)
 {
     parent::__construct($name, $type, $is_group);
     switch ($GLOBALS['cfg']['NavigationTreeDefaultTabTable']) {
         case 'tbl_structure.php':
             $this->icon = PMA_Util::getImage('b_props.png', __('Structure'));
             break;
         case 'tbl_select.php':
             $this->icon = PMA_Util::getImage('b_search.png', __('Search'));
             break;
         case 'tbl_change.php':
             $this->icon = PMA_Util::getImage('b_insrow.png', __('Insert'));
             break;
         case 'tbl_sql.php':
             $this->icon = PMA_Util::getImage('b_sql.png', __('SQL'));
             break;
         case 'sql.php':
             $this->icon = PMA_Util::getImage('b_browse.png', __('Browse'));
             break;
     }
     $this->links = array('text' => $GLOBALS['cfg']['DefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;pos=0&amp;token=' . $GLOBALS['token'], 'icon' => $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $GLOBALS['token']);
     $this->classes = 'table';
 }