Browse Source

finished design, improved template functions

master
Anika Henke 14 years ago
parent
commit
23bca4f384
  1. 1
      conf/default.php
  2. 3
      conf/metadata.php
  3. 7
      css/_links.css
  4. 8
      css/_mediamanager.css
  5. 4
      css/_toc.css
  6. 149
      css/design.css
  7. 8
      detail.php
  8. 12
      lang/en/lang.php
  9. 3
      lang/en/settings.php
  10. 75
      main.php
  11. 12
      mediamanager.php
  12. 55
      tpl_functions.php

1
conf/default.php

@ -6,6 +6,7 @@
$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;

3
conf/metadata.php

@ -6,8 +6,7 @@
$meta['tagline'] = array('string');
$meta['discussionNS'] = array('string');
$meta['discussNSreverse'] = array('onoff');
$meta['userNS'] = array('string');
$meta['sidebarID'] = array('string');
$meta['hideTools'] = array('onoff');
// array('multichoice','_choices' => array(0,1,2));

7
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,

8
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;
}

4
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__;
}

149
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 { }
/* 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;
}
#dokuwiki__aside ul,
#dokuwiki__aside ol {
padding-left: 0;
/* 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;
}
/*____________ user tools ____________*/
/* page 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;
}

8
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>
*/

12
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';

3
lang/en/settings.php

@ -4,8 +4,9 @@
*
*/
$lang['foo'] = 'Tagline';
$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?';

75
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>

12
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>

55
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>";
}
Loading…
Cancel
Save