PMA\libraries\navigation\nodes\NodeDatabaseChild::getHtmlForControlButtons PHP Метод

getHtmlForControlButtons() публичный Метод

Returns HTML for control buttons displayed infront of a node
public getHtmlForControlButtons ( ) : String
Результат String HTML for control buttons
    public function getHtmlForControlButtons()
    {
        $ret = '';
        $cfgRelation = PMA_getRelationsParam();
        if ($cfgRelation['navwork']) {
            $db = $this->realParent()->real_name;
            $item = $this->real_name;
            $params = array('hideNavItem' => true, 'itemType' => $this->getItemType(), 'itemName' => $item, 'dbName' => $db);
            $ret = '<span class="navItemControls">' . '<a href="navigation.php' . URL::getCommon($params) . '"' . ' class="hideNavItem ajax">' . PMA\libraries\Util::getImage('hide.png', __('Hide')) . '</a></span>';
        }
        return $ret;
    }

Usage Example

Пример #1
0
 /**
  * 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);
 }