Changeset 2513


Ignore:
Timestamp:
Sep 9, 2008, 11:53:31 AM (16 years ago)
Author:
rvelices
Message:
  • fix typing error in index.tpl
  • added template smarty function known_script (e.g.{known_script id="x" src"y.js"}) - useful to avoid double inclusion of a script such as prototype,jquery,... when a template and plugin need it independently (see the use in admin.tpl for example)
  • removed unused themeconf.template_dir
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/template/yoga/admin.tpl

    r2495 r2513  
    11{* $Id$ *}
     2{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
     3{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js" }
     4{known_script id="jquery.ui.accordion" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.accordion.packed.js" }
     5
     6<script type="text/javascript">
     7jQuery().ready(function(){ldelim}
     8  jQuery('#menubar').accordion({ldelim}
     9    header: "dt.rdion",
     10    event: "click",
     11    active: {$themeconf.selected_admin_menu}
     12  });
     13});
     14</script>
     15
    216<div id="menubar">
    317  <dl class="first">
  • trunk/admin/template/yoga/header.tpl

    r2455 r2513  
    44
    55          Warning : This is the admin pages header only
    6           don't be confusing with the public page header
     6          don't confuse with the public page header
    77
    88*}
     
    2323<link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/template/{$themeconf.template}/default-colors.css">
    2424<link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/template/{$themeconf.template}/theme/{$themeconf.theme}/theme.css">
     25{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js" now=1} {*jQuery is always available by default*}
    2526{$themeconf.local_head}
    2627<script type="text/javascript" src="{$ROOT_URL}template-common/scripts.js"></script>
  • trunk/admin/template/yoga/theme/admin/themeconf.inc.php

    r2489 r2513  
    5252  'template' => 'yoga',
    5353  'theme' => 'admin',
    54   'template_dir' => 'admin/template/yoga',
    5554  'icon_dir' => 'template/yoga/icon',
    5655  'admin_icon_dir' => 'template/yoga/icon/admin',
    5756  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    58   'local_head' => '
    59 <!-- New template location for admin -->
    60 <!-- Admin Accordion Menus -->
    61   <script type="text/javascript" src="template-common/lib/jquery.packed.js"></script>
    62   <script type="text/javascript" src="template-common/lib/ui/ui.core.packed.js"></script>
    63   <script type="text/javascript" src="template-common/lib/ui/ui.accordion.packed.js"></script>
    64   <script type="text/javascript">
    65   jQuery().ready(function(){
    66     jQuery(\'#menubar\').accordion({
    67       header: "dt.rdion",
    68       event: "click",
    69       active: '. selected_admin_menu() . '
    70     });
    71   });
    72   </script>'
     57  'selected_admin_menu' => selected_admin_menu(),
     58  'local_head' => '',
    7359);
    7460?>
  • trunk/include/template.class.php

    r2502 r2513  
    6363    $this->smarty->register_modifier( 'explode', array('Template', 'mod_explode') );
    6464    $this->smarty->register_block('html_head', array(&$this, 'block_html_head') );
     65    $this->smarty->register_function('known_script', array(&$this, 'func_known_script'), false );
    6566    $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') );
    6667    if ( $conf['compiled_template_cache_language'] )
     
    340341  }
    341342
     343 /**
     344   * This smarty "known_script" functions allows to insert well known java scripts
     345   * such as prototype, jquery, etc... only once. Examples:
     346   * {known_script id="jquery" src="{$ROOT_URL}template-common/lib/jquery.packed.js"}
     347   */
     348  function func_known_script($params, &$smarty )
     349  {
     350    if (!isset($params['id']))
     351    {
     352        $smarty->trigger_error("known_script: missing 'id' parameter");
     353        return;
     354    }
     355    $id = $params['id'];
     356    if (! isset( $this->known_scripts[$id] ) )
     357    {
     358      if (!isset($params['src']))
     359      {
     360          $smarty->trigger_error("known_script: missing 'src' parameter");
     361          return;
     362      }
     363      $this->known_scripts[$id] = $params['src'];
     364      $content = '<script type="text/javascript" src="'.$params['src'].'"></script>';
     365      if (isset($params['now']) and $params['now'] and empty($this->output) )
     366      {
     367        return $content;
     368      }
     369      $repeat = false;
     370      $this->block_html_head(null, $content, $smarty, $repeat);
     371    }
     372  }
     373
    342374  /*static */ function prefilter_white_space($source, &$smarty)
    343375  {
  • trunk/picture.php

    r2512 r2513  
    623623if ($page['slideshow'])
    624624{
    625   // Add local-slideshow.css file if exists
    626   // Not only for ligth
    627   $css = PHPWG_ROOT_PATH . get_themeconf('template_dir') . '/theme/'
    628        . get_themeconf('theme') . '/local-slideshow.css';
    629   if (file_exists($css))
    630   {
    631     //TODO CORRECT THIS $template->assign_block_vars('slideshow', array());
    632   }
    633 
    634625  $tpl_slideshow = array();
    635626
  • trunk/template/yoga/index.tpl

    r2352 r2513  
    1111      <select onchange="document.location = this.options[this.selectedIndex].value;">
    1212        {foreach from=$image_orders item=image_order }
    13         <option value="{$image_order.URL}"{if $image_order.SELECTED} selected="selected"{/if}}>{$image_order.DISPLAY}</option>
     13        <option value="{$image_order.URL}"{if $image_order.SELECTED} selected="selected"{/if}>{$image_order.DISPLAY}</option>
    1414        {/foreach}
    1515      </select>
  • trunk/template/yoga/theme/Sylvia/themeconf.inc.php

    r2506 r2513  
    33  'template' => 'yoga',
    44  'theme' => 'Sylvia',
    5   'template_dir' => 'template/yoga',
    65  'icon_dir' => 'template/yoga/icon',
    76  'admin_icon_dir' => 'template/yoga/icon/admin',
    87  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    9   'local_head' => '<!-- no theme specific head content -->',
     8  'local_head' => '',
    109);
    1110?>
  • trunk/template/yoga/theme/clear/themeconf.inc.php

    r1912 r2513  
    33  'template' => 'yoga',
    44  'theme' => 'clear',
    5   'template_dir' => 'template/yoga',
    65  'icon_dir' => 'template/yoga/icon',
    76  'admin_icon_dir' => 'template/yoga/icon/admin',
    87  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    9   'local_head' => '<!-- no theme specific head content -->',
     8  'local_head' => '',
    109);
    1110?>
  • trunk/template/yoga/theme/dark/themeconf.inc.php

    r1912 r2513  
    33  'template' => 'yoga',
    44  'theme' => 'dark',
    5   'template_dir' => 'template/yoga',
    65  'icon_dir' => 'template/yoga/icon',
    76  'admin_icon_dir' => 'template/yoga/icon/admin',
    87  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    9   'local_head' => '<!-- no theme specific head content -->',
     8  'local_head' => '',
    109);
    1110?>
  • trunk/template/yoga/theme/p0w0/themeconf.inc.php

    r1912 r2513  
    33  'template' => 'yoga',
    44  'theme' => 'p0w0',
    5   'template_dir' => 'template/yoga',
    65  'icon_dir' => 'template/yoga/icon',
    76  'admin_icon_dir' => 'template/yoga/icon/admin',
    87  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    9   'local_head' => '<!-- no theme specific head content -->',
     8  'local_head' => '',
    109);
    1110?>
  • trunk/template/yoga/theme/wipi/themeconf.inc.php

    r1912 r2513  
    33  'template' => 'yoga',
    44  'theme' => 'wipi',
    5   'template_dir' => 'template/yoga',
    65  'icon_dir' => 'template/yoga/icon',
    76  'admin_icon_dir' => 'template/yoga/icon/admin',
    87  'mime_icon_dir' => 'template/yoga/icon/mimetypes/',
    9   'local_head' => '<!-- no theme specific head content -->',
     8  'local_head' => '',
    109);
    1110if ( !isset($lang['Theme: wipi']) )
Note: See TracChangeset for help on using the changeset viewer.