Remove useless noEscape decorator since we removed recoded strings
authorJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 30 Dec 2011 14:07:19 +0000 (15:07 +0100)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 30 Dec 2011 14:07:19 +0000 (15:07 +0100)
noEscape decorator was only used to not escape recoded strings because
it was breaking non-ascii chars that was begining by &#...;. This make
the code a bit simpler, cleaner and remove useless piece of code.

database.php
fulltext.php
libraries/decorator.inc.php
plugin_slony.php
schemas.php
servers.php
tables.php
views.php

index c9cbfdc94b0caed7e840bd86ea5d3941bbdfce81..03a3b7ca7f79238d6a8bde76e527115ffdc63b99 100755 (executable)
                $items = $misc->adjustTabsForTree($tabs);
 
                $attrs = array(
-                       'text'   => noEscape(field('title')),
+                       'text'   => field('title'),
                        'icon'   => field('icon'),
                        'action' => url(field('url'),
                                                        $reqvars,
index 830c05b8564d9bae545be129be284a598d238d19..04fae72067bc2736390e98628deee023182a999e 100644 (file)
                $reqvars = $misc->getRequestVars('ftscfg');
 
                $attrs = array(
-                       'text'   => noEscape(field('title')),
+                       'text'   => field('title'),
                        'icon'   => field('icon'),
                        'action' => url('fulltext.php',
                                $reqvars,
                $reqvars = $misc->getRequestVars('ftscfg');
 
                $attrs = array(
-                       'text'   => noEscape(field('name')),
+                       'text'   => field('name'),
                        'icon'   => $what,
                        'toolTip'=> field('comment'),
                        'action' => url('fulltext.php',
index fec8f75e80d6806217a2e9220edc45bce47e0568..65311f6b286755a6ee4e88189bb4423323aef5ee 100644 (file)
@@ -41,14 +41,6 @@ function url($base, $vars = null /* ... */) {
        return new UrlDecorator($base, $vars);
 }
 
-function noEscape($value) {
-       if (is_a($value, 'Decorator')) {
-               $value->esc = false;
-               return $value;
-       }
-       return new Decorator($value, false);
-}
-
 function replace($str, $params) {
        return new replaceDecorator($str, $params);
 }
@@ -58,10 +50,10 @@ function replace($str, $params) {
 function value(&$var, &$fields, $esc = null) {
        if (is_a($var, 'Decorator')) {
                $val = $var->value($fields);
-               if (!$var->esc) $esc = null;
        } else {
                $val =& $var;
        }
+
        if (is_string($val)) {
                switch($esc) {
                        case 'xml':
@@ -99,11 +91,8 @@ function value_url(&$var, &$fields) {
 
 class Decorator
 {
-       var $esc = true;
-       
-       function Decorator($value, $esc = true) {
+       function Decorator($value) {
                $this->v = $value;
-               $this->esc = $esc;
        }
        
        function value($fields) {
index 850c2a1511fc70cd15346988637c063f94c9e2cb..fdb8d8abc97681b881d7b4cb100db3b4097301f2 100755 (executable)
@@ -56,7 +56,7 @@
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
@@ -84,7 +84,7 @@
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
                                $items = $misc->adjustTabsForTree($tabs);
                                
                                $attrs = array(
-                                       'text'   => noEscape(field('title')),
+                                       'text'   => field('title'),
                                        'icon'   => field('icon'),
                                        'action' => url(field('url'),
                                                                        $reqvars,
index 7ab6e9deabf5c05cdd9929cdc03fef7d2f298ee0..7ad336e57457646fc26e7b82292a1c0a92d098bb 100755 (executable)
                $reqvars = $misc->getRequestVars('schema');
 
                $attrs = array(
-                       'text'   => noEscape(field('title')),
+                       'text'   => field('title'),
                        'icon'   => field('icon'),
                        'action' => url(field('url'),
                                                        $reqvars,
index 295585e5d0f1e0b38766c3d1a9e39554d3d3d700..3211b921deb9f56d5feb94e6c3f4425535106073 100644 (file)
                
                $groups = $misc->getServersGroups();
 
-               function escape($fields) {
-                       global $lang;
-                       if ($fields['id'] === 'all') {
-                               return $lang['strallservers'];
-                       }
-                       else return value(field('desc'), $fields, 'xml');
-               }
-
                $attrs = array(
-                       'text'   => noEscape(callback('escape')),
+                       'text'   => field('desc'),
                        'icon'   => 'Servers',                  
                        'action' => url('servers.php',
                                array(
index ff760c3aff3eedef16751dcf02dd6853998e8127..89c4dba09fe146cee7c19e083efb087ed0ed5e89 100644 (file)
                $reqvars = $misc->getRequestVars('table');
 
                $attrs = array(
-                       'text'   => noEscape(field('title')),
+                       'text'   => field('title'),
                        'icon'   => field('icon'),
                        'action' => url(
                                field('url'),
index 90c16709501a7af55b330ff8dd750c93c82e6052..d782a76ef8f0ae8f1f2bd3eeb715c787b04e9262 100644 (file)
--- a/views.php
+++ b/views.php
                $reqvars = $misc->getRequestVars('view');
 
                $attrs = array(
-                       'text'   => noEscape(field('title')),
+                       'text'   => field('title'),
                        'icon'   => field('icon'),
                        'action' => url(field('url'),   $reqvars, field('urlvars'),     array('view' => $_REQUEST['view'])),
                        'branch' => ifempty(