Skip to content

Commit

Permalink
feature 1502: based on Dotclear model, P@t has reorganized the way Pi…
Browse files Browse the repository at this point in the history
…wigo

manages template/theme in a simpler "theme only level" architecture. It
supports multiple level inheritance.

git-svn-id: http://piwigo.org/svn/trunk@5123 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Mar 13, 2010
1 parent c396f08 commit 14778ce
Show file tree
Hide file tree
Showing 615 changed files with 652 additions and 648 deletions.
8 changes: 4 additions & 4 deletions admin.php
Expand Up @@ -62,26 +62,26 @@
// theme changer
if (isset($_GET['change_theme']))
{
$admin_themes = array('goto/roma', 'goto/clear');
$admin_themes = array('roma', 'clear');

$new_admin_theme = array_pop(
array_diff(
$admin_themes,
array($conf['admin_layout'])
array($conf['admin_theme'])
)
);

$query = '
DELETE
FROM '.CONFIG_TABLE.'
WHERE param = "admin_layout"
WHERE param = "admin_theme"
;';
pwg_query($query);

$query = '
INSERT
INTO '.CONFIG_TABLE.'
SET param = "admin_layout"
SET param = "admin_theme"
, value = "'.$new_admin_theme.'"
;';
pwg_query($query);
Expand Down
2 changes: 1 addition & 1 deletion admin/extend_for_templates.php
Expand Up @@ -111,7 +111,7 @@

$available_templates = array_merge(
array('N/A' => '----------'),
get_dirs(PHPWG_ROOT_PATH.'template'));
get_dirs(PHPWG_ROOT_PATH.'theme'));

// +-----------------------------------------------------------------------+
// | selected templates |
Expand Down
6 changes: 1 addition & 5 deletions admin/include/functions_notification_by_mail.inc.php
Expand Up @@ -256,11 +256,8 @@ function set_user_on_env_nbm(&$nbm_user, $is_action_send)

if ($is_action_send)
{
$nbm_user['template'] = $user['template'];
$nbm_user['theme'] = $user['theme'];
$env_nbm['mail_template'] =
get_mail_template($env_nbm['email_format'],
array('template' => $nbm_user['template'], 'theme' => $nbm_user['theme']));
$env_nbm['mail_template'] = get_mail_template($env_nbm['email_format'], $nbm_user['theme']);
$env_nbm['mail_template']->set_filename('notification_by_mail', 'notification_by_mail.tpl');
}
}
Expand Down Expand Up @@ -435,7 +432,6 @@ function do_subscribe_unsubscribe_notification_by_mail($is_admin_request, $is_su
'email_format' => $env_nbm['email_format'],
'content' => $env_nbm['mail_template']->parse('notification_by_mail', true),
'content_format' => $env_nbm['email_format'],
'template' => $nbm_user['template'],
'theme' => $nbm_user['theme']
)
))
Expand Down
86 changes: 0 additions & 86 deletions admin/template/goto/header.tpl

This file was deleted.

24 changes: 0 additions & 24 deletions admin/template/goto/include/datepicker.inc.tpl

This file was deleted.

15 changes: 0 additions & 15 deletions admin/template/goto/theme/clear/themeconf.inc.php

This file was deleted.

15 changes: 0 additions & 15 deletions admin/template/goto/theme/roma/themeconf.inc.php

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Expand Up @@ -6,7 +6,7 @@ body {ldelim} background-color:#111; color:#69c;}
#content {ldelim} background: transparent url({$ROOT_URL}template/{$themeconf.template}/mail/text/html/images/header-bg.png) no-repeat scroll left top;}
#copyright {ldelim} background: transparent url({$ROOT_URL}template/{$themeconf.template}/mail/text/html/images/footer-bg.png) no-repeat scroll left bottom;
color: #69c;}
h2 {ldelim} background-color: #222;color:#eee;background-image: url({$ROOT_URL}template/{$themeconf.template}/theme/{$themeconf.theme}/images/tableh1_bg.png);}
h2 {ldelim} background-color: #222;color:#eee;background-image: url({$ROOT_URL}template/{$themeconf.template}/themes/{$themeconf.theme}/images/tableh1_bg.png);}
img {ldelim} margin: 16px; padding:15px;border:1px solid #eee; -moz-border-radius: 4px; border-radius: 4px 4px; }
img:hover {ldelim} border:1px solid #69c; -moz-border-radius: 4px; border-radius: 4px 4px; }
a {ldelim} color: #69c; background: transparent; }
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions admin/themes/clear/themeconf.inc.php
@@ -0,0 +1,12 @@
<?php
if (!function_exists('selected_admin_menu'))
{
include_once(PHPWG_ROOT_PATH.'admin/include/functions_themes.inc.php');
}
$themeconf = array(
'theme' => 'clear',
'parent' => 'default',
'admin_icon_dir' => 'admin/themes/clear/icon',
'selected_admin_menu' => selected_admin_menu(),
);
?>
File renamed without changes.
File renamed without changes.
Expand Up @@ -695,4 +695,44 @@ html, body {height:100%; margin:0; padding:0;}
#tiptip_holder.tip_top #tiptip_arrow_inner {
border-top-color: rgba(20,20,20,0.92);
}
}

/* Set the width of the menubar for the galery */
#menubar {
width: 18em;
}
.content {
margin-left: 20em; /* = #menubar width + 2em */
}
/* Set minimum width of the page before getting a scrollbar */
/* IE5 and IE6 don't get that */
BODY {
min-width: 60em; /* ~ 3* #menubar width */
}
BODY#thePopuphelpPage {
min-width: 0;
}

/* Set some sizes according to your maximum thumbnail width and height */
.content UL.thumbnails SPAN,
.content UL.thumbnails SPAN.wrap2 A,
.content UL.thumbnails LABEL,
.content DIV.thumbnailCategory DIV.illustration {
width: 140px; /* max thumbnail width + 2px */
}
.content UL.thumbnails SPAN.wrap2,
.content DIV.thumbnailCategory DIV.description {
height: 140px; /* max thumbnail height + 2px */
}


/* Category thumbnails on main page */
.content UL.thumbnailCategories LI {
width: 49.7%; /* 49.7% for 2 per line, 33.2% for 3 per line*/
}

/* Set defaults for thumbnails legend */
.content UL.thumbnails SPAN.thumbLegend {
display: block; /* display: none; if you don't want legend */
height: 4em; /* legend height (don't set auto to be Gecko friendly)*/
}
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions admin/themes/default/local_head.tpl
@@ -0,0 +1,3 @@
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/themes/default/fix-ie5-ie6.css">
<![endif]-->
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.accordion" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.accordion.packed.js" }
{known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.tipTip.minified.js" }
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.accordion" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.accordion.packed.js" }
{known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" }

<script type="text/javascript">
jQuery().ready(function(){ldelim}
Expand Down
File renamed without changes.
@@ -1,6 +1,6 @@
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.sortable.packed.js" }
{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }

<script type="text/javascript">
jQuery().ready(function(){ldelim}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/packed/ui.sortable.packed.js" }
{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }

{literal}
<script type="text/javascript">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
77 changes: 77 additions & 0 deletions admin/themes/default/template/header.tpl
@@ -0,0 +1,77 @@
{*
Warning : This is the admin pages header only
don't confuse with the public page header
*}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="{$lang_info.code}" dir="{$lang_info.direction}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}">
<meta name="generator" content="Piwigo (aka PWG), see piwigo.org">
<title>{$GALLERY_TITLE} :: {$PAGE_TITLE}</title>
<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico">

{foreach from=$themes item=theme}
{if isset($theme.local_head)}{include file=$theme.local_head}{/if}
<link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/themes/{$theme.name}/theme.css">
{/foreach}

{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} {*jQuery is always available by default*}

<script type="text/javascript" src="{$ROOT_URL}themes/default/js/scripts.js"></script>
<!--[if lt IE 7]>
<script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script>
<![endif]-->

{if not empty($head_elements)}
{foreach from=$head_elements item=elt}
{$elt}
{/foreach}
{/if}

</head>

<body id="{$BODY_ID}">

<div id="the_page">

<div id="pwgHead">
<h1>
<a href="{$U_RETURN}" title="Visit Gallery">
<img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/home.png" alt="{'Home'|@translate}">
{$GALLERY_TITLE}
</a>
</h1>

<div id="headActions">
Hello {$USERNAME} :
<a href="{$U_RETURN}" title="Visit Gallery">Visit Gallery</a> |
<a href="{$U_CHANGE_THEME}" title="Switch to clear theme for administration">Change Theme</a> |
<a href="{$U_LOGOUT}">{'Logout'|@translate}</a>
<a href="{$U_FAQ}" title="{'Instructions'|@translate}" id="instructions"><img style="padding-left:10px;" src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="(?)"></a>
</div>
</div>

<div style="clear:both;"></div>

{if not empty($header_msgs)}
<div class="header_msgs">
{foreach from=$header_msgs item=elt}
{$elt}
{/foreach}
</div>
{/if}

<div id="theHeader">{*$PAGE_BANNER*}</div>

{if not empty($header_notes)}
<div class="header_notes">
{foreach from=$header_notes item=elt}
{$elt}
{/foreach}
</div>
{/if}

<div id="pwgMain">
File renamed without changes.
@@ -1,5 +1,5 @@
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
{known_script id="jquery.autogrow" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.autogrow-textarea.js"}
{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
{known_script id="jquery.autogrow" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.autogrow-textarea.js"}

{* Auto size and auto grow textarea *}
{literal}
Expand Down

0 comments on commit 14778ce

Please sign in to comment.