showText() public static method

Checks whether configuration value tells to show text.
public static showText ( string $value ) : boolean
$value string Configuration option name
return boolean Whether to show text.
Esempio n. 1
0
 /**
  * Get a navigation button
  *
  * @param string  $caption            iconic caption for button
  * @param string  $title              text for button
  * @param integer $pos                position for next query
  * @param string  $html_sql_query     query ready for display
  * @param boolean $back               whether 'begin' or 'previous'
  * @param string  $onsubmit           optional onsubmit clause
  * @param string  $input_for_real_end optional hidden field for special treatment
  * @param string  $onclick            optional onclick clause
  *
  * @return string                     html content
  *
  * @access  private
  *
  * @see     _getMoveBackwardButtonsForTableNavigation(),
  *          _getMoveForwardButtonsForTableNavigation()
  */
 private function _getTableNavigationButton($caption, $title, $pos, $html_sql_query, $back, $onsubmit = '', $input_for_real_end = '', $onclick = '')
 {
     $caption_output = '';
     if ($back) {
         if (Util::showIcons('TableNavigationLinksMode')) {
             $caption_output .= $caption;
         }
         if (Util::showText('TableNavigationLinksMode')) {
             $caption_output .= ' ' . $title;
         }
     } else {
         if (Util::showText('TableNavigationLinksMode')) {
             $caption_output .= $title;
         }
         if (Util::showIcons('TableNavigationLinksMode')) {
             $caption_output .= ' ' . $caption;
         }
     }
     $title_output = ' title="' . $title . '"';
     return '<td>' . '<form action="sql.php" method="post" ' . $onsubmit . '>' . PMA_URL_getHiddenInputs($this->__get('db'), $this->__get('table')) . '<input type="hidden" name="sql_query" value="' . $html_sql_query . '" />' . '<input type="hidden" name="pos" value="' . $pos . '" />' . '<input type="hidden" name="is_browse_distinct" value="' . $this->__get('is_browse_distinct') . '" />' . '<input type="hidden" name="goto" value="' . $this->__get('goto') . '" />' . $input_for_real_end . '<input type="submit" name="navig"' . ' class="ajax" ' . 'value="' . $caption_output . '" ' . $title_output . $onclick . ' />' . '</form>' . '</td>';
 }
Esempio n. 2
0
 /**
  * Returns the breadcrumbs as HTML
  *
  * @return string HTML formatted breadcrumbs
  */
 private function _getBreadcrumbs()
 {
     $retval = '';
     $tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)->isView();
     if (empty($GLOBALS['cfg']['Server']['host'])) {
         $GLOBALS['cfg']['Server']['host'] = '';
     }
     $server_info = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host'];
     $server_info .= empty($GLOBALS['cfg']['Server']['port']) ? '' : ':' . $GLOBALS['cfg']['Server']['port'];
     $separator = "<span class='separator item'>&nbsp;»</span>";
     $item = '<a href="%1$s%2$s" class="item">';
     if (Util::showText('TabsMode')) {
         $item .= '%4$s: ';
     }
     $item .= '%3$s</a>';
     $retval .= "<div id='floating_menubar'></div>";
     $retval .= "<div id='serverinfo'>";
     if (Util::showIcons('TabsMode')) {
         $retval .= Util::getImage('s_host.png', '', array('class' => 'item'));
     }
     $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabServer'], 'server'), URL::getCommon(), htmlspecialchars($server_info), __('Server'));
     if (strlen($this->_db) > 0) {
         $retval .= $separator;
         if (Util::showIcons('TabsMode')) {
             $retval .= Util::getImage('s_db.png', '', array('class' => 'item'));
         }
         $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), URL::getCommon(array('db' => $this->_db)), htmlspecialchars($this->_db), __('Database'));
         // if the table is being dropped, $_REQUEST['purge'] is set to '1'
         // so do not display the table name in upper div
         if (strlen($this->_table) > 0 && !(isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) {
             include './libraries/tbl_info.inc.php';
             $retval .= $separator;
             if (Util::showIcons('TabsMode')) {
                 $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png';
                 $retval .= Util::getImage($icon, '', array('class' => 'item'));
             }
             $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'), URL::getCommon(array('db' => $this->_db, 'table' => $this->_table)), str_replace(' ', '&nbsp;', htmlspecialchars($this->_table)), $tbl_is_view ? __('View') : __('Table'));
             /**
              * Displays table comment
              */
             if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
                 if (mb_strstr($show_comment, '; InnoDB free')) {
                     $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
                 }
                 $retval .= '<span class="table_comment"';
                 $retval .= ' id="span_table_comment">&quot;';
                 $retval .= htmlspecialchars($show_comment);
                 $retval .= '&quot;</span>';
             }
             // end if
         } else {
             // no table selected, display database comment if present
             $cfgRelation = PMA_getRelationsParam();
             // Get additional information about tables for tooltip is done
             // in Util::getDbInfo() only once
             if ($cfgRelation['commwork']) {
                 $comment = PMA_getDbComment($this->_db);
                 /**
                  * Displays table comment
                  */
                 if (!empty($comment)) {
                     $retval .= '<span class="table_comment"' . ' id="span_table_comment">&quot;' . htmlspecialchars($comment) . '&quot;</span>';
                 }
                 // end if
             }
         }
     }
     $retval .= '<div class="clearfloat"></div>';
     $retval .= '</div>';
     return $retval;
 }