コード例 #1
0
ファイル: header.inc.php プロジェクト: davidmottet/automne
                         $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
                     }
                     echo '<span class="table_comment" id="span_table_comment">' . '&quot;' . htmlspecialchars($show_comment) . '&quot;</span>' . "\n";
                 }
                 // end if
             } else {
                 // no table selected, display database comment if present
                 /**
                  * Settings for relations stuff
                  */
                 require_once './libraries/relation.lib.php';
                 $cfgRelation = PMA_getRelationsParam();
                 // Get additional information about tables for tooltip is done
                 // in libraries/db_info.inc.php only once
                 if ($cfgRelation['commwork']) {
                     $comment = PMA_getDbComment($GLOBALS['db']);
                     /**
                      * Displays table comment
                      */
                     if (!empty($comment)) {
                         echo '<span class="table_comment"' . ' id="span_table_comment">&quot;' . htmlspecialchars($comment) . '&quot;</span>' . "\n";
                     }
                     // end if
                 }
             }
         }
     }
     echo '</div>';
 }
 /**
  * Sets a variable to remember headers have been sent
コード例 #2
0
ファイル: relation.lib.php プロジェクト: mercysmart/naikelas
/**
 * Gets the comments for all columns of a table or the db itself
 *
 * @param string $db    the name of the db to check for
 * @param string $table the name of the table to check for
 *
 * @return array    [column_name] = comment
 *
 * @access  public
 */
function PMA_getComments($db, $table = '')
{
    $comments = array();
    if ($table != '') {
        // MySQL native column comments
        $columns = $GLOBALS['dbi']->getColumns($db, $table, null, true);
        if ($columns) {
            foreach ($columns as $column) {
                if (!empty($column['Comment'])) {
                    $comments[$column['Field']] = $column['Comment'];
                }
            }
        }
    } else {
        $comments[] = PMA_getDbComment($db);
    }
    return $comments;
}
コード例 #3
0
ファイル: db_datadict.php プロジェクト: flash1452/phpmyadmin
$header->enablePrintView();
/**
 * Gets the relations settings
 */
$cfgRelation = PMA_getRelationsParam();
require_once 'libraries/transformations.lib.php';
/**
 * Check parameters
 */
PMA\libraries\Util::checkParameters(array('db'));
/**
 * Defines the url to return to in case of error in a sql statement
 */
$err_url = 'db_sql.php' . PMA_URL_getCommon(array('db' => $db));
if ($cfgRelation['commwork']) {
    $comment = PMA_getDbComment($db);
    /**
     * Displays DB comment
     */
    if ($comment) {
        echo '<p>', __('Database comment'), '<br /><i>', htmlspecialchars($comment), '</i></p>';
    }
    // end if
}
/**
 * Selects the database and gets tables names
 */
$GLOBALS['dbi']->selectDb($db);
$tables = $GLOBALS['dbi']->getTables($db);
$count = 0;
foreach ($tables as $table) {
コード例 #4
0
ファイル: Menu.class.php プロジェクト: Sorekk/cvillecouncilus
 /**
  * Returns the breadcrumbs as HTML
  *
  * @return string HTML formatted breadcrumbs
  */
 private function _getBreadcrumbs()
 {
     $retval = '';
     $tbl_is_view = PMA_Table::isView($this->_db, $this->_table);
     $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 (PMA_Util::showText('TabsMode')) {
         $item .= '%4$s: ';
     }
     $item .= '%3$s</a>';
     $retval .= "<div id='floating_menubar'></div>";
     $retval .= "<div id='serverinfo'>";
     if (PMA_Util::showIcons('TabsMode')) {
         $retval .= PMA_Util::getImage('s_host.png', '', array('class' => 'item'));
     }
     $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabServer'], PMA_URL_getCommon(), htmlspecialchars($server_info), __('Server'));
     if (mb_strlen($this->_db)) {
         $retval .= $separator;
         if (PMA_Util::showIcons('TabsMode')) {
             $retval .= PMA_Util::getImage('s_db.png', '', array('class' => 'item'));
         }
         $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabDatabase'], PMA_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 (mb_strlen($this->_table) && !(isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) {
             include './libraries/tbl_info.inc.php';
             $retval .= $separator;
             if (PMA_Util::showIcons('TabsMode')) {
                 $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png';
                 $retval .= PMA_Util::getImage($icon, '', array('class' => 'item'));
             }
             $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabTable'], PMA_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 libraries/db_info.inc.php 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;
 }
コード例 #5
0
ファイル: relation.lib.php プロジェクト: AmberWish/laba_web
/**
 * Gets the comments for all rows of a table or the db itself
 *
 * @param string $db    the name of the db to check for
 * @param string $table the name of the table to check for
 *
 * @return  array    [field_name] = comment
 *
 * @access  public
 */
function PMA_getComments($db, $table = '')
{
    $comments = array();
    if ($table != '') {
        // MySQL native column comments
        $fields = PMA_DBI_get_columns($db, $table, null, true);
        if ($fields) {
            foreach ($fields as $field) {
                if (!empty($field['Comment'])) {
                    $comments[$field['Field']] = $field['Comment'];
                }
            }
        }
    } else {
        $comments[] = PMA_getDbComment($db);
    }
    return $comments;
}
コード例 #6
0
ファイル: navigation.php プロジェクト: kebyn/apache_workspace
// 2. there is only one database available (ie either only one database exists
//    or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
//    In this case, the database should not be collapsible/expandable
$img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"' . ' width="9" height="9" alt="+" />';
$img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"' . ' width="9" height="9" alt="-" />';
$href_left = '<a onclick="if (toggle(\'%d\')) return false;"' . ' href="navigation.php?%s" target="_self">';
$element_counter = 0;
if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
    $table_list = PMA_getTableList($GLOBALS['db']);
    $table_count = count($table_list);
    // show selected databasename as link to DefaultTabDatabase-page
    // with table count in ()
    $common_url_query = PMA_generate_common_url($GLOBALS['db']);
    $db_tooltip = '';
    if ($GLOBALS['cfg']['ShowTooltip'] && $GLOBALS['cfgRelation']['commwork']) {
        $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
        if ($_db_tooltip) {
            $db_tooltip = $_db_tooltip;
        }
    }
    $disp_name = $GLOBALS['db'];
    if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
        $disp_name = $db_tooltip;
        $disp_name_cut = $db_tooltip;
        $db_tooltip = $GLOBALS['db'];
    }
    ?>
    <p><a class="item"
        href="<?php 
    echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query;
    ?>
コード例 #7
0
 /**
  * Returns the comment associated with node
  * This method should be overridden by specific type of nodes
  *
  * @return string
  */
 public function getComment()
 {
     return PMA_getDbComment($this->real_name);
 }