Changeset 2240


Ignore:
Timestamp:
Mar 2, 2008, 1:29:27 AM (16 years ago)
Author:
rvelices
Message:

header.tpl goes smart

Location:
trunk
Files:
6 edited

Legend:

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

    r2215 r2240  
    258258if (count($header_msgs) > 0)
    259259{
    260   $template->assign_block_vars('header_msgs',array());
    261   foreach ($header_msgs as $header_msg)
    262   {
    263     $template->assign_block_vars('header_msgs.header_msg',
    264                                  array('HEADER_MSG'=>$header_msg));
    265   }
     260  $template->assign('header_msgs', $header_msgs);
     261  $header_msgs=array();
    266262}
    267263
  • trunk/include/page_header.php

    r2239 r2240  
    55// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    7 // | branch        : BSF (Best So Far)
    87// | file          : $Id$
    98// | last update   : $Date$
     
    3332trigger_action('loc_begin_page_header');
    3433
    35 $template->assign_vars(
     34$template->assign(
    3635  array(
    3736    'GALLERY_TITLE' =>
     
    5655    ));
    5756
    58 // picture header infos
    59 if (isset($header_infos))
    60 {
    61   $template->assign_block_vars( 'header_meta', $header_infos);
    62 }
    6357
    6458// Header notes
    65 if ( isset($header_notes) and count($header_notes)>0)
     59if ( !empty($header_notes) )
    6660{
    67   foreach ($header_notes as $header_note)
    68   {
    69     $template->assign_block_vars('header_notes.header_note',
    70                                  array('HEADER_NOTE' => $header_note));
    71   }
     61  $template->assign('header_notes',$header_notes);
    7262}
    7363
    7464if ( !empty($page['meta_robots']) )
    7565{
    76   $template->assign_block_vars('head_element',
    77       array(
    78           'CONTENT' =>
    79               '<meta name="robots" content="'
    80               .implode(',', array_keys($page['meta_robots']))
    81               .'">'
    82         )
     66  $template->append('head_elements',
     67        '<meta name="robots" content="'
     68        .implode(',', array_keys($page['meta_robots']))
     69        .'">'
    8370    );
    8471}
     
    8875    and isset( $url_link ) and isset( $redirect_msg ) )
    8976{
    90   $template->assign_vars(
     77  $template->assign(
    9178    array(
    92       'U_REDIRECT_MSG' => $redirect_msg,
    93       'REFRESH_TIME' => $refresh,
    94       'U_REFRESH' => $url_link
     79      'REDIRECT_MSG' => $redirect_msg,
     80      'page_refresh' => array(
     81            'TIME' => $refresh,
     82            'U_REFRESH' => $url_link
     83          )
    9584      ));
    96   $template->assign_block_vars('refresh', array());
    9785}
    9886
  • trunk/notification.php

    r2029 r2240  
    7272$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
    7373
    74 $template->assign_block_vars('head_element',
    75     array(
    76       'CONTENT' => '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
    77       )
     74$template->append('head_elements',
     75    '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
    7876  );
    7977
  • trunk/plugins/admin_advices/main.inc.php

    r1926 r2240  
    1818    )
    1919  {// This Plugin works only on the Admin page
    20     $template->assign_block_vars(
    21       'head_element',
    22        array(
    23          'CONTENT' => '<link rel="stylesheet" type="text/css" '
    24                     . 'href="'.PHPWG_PLUGINS_PATH.'admin_advices/default-layout.css">',
    25        )
     20    $template->append(
     21      'head_elements',
     22      '<link rel="stylesheet" type="text/css" '
     23                    . 'href="'.PHPWG_PLUGINS_PATH.'admin_advices/default-layout.css">'
    2624     );
    2725    add_event_handler('loc_begin_page_tail', 'set_admin_advice' );
     
    5654    $query = '
    5755SELECT *
    58 FROM '.IMAGES_TABLE.' 
     56FROM '.IMAGES_TABLE.'
    5957ORDER BY RAND(NOW())
    6058LIMIT 0, 1
     
    6866      $url_check = get_themeconf('icon_dir').'/';
    6967      $url_uncheck = $url_check . 'uncheck';
    70       $url_check .= 'check'; 
    71       $picture_id = $row['id']; 
     68      $url_check .= 'check';
     69      $picture_id = $row['id'];
    7270      $query = '
    73 SELECT * FROM '.IMAGE_TAG_TABLE.' 
     71SELECT * FROM '.IMAGE_TAG_TABLE.'
    7472WHERE image_id =  ' . $picture_id .'
    7573;';
    76       $tag_count = mysql_num_rows(mysql_query($query)); 
     74      $tag_count = mysql_num_rows(mysql_query($query));
    7775      $template->assign_block_vars(
    7876        'thumbnail',
     
    9492                                   $url_uncheck : $url_check,
    9593           'NUM_TAGS'           => (string) $tag_count,
    96            'U_MODIFY'           => $url_modify,     
     94           'U_MODIFY'           => $url_modify,
    9795         )
    9896       );
  • trunk/plugins/admin_multi_view/is_admin.inc.php

    r2223 r2240  
    4343</script>';
    4444
    45   $template->assign_block_vars( 'head_element', array(
    46     'CONTENT' => $js
    47       )
    48     );
     45  $template->append( 'head_elements', $js );
    4946}
    5047?>
  • trunk/template/yoga/header.tpl

    r2224 r2240  
    1 <!-- DEV TAG: not smarty migrated -->
     1{* $Id$ *}
    22<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    33"http://www.w3.org/TR/html4/strict.dtd">
    4 <html lang="{LANG}" dir="{DIR}">
     4<html lang="{$LANG}" dir="{$DIR}">
    55<head>
    6 <meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}">
     6<meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}">
    77<meta name="generator" content="PhpWebGallery (aka PWG), see www.phpwebgallery.net">
    8 <!-- BEGIN header_meta -->
    9 <meta name="author" content="{header_meta.INFO_AUTHOR}">
    10 <meta name="keywords" content="{header_meta.INFO_TAGS}">
    11 <meta name="description" content="{header_meta.COMMENT}">
    12 <!-- END header_meta -->
    13 <title>{GALLERY_TITLE} :: {PAGE_TITLE}</title>
    14 <link rel="shortcut icon" type="image/x-icon" href="{pwg_root}template-common/favicon.ico">
    15 <link rel="start" title="{lang:home}" href="{U_HOME}" >
    16 <link rel="search" title="{lang:search}" href="{pwg_root}search.php" >
    17 <!-- BEGIN first -->
    18 <link rel="first" title="{lang:first_page}" href="{first.U_IMG}" >
    19 <!-- END first -->
    20 <!-- BEGIN previous -->
    21 <link rel="prev" title="{lang:previous_page}" href="{previous.U_IMG}" >
    22 <!-- END previous -->
    23 <!-- BEGIN next -->
    24 <link rel="next" title="{lang:next_page}" href="{next.U_IMG}" >
    25 <!-- END next -->
    26 <!-- BEGIN last -->
    27 <link rel="last" title="{lang:last_page}" href="{last.U_IMG}" >
    28 <!-- END last -->
    29 <!-- BEGIN up -->
    30 <link rel="up" title="{lang:thumbnails}" href="{up.U_URL}" >
    31 <!-- END up -->
    32 <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/layout.css">
    33 <!-- the next css is used to fix khtml (Konqueror/Safari) issue
    34 the "text/nonsense" prevents gecko based browsers to load it -->
    35 <link rel="stylesheet" type="text/nonsense" href="{pwg_root}template/{themeconf:template}/fix-khtml.css">
     8<title>{$GALLERY_TITLE} :: {$PAGE_TITLE}</title>
     9<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}template-common/favicon.ico">
     10
     11<link rel="start" title="{'home'|@translate}" href="{$U_HOME}" >
     12<link rel="search" title="{'search'|@translate}" href="{$ROOT_URL}search.php" >
     13{if isset($first.U_IMG)   }<link rel="first" title="{'first_page'|@translate}" href="{$first.U_IMG}" >{/if}
     14{if isset($previous.U_IMG)}<link rel="prev" title="{'previous_page'|@translate}" href="{$previous.U_IMG}" >{/if}
     15{if isset($next.U_IMG)    }<link rel="next" title="{'next_page'|@translate}" href="{$next.U_IMG}" >{/if}
     16{if isset($last.U_IMG)    }<link rel="last" title="{'last_page'|@translate}" href="{$last.U_IMG}" >{/if}
     17{if isset($U_UP)          }<link rel="up" title="{'thumbnails'|@translate}" href="{$U_UP}" >{/if}
     18
     19<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/layout.css">
     20{* the next css is used to fix khtml (Konqueror/Safari) issue the "text/nonsense" prevents gecko based browsers to load it *}
     21<link rel="stylesheet" type="text/nonsense" href="{$ROOT_URL}template/{$themeconf.template}/fix-khtml.css">
    3622<!--[if lt IE 7]>
    37   <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/fix-ie5-ie6.css">
     23        <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie5-ie6.css">
    3824<![endif]-->
    3925<!--[if gt IE 6]>
    40   <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/fix-ie7.css">
     26        <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie7.css">
    4127<![endif]-->
    4228<!--[if !IE]> <-->
    43    <link rel="stylesheet" href="{pwg_root}template/{themeconf:template}/not-ie.css" type="text/css">
     29        <link rel="stylesheet" href="{$ROOT_URL}template/{$themeconf.template}/not-ie.css" type="text/css">
    4430<!--> <![endif]-->
    45 <link rel="stylesheet" type="text/css" media="print" href="{pwg_root}template/{themeconf:template}/print.css">
    46 <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/default-colors.css">
    47 <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/theme/{themeconf:theme}/theme.css">
    48 <!-- BEGIN slideshow -->
    49 <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/theme/{themeconf:theme}/local-slideshow.css">
    50 <!-- END slideshow -->
    51 {themeconf:local_head}
    52 <!-- BEGIN prefetch -->
    53 <link rel="prefetch" href="{prefetch.URL}">
    54 <!-- END prefetch -->
    55 <!-- BEGIN refresh -->
    56 <meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}">
    57 <!-- END refresh -->
    58 <script type="text/javascript" src="{pwg_root}template-common/scripts.js"></script>
     31<link rel="stylesheet" type="text/css" media="print" href="{$ROOT_URL}template/{$themeconf.template}/print.css">
     32<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/default-colors.css">
     33<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/theme/{$themeconf.theme}/theme.css">
     34{$themeconf.local_head}
     35{if isset($U_PREFETCH)          }<link rel="prefetch" href="{$U_PREFETCH}">{/if}
     36
     37{if not empty($page_refresh)    }<meta http-equiv="refresh" content="{$page_refresh.TIME};url={$page_refresh.U_REFRESH}">{/if}
     38
     39<script type="text/javascript" src="{$ROOT_URL}template-common/scripts.js"></script>
    5940<!--[if lt IE 7]>
    60   <style>
    61     /* only because we need \{pwg_root\} otherwise use fix-ie5-ie6.css */
    62     BODY { behavior:url("{pwg_root}template-common/csshover.htc"); }
    63     A IMG, .button, .icon {
    64       behavior:url("{pwg_root}template-common/tooltipfix.htc");
    65     }
    66     FORM { behavior: url("{pwg_root}template-common/inputfix.htc"); }
    67   </style>
    68   <script type="text/javascript" src="{pwg_root}template-common/pngfix.js"></script>
     41<style>
     42        {* only because we need {$ROOT_URL} otherwise use fix-ie5-ie6.css *}
     43        BODY {ldelim} behavior:url("{$ROOT_URL}template-common/csshover.htc"); }
     44        A IMG, .button, .icon {ldelim}
     45                behavior:url("{$ROOT_URL}template-common/tooltipfix.htc");
     46        }
     47        FORM {ldelim} behavior: url("{$ROOT_URL}template-common/inputfix.htc"); }
     48</style>
     49<script type="text/javascript" src="{$ROOT_URL}template-common/pngfix.js"></script>
    6950<![endif]-->
    70 <!-- BEGIN head_element -->
    71 {head_element.CONTENT}
    72 <!-- END head_element -->
     51
     52{if not empty($head_elements)}
     53        {foreach from=$head_elements item=elt}{$elt}{/foreach}
     54{/if}
     55
    7356</head>
    7457
    75 <body id="{BODY_ID}">
     58<body id="{$BODY_ID}">
    7659<div id="the_page">
    77 <!-- BEGIN header_msgs -->
     60
     61{if not empty($header_msgs)}
    7862<div class="header_msgs">
    79   <!-- BEGIN header_msg -->
    80   <P>{header_msgs.header_msg.HEADER_MSG}</p>
    81   <!-- END header_msg -->
     63        {foreach from=$header_msgs item=elt}
     64        <p>{$elt}</p>
     65        {/foreach}
    8266</div>
    83 <!-- END header_msgs -->
    84 <div id="theHeader">{PAGE_BANNER}</div>
    85 <!-- BEGIN header_notes -->
     67{/if}
     68
     69<div id="theHeader">{$PAGE_BANNER}</div>
     70
     71{if not empty($header_notes)}
    8672<div class="header_notes">
    87   <!-- BEGIN header_note -->
    88   <P>{header_notes.header_note.HEADER_NOTE}</p>
    89   <!-- END header_note -->
     73        {foreach from=$header_notes item=elt}
     74        <p>{$elt}</p>
     75        {/foreach}
    9076</div>
    91 <!-- END header_notes -->
     77{/if}
Note: See TracChangeset for help on using the changeset viewer.