[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5795-g40aaa76

Michal Čihař nijel at users.sourceforge.net
Wed Jul 21 09:30:49 CEST 2010


The branch, master has been updated
       via  40aaa768dd3529b05563f7c0193c1a70661574fd (commit)
       via  ce9e7a94629b6b07d33f70b4f412ab4dd04ebcd8 (commit)
      from  eeae8bec2159e2be2b25cf704fa25d1ac1d33c33 (commit)


- Log -----------------------------------------------------------------
commit 40aaa768dd3529b05563f7c0193c1a70661574fd
Author: Michal Čihař <mcihar at novell.com>
Date:   Wed Jul 21 09:30:31 2010 +0200

    Factor out variable expanding.

commit ce9e7a94629b6b07d33f70b4f412ab4dd04ebcd8
Author: Michal Čihař <mcihar at novell.com>
Date:   Wed Jul 21 09:26:00 2010 +0200

    Not used anywhere.

-----------------------------------------------------------------------

Summary of changes:
 libraries/common.lib.php         |   38 ++++++++++++++++++++++++--------------
 libraries/header_scripts.inc.php |   20 +-------------------
 2 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 3302658..e2af6d9 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -2827,19 +2827,29 @@ $mapping = array(
     return $mapping[$target];
 }
 
-function PMA_js($code, $print=true)
-{
-    // these generated newlines are needed
-  $out  = '';
-  $out .= '<script type="text/javascript">'."\n";
-  $out .= "\n" . '// <![CDATA[' . "\n";
-  $out .= $code;
-  $out .= "\n" . '// ]]>' . "\n";
-  $out .= '</script>'."\n";
-
-  if ($print)
-    echo $out;
-
-  return $out;
+/**
+ * Formats user string, expading @VARIABLES at .
+ */
+function PMA_expandUserString($string) {
+    return str_replace(
+        array(
+            '@HTTP_HOST@',
+            '@SERVER@',
+            '@VERBOSE@',
+            '@VSERVER@',
+            '@DATABASE@',
+            '@TABLE@',
+            '@PHPMYADMIN@',
+            ),
+        array(
+            PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '',
+            $GLOBALS['cfg']['Server']['host'],
+            $GLOBALS['cfg']['Server']['verbose'],
+            !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host'],
+            $GLOBALS['db'],
+            $GLOBALS['table'],
+            'phpMyAdmin ' . PMA_VERSION,
+            ),
+        $string);
 }
 ?>
diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php
index 3463309..a292d0f 100644
--- a/libraries/header_scripts.inc.php
+++ b/libraries/header_scripts.inc.php
@@ -21,25 +21,7 @@ if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
 <?php
 }
 // generate title
-$title = str_replace(
-            array(
-                '@HTTP_HOST@',
-                '@SERVER@',
-                '@VERBOSE@',
-                '@VSERVER@',
-                '@DATABASE@',
-                '@TABLE@',
-                '@PHPMYADMIN@',
-                ),
-            array(
-                PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '',
-                isset($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['Server']['host'] : '',
-                isset($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : '',
-                !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : (isset($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['Server']['host'] : ''),
-                $GLOBALS['db'],
-                $GLOBALS['table'],
-                'phpMyAdmin ' . PMA_VERSION,
-                ),
+$title = PMA_expandUserString(
             !empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] :
             (!empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] :
             (!empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] :


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list