From cbfc601ad8579ae8516464b324d52a4136bc4fe7 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 9 Mar 2010 23:19:11 +0000 Subject: feature 1491: administration panel header/footer. Graphicaly outside the administration theme. The header includes the gallery title with a link to gallery, a theme changer, an explicit "visit gallery" link, a logout link. The footer includes links to piwigo.org (homepage, documentation, forum) and the contact webmaster link. Due to new header/footer, I've removed the "Links" section in the menubar. The new footer sticks to the bottom of the browser window. I've slightly "rounded" grum tabs to look like the menubar borders. Graphical illustration (top left and bottom left leaves) were removed to improve readability. They make things beautiful on gallery side, they decrease usability on admin side. Piwigo logo was removed to save space on administration footer. It would be nice to have a small logo to place bottom left in the footer next to "Powered by Piwigo". Links>Administration link was replaced by a big link box just above the menubar. The H2 was outside the #content box, nearly invisible on top right corner. Now it is 1) easy to read 2) inside #content. feature 1490: ability to switch from goto/roma to goto/clear with a single click in administration header. The global organisation of the page is quite heavily changed. The global layout is: body#theAdminPage body#theAdminPage > #the_page body#theAdminPage > #the_page > #pwgHead body#theAdminPage > #the_page > #pwgMain body#theAdminPage > #the_page > #pwgMain > #menubar body#theAdminPage > #the_page > #pwgMain > #content body#theAdminPage > #the_page > #footer git-svn-id: http://piwigo.org/svn/trunk@5098 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin.php | 32 ++++ admin/template/goto/admin.tpl | 20 +-- admin/template/goto/content.css | 2 +- admin/template/goto/default-layout.css | 186 ++++++++++++++++++--- admin/template/goto/footer.tpl | 59 ++++--- admin/template/goto/header.tpl | 26 ++- admin/template/goto/icon/home.png | Bin 0 -> 726 bytes admin/template/goto/photos_add_direct.tpl | 2 +- admin/template/goto/theme/clear/theme.css | 10 +- admin/template/goto/theme/roma/theme.css | 45 +++-- .../lib/plugins/jquery.tipTip.minified.js | 27 +++ 11 files changed, 319 insertions(+), 90 deletions(-) create mode 100644 admin/template/goto/icon/home.png create mode 100644 template-common/lib/plugins/jquery.tipTip.minified.js diff --git a/admin.php b/admin.php index 01bba5475..d914ad7ca 100644 --- a/admin.php +++ b/admin.php @@ -59,6 +59,36 @@ SELECT exit(); } +// theme changer +if (isset($_GET['change_theme'])) +{ + $admin_themes = array('goto/roma', 'goto/clear'); + + $new_admin_theme = array_pop( + array_diff( + $admin_themes, + array($conf['admin_layout']) + ) + ); + + $query = ' +DELETE + FROM '.CONFIG_TABLE.' + WHERE param = "admin_layout" +;'; + pwg_query($query); + + $query = ' +INSERT + INTO '.CONFIG_TABLE.' + SET param = "admin_layout" + , value = "'.$new_admin_theme.'" +;'; + pwg_query($query); + + redirect('admin.php'); +} + // +-----------------------------------------------------------------------+ // | synchronize user informations | // +-----------------------------------------------------------------------+ @@ -94,6 +124,7 @@ $template->set_filenames(array('admin' => 'admin.tpl')); $template->assign( array( + 'USERNAME' => $user['username'], 'U_SITE_MANAGER'=> $link_start.'site_manager', 'U_HISTORY_STAT'=> $link_start.'stats', 'U_FAQ'=> $link_start.'help', @@ -123,6 +154,7 @@ $template->assign( 'U_LOGOUT'=> PHPWG_ROOT_PATH.'index.php?act=logout', 'U_PLUGINS'=> $link_start.'plugins_list', 'U_ADD_PHOTOS' => $link_start.'photos_add', + 'U_CHANGE_THEME' => PHPWG_ROOT_PATH.'admin.php?change_theme=1', ) ); diff --git a/admin/template/goto/admin.tpl b/admin/template/goto/admin.tpl index c2242fbca..ac25b3990 100644 --- a/admin/template/goto/admin.tpl +++ b/admin/template/goto/admin.tpl @@ -1,5 +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" } +{literal} + +{/literal} + \ No newline at end of file diff --git a/admin/template/goto/header.tpl b/admin/template/goto/header.tpl index 7756c593f..5c71f42e0 100644 --- a/admin/template/goto/header.tpl +++ b/admin/template/goto/header.tpl @@ -43,9 +43,28 @@ -
{* Dummy block for double background management *} +
+
+

+ + {'Home'|@translate} + {$GALLERY_TITLE} + +

+ +
+ Hello {$USERNAME} : + Visit Gallery | + Change Theme | + {'Logout'|@translate} + (?) +
+
+ +
+ {if not empty($header_msgs)}
{foreach from=$header_msgs item=elt} @@ -55,10 +74,13 @@ {/if}
{*$PAGE_BANNER*}
+ {if not empty($header_notes)}
{foreach from=$header_notes item=elt} {$elt} {/foreach}
-{/if} \ No newline at end of file +{/if} + +
\ No newline at end of file diff --git a/admin/template/goto/icon/home.png b/admin/template/goto/icon/home.png new file mode 100644 index 000000000..81b6bddb7 Binary files /dev/null and b/admin/template/goto/icon/home.png differ diff --git a/admin/template/goto/photos_add_direct.tpl b/admin/template/goto/photos_add_direct.tpl index 419946734..5715d358e 100644 --- a/admin/template/goto/photos_add_direct.tpl +++ b/admin/template/goto/photos_add_direct.tpl @@ -71,7 +71,7 @@ jQuery(document).ready(function() { {/if} -
+

{'Upload photos'|@translate}

diff --git a/admin/template/goto/theme/clear/theme.css b/admin/template/goto/theme/clear/theme.css index 3a73616c9..ed9a57a6e 100644 --- a/admin/template/goto/theme/clear/theme.css +++ b/admin/template/goto/theme/clear/theme.css @@ -22,8 +22,8 @@ padding:15px 60px 0 0; position:absolute; right:0; text-align:right; top:30px; width:550px; } html, body { min-height: 100%; } body { margin: 0; padding: 0; background:#eeeeee } -#the_page { margin: 0; padding: 0; z-index: 1; top:0px; -padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } +/* #the_page { margin: 0; padding: 0; z-index: 1; top:0px; */ +/* padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } */ #headbranch { width: 233px; height: 240px; margin: 0; padding: 0; position:absolute; left:0px; top:0px; z-index: 0; background:transparent } @@ -40,7 +40,7 @@ h3, #imageToolBar a:hover, .row2, .content { background-color: #ddd; } .content h4 { color: #aaa; font-size:14px; text-align:center; padding:3px; margin-top: 0; margin-bottom: 10px;} /*.content h2:before, .content h2:after, */ .content h2 { -letter-spacing:2px; margin-right:30px; text-align:right; color: #999; +letter-spacing:2px; margin-right:30px; text-align:left; color: #999; text-transform:none; font-weight:bold; padding-left:20px; width:54%; } .content h2:lang(en) { text-transform:capitalize; } @@ -96,9 +96,7 @@ a { color:#04f; border-width: 0; } a:hover, a:active { color: #0aa; border-bottom: 0 none; cursor: pointer; } .content .navigationBar {color:#999;} ul.actions, .content form#waiting {text-align:center;} -h2 { display:block; font-size:28px; letter-spacing:-1px; -margin:0 20px; height:40px; overflow:hidden; padding:0; position:absolute; -right:0; text-align:right; top:0; width:770px; } +h2 { font-size:28px; letter-spacing:-1px;padding:0; text-align:left;} .header_msgs { background:transparent url(images/header_msgs-bg.gif) repeat scroll right top; border:0; color:#ccc; font-size:24px; height:30px; left:0; margin:0; padding:10px 0 0; position:absolute; text-align:center; top:0; width:100%; z-index:99; } diff --git a/admin/template/goto/theme/roma/theme.css b/admin/template/goto/theme/roma/theme.css index 378530fed..81af6c627 100644 --- a/admin/template/goto/theme/roma/theme.css +++ b/admin/template/goto/theme/roma/theme.css @@ -8,46 +8,43 @@ input[type="radio"], input[type="checkbox"] { background-color: transparent; } { color:#999; background-color: #eee; } */ INPUT[type="submit"], INPUT[type="reset"] { color:#999; border: 1px solid #666; background-color: #444; padding: 1px 15px; } input.rateButton, legend, h3 { color: #666; } -#theAdminPage h2 { color: #333; } +#theAdminPage h2 { color: #ccc; letter-spacing:2px; font-weight:bold;} .content .infos { color: #f70; border:0; background-color: transparent; padding:5px 60px 0pt 10pt; min-height: 48px; text-align:left; background-position:left top;} .content .infos .submit {margin-left:30px;} .content .infos li, .content .errors li { list-style-type:none; } .content .errors { color: #f33; border:0; background-color: transparent; padding:5px 60px 0pt 10pt; min-height: 48px; text-align:left; font-weight:bold; background-position:left top; } -#copyright { color:#666; margin:60px auto 0px 240px; text-align:center; -padding-bottom: 15px; } .header_notes { background: transparent url(../../icon/note.png) no-repeat right top; border:0; font-weight:bold; min-height: 48px; padding:15px 60px 0 0; position:absolute; right:0; text-align:right; top:90px; width:550px; } html, body { min-height: 100%; } body { margin: 0; padding: 0; -background:#111111 url(images/bottom-left-bg.jpg) no-repeat fixed left bottom; } -#the_page { margin: 0; padding: 0; z-index: 1; top:0px; -padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } +background-color:#111111; } +/* #the_page { margin: 0; padding: 0; z-index: 1; top:0px; */ +/* padding-top: 0; min-height: 100%; width:100%; position:absolute; left:0px; } */ #headbranch { width: 233px; height: 240px; margin: 0; padding: 0; position:absolute; left:0px; top:0px; z-index: 0; -background:transparent url(images/top-left-bg.jpg) no-repeat scroll left top; } -#theHeader { min-height:105px; margin: 0; padding: 0; +} +#theHeader { display:none;min-height:105px; margin: 0; padding: 0; background:transparent url(images/piwigo_logo_sombre_214x100.png) no-repeat scroll 245px top; } h3, #imageToolBar a:hover, .row2, .content { background-color: #222; } .throw, .row1 { background-color:#111; } .throw em { font-style: normal; color: #ff3363; } -#content { min-height: 466px; margin-top: 9px; } + +#content { min-height: 466px; margin-top: 15px; } .content { padding:0 5px 5px; margin: 0 10px 0 248px; z-index:99; } -.content h3 { font-size:20px; letter-spacing:-0.4px; margin:0 20px 12px 0; - text-align:center; background:none; border: 0; } + +.content h3 { font-size:20px; letter-spacing:-0.4px; margin:0 20px 12px 0; text-align:center; background:none; border: 0; } .content h3 ~ h3{ margin-top: 40px; } .content h4 { font-size:14px; text-align:left; padding:3px; margin: 2px;} -/*.content h2:before, .content h2:after, */ -.content h2 { -letter-spacing:2px; margin-right:30px; text-align:right; color: #666; -text-transform:none; font-weight:bold; padding-left:20px; width:54%; } -.content h2:lang(en) { text-transform:capitalize; } + +/*.content h2:before, .content h2:after, */ +h2:lang(en) { text-transform:capitalize; } .content dl, dd { margin:5px; } -.content div.titrePage { height:55px; } +.content div.titrePage {} .instructions { height:450px; overflow:scroll; padding:0 20px 0; text-align:left; margin-bottom: 20px; font-size:14px; line-height:21px; } .instructions { overflow-y:scroll; overflow-x:hidden; } @@ -107,9 +104,7 @@ a { color:#f70; border-width: 0; } a:hover, a:active { color: #f33; border-bottom: 1px solid #FF3363; cursor: pointer; } .content .navigationBar {color:#666;} ul.actions, .content form#waiting {text-align:center;} -h2 { display:block; font-size:28px; letter-spacing:-1px; -margin:0 20px; height:104px; overflow:hidden; padding:0; position:absolute; -right:0; text-align:right; top:0; width:770px; } + .header_msgs { background:transparent url(images/header_msgs-bg.gif) repeat scroll right top; border:0; color:#333; font-size:24px; height:30px; left:0; margin:0; padding:10px 0 0; position:absolute; text-align:center; top:0; width:100%; z-index:99; } @@ -124,7 +119,7 @@ font-family:verdana,arial,helvetica,sans-serif; font-size:8px; list-style-image:none; padding: 0; position:relative; text-decoration:none; top:-2px; white-space:nowrap; margin: 0 0 0 -5px; padding-left:10px; width:100%; } -.tabsheet li { background:#222222; float:left; margin:0 6px 0 0; overflow:hidden; text-align:right; border:1px solid #ff3363; border-bottom:none; position:relative; top:11px; } +.tabsheet li { background:#222222; float:left; margin:0 6px 0 0; overflow:hidden; text-align:right; border:1px solid #ff3363; border-bottom:none; position:relative; top:11px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px;} .tabsheet a { color:#666; display:block; font-size:11px; border:0; font-weight:bold; overflow:hidden; padding:6px; @@ -142,8 +137,8 @@ margin-top:4px; padding-bottom:3px; padding-top:3px; top:1px; /* menubar is on all admin pages => No specific css file */ #menubar { background:transparent url(images/menuBoxBottom_new.png) no-repeat scroll left bottom; -border:0; display:inline; float:left; left:0; margin: 0 0 0 35px; min-height:475px; height:475px; /* should be 477 */ -padding:0; width:207px; z-index:99; text-align: left; } +border:0; display:inline; float:left; left:0; margin: 10px 0 0 10px; min-height:475px; height:475px; /* should be 477 */ +padding:0; width:230px; z-index:99; text-align: left; } #menubar ul.scroll { height:163px; margin-right:10px; overflow-y:auto; /* Only IE family supports colored scrollbar */ scrollbar-face-color: #222; scrollbar-shadow-color: #444; scrollbar-highlight-color: #000; @@ -217,4 +212,8 @@ html>body #menubar {min-height:477px; height:477px;} /* IE 7 and modern browsers * html[lang="en"] body .content h2 , *+html[lang="en"] body .content h2 { text-transform:capitalize; } /* IE */ *+html .bigtext { left: 70px; } *+html .bigbutton input, * html .bigbutton input { left:0px; position:relative; top:-40px; } + * html .bigtext { margin-right: 300px; } + +#adminHome {background-color:#222;} +#adminHome:hover {background-color:#333;} diff --git a/template-common/lib/plugins/jquery.tipTip.minified.js b/template-common/lib/plugins/jquery.tipTip.minified.js new file mode 100644 index 000000000..62b7cfde0 --- /dev/null +++ b/template-common/lib/plugins/jquery.tipTip.minified.js @@ -0,0 +1,27 @@ + /* + * TipTip + * Copyright 2010 Drew Wilson + * www.drewwilson.com + * code.drewwilson.com/entry/tiptip-jquery-plugin + * + * Version 1.2 - Updated: Jan. 13, 2010 + * + * This Plug-In will create a custom tooltip to replace the default + * browser tooltip. It is extremely lightweight and very smart in + * that it detects the edges of the browser window and will make sure + * the tooltip stays within the current window size. As a result the + * tooltip will adjust itself to be displayed above, below, to the left + * or to the right depending on what is necessary to stay within the + * browser window. It is completely customizable as well via CSS. + * + * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($){$.fn.tipTip=function(options){var defaults={maxWidth:"200px",edgeOffset:3,delay:400,fadeIn:200,fadeOut:200,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('
');var tiptip_content=$('
');var tiptip_arrow=$('
');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
')));}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow");} +return this.each(function(){var org_elem=$(this);var org_title=org_elem.attr("title");if(org_title!=""){org_elem.removeAttr("title");var timeout=false;org_elem.hover(function(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(w_compare<0){if((w_compare+left)parseInt($(window).width())){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare);}} +if((top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop())){t_class=t_class+"_top";arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset));}else if(((top+org_height)-(opts.edgeOffset+tip_h))<0||t_class==""){t_class=t_class+"_bottom";arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset);} +if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5;}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5;} +if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5;} +tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout);} +timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn);},opts.delay);},function(){opts.exit.call(this);if(timeout){clearTimeout(timeout);}tiptip_holder.fadeOut(opts.fadeOut);});}});}})(jQuery); \ No newline at end of file -- cgit v1.2.3