diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-03-02 00:29:27 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-03-02 00:29:27 +0000 |
commit | 6e932e8752faae824cdcb1073014771163a600a7 (patch) | |
tree | 384e84cbf6ca9b0f205764b948895ec8682d6a3a | |
parent | 1f271ceca3e74c7b077f8462086db020121e81c3 (diff) |
header.tpl goes smart
git-svn-id: http://piwigo.org/svn/trunk@2240 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | include/common.inc.php | 8 | ||||
-rw-r--r-- | include/page_header.php | 38 | ||||
-rw-r--r-- | notification.php | 6 | ||||
-rw-r--r-- | plugins/admin_advices/main.inc.php | 22 | ||||
-rw-r--r-- | plugins/admin_multi_view/is_admin.inc.php | 5 | ||||
-rw-r--r-- | template/yoga/header.tpl | 130 |
6 files changed, 86 insertions, 123 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 5986fe087..6776b5fb1 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -257,12 +257,8 @@ if (is_adviser()) if (count($header_msgs) > 0) { - $template->assign_block_vars('header_msgs',array()); - foreach ($header_msgs as $header_msg) - { - $template->assign_block_vars('header_msgs.header_msg', - array('HEADER_MSG'=>$header_msg)); - } + $template->assign('header_msgs', $header_msgs); + $header_msgs=array(); } if (!empty($conf['filter_pages']) and get_filter_page_value('used')) diff --git a/include/page_header.php b/include/page_header.php index 8f6e1a87b..dc0fe615f 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -4,7 +4,6 @@ // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ -// | branch : BSF (Best So Far) // | file : $Id$ // | last update : $Date$ // | last modifier : $Author$ @@ -32,7 +31,7 @@ $template->set_filenames(array('header'=>'header.tpl')); trigger_action('loc_begin_page_header'); -$template->assign_vars( +$template->assign( array( 'GALLERY_TITLE' => isset($page['gallery_title']) ? @@ -55,31 +54,19 @@ $template->assign_vars( 'U_HOME' => make_index_url(), )); -// picture header infos -if (isset($header_infos)) -{ - $template->assign_block_vars( 'header_meta', $header_infos); -} // Header notes -if ( isset($header_notes) and count($header_notes)>0) +if ( !empty($header_notes) ) { - foreach ($header_notes as $header_note) - { - $template->assign_block_vars('header_notes.header_note', - array('HEADER_NOTE' => $header_note)); - } + $template->assign('header_notes',$header_notes); } if ( !empty($page['meta_robots']) ) { - $template->assign_block_vars('head_element', - array( - 'CONTENT' => - '<meta name="robots" content="' - .implode(',', array_keys($page['meta_robots'])) - .'">' - ) + $template->append('head_elements', + '<meta name="robots" content="' + .implode(',', array_keys($page['meta_robots'])) + .'">' ); } @@ -87,13 +74,14 @@ if ( !empty($page['meta_robots']) ) if ( isset( $refresh ) and intval($refresh) >= 0 and isset( $url_link ) and isset( $redirect_msg ) ) { - $template->assign_vars( + $template->assign( array( - 'U_REDIRECT_MSG' => $redirect_msg, - 'REFRESH_TIME' => $refresh, - 'U_REFRESH' => $url_link + 'REDIRECT_MSG' => $redirect_msg, + 'page_refresh' => array( + 'TIME' => $refresh, + 'U_REFRESH' => $url_link + ) )); - $template->assign_block_vars('refresh', array()); } trigger_action('loc_end_page_header'); diff --git a/notification.php b/notification.php index 7bbe66cc1..6d5d67ae3 100644 --- a/notification.php +++ b/notification.php @@ -71,10 +71,8 @@ $title = l10n('Notification'); $page['body_id'] = 'theNotificationPage'; $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); -$template->assign_block_vars('head_element', - array( - 'CONTENT' => '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">' - ) +$template->append('head_elements', + '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">' ); include(PHPWG_ROOT_PATH.'include/page_header.php'); diff --git a/plugins/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php index 5df961ef0..fcefc1cb4 100644 --- a/plugins/admin_advices/main.inc.php +++ b/plugins/admin_advices/main.inc.php @@ -17,12 +17,10 @@ function set_admin_advice_add_css() and $page['page'] == 'intro' ) {// This Plugin works only on the Admin page - $template->assign_block_vars( - 'head_element', - array( - 'CONTENT' => '<link rel="stylesheet" type="text/css" ' - . 'href="'.PHPWG_PLUGINS_PATH.'admin_advices/default-layout.css">', - ) + $template->append( + 'head_elements', + '<link rel="stylesheet" type="text/css" ' + . 'href="'.PHPWG_PLUGINS_PATH.'admin_advices/default-layout.css">' ); add_event_handler('loc_begin_page_tail', 'set_admin_advice' ); } @@ -55,7 +53,7 @@ function set_admin_advice() // Random Thumbnail $query = ' SELECT * -FROM '.IMAGES_TABLE.' +FROM '.IMAGES_TABLE.' ORDER BY RAND(NOW()) LIMIT 0, 1 ;'; @@ -67,13 +65,13 @@ LIMIT 0, 1 .'&image_id='.$row['id']; $url_check = get_themeconf('icon_dir').'/'; $url_uncheck = $url_check . 'uncheck'; - $url_check .= 'check'; - $picture_id = $row['id']; + $url_check .= 'check'; + $picture_id = $row['id']; $query = ' -SELECT * FROM '.IMAGE_TAG_TABLE.' +SELECT * FROM '.IMAGE_TAG_TABLE.' WHERE image_id = ' . $picture_id .' ;'; - $tag_count = mysql_num_rows(mysql_query($query)); + $tag_count = mysql_num_rows(mysql_query($query)); $template->assign_block_vars( 'thumbnail', array( @@ -93,7 +91,7 @@ WHERE image_id = ' . $picture_id .' 'TAGS' => ($tag_count == 0) ? $url_uncheck : $url_check, 'NUM_TAGS' => (string) $tag_count, - 'U_MODIFY' => $url_modify, + 'U_MODIFY' => $url_modify, ) ); } diff --git a/plugins/admin_multi_view/is_admin.inc.php b/plugins/admin_multi_view/is_admin.inc.php index e94b719ba..7ae1f90dc 100644 --- a/plugins/admin_multi_view/is_admin.inc.php +++ b/plugins/admin_multi_view/is_admin.inc.php @@ -42,9 +42,6 @@ if ( theController.location.toString()=="about:blank" || !theController.location } </script>'; - $template->assign_block_vars( 'head_element', array( - 'CONTENT' => $js - ) - ); + $template->append( 'head_elements', $js ); } ?> diff --git a/template/yoga/header.tpl b/template/yoga/header.tpl index 19e9e755d..190ab1670 100644 --- a/template/yoga/header.tpl +++ b/template/yoga/header.tpl @@ -1,91 +1,77 @@ -<!-- DEV TAG: not smarty migrated --> +{* $Id$ *} <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="{LANG}" dir="{DIR}"> +<html lang="{$LANG}" dir="{$DIR}"> <head> -<meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}"> +<meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}"> <meta name="generator" content="PhpWebGallery (aka PWG), see www.phpwebgallery.net"> -<!-- BEGIN header_meta --> -<meta name="author" content="{header_meta.INFO_AUTHOR}"> -<meta name="keywords" content="{header_meta.INFO_TAGS}"> -<meta name="description" content="{header_meta.COMMENT}"> -<!-- END header_meta --> -<title>{GALLERY_TITLE} :: {PAGE_TITLE}</title> -<link rel="shortcut icon" type="image/x-icon" href="{pwg_root}template-common/favicon.ico"> -<link rel="start" title="{lang:home}" href="{U_HOME}" > -<link rel="search" title="{lang:search}" href="{pwg_root}search.php" > -<!-- BEGIN first --> -<link rel="first" title="{lang:first_page}" href="{first.U_IMG}" > -<!-- END first --> -<!-- BEGIN previous --> -<link rel="prev" title="{lang:previous_page}" href="{previous.U_IMG}" > -<!-- END previous --> -<!-- BEGIN next --> -<link rel="next" title="{lang:next_page}" href="{next.U_IMG}" > -<!-- END next --> -<!-- BEGIN last --> -<link rel="last" title="{lang:last_page}" href="{last.U_IMG}" > -<!-- END last --> -<!-- BEGIN up --> -<link rel="up" title="{lang:thumbnails}" href="{up.U_URL}" > -<!-- END up --> -<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/layout.css"> -<!-- the next css is used to fix khtml (Konqueror/Safari) issue -the "text/nonsense" prevents gecko based browsers to load it --> -<link rel="stylesheet" type="text/nonsense" href="{pwg_root}template/{themeconf:template}/fix-khtml.css"> +<title>{$GALLERY_TITLE} :: {$PAGE_TITLE}</title> +<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}template-common/favicon.ico"> + +<link rel="start" title="{'home'|@translate}" href="{$U_HOME}" > +<link rel="search" title="{'search'|@translate}" href="{$ROOT_URL}search.php" > +{if isset($first.U_IMG) }<link rel="first" title="{'first_page'|@translate}" href="{$first.U_IMG}" >{/if} +{if isset($previous.U_IMG)}<link rel="prev" title="{'previous_page'|@translate}" href="{$previous.U_IMG}" >{/if} +{if isset($next.U_IMG) }<link rel="next" title="{'next_page'|@translate}" href="{$next.U_IMG}" >{/if} +{if isset($last.U_IMG) }<link rel="last" title="{'last_page'|@translate}" href="{$last.U_IMG}" >{/if} +{if isset($U_UP) }<link rel="up" title="{'thumbnails'|@translate}" href="{$U_UP}" >{/if} + +<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/layout.css"> +{* the next css is used to fix khtml (Konqueror/Safari) issue the "text/nonsense" prevents gecko based browsers to load it *} +<link rel="stylesheet" type="text/nonsense" href="{$ROOT_URL}template/{$themeconf.template}/fix-khtml.css"> <!--[if lt IE 7]> - <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/fix-ie5-ie6.css"> + <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie5-ie6.css"> <![endif]--> <!--[if gt IE 6]> - <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/fix-ie7.css"> + <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie7.css"> <![endif]--> <!--[if !IE]> <--> - <link rel="stylesheet" href="{pwg_root}template/{themeconf:template}/not-ie.css" type="text/css"> + <link rel="stylesheet" href="{$ROOT_URL}template/{$themeconf.template}/not-ie.css" type="text/css"> <!--> <![endif]--> -<link rel="stylesheet" type="text/css" media="print" href="{pwg_root}template/{themeconf:template}/print.css"> -<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/default-colors.css"> -<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/theme/{themeconf:theme}/theme.css"> -<!-- BEGIN slideshow --> -<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/theme/{themeconf:theme}/local-slideshow.css"> -<!-- END slideshow --> -{themeconf:local_head} -<!-- BEGIN prefetch --> -<link rel="prefetch" href="{prefetch.URL}"> -<!-- END prefetch --> -<!-- BEGIN refresh --> -<meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> -<!-- END refresh --> -<script type="text/javascript" src="{pwg_root}template-common/scripts.js"></script> +<link rel="stylesheet" type="text/css" media="print" href="{$ROOT_URL}template/{$themeconf.template}/print.css"> +<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/default-colors.css"> +<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/theme/{$themeconf.theme}/theme.css"> +{$themeconf.local_head} +{if isset($U_PREFETCH) }<link rel="prefetch" href="{$U_PREFETCH}">{/if} + +{if not empty($page_refresh) }<meta http-equiv="refresh" content="{$page_refresh.TIME};url={$page_refresh.U_REFRESH}">{/if} + +<script type="text/javascript" src="{$ROOT_URL}template-common/scripts.js"></script> <!--[if lt IE 7]> - <style> - /* only because we need \{pwg_root\} otherwise use fix-ie5-ie6.css */ - BODY { behavior:url("{pwg_root}template-common/csshover.htc"); } - A IMG, .button, .icon { - behavior:url("{pwg_root}template-common/tooltipfix.htc"); - } - FORM { behavior: url("{pwg_root}template-common/inputfix.htc"); } - </style> - <script type="text/javascript" src="{pwg_root}template-common/pngfix.js"></script> +<style> + {* only because we need {$ROOT_URL} otherwise use fix-ie5-ie6.css *} + BODY {ldelim} behavior:url("{$ROOT_URL}template-common/csshover.htc"); } + A IMG, .button, .icon {ldelim} + behavior:url("{$ROOT_URL}template-common/tooltipfix.htc"); + } + FORM {ldelim} behavior: url("{$ROOT_URL}template-common/inputfix.htc"); } +</style> +<script type="text/javascript" src="{$ROOT_URL}template-common/pngfix.js"></script> <![endif]--> -<!-- BEGIN head_element --> -{head_element.CONTENT} -<!-- END head_element --> + +{if not empty($head_elements)} + {foreach from=$head_elements item=elt}{$elt}{/foreach} +{/if} + </head> -<body id="{BODY_ID}"> +<body id="{$BODY_ID}"> <div id="the_page"> -<!-- BEGIN header_msgs --> + +{if not empty($header_msgs)} <div class="header_msgs"> - <!-- BEGIN header_msg --> - <P>{header_msgs.header_msg.HEADER_MSG}</p> - <!-- END header_msg --> + {foreach from=$header_msgs item=elt} + <p>{$elt}</p> + {/foreach} </div> -<!-- END header_msgs --> -<div id="theHeader">{PAGE_BANNER}</div> -<!-- BEGIN header_notes --> +{/if} + +<div id="theHeader">{$PAGE_BANNER}</div> + +{if not empty($header_notes)} <div class="header_notes"> - <!-- BEGIN header_note --> - <P>{header_notes.header_note.HEADER_NOTE}</p> - <!-- END header_note --> + {foreach from=$header_notes item=elt} + <p>{$elt}</p> + {/foreach} </div> -<!-- END header_notes --> +{/if} |