PMA\libraries\Theme::getPrintPreview PHP Метод

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

Renders the preview for this theme
public getPrintPreview ( ) : string
Результат string
    public function getPrintPreview()
    {
        $url_params = array('set_theme' => $this->getId());
        $url = 'index.php' . URL::getCommon($url_params);
        $retval = '<div class="theme_preview">';
        $retval .= '<h2>';
        $retval .= htmlspecialchars($this->getName());
        $retval .= ' (' . htmlspecialchars($this->getVersion()) . ') ';
        $retval .= '</h2>';
        $retval .= '<p>';
        $retval .= '<a class="take_theme" ';
        $retval .= 'name="' . htmlspecialchars($this->getId()) . '" ';
        $retval .= 'href="' . $url . '">';
        if (@file_exists($this->getPath() . '/screen.png')) {
            // if screen exists then output
            $retval .= '<img src="' . $this->getPath() . '/screen.png" border="1"';
            $retval .= ' alt="' . htmlspecialchars($this->getName()) . '"';
            $retval .= ' title="' . htmlspecialchars($this->getName()) . '" />';
            $retval .= '<br />';
        } else {
            $retval .= __('No preview available.');
        }
        $retval .= '[ <strong>' . __('take it') . '</strong> ]';
        $retval .= '</a>';
        $retval .= '</p>';
        $retval .= '</div>';
        return $retval;
    }

Usage Example

Пример #1
0
 /**
  * Test for getPrintPreview().
  *
  * @return void
  */
 public function testPrintPreview()
 {
     $this->assertEquals($this->object->getPrintPreview(), '<div class="theme_preview"><h2> (0.0.0.0) </h2><p><a class="take_' . 'theme" name="" href="index.php?set_theme=&amp;server=99&amp;lang=en' . '&amp;collation_connection=utf-8' . '&amp;token=token">No preview available.[ <strong>take it</strong> ]' . '</a></p></div>');
 }