当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::expandUserString方法代码示例

本文整理汇总了PHP中PMA\libraries\Util::expandUserString方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::expandUserString方法的具体用法?PHP Util::expandUserString怎么用?PHP Util::expandUserString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA\libraries\Util的用法示例。


在下文中一共展示了Util::expandUserString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getPageTitle

 /**
  * If the page is missing the title, this function
  * will set it to something reasonable
  *
  * @return string
  */
 private function _getPageTitle()
 {
     if (empty($this->_title)) {
         if ($GLOBALS['server'] > 0) {
             if (!empty($GLOBALS['table'])) {
                 $temp_title = $GLOBALS['cfg']['TitleTable'];
             } else {
                 if (!empty($GLOBALS['db'])) {
                     $temp_title = $GLOBALS['cfg']['TitleDatabase'];
                 } elseif (!empty($GLOBALS['cfg']['Server']['host'])) {
                     $temp_title = $GLOBALS['cfg']['TitleServer'];
                 } else {
                     $temp_title = $GLOBALS['cfg']['TitleDefault'];
                 }
             }
             $this->_title = htmlspecialchars(Util::expandUserString($temp_title));
         } else {
             $this->_title = 'phpMyAdmin';
         }
     }
     return $this->_title;
 }
开发者ID:iShareLife,项目名称:phpmyadmin,代码行数:28,代码来源:Header.php

示例2: exportStructure

 /**
  * Outputs table's structure
  *
  * @param string $db          database name
  * @param string $table       table name
  * @param string $crlf        the end of line sequence
  * @param string $error_url   the url to go back in case of error
  * @param string $export_mode 'create_table', 'triggers', 'create_view',
  *                            'stand_in'
  * @param string $export_type 'server', 'database', 'table'
  * @param bool   $do_relation whether to include relation comments
  * @param bool   $do_comments whether to include the pmadb-style column
  *                            comments as comments in the structure;
  *                            this is deprecated but the parameter is
  *                            left here because export.php calls
  *                            exportStructure() also for other
  *                            export types which use this parameter
  * @param bool   $do_mime     whether to include mime comments
  * @param bool   $dates       whether to include creation/update/check dates
  * @param array  $aliases     Aliases of db/table/columns
  *
  * @return bool Whether it succeeded
  */
 public function exportStructure($db, $table, $crlf, $error_url, $export_mode, $export_type, $do_relation = false, $do_comments = false, $do_mime = false, $dates = false, $aliases = array())
 {
     $db_alias = $db;
     $table_alias = $table;
     $this->initAlias($aliases, $db_alias, $table_alias);
     global $cfgRelation;
     /* We do not export triggers */
     if ($export_mode == 'triggers') {
         return true;
     }
     /**
      * Get the unique keys in the table
      */
     $unique_keys = array();
     $keys = $GLOBALS['dbi']->getTableIndexes($db, $table);
     foreach ($keys as $key) {
         if ($key['Non_unique'] == 0) {
             $unique_keys[] = $key['Column_name'];
         }
     }
     /**
      * Gets fields properties
      */
     $GLOBALS['dbi']->selectDb($db);
     // Check if we can use Relations
     list($res_rel, $have_rel) = PMA_getRelationsAndStatus($do_relation && !empty($cfgRelation['relation']), $db, $table);
     /**
      * Displays the table structure
      */
     $buffer = $crlf . '%' . $crlf . '% ' . __('Structure:') . ' ' . $table_alias . $crlf . '%' . $crlf . ' \\begin{longtable}{';
     if (!PMA_exportOutputHandler($buffer)) {
         return false;
     }
     $alignment = '|l|c|c|c|';
     if ($do_relation && $have_rel) {
         $alignment .= 'l|';
     }
     if ($do_comments) {
         $alignment .= 'l|';
     }
     if ($do_mime && $cfgRelation['mimework']) {
         $alignment .= 'l|';
     }
     $buffer = $alignment . '} ' . $crlf;
     $header = ' \\hline ';
     $header .= '\\multicolumn{1}{|c|}{\\textbf{' . __('Column') . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Type') . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Null') . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Default') . '}}';
     if ($do_relation && $have_rel) {
         $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Links to') . '}}';
     }
     if ($do_comments) {
         $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Comments') . '}}';
         $comments = PMA_getComments($db, $table);
     }
     if ($do_mime && $cfgRelation['mimework']) {
         $header .= ' & \\multicolumn{1}{|c|}{\\textbf{MIME}}';
         $mime_map = PMA_getMIME($db, $table, true);
     }
     // Table caption for first page and label
     if (isset($GLOBALS['latex_caption'])) {
         $buffer .= ' \\caption{' . Util::expandUserString($GLOBALS['latex_structure_caption'], array('texEscape', get_class($this)), array('table' => $table_alias, 'database' => $db_alias)) . '} \\label{' . Util::expandUserString($GLOBALS['latex_structure_label'], null, array('table' => $table_alias, 'database' => $db_alias)) . '} \\\\' . $crlf;
     }
     $buffer .= $header . ' \\\\ \\hline \\hline' . $crlf . '\\endfirsthead' . $crlf;
     // Table caption on next pages
     if (isset($GLOBALS['latex_caption'])) {
         $buffer .= ' \\caption{' . Util::expandUserString($GLOBALS['latex_structure_continued_caption'], array('texEscape', get_class($this)), array('table' => $table_alias, 'database' => $db_alias)) . '} \\\\ ' . $crlf;
     }
     $buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf;
     if (!PMA_exportOutputHandler($buffer)) {
         return false;
     }
     $fields = $GLOBALS['dbi']->getColumns($db, $table);
     foreach ($fields as $row) {
         $extracted_columnspec = Util::extractColumnSpec($row['Type']);
         $type = $extracted_columnspec['print_type'];
         if (empty($type)) {
             $type = ' ';
         }
//.........这里部分代码省略.........
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:101,代码来源:ExportLatex.php


注:本文中的PMA\libraries\Util::expandUserString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。