[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-13364-gb57e186

Michal Čihař nijel at users.sourceforge.net
Mon Aug 8 13:53:53 CEST 2011


The branch, master has been updated
       via  b57e186331d2f1abeff9febbf8f9933d906eb029 (commit)
      from  8f618e6f013262963c279b71c1f2fff1d1d74e3d (commit)


- Log -----------------------------------------------------------------
commit b57e186331d2f1abeff9febbf8f9933d906eb029
Author: Michal Čihař <mcihar at suse.cz>
Date:   Mon Aug 8 13:53:41 2011 +0200

    Drop another ocurence of inline js

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

Summary of changes:
 js/functions.js           |   16 ++++++++++++++++
 libraries/Theme.class.php |   13 +++++++------
 themes.php                |   16 +---------------
 3 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index 9b80619..008dcf2 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -3127,4 +3127,20 @@ $(document).ready(function() {
     $('.autosubmit').change(function(e) {
         e.target.form.submit();
     });
+
+    /**
+     * Theme changer.
+     */
+    $('.take_theme').live('click', function(e) {
+        alert(e.target.nodeName);
+        var evt = $(e);
+        var what = evt.target.id;
+        if (window.opener && window.opener.document.forms['setTheme'].elements['set_theme']) {
+            window.opener.document.forms['setTheme'].elements['set_theme'].value = what;
+            window.opener.document.forms['setTheme'].submit();
+            window.close();
+            return false;
+        }
+        return true;
+    });
 });
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php
index 0347ac8..252d554 100644
--- a/libraries/Theme.class.php
+++ b/libraries/Theme.class.php
@@ -321,12 +321,13 @@ class PMA_Theme
     {
         echo '<div class="theme_preview">';
         echo '<h2>' . htmlspecialchars($this->getName())
-            .' (' . htmlspecialchars($this->getVersion()) . ')</h2>'
-            .'<p>'
-            .'<a target="_top" href="index.php'
-            .PMA_generate_common_url(array('set_theme' => $this->getId())) . '"'
-            .' onclick="takeThis(\'' . addslashes($this->getId()) . '\');'
-            .' return false;">';
+            .' (' . htmlspecialchars($this->getVersion()) . ')</h2>';
+        echo '<p>';
+        echo '<a target="_top" class="take_theme" '
+            .'id="' . htmlspecialchars($this->getId()) . '" '
+            . 'href="index.php'.PMA_generate_common_url(array(
+                'set_theme' => $this->getId()
+                )) . '">';
         if (@file_exists($this->getPath() . '/screen.png')) {
             // if screen exists then output
 
diff --git a/themes.php b/themes.php
index 732f1e3..1663334 100644
--- a/themes.php
+++ b/themes.php
@@ -19,22 +19,8 @@ require './libraries/header_http.inc.php';
 /* HTML header */
 $page_title = 'phpMyAdmin - ' . __('Theme');
 require './libraries/header_meta_style.inc.php';
+require './libraries/header_scripts.inc.php';
 ?>
-<script type="text/javascript" language="javascript">
-// <![CDATA[
-function takeThis(what)
-{
-    if (window.opener && window.opener.document.forms['setTheme'].elements['set_theme']) {
-        window.opener.document.forms['setTheme'].elements['set_theme'].value = what;
-        window.opener.document.forms['setTheme'].submit();
-        self.close();
-    } else {
-        alert('<?php echo sprintf(__('No themes support; please check your configuration and/or your themes in directory %s.'), $cfg['ThemePath']); ?>');
-        self.close();
-    }
-}
-// ]]>
-</script>
 </head>
 
 <body id="bodythemes">


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list