summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2010-11-06 23:11:25 +0000
committerAnika Henke <anika@selfthinker.org>2010-11-06 23:11:25 +0000
commit23bca4f3845d2ee190cdcbd04ecb5452c1fc502f (patch)
tree0dc250c52475fe93ebba291fbdfdfa405a4fc930
parent5b4c3e60499b9ce847a755833ee8041800e0fcdb (diff)
downloadrpg-23bca4f3845d2ee190cdcbd04ecb5452c1fc502f.tar.gz
rpg-23bca4f3845d2ee190cdcbd04ecb5452c1fc502f.tar.bz2
finished design, improved template functions
-rw-r--r--conf/default.php11
-rw-r--r--conf/metadata.php13
-rw-r--r--css/_links.css7
-rw-r--r--css/_mediamanager.css8
-rw-r--r--css/_toc.css4
-rw-r--r--css/design.css149
-rw-r--r--detail.php8
-rw-r--r--lang/en/lang.php12
-rw-r--r--lang/en/settings.php11
-rw-r--r--main.php75
-rw-r--r--mediamanager.php12
-rw-r--r--tpl_functions.php55
12 files changed, 219 insertions, 146 deletions
diff --git a/conf/default.php b/conf/default.php
index 7c60e665e..e5bce5e9d 100644
--- a/conf/default.php
+++ b/conf/default.php
@@ -4,8 +4,9 @@
*
*/
-$conf['tagline'] = 'This is the tagline - explaining what this site is about.';
-$conf['discussionNS'] = 'discussion';
-$conf['userNS'] = 'user';
-$conf['sidebarID'] = 'sidebar';
-$conf['hideTools'] = 0;
+$conf['tagline'] = 'This is the tagline - explaining what this site is about.';
+$conf['discussionNS'] = 'discussion';
+$conf['discussNSreverse'] = 0;
+$conf['userNS'] = 'user';
+$conf['sidebarID'] = 'sidebar';
+$conf['hideTools'] = 0;
diff --git a/conf/metadata.php b/conf/metadata.php
index c6ebe1638..792c47ae2 100644
--- a/conf/metadata.php
+++ b/conf/metadata.php
@@ -4,10 +4,9 @@
*
*/
-$meta['tagline'] = array('string');
-$meta['discussionNS'] = array('string');
-$meta['userNS'] = array('string');
-$meta['sidebarID'] = array('string');
-$meta['hideTools'] = array('onoff');
-
-// array('multichoice','_choices' => array(0,1,2));
+$meta['tagline'] = array('string');
+$meta['discussionNS'] = array('string');
+$meta['discussNSreverse'] = array('onoff');
+$meta['userNS'] = array('string');
+$meta['sidebarID'] = array('string');
+$meta['hideTools'] = array('onoff');
diff --git a/css/_links.css b/css/_links.css
index 8fc6c1322..d62a4dede 100644
--- a/css/_links.css
+++ b/css/_links.css
@@ -13,7 +13,7 @@
.dokuwiki a.wikilink2 {
color: __missing__;
background-color: inherit;
- text-decoration: none !important;
+ text-decoration: none;
}
.dokuwiki a.wikilink2:link,
.dokuwiki a.wikilink2:visited {
@@ -25,6 +25,11 @@
border-bottom-width: 0;
}
+/* any link to current page */
+.dokuwiki span.curid a {
+ font-weight: bold;
+}
+
/*____________ other link types ____________*/
.dokuwiki a.urlextern,
diff --git a/css/_mediamanager.css b/css/_mediamanager.css
index da1af909e..01e23efd0 100644
--- a/css/_mediamanager.css
+++ b/css/_mediamanager.css
@@ -14,7 +14,7 @@ html.popup {
overflow: hidden;
}
-#media__left {
+#mediamgr__aside {
width: 30%;
height: 100%;
overflow: auto;
@@ -22,18 +22,18 @@ html.popup {
left: 0;
border-right: solid 1px __border__;
}
-#media__left .pad {
+#mediamgr__aside .pad {
padding: .5em;
}
-#media__right {
+#mediamgr__content {
width: 69.7%;
height: 100%;
overflow: auto;
position: absolute;
right: 0;
}
-#media__right .pad {
+#mediamgr__content .pad {
padding: .5em;
}
diff --git a/css/_toc.css b/css/_toc.css
index 5595c521b..fcccf4fc1 100644
--- a/css/_toc.css
+++ b/css/_toc.css
@@ -16,7 +16,7 @@
/*____________ toc header ____________*/
.dokuwiki div.tocheader {
- padding: 0.2em 0.4em;
+ padding: .2em .5em;
margin-bottom: .2em;
font-weight: bold;
background-color: __background_alt__;
@@ -47,7 +47,7 @@
/*____________ toc list ____________*/
.dokuwiki #toc__inside {
- padding: .2em .4em;
+ padding: .2em .5em;
background-color: __background_alt__;
color: __text__;
}
diff --git a/css/design.css b/css/design.css
index d6e68baa2..a86fc9f27 100644
--- a/css/design.css
+++ b/css/design.css
@@ -10,13 +10,14 @@
********************************************************************/
#dokuwiki__header {
- margin: 1em 0 1.4em;
+ margin: 1em 0 0;
}
+
#dokuwiki__header .headings {
- margin-bottom: .7em;
+ margin-bottom: 2.1em;
}
#dokuwiki__header h1 {
- margin-bottom: .2em;
+ margin-bottom: 0;
font-size: 1.5em;
}
#dokuwiki__header h1 a {
@@ -33,21 +34,7 @@
}
#dokuwiki__header .tools {
- margin-bottom: .7em;
-}
-#dokuwiki__header .tools #dokuwiki__usertools {
- position: absolute;
- top: 0;
- right: 0;
- border-bottom: 1px solid __border__;
- background-color: __background_alt__;
- width: 100%;
-}
-#dokuwiki__header .tools #dokuwiki__usertools ul {
- /* imitate #dokuwiki__site */
- margin: 0 auto;
- max-width: 64em;
- padding: 0 1em;
+ margin-bottom: 2.1em;
}
#dokuwiki__header .tools ul {
margin-bottom: 0;
@@ -55,71 +42,132 @@
#dokuwiki__header .tools ul li {
display: inline;
}
+
#dokuwiki__header form.search {
- margin: .5em 0 .2em;
+ margin: .5em 0 0;
display: block;
}
-form.search #qsearch__in {
+#dokuwiki__header form.search #qsearch__in {
width: 12em;
margin-right: .5em;
}
#dokuwiki__header div.breadcrumbs {
+ margin-bottom: .3em;
}
-div.breadcrumbs a {
+#dokuwiki__header div.breadcrumbs a {
color: __existing__;
background-color: inherit;
}
-/* nav
+/* tools
********************************************************************/
-#dokuwiki__aside h1 { }
-#dokuwiki__aside h2 { }
-#dokuwiki__aside h3 { }
-#dokuwiki__aside h4 { }
-#dokuwiki__aside h5 { }
-
-#dokuwiki__aside ul,
-#dokuwiki__aside ol {
- padding-left: 0;
+/* make wiki links look the same as tool links in tool bars */
+#dokuwiki__usertools a.wikilink1,
+#dokuwiki__pagetools a.wikilink1,
+#dokuwiki__usertools a.wikilink2,
+#dokuwiki__pagetools a.wikilink2 {
+ color: #00c;
+ border-bottom-width: 0;
+}
+#dokuwiki__usertools a.wikilink2:hover,
+#dokuwiki__pagetools a.wikilink2:hover,
+#dokuwiki__usertools a.wikilink2:active,
+#dokuwiki__pagetools a.wikilink2:active,
+#dokuwiki__usertools a.wikilink2:focus,
+#dokuwiki__pagetools a.wikilink2:focus {
+ text-decoration: underline;
}
+/* highlight selected tool */
+.mode_admin a.action.admin,
+.mode_profile a.action.profile,
+.mode_recent a.action.recent,
+.mode_index a.action.index,
+.mode_revisions a.action.revs,
+.mode_backlink a.action.backlink {
+ font-weight: bold;
+}
-/* page tools
-********************************************************************/
+/*____________ user tools ____________*/
-#dokuwiki__pagetools {
- position: fixed;
- bottom: 0;
- left: 0;
- border-top: 1px solid __border__;
+#dokuwiki__usertools {
+ position: absolute;
+ top: 0;
+ right: 0;
+ border-bottom: 1px solid __border__;
background-color: __background_alt__;
width: 100%;
}
+#dokuwiki__usertools ul,
#dokuwiki__pagetools ul {
/* imitate #dokuwiki__site */
margin: 0 auto;
max-width: 64em;
padding: 0 1em;
}
-#dokuwiki__pagetools li {
+#dokuwiki__usertools ul li.user {
+ float: left;
+ margin-left: 0;
+}
+
+/*____________ page tools ____________*/
+
+#dokuwiki__pagetools {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ border-top: 1px solid __border__;
+ background-color: __background_alt__;
+ width: 100%;
+ z-index: 10;
+}
+#dokuwiki__pagetools ul li {
display: inline;
margin: 0 1.5em 0 0;
}
+#dokuwiki__pagetools ul li a.action.top {
+ float: right;
+}
+
+
+/* sidebar
+********************************************************************/
+
+#dokuwiki__aside {
+ padding-top: .4em;
+ line-height: 1.2;
+}
+
+/* make sidebar more condensed */
+
+#dokuwiki__aside h1 { margin-bottom: .222em; }
+#dokuwiki__aside h2 { margin-bottom: .333em; }
+#dokuwiki__aside h3 { margin-bottom: .444em; }
+#dokuwiki__aside h4 { margin-bottom: .5em; }
+#dokuwiki__aside h5 { margin-bottom: .5714em; }
+
+#dokuwiki__aside p, #dokuwiki__aside ul, #dokuwiki__aside ol, #dokuwiki__aside dl,
+#dokuwiki__aside pre, #dokuwiki__aside table, #dokuwiki__aside fieldset,
+#dokuwiki__aside hr, #dokuwiki__aside blockquote, #dokuwiki__aside address {
+ margin-bottom: .7em;
+}
+
+#dokuwiki__aside ul, #dokuwiki__aside ol {
+ padding-left: 0;
+}
+#dokuwiki__aside li ul, #dokuwiki__aside li ol {
+ margin-bottom: 0;
+}
+
/* content
********************************************************************/
- /*
.dokuwiki .page {
- -webkit-border-image: 1em -webkit-gradient(linear, left top, right top, from(#cccccc), to(#ffffff));
- padding: 1em;
- background: -moz-linear-gradient(100% 100% 180deg, #cccccc, #ffffff 1em);
- background: -webkit-gradient(linear, left top, right top, from(#cccccc), to(#ffffff));
}
- */
/*____________ section indenting ____________
@@ -180,6 +228,7 @@ div.breadcrumbs a {
}
.dokuwiki pre {
border: 1px solid __border__;
+ padding: 0 .2em;
}
/* for code in <file> */
.dokuwiki pre.file {
@@ -217,11 +266,6 @@ div.breadcrumbs a {
font-size: 90%;
}
-/* any link to current page */
-.dokuwiki span.curid a {
- color: __text_neu__;
-}
-
/*____________ JS popup ____________*/
@@ -230,6 +274,7 @@ div.breadcrumbs a {
color: __text__;
border: 1px solid __border__;
line-height: 1.2;
+ padding: 0 .2em;
}
.JSpopup ul,
@@ -257,4 +302,8 @@ div.breadcrumbs a {
#dokuwiki__footer .license {
clear: both;
}
+#dokuwiki__footer .license img {
+ margin: 0 .5em 0 0;
+ float: none;
+}
diff --git a/detail.php b/detail.php
index 4dc870c5d..500890114 100644
--- a/detail.php
+++ b/detail.php
@@ -1,13 +1,7 @@
<?php
/**
- * DokuWiki Image Detail Template
+ * DokuWiki Image Detail Page
*
- * This is the template for displaying image details
- *
- * You should leave the doctype at the very top - It should
- * always be the very first line of a document.
- *
- * @link http://dokuwiki.org/templates
* @author Andreas Gohr <andi@splitbrain.org>
* @author Anika Henke <anika@selfthinker.org>
*/
diff --git a/lang/en/lang.php b/lang/en/lang.php
index 5496cbe86..91b04b177 100644
--- a/lang/en/lang.php
+++ b/lang/en/lang.php
@@ -4,6 +4,12 @@
*
*/
-$lang['btn_discussion'] = "Discussion";
-$lang['btn_back2article'] = "Back to article";
-$lang['btn_userpage'] = "User page";
+$lang['discussion'] = 'Discussion';
+$lang['back_to_article'] = 'Back to article';
+$lang['userpage'] = 'User page';
+
+/* accessibility headlines */
+$lang['user_tools'] = 'User Tools';
+$lang['site_tools'] = 'Site Tools';
+$lang['page_tools'] = 'Page Tools';
+$lang['skip_to_content'] = 'skip to content';
diff --git a/lang/en/settings.php b/lang/en/settings.php
index 66c9c4486..e2fde20c4 100644
--- a/lang/en/settings.php
+++ b/lang/en/settings.php
@@ -4,8 +4,9 @@
*
*/
-$lang['foo'] = 'Tagline';
-$lang['discussionNS'] = 'Discussion namespace (leave empty to disable discussions)';
-$lang['userNS'] = 'User namespace (leave empty to disable user pages)';
-$lang['sidebarID'] = 'page name of page included in sidebar';
-$lang['hideTools'] = 'Hide tools when not logged in?';
+$lang['tagline'] = 'Tagline';
+$lang['discussionNS'] = 'Discussion namespace (leave empty to disable discussions)';
+$lang['discussNSreverse'] = 'Reverse discussion namespace? (e.g. &quot;foo:bar:discussion&quot; instead of &quot;discussion:foo:bar&quot;)';
+$lang['userNS'] = 'User namespace (leave empty to disable user pages)';
+$lang['sidebarID'] = 'page name of page included in sidebar';
+$lang['hideTools'] = 'Hide tools when not logged in?';
diff --git a/main.php b/main.php
index 65d964cee..23f3f2d24 100644
--- a/main.php
+++ b/main.php
@@ -45,44 +45,41 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<?php if (tpl_getConf('tagline')): ?>
<p class="claim"><?php echo tpl_getConf('tagline') ?></p>
<?php endif ?>
- <!--<h2><?php if (!$conf['useheading']) echo '[[' ?><?php tpl_pagetitle($ID) ?><?php if (!$conf['useheading']) echo ']]' ?></h2>-->
- <?php /* TODO: skip links */ ?>
<ul class="a11y">
- <li><a href="#">skip to nav</a></li>
- <li><a href="#">skip to controls</a></li>
- <li><a href="#">skip to content</a></li>
+ <li><a href="#dokuwiki__content"><?php echo tpl_getLang('skip_to_content') ?></a></li>
</ul>
<div class="clearer"></div>
</div>
<div class="tools">
- <!-- AUTH ACTIONS -->
+ <!-- USER TOOLS -->
<?php if ($conf['useacl'] && $showTools): ?>
<div id="dokuwiki__usertools">
- <h3 class="a11y">User Tools</h3> <?php /*TODO: localize*/ ?>
+ <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') */
- tpl_action('admin', 1, 'li');
- tpl_action('profile', 1, 'li', 0, '', '', $INFO['userinfo']['name'].' ('.$_SERVER['REMOTE_USER'].')');
- // this partly replaces tpl_userinfo()
- if (tpl_getConf('userNS') && $_SERVER['REMOTE_USER']) {
- echo '<li>';
- _tpl_userpage(tpl_getConf('userNS').':',1);
+ if ($_SERVER['REMOTE_USER']) {
+ echo '<li class="user">';
+ tpl_userinfo(); /* 'Logged in as ...' */
echo '</li>';
}
+ tpl_action('admin', 1, 'li');
+ if (tpl_getConf('userNS')) {
+ _tpl_userpage(tpl_getConf('userNS'),1,'li');
+ }
+ tpl_action('profile', 1, 'li');
tpl_action('login', 1, 'li');
?>
</ul>
- <!-- <div class="user"><?php tpl_userinfo() /* 'Logged in as ...' */ ?></div> -->
</div>
<?php endif ?>
- <!-- SITE ACTIONS -->
+ <!-- SITE TOOLS -->
<div id="dokuwiki__sitetools">
- <h3 class="a11y">Site Tools</h3> <?php /*TODO: localize*/ ?>
- <?php tpl_searchform(); ?>
+ <h3 class="a11y"><?php echo tpl_getLang('site_tools') ?></h3>
+ <?php tpl_searchform() ?>
<ul>
<?php
tpl_action('recent', 1, 'li');
@@ -118,26 +115,6 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<!-- ********** CONTENT ********** -->
<div id="dokuwiki__content"><div class="pad">
- <!-- PAGE ACTIONS -->
- <?php if ($showTools): ?>
- <div id="dokuwiki__pagetools">
- <h3 class="a11y">Page Tools</h3> <?php /*TODO: localize*/ ?>
- <ul>
- <?php
- tpl_action('edit', 1, 'li');
- if (tpl_getConf('discussionNS')) {
- echo '<li>';
- _tpl_discussion(tpl_getConf('discussionNS').':',1);
- echo '</li>';
- }
- tpl_action('history', 1, 'li');
- tpl_action('backlink', 1, 'li');
- tpl_action('subscribe', 1, 'li');
- ?>
- </ul>
- </div>
- <?php endif; ?>
-
<?php tpl_flush() /* flush the output buffer */ ?>
<?php @include(dirname(__FILE__).'/pageheader.html') /* include hook */ ?>
@@ -154,20 +131,38 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<div class="clearer"></div>
<hr class="a11y" />
- </div><!-- /wrapper -->
+ <!-- PAGE ACTIONS -->
+ <?php if ($showTools): ?>
+ <div id="dokuwiki__pagetools">
+ <h3 class="a11y"><?php echo tpl_getLang('page_tools') ?></h3>
+ <ul>
+ <?php
+ tpl_action('edit', 1, 'li');
+ if (tpl_getConf('discussionNS')) {
+ _tpl_discussion(tpl_getConf('discussionNS'),1,'li',tpl_getConf('discussNSreverse'));
+ }
+ tpl_action('history', 1, 'li');
+ tpl_action('backlink', 1, 'li');
+ tpl_action('subscribe', 1, 'li');
+ tpl_action('revert', 1, 'li');
+ tpl_action('top', 1, 'li');
+ ?>
+ </ul>
+ </div>
+ <?php endif; ?>
+ </div><!-- /wrapper -->
<!-- ********** FOOTER ********** -->
<div id="dokuwiki__footer"><div class="pad">
<div class="doc"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></div>
- <?php tpl_action('top',1) /* the second parameter switches between a link and a button */ ?>
<?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
</div></div><!-- /footer -->
</div></div><!-- /site -->
- <?php //@include(dirname(__FILE__).'/footer.html') /* include hook */ ?>
+ <?php @include(dirname(__FILE__).'/footer.html') /* include hook */ ?>
<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
<!--[if ( IE 6 | IE 7 | IE 8 ) ]></div><![endif]-->
</body>
diff --git a/mediamanager.php b/mediamanager.php
index df9ff6ef6..0f4362577 100644
--- a/mediamanager.php
+++ b/mediamanager.php
@@ -1,13 +1,7 @@
<?php
/**
- * DokuWiki Default Template
+ * DokuWiki Media Manager Popup
*
- * This is the template for the media manager popup
- *
- * You should leave the doctype at the very top - It should
- * always be the very first line of a document.
- *
- * @link http://dokuwiki.org/templates
* @author Andreas Gohr <andi@splitbrain.org>
*/
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -28,7 +22,7 @@
<!--[if IE 6 ]><div id="IE6"><![endif]--><!--[if IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="media__manager" class="dokuwiki">
<?php html_msgarea() ?>
- <div id="media__left"><div class="pad">
+ <div id="mediamgr__aside"><div class="pad">
<h1><?php echo hsc($lang['mediaselect'])?></h1>
<?php /* keep the id! additional elements are inserted via JS here */?>
@@ -37,7 +31,7 @@
<?php tpl_mediaTree() ?>
</div></div>
- <div id="media__right"><div class="pad">
+ <div id="mediamgr__content"><div class="pad">
<?php tpl_mediaContent() ?>
</div></div>
</div>
diff --git a/tpl_functions.php b/tpl_functions.php
index 6dc9e4bc2..0dfee9595 100644
--- a/tpl_functions.php
+++ b/tpl_functions.php
@@ -1,37 +1,66 @@
<?php
+/**
+ * Template Functions
+ *
+ * This file provides template specific custom functions that are
+ * not provided by the DokuWiki core.
+ */
// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
-if (!defined('DOKU_LF')) define('DOKU_LF',"\n");
-
-/* @todo: fix label of buttons */
/**
* Create link/button to discussion page and back
+ *
+ * @author Anika Henke <anika@selfthinker.org>
*/
-function _tpl_discussion($discussNS='discussion:',$link=0) {
+function _tpl_discussion($discussNS='discussion',$link=0,$wrapper=0,$reverse=0) {
global $ID;
- if(substr($ID,0,strlen($discussNS))==$discussNS) {
- $backID = substr(strstr($ID,':'),1);
+
+ if ($reverse) {
+ $discussPage = $ID.':'.$discussNS;
+ $isDiscussPage = substr($ID,-strlen($discussNS),strlen($discussNS))==$discussNS;
+ $backID = substr($ID,0,-strlen($discussNS));
+ } else {
+ $discussPage = $discussNS.':'.$ID;
+ $isDiscussPage = substr($ID,0,strlen($discussNS))==$discussNS;
+ $backID = strstr($ID,':');
+ }
+
+ if ($wrapper) echo "<$wrapper>";
+
+ if($isDiscussPage) {
if ($link)
- tpl_link(wl($backID),tpl_getLang('btn_back2article'));
+ tpl_pagelink($backID,tpl_getLang('back_to_article'));
else
- echo html_btn('back2article',$backID,'',array());
+ echo html_btn('back2article',$backID,'',array(),0,0,tpl_getLang('back_to_article'));
} else {
if ($link)
- tpl_link(wl($discussNS.$ID),tpl_getLang('btn_discussion'));
+ tpl_pagelink($discussPage,tpl_getLang('discussion'));
else
- echo html_btn('discussion',$discussNS.$ID,'',array());
+ echo html_btn('discussion',$discussPage,'',array(),0,0,tpl_getLang('discussion'));
}
+
+ if ($wrapper) echo "</$wrapper>";
}
/**
* Create link/button to user page
+ *
+ * @author Anika Henke <anika@selfthinker.org>
*/
-function _tpl_userpage($userNS='user:',$link=0) {
+function _tpl_userpage($userNS='user',$link=0,$wrapper=false) {
+ if (!$_SERVER['REMOTE_USER']) return;
+
global $conf;
+ $userPage = $userNS.':'.$_SERVER['REMOTE_USER'].':'.$conf['start'];
+
+ if ($wrapper) echo "<$wrapper>";
+
if ($link)
- tpl_link(wl($userNS.$_SERVER['REMOTE_USER'].':'.$conf['start']),tpl_getLang('btn_userpage'));
+ tpl_pagelink($userPage,tpl_getLang('userpage'));
else
- echo html_btn('userpage',$userNS.$_SERVER['REMOTE_USER'].':'.$conf['start'],'',array());
+ echo html_btn('userpage',$userPage,'',array(),0,0,tpl_getLang('userpage'));
+
+ if ($wrapper) echo "</$wrapper>";
}