Changeset 2700


Ignore:
Timestamp:
Oct 10, 2008, 3:11:31 PM (16 years ago)
Author:
rvelices
Message:
  • replace a preg_match with simple comparison (faster)
  • try to get rid of some JS strict warnings in FF (hope it's fixed)
  • template.class.php is included from functions.inc.php instead of common,upgrade,install (maybe later I will try to see the perf impact of compacting/compiling functions.inc.php together with the included files from itself)
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r2544 r2700  
    138138include(PHPWG_ROOT_PATH . 'include/constants.php');
    139139include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
    140 include(PHPWG_ROOT_PATH . 'include/template.class.php');
    141140
    142141// Database connection
  • trunk/include/functions.inc.php

    r2620 r2700  
    3131include_once( PHPWG_ROOT_PATH .'include/functions_url.inc.php' );
    3232include_once( PHPWG_ROOT_PATH .'include/functions_plugins.inc.php' );
     33include_once( PHPWG_ROOT_PATH .'include/template.class.php');
    3334
    3435//----------------------------------------------------------- generic functions
     
    7071{
    7172  $boolean = true;
    72   if ( preg_match( '/^false$/i', $string ) )
     73  if ( 'false' == strtolower($string) )
    7374  {
    7475    $boolean = false;
     
    8788  if (is_bool($var))
    8889  {
    89     if ($var)
    90     {
    91       return 'true';
    92     }
    93     else
    94     {
    95       return 'false';
    96     }
     90    return $var ? 'true' : 'false';
    9791  }
    9892  else
  • trunk/install.php

    r2479 r2700  
    187187include(PHPWG_ROOT_PATH . 'admin/include/functions.php');
    188188include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php');
    189 include(PHPWG_ROOT_PATH . 'include/template.class.php');
    190189
    191190if (isset($_GET['language']))
  • trunk/template-common/scripts.js

    r2496 r2700  
    8080}
    8181
    82 PwgWS = function(urlRoot)
     82function PwgWS(urlRoot)
    8383{
    8484        this.urlRoot = urlRoot;
  • trunk/template/yoga/picture_nav_buttons.tpl

    r2478 r2700  
    6363  </div>
    6464
    65 <script type="text/javascript">
     65<script type="text/javascript">// <![CDATA[
    6666{literal}
    6767function keyboardNavigation(e)
    6868{
    69   if(!e) var e=window.event;
    70   if (e.altKey) return true;
    71   var target = e.target || e.srcElement;
    72   if (target && target.type) return true; //an input editable element
    73   var keyCode=e.keyCode || e.which;
    74   var docElem = document.documentElement;
    75   switch(keyCode) {
     69        if(!e) e=window.event;
     70        if (e.altKey) return true;
     71        var target = e.target || e.srcElement;
     72        if (target && target.type) return true; //an input editable element
     73        var keyCode=e.keyCode || e.which;
     74        var docElem = document.documentElement;
     75        switch(keyCode) {
    7676{/literal}
    7777{if isset($next)}
    78   case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
     78        case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
    7979{/if}
    8080{if isset($previous)}
    81   case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     81        case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8282{/if}
    8383{if isset($first)}
    84   /*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     84        /*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8585{/if}
    8686{if isset($last)}
    87   /*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     87        /*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8888{/if}
    8989{if isset($U_UP) and !isset($slideshow)}
    90   /*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     90        /*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9191{/if}
    9292
    9393{if isset($slideshow.U_START_PLAY)}
    94   /*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     94        /*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9595{/if}
    9696{if isset($slideshow.U_STOP_PLAY)}
    97   /*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     97        /*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9898{/if}
    99   }
    100   return true;
     99        }
     100        return true;
    101101}
    102102document.onkeydown=keyboardNavigation;
    103 </script>
     103// ]]></script>
  • trunk/upgrade.php

    r2512 r2700  
    2727include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    2828include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php');
    29 include(PHPWG_ROOT_PATH.'include/template.class.php');
    3029
    3130include(PHPWG_ROOT_PATH.'include/mysql.inc.php');
Note: See TracChangeset for help on using the changeset viewer.