當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。