Skip to content

Commit

Permalink
- Configuration reversed to simplify CSS
Browse files Browse the repository at this point in the history
- theme.css a test to solve menubar issue
- STC: php version control

git-svn-id: http://piwigo.org/svn/trunk@2492 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
vdigital committed Aug 31, 2008
1 parent bd833ee commit 5c02129
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 116 deletions.
18 changes: 9 additions & 9 deletions admin/template/yoga/admin/configuration.tpl
Expand Up @@ -6,32 +6,32 @@
<form method="post" action="{$F_ACTION}" class="properties">

{if isset($main)}
<fieldset id="mainConf">
<fieldset>
<ul>
<li>
<span class="property">
<span class="property m38">
<label for="gallery_title">{'Gallery title'|@translate}</label>
</span>
<input type="text" maxlength="255" size="50" name="gallery_title" id="gallery_title" value="{$main.CONF_GALLERY_TITLE}" />
</li>

<li>
<span class="property">
<span class="property m38">
<label for="page_banner">{'Page banner'|@translate}</label>
</span>
<textarea class="description" name="page_banner" id="page_banner">{$main.CONF_PAGE_BANNER}</textarea>
</li>

<li>
<span class="property">
<span class="property m38">
<label for="gallery_url">{'Gallery URL'|@translate}</label>
</span>
<input type="text" maxlength="255" size="50" name="gallery_url" id="gallery_url" value="{$main.CONF_GALLERY_URL}" />
</li>
</ul>
</fieldset>

<fieldset id="mainConfCheck">
<fieldset>
<ul>

<li>
Expand Down Expand Up @@ -80,7 +80,7 @@
{/if}

{if isset($history)}
<fieldset id="historyConf">
<fieldset>
<ul>
<li>
<label><span class="property">{'conf_history_guest'|@translate}</span><input type="checkbox" name="history_guest" {if ($history.history_guest)}checked="checked"{/if} /></label>
Expand All @@ -99,7 +99,7 @@


{if isset($comments)}
<fieldset id="commentsConf">
<fieldset>
<ul>
<li>
<label>
Expand Down Expand Up @@ -142,15 +142,15 @@
{/if}

{if isset($upload)}
<fieldset id="uploadConf">
<fieldset>
<ul>
<li>
<label><span class="property">{'Show upload link every time'|@translate}</span>
<input type="checkbox" name="upload_link_everytime" {if ($upload.upload_link_everytime)}checked="checked"{/if} /></label>
</li>
<li>
<label><span class="property">{'User access level to upload'|@translate}</span>
{html_options name="upload_user_access" options=$upload.upload_user_access_options selected=$upload.upload_user_access_options_selected}
{html_options class="widefield" name="upload_user_access" options=$upload.upload_user_access_options selected=$upload.upload_user_access_options_selected}
</li>
<li>
<label>
Expand Down
50 changes: 9 additions & 41 deletions admin/template/yoga/default-layout.css
Expand Up @@ -93,48 +93,13 @@ FORM#categoryPermissions LI {
display:inline;
white-space: nowrap;
}

FIELDSET#mainConfCheck SPAN.property,
FIELDSET#historyConf SPAN.property,
FIELDSET#commentsConf SPAN.property,
FIELDSET#uploadConf SPAN.property {
float: right;
text-align: left;
}
FIELDSET#mainConfCheck INPUT,
FIELDSET#historyConf INPUT,
FIELDSET#commentsConf INPUT,
FIELDSET#uploadConf INPUT {
float: none;
}

FIELDSET#mainConf SPAN.property {
width: 25%;
.property {
width: 60%;
}
FIELDSET#mainConf TEXTAREA.description {
TEXTAREA.description {
width: 70%;
}

FIELDSET#mainConfCheck SPAN.property,
FIELDSET#historyConf SPAN.property {
width: 90%;
}
FIELDSET#mainConfCheck INPUT,
FIELDSET#historyConf INPUT,
FIELDSET#commentsConf INPUT,
FIELDSET#uploadConf SELECT,
FIELDSET#uploadConf INPUT {
margin-left: 5%;
}

FIELDSET#commentsConf SPAN.property {
width: 85%;
}

FIELDSET#uploadConf SPAN.property {
width: 75%;
}

.statBar {
height: 10px;
background-color: #66f;
Expand Down Expand Up @@ -314,8 +279,8 @@ FORM FIELDSET P {
}

TEXTAREA.description {
height: 6em;
width: 40em;
height: 12em;
width: 60%;
overflow: auto;
}

Expand Down Expand Up @@ -423,11 +388,14 @@ FORM.properties LI, FORM#update UL {
FORM.properties SPAN.property {
font-weight: bold;
float: left;
width: 50%;
width: 60%;
text-align: right;
margin: 0;
padding: 0 0.5em 0 0;
}
.m38 {
width: 38% !important;
}

#theHeader H1 {
margin-bottom: 0.5em;
Expand Down
20 changes: 10 additions & 10 deletions admin/template/yoga/theme/admin/theme.css
Expand Up @@ -64,14 +64,14 @@ a.Piwigo {
a { color:#f70; border-color: #FF3363; }
a:hover { color: #f33; border-color: #FF3363; }

#theAdminPage h2 { display:block; font-size:28px; letter-spacing:-1px;
h2 { display:block; font-size:28px; letter-spacing:-1px;
margin:0 20px; height:95px; overflow:hidden; padding:0; position:absolute;
right:0; text-align:right; top:0; width:770px; }
.header_msgs { background-color:transparent; }
.HelpActions a { border:0; margin:4px 14px 0 0; position:absolute; right:0; }
.HelpActions li {list-style-image:none; list-style-position:outside;
list-style-type:none; text-align:center; text-indent:0pt; }
fieldset#uploadConf input { margin:0 5px 0 110px; width:160px; }

table.table2 th { padding:3px 30px; }
table.table2 tr.throw { text-align: center; }
table.table2 { margin:0pt auto; }
Expand All @@ -90,7 +90,7 @@ width:136px !important; border: 0; }
.tabsheet a {
background:transparent url(images/inactive_tab.png) no-repeat scroll left 5px;
border: 0 none; color:#777777; display:block; font-size:11px; text-transform:capitalize;
font-weight:bold; height:33px; overflow:hidden; padding:12px 30px 5px 0; line-height: 18px;
font-weight:bold; height:28px; overflow:hidden; padding:12px 30px 5px 0; line-height: 18px;
text-align:right; text-decoration:none; width:122px !important; }
.tabsheet a:hover, .tabsheet li.selected_tab a {
background:transparent url(images/active_tab.png) no-repeat scroll left 5px;
Expand All @@ -103,25 +103,25 @@ background:transparent url(images/active_tab_letters.png) no-repeat scroll left
/* 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:468px;
padding:0; width:207px; z-index:99; text-align: left; /* "be nice to IE5" rule */ }
#menubar .selected a { color: #f70; border-color: #f36; }
border:0; display:inline; float:left; left:0; margin: 0 0 0 35px; min-height:477px; height:477px;
padding:0; width:207px; z-index:99; text-align: left; }
#menubar .selected a { color: #f70; border-color: #f36;}
#menubar .selected a:hover { color: #f36; border-bottom: 1px solid #f36;}
#menubar dd {
background: transparent url(images/menubar-detail.png) repeat-y top left;
margin: 0; padding: 0; height:232px; display:block; }
margin: 10px 0 0 0; padding: 0; height:232px; }
#menubar dl {
background:transparent url(images/menuBoxTop_new.png) no-repeat scroll left top;
width: 207px; border:0; margin: 0; padding: 0; display: block; min-height:35px; }
#menubar dl.first {
#menubar dl.first {
background:transparent url(images/menubar-top.png) no-repeat scroll left 1px; }
#menubar dt { margin: 0; display: block; background: none; left:10px; font-weight:bold;
position:relative; padding: 5px; top:-10px; font-size: 13px; color: #666; }
position:relative; padding: 5px 1px 4px 5px; top:-10px; font-size: 13px; color: #666; }
#menubar dt span { background-color: #111; cursor:pointer; }
#menubar a { border-bottom:0; text-decoration:none; font-size: 12px;
color: #F70; border-bottom: 1px dotted #777;}
#menubar li { margin: 0 0 0 6px; }
#menubar li.external { list-style-image:url(images/external_inactive.png); padding:10px 0px 0pt 10px; }
#menubar li.external:hover { list-style-image:url(images/external_active.png); }
#menubar ul { color: #333; margin:9px 0pt 3px 9px;
#menubar ul { color: #333; margin:10px 0pt 3px 9px;
list-style-type: square; list-style-position: inside; padding: 0 0 0 2px; }
115 changes: 59 additions & 56 deletions plugins/SwiftThemeCreator/theme_creator.php
Expand Up @@ -257,13 +257,16 @@ function init_main(&$main)
* Header background controls
*/
$main['subphase'] = 'fixed background controls';
if (isset($_POST['picture_url'])) $main['picture_url'] = $_POST['picture_url'];
if (isset($_POST['background_mode']))
$main['background_mode'] = $_POST['background_mode'];
if (isset($_POST['background'])) $main['background'] = $_POST['background'];
// Fixed
if ( $main['background'] == 'fixed' and isset($_POST['picture_url'])) {
if ( is_dir($_POST['picture_url'])
or !is_file($_POST['picture_url']) )
if ( $main['background'] == 'fixed') {
if ( is_dir($main['picture_url'])
or !is_file($main['picture_url']) )
array_push($errors, l10n('Header picture is not found, check its path and name.'));
$extension = substr($_POST['picture_url'],strrpos($_POST['picture_url'],'.')+1);
$extension = substr($main['picture_url'],strrpos($main['picture_url'],'.')+1);
if (!in_array($extension, array('jpg','jpeg','png')))
array_push($errors, l10n('Compliant extensions are .jpg, .jpeg or .png.'));
}
Expand Down Expand Up @@ -315,6 +318,19 @@ function init_main(&$main)
// | Build files |
// +-----------------------------------------------------------------------+
$main['phase'] = 'Files building';
if (!function_exists('imagecreatetruecolor') or !function_exists('imagefilter')) {
array_push($errors, l10n('Some Php Graphic resources are missing.'
. ' Sorry for the inconvenience, but Swift Theme Creator couldn\'t work in such case.'));
array_push($infos, l10n('This plugin requires PHP 5.2.5 or later'
. ' and compiled against graphic library GD 2.0.1 or later.'));
array_push($infos, l10n('On this server, PHP is:'). phpversion());
if (function_exists('gd_info')) {
$GD = gd_info();
array_push($infos, l10n('and graphic library is:').$GD['GD Version']);
}
else array_push($infos, l10n('graphic library version is not available.'));
$main['background'] = 'off';
}
if ((isset($_POST['submit']) or $main['simulate'] ) and (!is_adviser()))
{
/*
Expand Down Expand Up @@ -387,55 +403,54 @@ function init_main(&$main)
AND ic.image_id = i.id
ORDER BY RAND(' . $main['random'] . ')
LIMIT 0,1');
if($result) list($main['pic_path']) = mysql_fetch_array($result);
else $main['pic_path'] =
PHPWG_ROOT_PATH . 'plugins/SwiftThemeCreator/simul/header.jpg';
$main['pic_ext'] = substr($main['pic_path'],strrpos($main['pic_path'],'.')+1);
if ($main['pic_ext']=='png')
$img = imagecreatefrompng($main['pic_path']);
elseif (in_array($main['pic_ext'],array('jpg','jpeg')))
$img = imagecreatefromjpeg($main['pic_path']);
else $img = imagecreatefromjpeg(PHPWG_ROOT_PATH
. 'plugins/SwiftThemeCreator/simul/header.jpg');
imagejpeg( $img, $themedir . '/header.jpg', 90 );
imagedestroy ($img);
if($result) list($main['pic_path']) = mysql_fetch_array($result);
else $main['pic_path'] =
PHPWG_ROOT_PATH . 'plugins/SwiftThemeCreator/simul/header.jpg';
$main['pic_ext'] = substr($main['pic_path'],strrpos($main['pic_path'],'.')+1);
if ($main['pic_ext']=='png')
$img = imagecreatefrompng($main['pic_path']);
elseif (in_array($main['pic_ext'],array('jpg','jpeg')))
$img = imagecreatefromjpeg($main['pic_path']);
else $img = imagecreatefromjpeg(PHPWG_ROOT_PATH
. 'plugins/SwiftThemeCreator/simul/header.jpg');
imagejpeg( $img, $themedir . '/header.jpg', 90 );
imagedestroy ($img);
}
if (isset($_POST['background']) and $_POST['background'] == 'fixed')
{
if (function_exists('imagecreatefromjpeg'))
{
$hdr = imagecreatetruecolor ($main['picture_width'], $main['picture_height']);
imagecolorset ( $hdr, 0, $r2, $g2, $b2 );
if ($extension == 'png') $img = imagecreatefrompng($_POST['picture_url']);
else $img = imagecreatefromjpeg($_POST['picture_url']);
imagecopymerge ( $hdr, $img, 0, 0, 0, 0, $main['picture_width'], $main['picture_height'], 60 );
imagedestroy ($img);
if ($main['colorize']) imagefilter($hdr, IMG_FILTER_COLORIZE, $r, $g, $b);
if ($main['brightness']) imagefilter($hdr, IMG_FILTER_BRIGHTNESS, $delta);
if ($main['contrast']) imagefilter($hdr, IMG_FILTER_CONTRAST, 20);
imagejpeg( $hdr, $themedir . '/header.jpg', 90 );
imagedestroy ($hdr);
}
else @copy( $_POST['picture_url'], $themedir . '/header.jpg');
}
/*
* Build background image for titrePage or definition list (in #menubar)
**/
if (function_exists('imagecreatefrompng'))
{
$hdr = imagecreatetruecolor (1, 38);
$main['subphase'] = 'Fixed background';
$hdr = imagecreatetruecolor ($main['picture_width'], $main['picture_height']);
imagecolorset ( $hdr, 0, $r2, $g2, $b2 );
$img = imagecreatefrompng(STC_PATH . '/titrePage-bg.png');
imagecopymerge ( $hdr, $img, 0, 0, 0, 0, 1, 38, 60 );
if ($extension == 'png') $img = imagecreatefrompng($main['picture_url']);
else $img = imagecreatefromjpeg($main['picture_url']);
imagecopymerge ( $hdr, $img, 0, 0, 0, 0, $main['picture_width'], $main['picture_height'], 60 );
imagedestroy ($img);
if ($main['colorize']) imagefilter($hdr, IMG_FILTER_COLORIZE, $r, $g, $b);
if ($main['brightness']) imagefilter($hdr, IMG_FILTER_BRIGHTNESS, $delta);
if ($main['contrast']) imagefilter($hdr, IMG_FILTER_CONTRAST, 20);
imagepng( $hdr, $themedir . '/stc.png', 9 );
imagedestroy ($hdr);
imagejpeg( $hdr, $themedir . '/header.jpg', 90 );
imagedestroy ($hdr);
}
else @copy( STC_PATH
. '/titrePage-bg.png', $themedir . '/stc.png');
/*
* Build background image for titrePage or definition list (in #menubar)
**/
$main['subphase'] = 'Headbars background';
$hdr = imagecreatetruecolor (1, 38);
imagecolorset ( $hdr, 0, $r2, $g2, $b2 );
$img = imagecreatefrompng(STC_PATH . '/titrePage-bg.png');
imagecopymerge ( $hdr, $img, 0, 0, 0, 0, 1, 38, 60 );
imagedestroy ($img);
if ($main['colorize']) imagefilter($hdr, IMG_FILTER_COLORIZE, $r, $g, $b);
if ($main['brightness']) imagefilter($hdr, IMG_FILTER_BRIGHTNESS, $delta);
if ($main['contrast']) imagefilter($hdr, IMG_FILTER_CONTRAST, 20);
imagepng( $hdr, $themedir . '/stc.png', 9 );
imagedestroy ($hdr);

/*
* Errors and cleaning or Congratulations
**/
$main['phase'] = 'Congratulation';
$main['subphase'] = 'cleaning';
if ($rfs == false) {
array_push($errors,
l10n('Theme files creation failure: theme should be deleted.'));
Expand Down Expand Up @@ -507,18 +522,6 @@ function init_main(&$main)
'random' => l10n('24H Random'),
'fixed' => l10n('Fixed URL'),
));
$main['picture_url'] = PHPWG_ROOT_PATH . 'plugins/SwiftThemeCreator/sample.jpg';
if (isset($swift_theme_creator->picture_url))
$main['picture_url'] = $swift_theme_creator->picture_url;
if (isset($_POST['picture_url'])) $main['picture_url'] = $_POST['picture_url'];

if (isset($_POST['picture_width']))
$main['picture_width'] = $_POST['picture_width'];
if (isset($_POST['picture_height']))
$main['picture_height'] = $_POST['picture_height'];

if (isset($_POST['background_mode']))
$main['background_mode'] = $_POST['background_mode'];
$template->assign('background_mode_options',
array(
'as' => l10n('As is'),
Expand Down
1 change: 1 addition & 0 deletions template/yoga/default-layout.css
Expand Up @@ -273,3 +273,4 @@ TABLE.tagLetterContent {
font-size:80%;
border-collapse : collapse;
}
#theHeader {text-align: center;}

0 comments on commit 5c02129

Please sign in to comment.