diff options
author | Anika Henke <anika@selfthinker.org> | 2012-01-22 15:58:03 +0000 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2012-01-22 15:58:03 +0000 |
commit | dd63cd2b93bfa75cc2c13a50047278aaa94f4c9a (patch) | |
tree | 7cd4496c211e090841ef9b05ed371cf2c9075712 | |
parent | fc1d0a5b10210a22c8909f30661668d876e9583d (diff) | |
download | rpg-dd63cd2b93bfa75cc2c13a50047278aaa94f4c9a.tar.gz rpg-dd63cd2b93bfa75cc2c13a50047278aaa94f4c9a.tar.bz2 |
integrated image detail page into main layout
-rwxr-xr-x | css/_imgdetail.css | 10 | ||||
-rwxr-xr-x | css/design.css | 6 | ||||
-rwxr-xr-x | detail.php | 132 | ||||
-rwxr-xr-x | main.php | 79 | ||||
-rw-r--r-- | tpl_footer.php | 6 | ||||
-rw-r--r-- | tpl_header.php | 72 |
6 files changed, 170 insertions, 135 deletions
diff --git a/css/_imgdetail.css b/css/_imgdetail.css index d6cc4abaf..a3e0f55f5 100755 --- a/css/_imgdetail.css +++ b/css/_imgdetail.css @@ -8,14 +8,11 @@ #dokuwiki__detail h1 { } -#dokuwiki__detail div.content { -} - -#dokuwiki__detail div.content img { +#dokuwiki__detail img { float: left; - margin-right: 1.5em; + margin: 0 1.5em .5em 0; } -#dokuwiki__detail div.content div.img_detail { +#dokuwiki__detail div.img_detail { float: left; } @@ -29,4 +26,5 @@ } #dokuwiki__detail p.back { + clear: both; } diff --git a/css/design.css b/css/design.css index 1b596d590..026c5e3c0 100755 --- a/css/design.css +++ b/css/design.css @@ -366,6 +366,12 @@ } +/*____________ changes to _imgdetail ____________*/ + +#dokuwiki__detail { + padding: 0; +} + /*____________ JS popup ____________*/ .JSpopup { diff --git a/detail.php b/detail.php index 03f83a860..f3951e7bc 100755 --- a/detail.php +++ b/detail.php @@ -11,6 +11,8 @@ if (!defined('DOKU_INC')) die(); @require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ +$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'] ); +$showSidebar = tpl_getConf('sidebarID') && page_exists(tpl_getConf('sidebarID')) && ($ACT=='show'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" @@ -29,70 +31,96 @@ if (!defined('DOKU_INC')) die(); </head> <body> + <?php /* with these Conditional Comments you can better address IE issues in CSS files, + precede CSS rules by #IE7 for IE7 and #IE8 for IE8 (div closes at the bottom) */ ?> <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]--> - <div id="dokuwiki__detail" class="dokuwiki"> - <?php html_msgarea() ?> - <?php if($ERROR){ print $ERROR; }else{ ?> + <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?> + <?php /* classes mode_<action> are added to make it possible to e.g. style a page differently if it's in edit mode, + see http://www.dokuwiki.org/devel:action_modes for a list of action modes */ ?> + <?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?> + <div id="dokuwiki__site"><div id="dokuwiki__top" + class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>"> - <h1><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1> + <?php include('tpl_header.php') ?> - <div class="content"> - <?php tpl_img(900,700) ?> + <div class="wrapper group" id="dokuwiki__detail"> - <div class="img_detail"> - <h2><?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h2> + <!-- ********** CONTENT ********** --> + <div id="dokuwiki__content"><div class="pad group"> + <?php tpl_flush() /* flush the output buffer */ ?> + <?php _tpl_include('pageheader.html') ?> - <dl> - <?php - $config_files = getConfigFiles('mediameta'); - foreach ($config_files as $config_file) { - if(@file_exists($config_file)) { - include($config_file); - } - } + <!-- ********** IMG DETAIL ********** --> - foreach($fields as $key => $tag){ - $t = array(); - if (!empty($tag[0])) { - $t = array($tag[0]); - } - if(is_array($tag[3])) { - $t = array_merge($t,$tag[3]); + <?php if($ERROR){ print $ERROR; }else{ ?> + + <h1><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1> + + <?php tpl_img(900,700) ?> + + <div class="img_detail"> + <h2><?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h2> + + <dl> + <?php + $config_files = getConfigFiles('mediameta'); + foreach ($config_files as $config_file) { + if(@file_exists($config_file)) { + include($config_file); + } } - $value = tpl_img_getTag($t); - if ($value) { - echo '<dt>'.$lang[$tag[1]].':</dt><dd>'; - if ($tag[2] == 'date') { - echo dformat($value); - } else { - echo hsc($value); + + foreach($fields as $key => $tag){ + $t = array(); + if (!empty($tag[0])) { + $t = array($tag[0]); + } + if(is_array($tag[3])) { + $t = array_merge($t,$tag[3]); + } + $value = tpl_img_getTag($t); + if ($value) { + echo '<dt>'.$lang[$tag[1]].':</dt><dd>'; + if ($tag[2] == 'date') { + echo dformat($value); + } else { + echo hsc($value); + } + echo '</dd>'; } - echo '</dd>'; } + ?> + </dl> + <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?> + </div> + + <p class="back"> + <?php + $imgNS = getNS($IMG); + $authNS = auth_quickaclcheck("$imgNS:*"); + if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) { + $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG)); + echo '<a href="'.$mmURL.'">'.$lang['img_manager'].'</a><br />'; } ?> - </dl> - <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?> - </div> - <div class="clearer"></div> - </div><!-- /.content --> - - <p class="back"> - <?php - $imgNS = getNS($IMG); - $authNS = auth_quickaclcheck("$imgNS:*"); - if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) { - $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG)); - echo '<a href="'.$mmURL.'">'.$lang['img_manager'].'</a><br />'; - } - ?> - ← <?php echo $lang['img_backto']?> <?php tpl_pagelink($ID)?> - </p> - - <?php } ?> - </div> + ← <?php echo $lang['img_backto']?> <?php tpl_pagelink($ID)?> + </p> + + <?php } ?> + + <!-- ********** /IMG DETAIL ********** --> + + <?php tpl_flush() ?> + <?php _tpl_include('pagefooter.html') ?> + </div></div><!-- /content --> + <hr class="a11y" /> + + </div><!-- /wrapper --> + + <?php include('tpl_footer.php') ?> + </div></div><!-- /site --> + <!--[if ( IE 6 | IE 7 | IE 8 ) ]></div><![endif]--> </body> </html> - @@ -38,78 +38,8 @@ $showSidebar = tpl_getConf('sidebarID') && page_exists(tpl_getConf('sidebarID')) <?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?> <div id="dokuwiki__site"><div id="dokuwiki__top" class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>"> - <?php html_msgarea() /* occasional error and info messages on top of the page */ ?> - <?php _tpl_include('header.html') ?> - - <!-- ********** HEADER ********** --> - <div id="dokuwiki__header"><div class="pad group"> - - <div class="headings group"> - <h1><?php tpl_link( - wl(), - '<img src="'.tpl_getFavicon(false, 'logo.png').'" width="64" height="64" alt="" /> <span>'.$conf['title'].'</span>', - 'accesskey="h" title="[H]"' - ) /* @todo: obviously don't use tpl_getFavicon, but make a new function (or use a config option?) */ ?></h1> - <?php if (tpl_getConf('tagline')): ?> - <p class="claim"><?php echo tpl_getConf('tagline') ?></p> - <?php endif ?> - - <ul class="a11y"> - <li><a href="#dokuwiki__content"><?php echo tpl_getLang('skip_to_content') ?></a></li> - </ul> - </div> - - <div class="tools group"> - <!-- USER TOOLS --> - <?php if ($conf['useacl'] && $showTools): ?> - <div id="dokuwiki__usertools"> - <h3 class="a11y"><?php echo tpl_getLang('user_tools') ?></h3> - <ul> - <?php /* the optional second parameter of tpl_action() switches between a link and a button, - e.g. a button inside a <li> would be: tpl_action('edit',0,'li') */ - if ($_SERVER['REMOTE_USER']) { - echo '<li class="user">'; - tpl_userinfo(); /* 'Logged in as ...' */ - echo '</li>'; - } - tpl_action('admin', 1, 'li'); - tpl_action('profile', 1, 'li'); - tpl_action('register', 1, 'li'); - tpl_action('login', 1, 'li'); - ?> - </ul> - </div> - <?php endif ?> - - <!-- SITE TOOLS --> - <div id="dokuwiki__sitetools"> - <h3 class="a11y"><?php echo tpl_getLang('site_tools') ?></h3> - <?php tpl_searchform() ?> - <ul> - <?php - tpl_action('recent', 1, 'li'); - tpl_action('media', 1, 'li'); - tpl_action('index', 1, 'li'); - ?> - </ul> - </div> - </div> - - <!-- BREADCRUMBS --> - <?php if($conf['breadcrumbs'] || $conf['youarehere']): ?> - <div class="breadcrumbs"> - <?php if($conf['youarehere']): ?> - <div class="youarehere"><?php tpl_youarehere() ?></div> - <?php endif ?> - <?php if($conf['breadcrumbs']): ?> - <div class="trace"><?php tpl_breadcrumbs() ?></div> - <?php endif ?> - </div> - <?php endif ?> - - <hr class="a11y" /> - </div></div><!-- /header --> + <?php include('tpl_header.php') ?> <div class="wrapper group"> @@ -161,12 +91,7 @@ $showSidebar = tpl_getConf('sidebarID') && page_exists(tpl_getConf('sidebarID')) <?php endif; ?> </div><!-- /wrapper --> - <!-- ********** FOOTER ********** --> - <div id="dokuwiki__footer"><div class="pad"> - <?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?> - </div></div><!-- /footer --> - - <?php _tpl_include('footer.html') ?> + <?php include('tpl_footer.php') ?> </div></div><!-- /site --> <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div> diff --git a/tpl_footer.php b/tpl_footer.php new file mode 100644 index 000000000..fcc9d21c7 --- /dev/null +++ b/tpl_footer.php @@ -0,0 +1,6 @@ +<!-- ********** FOOTER ********** --> +<div id="dokuwiki__footer"><div class="pad"> + <?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?> +</div></div><!-- /footer --> + +<?php _tpl_include('footer.html') ?> diff --git a/tpl_header.php b/tpl_header.php new file mode 100644 index 000000000..d782c051a --- /dev/null +++ b/tpl_header.php @@ -0,0 +1,72 @@ +<?php html_msgarea() /* occasional error and info messages on top of the page */ ?> +<?php _tpl_include('header.html') ?> + +<!-- ********** HEADER ********** --> +<div id="dokuwiki__header"><div class="pad group"> + + <div class="headings group"> + <h1><?php tpl_link( + wl(), + '<img src="'.tpl_getFavicon(false, 'logo.png').'" width="64" height="64" alt="" /> <span>'.$conf['title'].'</span>', + 'accesskey="h" title="[H]"' + ) /* @todo: obviously don't use tpl_getFavicon, but make a new function (or use a config option?) */ ?></h1> + <?php if (tpl_getConf('tagline')): ?> + <p class="claim"><?php echo tpl_getConf('tagline') ?></p> + <?php endif ?> + + <ul class="a11y"> + <li><a href="#dokuwiki__content"><?php echo tpl_getLang('skip_to_content') ?></a></li> + </ul> + </div> + + <div class="tools group"> + <!-- USER TOOLS --> + <?php if ($conf['useacl'] && $showTools): ?> + <div id="dokuwiki__usertools"> + <h3 class="a11y"><?php echo tpl_getLang('user_tools') ?></h3> + <ul> + <?php /* the optional second parameter of tpl_action() switches between a link and a button, + e.g. a button inside a <li> would be: tpl_action('edit',0,'li') */ + if ($_SERVER['REMOTE_USER']) { + echo '<li class="user">'; + tpl_userinfo(); /* 'Logged in as ...' */ + echo '</li>'; + } + tpl_action('admin', 1, 'li'); + tpl_action('profile', 1, 'li'); + tpl_action('register', 1, 'li'); + tpl_action('login', 1, 'li'); + ?> + </ul> + </div> + <?php endif ?> + + <!-- SITE TOOLS --> + <div id="dokuwiki__sitetools"> + <h3 class="a11y"><?php echo tpl_getLang('site_tools') ?></h3> + <?php tpl_searchform() ?> + <ul> + <?php + tpl_action('recent', 1, 'li'); + tpl_action('media', 1, 'li'); + tpl_action('index', 1, 'li'); + ?> + </ul> + </div> + + </div> + + <!-- BREADCRUMBS --> + <?php if($conf['breadcrumbs'] || $conf['youarehere']): ?> + <div class="breadcrumbs"> + <?php if($conf['youarehere']): ?> + <div class="youarehere"><?php tpl_youarehere() ?></div> + <?php endif ?> + <?php if($conf['breadcrumbs']): ?> + <div class="trace"><?php tpl_breadcrumbs() ?></div> + <?php endif ?> + </div> + <?php endif ?> + + <hr class="a11y" /> +</div></div><!-- /header --> |