diff options
author | andi <andi@splitbrain.org> | 2005-06-05 12:38:42 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-06-05 12:38:42 +0200 |
commit | f62ea8a1d1cf10eddeae777b11420624e111b7ea (patch) | |
tree | 87a15e898308a5de1ef37874645a4cdcb83c707b /lib | |
parent | 248a73214063d2fe47787c8c4aa292777cddb12b (diff) | |
download | rpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.gz rpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.bz2 |
directory layout cleanup !IMPORTANT
This patch changes the directory structure of dokuwiki as suggested
in http://www.freelists.org/archives/dokuwiki/06-2005/msg00045.html
As the changes.log is not managed through darcs you need to move it your
self to the new location in data/changes.log
I think I modified the code at all nessessary places, but I may have
forgotten a few things.
darcs-hash:20050605103842-9977f-af20f63c1d604888375d175d89ac6bd71566d47d.gz
Diffstat (limited to 'lib')
107 files changed, 2685 insertions, 0 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php new file mode 100644 index 000000000..dfe0d2ceb --- /dev/null +++ b/lib/exe/ajax.php @@ -0,0 +1,53 @@ +<?php +/** + * DokuWiki AJAX call handler + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Andreas Gohr <andi@splitbrain.org> + */ + +//fix for Opera XMLHttpRequests +if(!count($_POST) && $HTTP_RAW_POST_DATA){ + parse_str($HTTP_RAW_POST_DATA, $_POST); +} + +if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +require_once(DOKU_INC.'inc/init.php'); +require_once(DOKU_INC.'inc/common.php'); +require_once(DOKU_INC.'inc/pageutils.php'); +require_once(DOKU_INC.'inc/auth.php'); + +//call the requested function +$call = 'ajax_'.$_POST['call']; +if(function_exists($call)){ + $call(); +}else{ + print "The called function does not exist!"; +} + +/** + * Searches for matching pagenames + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function ajax_qsearch(){ + global $conf; + global $lang; + + $query = cleanID($_POST['q']); + if(empty($query)) return; + + $nsdir = str_replace(':','/',getNS($query)); + require_once(DOKU_INC.'inc/search.php'); + require_once(DOKU_INC.'inc/html.php'); + + $data = array(); + search($data,$conf['datadir'],'search_qsearch',array(query => $query),$nsdir); + + if(!count($data)) return; + + print '<b>'.$lang['quickhits'].'</b>'; + print html_buildlist($data,'qsearch','html_list_index'); +} + +?> diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php new file mode 100644 index 000000000..3fa8777f1 --- /dev/null +++ b/lib/exe/fetch.php @@ -0,0 +1,230 @@ +<?php +/** + * DokuWiki media passthrough file + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Andreas Gohr <andi@splitbrain.org> + */ + + if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/'); + require_once(DOKU_INC.'inc/init.php'); + require_once(DOKU_INC.'inc/common.php'); + require_once(DOKU_INC.'inc/pageutils.php'); + require_once(DOKU_INC.'inc/confutils.php'); + require_once(DOKU_INC.'inc/auth.php'); + $mimetypes = getMimeTypes(); + + //get input + $MEDIA = $_REQUEST['media']; + $CACHE = calc_cache($_REQUEST['cache']); + $WIDTH = $_REQUEST['w']; + $HEIGHT = $_REQUEST['h']; + list($EXT,$MIME) = mimetype($MEDIA); + if($EXT === false){ + $EXT = 'unknown'; + $MIME = 'application/octet-stream'; + } + + //media to local file + if(preg_match('#^(https?|ftp)://#i',$MEDIA)){ + //handle external media + $FILE = get_from_URL($MEDIA,$EXT,$CACHE); + if(!$FILE){ + //download failed - redirect to original URL + header('Location: '.$MEDIA); + exit; + } + }else{ + $MEDIA = cleanID($MEDIA); + if(empty($MEDIA)){ + header("HTTP/1.0 400 Bad Request"); + print 'Bad request'; + exit; + } + + //check permissions (namespace only) + if(auth_quickaclcheck(getNS($MEDIA).':X') < AUTH_READ){ + header("HTTP/1.0 401 Unauthorized"); + //fixme add some image for imagefiles + print 'Unauthorized'; + exit; + } + $FILE = mediaFN($MEDIA); + } + + //check file existance + if(!@file_exists($FILE)){ + header("HTTP/1.0 404 Not Found"); + //FIXME add some default broken image + print 'Not Found'; + exit; + } + + //handle image resizing + if((substr($MIME,0,5) == 'image') && $WIDTH){ + $FILE = get_resized($FILE,$EXT,$WIDTH,$HEIGHT); + } + + + //FIXME set sane cachecontrol headers + //FIXME handle conditional and partial requests + + //send file + header("Content-Type: $MIME"); + header('Last-Modified: '.date('r',filemtime($FILE))); + header('Content-Length: '.filesize($FILE)); + + //application mime type is downloadable + if(substr($MIME,0,11) == 'application'){ + header('Content-Disposition: attachment; filename="'.basename($FILE).'"'); + } + + $fp = @fopen($FILE,"rb"); + if($fp){ + fpassthru($fp); //does a close itself + }else{ + header("HTTP/1.0 500 Internal Server Error"); + print "Could not read $FILE - bad permissions?"; + } + +/* ------------------------------------------------------------------------ */ + +/** + * Resizes the given image to the given size + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function get_resized($file, $ext, $w, $h=0){ + global $conf; + + $md5 = md5($file); + $info = getimagesize($file); + if(!$h) $h = round(($w * $info[1]) / $info[0]); + + + //cache + $local = $conf['mediadir'].'/_cache/'.$md5.'.'.$w.'x'.$h.'.'.$ext; + $mtime = @filemtime($local); // 0 if not exists + + if( $mtime > filemtime($file) || resize_image($ext,$file,$info[0],$info[1],$local,$w,$h) ){ + return $local; + } + //still here? resizing failed + return $file; +} + +/** + * Returns the wanted cachetime in seconds + * + * Resolves named constants + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function calc_cache($cache){ + global $conf; + + if(strtolower($cache) == 'nocache') return 0; //never cache + if(strtolower($cache) == 'recache') return $conf['cachetime']; //use standard cache + return -1; //cache endless +} + +/** + * Download a remote file and return local filename + * + * returns false if download fails. Uses cached file if available and + * wanted + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function get_from_URL($url,$ext,$cache){ + global $conf; + + $url = strtolower($url); + $md5 = md5($url); + + $local = $conf['mediadir']."/_cache/$md5.$ext"; + $mtime = @filemtime($local); // 0 if not exists + + //decide if download needed: + + // never cache exists but no endless cache not exists or expired + if( $cache == 0 || ($mtime != 0 && $cache != -1) || $mtime < time()-$cache ){ + if(io_download($url,$local)){ + return $local; + }else{ + return false; + } + } + + //if cache exists use it else + if($mtime) return $local; + + //else return false + return false; +} + +/** + * resize images + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function resize_image($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){ + global $conf; + + if($conf['gdlib'] < 1) return false; //no GDlib available or wanted + + // create an image of the given filetype + if ($ext == 'jpg' || $ext == 'jpeg'){ + if(!function_exists("imagecreatefromjpeg")) return false; + $image = @imagecreatefromjpeg($from); + }elseif($ext == 'png') { + if(!function_exists("imagecreatefrompng")) return false; + $image = @imagecreatefrompng($from); + + }elseif($ext == 'gif') { + if(!function_exists("imagecreatefromgif")) return false; + $image = @imagecreatefromgif($from); + } + if(!$image) return false; + + if(($conf['gdlib']>1) && function_exists("imagecreatetruecolor")){ + $newimg = @imagecreatetruecolor ($to_w, $to_h); + } + if(!$newimg) $newimg = @imagecreate($to_w, $to_h); + if(!$newimg) return false; + + //keep png alpha channel if possible + if($ext == 'png' && $conf['gdlib']>1 && function_exists('imagesavealpha')){ + imagealphablending($newimg, false); + imagesavealpha($newimg,true); + } + + // create cachedir + io_makeFileDir($to); + + //try resampling first + if(function_exists("imagecopyresampled")){ + if(!@imagecopyresampled($newimg, $image, 0, 0, 0, 0, $to_w, $to_h, $from_w, $from_h)) { + imagecopyresized($newimg, $image, 0, 0, 0, 0, $to_w, $to_h, $from_w, $from_h); + } + }else{ + imagecopyresized($newimg, $image, 0, 0, 0, 0, $to_w, $to_h, $from_w, $from_h); + } + + if ($ext == 'jpg' || $ext == 'jpeg'){ + if(!function_exists("imagejpeg")) return false; + return imagejpeg($newimg, $to, 70); + }elseif($ext == 'png') { + if(!function_exists("imagepng")) return false; + return imagepng($newimg, $to); + }elseif($ext == 'gif') { + if(!function_exists("imagegif")) return false; + return imagegif($newimg, $to); + } + + return false; +} + + +//Setup VIM: ex: et ts=2 enc=utf-8 : +?> diff --git a/lib/exe/media.php b/lib/exe/media.php new file mode 100644 index 000000000..5ca3bd360 --- /dev/null +++ b/lib/exe/media.php @@ -0,0 +1,133 @@ +<?php + if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/'); + require_once(DOKU_INC.'inc/init.php'); + require_once(DOKU_INC.'inc/common.php'); + require_once(DOKU_INC.'lang/en/lang.php'); + require_once(DOKU_INC.'lang/'.$conf['lang'].'/lang.php'); + require_once(DOKU_INC.'inc/html.php'); + require_once(DOKU_INC.'inc/search.php'); + require_once(DOKU_INC.'inc/template.php'); + require_once(DOKU_INC.'inc/auth.php'); + + header('Content-Type: text/html; charset='.$lang['encoding']); + + //get namespace to display (either direct or from deletion order) + if($_REQUEST['delete']){ + $DEL = cleanID($_REQUEST['delete']); + $NS = getNS($DEL); + }else{ + $NS = $_REQUEST['ns']; + $NS = cleanID($NS); + } + + //check upload permissions + $AUTH = auth_quickaclcheck("$NS:*"); + if($AUTH >= AUTH_UPLOAD){ + $UPLOADOK = true; + //create the given namespace (just for beautification) + $mdir = $conf['mediadir'].'/'.utf8_encodeFN(str_replace(':','/',$NS)); + io_makeFileDir("$mdir/xxx"); + }else{ + $UPLOADOK = false; + } + + //handle deletion + if($DEL && $AUTH >= AUTH_DELETE){ + media_delete($DEL); + } + + //handle upload + if($_FILES['upload']['tmp_name'] && $UPLOADOK){ + media_upload($NS,$AUTH); + } + + //start output and load template + header('Content-Type: text/html; charset=utf-8'); + include(DOKU_INC.'lib/tpl/'.$conf['template'].'/lib/exe/media.php'); + + //restore old umask + umask($conf['oldumask']); + +/**********************************************/ + +/** + * Deletes mediafiles - Auth is not handled here! + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function media_delete($delid){ + $file = mediaFN($delid); + if(@unlink($file)){ + return true; + } + //something went wrong + msg("'$file' couldn't be deleted - check permissions",-1); + return false; +} + +/** + * Handles Mediafile uploads + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function media_upload($NS,$AUTH){ + require_once(DOKU_INC.'inc/confutils.php'); + global $lang; + global $conf; + + // get file + $id = $_POST['id']; + $file = $_FILES['upload']; + // get id + if(empty($id)) $id = $file['name']; + $id = cleanID($NS.':'.$id); + // get filename + $fn = mediaFN($id); + + // get filetype regexp + $types = array_keys(getMimeTypes()); + $types = array_map(create_function('$q','return preg_quote($q,"/");'),$types); + $regex = join('|',$types); + + // we set the umask here but this doesn't really help + // because a temp file was created already + umask($conf['umask']); + if(preg_match('/\.('.$regex.')$/i',$fn)){ + //check for overwrite + if(@file_exists($fn) && (!$_POST['ow'] || $AUTH < AUTH_DELETE)){ + msg($lang['uploadexist'],0); + return false; + } + // prepare directory + io_makeFileDir($fn); + if(move_uploaded_file($file['tmp_name'], $fn)) { + // set the correct permission here + chmod($fn, 0777 - $conf['umask']); + msg($lang['uploadsucc'],1); + return true; + }else{ + msg($lang['uploadfail'],-1); + } + }else{ + msg($lang['uploadwrong'],-1); + } + return false; +} + +/** + * Userfunction for html_buildlist + * + * Prints available media namespaces + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function media_html_list_namespaces($item){ + $ret = ''; + $ret .= '<a href="'.DOKU_BASE.'lib/exe/media.php?ns='.idfilter($item['id']).'" class="idx_dir">'; + $pos = strrpos($item['id'], ':'); + $ret .= substr($item['id'], $pos > 0 ? $pos + 1 : 0); + $ret .= '</a>'; + return $ret; +} + +?> diff --git a/lib/images/arrow_down.png b/lib/images/arrow_down.png Binary files differnew file mode 100644 index 000000000..cc0ab149c --- /dev/null +++ b/lib/images/arrow_down.png diff --git a/lib/images/arrow_up.png b/lib/images/arrow_up.png Binary files differnew file mode 100644 index 000000000..3031122e5 --- /dev/null +++ b/lib/images/arrow_up.png diff --git a/lib/images/blank.gif b/lib/images/blank.gif Binary files differnew file mode 100644 index 000000000..9935f8210 --- /dev/null +++ b/lib/images/blank.gif diff --git a/lib/images/del.png b/lib/images/del.png Binary files differnew file mode 100644 index 000000000..a3260d718 --- /dev/null +++ b/lib/images/del.png diff --git a/lib/images/diff.png b/lib/images/diff.png Binary files differnew file mode 100644 index 000000000..0b98d79ac --- /dev/null +++ b/lib/images/diff.png diff --git a/lib/images/error.png b/lib/images/error.png Binary files differnew file mode 100644 index 000000000..ad2ca6ee2 --- /dev/null +++ b/lib/images/error.png diff --git a/lib/images/favicon.ico b/lib/images/favicon.ico Binary files differnew file mode 100644 index 000000000..8b9616abb --- /dev/null +++ b/lib/images/favicon.ico diff --git a/lib/images/history.png b/lib/images/history.png Binary files differnew file mode 100644 index 000000000..ef9e311d3 --- /dev/null +++ b/lib/images/history.png diff --git a/lib/images/info.png b/lib/images/info.png Binary files differnew file mode 100644 index 000000000..ee5f3f5ad --- /dev/null +++ b/lib/images/info.png diff --git a/lib/images/interwiki/amazon.de.gif b/lib/images/interwiki/amazon.de.gif Binary files differnew file mode 100644 index 000000000..f52c1c581 --- /dev/null +++ b/lib/images/interwiki/amazon.de.gif diff --git a/lib/images/interwiki/amazon.gif b/lib/images/interwiki/amazon.gif Binary files differnew file mode 100644 index 000000000..f52c1c581 --- /dev/null +++ b/lib/images/interwiki/amazon.gif diff --git a/lib/images/interwiki/amazon.uk.gif b/lib/images/interwiki/amazon.uk.gif Binary files differnew file mode 100644 index 000000000..f52c1c581 --- /dev/null +++ b/lib/images/interwiki/amazon.uk.gif diff --git a/lib/images/interwiki/bug.gif b/lib/images/interwiki/bug.gif Binary files differnew file mode 100644 index 000000000..3432b8d57 --- /dev/null +++ b/lib/images/interwiki/bug.gif diff --git a/lib/images/interwiki/coral.gif b/lib/images/interwiki/coral.gif Binary files differnew file mode 100644 index 000000000..0f9f67587 --- /dev/null +++ b/lib/images/interwiki/coral.gif diff --git a/lib/images/interwiki/doku.gif b/lib/images/interwiki/doku.gif Binary files differnew file mode 100644 index 000000000..7dc4248e8 --- /dev/null +++ b/lib/images/interwiki/doku.gif diff --git a/lib/images/interwiki/google.gif b/lib/images/interwiki/google.gif Binary files differnew file mode 100644 index 000000000..fb39f6152 --- /dev/null +++ b/lib/images/interwiki/google.gif diff --git a/lib/images/interwiki/meatball.gif b/lib/images/interwiki/meatball.gif Binary files differnew file mode 100644 index 000000000..7ac545436 --- /dev/null +++ b/lib/images/interwiki/meatball.gif diff --git a/lib/images/interwiki/phpfn.gif b/lib/images/interwiki/phpfn.gif Binary files differnew file mode 100644 index 000000000..638d4c450 --- /dev/null +++ b/lib/images/interwiki/phpfn.gif diff --git a/lib/images/interwiki/sb.gif b/lib/images/interwiki/sb.gif Binary files differnew file mode 100644 index 000000000..e272a29b7 --- /dev/null +++ b/lib/images/interwiki/sb.gif diff --git a/lib/images/interwiki/wiki.gif b/lib/images/interwiki/wiki.gif Binary files differnew file mode 100644 index 000000000..e8dc5d274 --- /dev/null +++ b/lib/images/interwiki/wiki.gif diff --git a/lib/images/interwiki/wp.gif b/lib/images/interwiki/wp.gif Binary files differnew file mode 100644 index 000000000..ca853b8c9 --- /dev/null +++ b/lib/images/interwiki/wp.gif diff --git a/lib/images/interwiki/wpde.gif b/lib/images/interwiki/wpde.gif Binary files differnew file mode 100644 index 000000000..ca853b8c9 --- /dev/null +++ b/lib/images/interwiki/wpde.gif diff --git a/lib/images/interwiki/wpmeta.gif b/lib/images/interwiki/wpmeta.gif Binary files differnew file mode 100644 index 000000000..ca853b8c9 --- /dev/null +++ b/lib/images/interwiki/wpmeta.gif diff --git a/lib/images/larger.gif b/lib/images/larger.gif Binary files differnew file mode 100644 index 000000000..e137c92fa --- /dev/null +++ b/lib/images/larger.gif diff --git a/lib/images/loading.gif b/lib/images/loading.gif Binary files differnew file mode 100644 index 000000000..240bd88c5 --- /dev/null +++ b/lib/images/loading.gif diff --git a/lib/images/smaller.gif b/lib/images/smaller.gif Binary files differnew file mode 100644 index 000000000..66d3a51e7 --- /dev/null +++ b/lib/images/smaller.gif diff --git a/lib/images/smileys/delete.gif b/lib/images/smileys/delete.gif Binary files differnew file mode 100644 index 000000000..d668348b9 --- /dev/null +++ b/lib/images/smileys/delete.gif diff --git a/lib/images/smileys/fixme.gif b/lib/images/smileys/fixme.gif Binary files differnew file mode 100644 index 000000000..b66ea99d6 --- /dev/null +++ b/lib/images/smileys/fixme.gif diff --git a/lib/images/smileys/icon_arrow.gif b/lib/images/smileys/icon_arrow.gif Binary files differnew file mode 100644 index 000000000..2880055cc --- /dev/null +++ b/lib/images/smileys/icon_arrow.gif diff --git a/lib/images/smileys/icon_biggrin.gif b/lib/images/smileys/icon_biggrin.gif Binary files differnew file mode 100644 index 000000000..d3527723c --- /dev/null +++ b/lib/images/smileys/icon_biggrin.gif diff --git a/lib/images/smileys/icon_confused.gif b/lib/images/smileys/icon_confused.gif Binary files differnew file mode 100644 index 000000000..0c49e0698 --- /dev/null +++ b/lib/images/smileys/icon_confused.gif diff --git a/lib/images/smileys/icon_cool.gif b/lib/images/smileys/icon_cool.gif Binary files differnew file mode 100644 index 000000000..cead0306c --- /dev/null +++ b/lib/images/smileys/icon_cool.gif diff --git a/lib/images/smileys/icon_cry.gif b/lib/images/smileys/icon_cry.gif Binary files differnew file mode 100644 index 000000000..7d54b1f99 --- /dev/null +++ b/lib/images/smileys/icon_cry.gif diff --git a/lib/images/smileys/icon_doubt.gif b/lib/images/smileys/icon_doubt.gif Binary files differnew file mode 100644 index 000000000..fd7903b19 --- /dev/null +++ b/lib/images/smileys/icon_doubt.gif diff --git a/lib/images/smileys/icon_doubt2.gif b/lib/images/smileys/icon_doubt2.gif Binary files differnew file mode 100644 index 000000000..eb4b70b66 --- /dev/null +++ b/lib/images/smileys/icon_doubt2.gif diff --git a/lib/images/smileys/icon_eek.gif b/lib/images/smileys/icon_eek.gif Binary files differnew file mode 100644 index 000000000..5d3978106 --- /dev/null +++ b/lib/images/smileys/icon_eek.gif diff --git a/lib/images/smileys/icon_evil.gif b/lib/images/smileys/icon_evil.gif Binary files differnew file mode 100644 index 000000000..ab1aa8e12 --- /dev/null +++ b/lib/images/smileys/icon_evil.gif diff --git a/lib/images/smileys/icon_exclaim.gif b/lib/images/smileys/icon_exclaim.gif Binary files differnew file mode 100644 index 000000000..6e50e2eec --- /dev/null +++ b/lib/images/smileys/icon_exclaim.gif diff --git a/lib/images/smileys/icon_frown.gif b/lib/images/smileys/icon_frown.gif Binary files differnew file mode 100644 index 000000000..d2ac78c04 --- /dev/null +++ b/lib/images/smileys/icon_frown.gif diff --git a/lib/images/smileys/icon_fun.gif b/lib/images/smileys/icon_fun.gif Binary files differnew file mode 100644 index 000000000..a8bb8a303 --- /dev/null +++ b/lib/images/smileys/icon_fun.gif diff --git a/lib/images/smileys/icon_idea.gif b/lib/images/smileys/icon_idea.gif Binary files differnew file mode 100644 index 000000000..a40ae0d7e --- /dev/null +++ b/lib/images/smileys/icon_idea.gif diff --git a/lib/images/smileys/icon_kaddi.gif b/lib/images/smileys/icon_kaddi.gif Binary files differnew file mode 100644 index 000000000..1410f7f1e --- /dev/null +++ b/lib/images/smileys/icon_kaddi.gif diff --git a/lib/images/smileys/icon_lol.gif b/lib/images/smileys/icon_lol.gif Binary files differnew file mode 100644 index 000000000..374ba150f --- /dev/null +++ b/lib/images/smileys/icon_lol.gif diff --git a/lib/images/smileys/icon_mrgreen.gif b/lib/images/smileys/icon_mrgreen.gif Binary files differnew file mode 100644 index 000000000..b54cd0f94 --- /dev/null +++ b/lib/images/smileys/icon_mrgreen.gif diff --git a/lib/images/smileys/icon_neutral.gif b/lib/images/smileys/icon_neutral.gif Binary files differnew file mode 100644 index 000000000..4f311567e --- /dev/null +++ b/lib/images/smileys/icon_neutral.gif diff --git a/lib/images/smileys/icon_question.gif b/lib/images/smileys/icon_question.gif Binary files differnew file mode 100644 index 000000000..9d072265b --- /dev/null +++ b/lib/images/smileys/icon_question.gif diff --git a/lib/images/smileys/icon_razz.gif b/lib/images/smileys/icon_razz.gif Binary files differnew file mode 100644 index 000000000..29da2a2fc --- /dev/null +++ b/lib/images/smileys/icon_razz.gif diff --git a/lib/images/smileys/icon_redface.gif b/lib/images/smileys/icon_redface.gif Binary files differnew file mode 100644 index 000000000..ad7628320 --- /dev/null +++ b/lib/images/smileys/icon_redface.gif diff --git a/lib/images/smileys/icon_rolleyes.gif b/lib/images/smileys/icon_rolleyes.gif Binary files differnew file mode 100644 index 000000000..d7f5f2f4b --- /dev/null +++ b/lib/images/smileys/icon_rolleyes.gif diff --git a/lib/images/smileys/icon_sad.gif b/lib/images/smileys/icon_sad.gif Binary files differnew file mode 100644 index 000000000..d2ac78c04 --- /dev/null +++ b/lib/images/smileys/icon_sad.gif diff --git a/lib/images/smileys/icon_silenced.gif b/lib/images/smileys/icon_silenced.gif Binary files differnew file mode 100644 index 000000000..448399b2b --- /dev/null +++ b/lib/images/smileys/icon_silenced.gif diff --git a/lib/images/smileys/icon_smile.gif b/lib/images/smileys/icon_smile.gif Binary files differnew file mode 100644 index 000000000..7b1f6d304 --- /dev/null +++ b/lib/images/smileys/icon_smile.gif diff --git a/lib/images/smileys/icon_smile2.gif b/lib/images/smileys/icon_smile2.gif Binary files differnew file mode 100644 index 000000000..769639d32 --- /dev/null +++ b/lib/images/smileys/icon_smile2.gif diff --git a/lib/images/smileys/icon_surprised.gif b/lib/images/smileys/icon_surprised.gif Binary files differnew file mode 100644 index 000000000..cb2142431 --- /dev/null +++ b/lib/images/smileys/icon_surprised.gif diff --git a/lib/images/smileys/icon_twisted.gif b/lib/images/smileys/icon_twisted.gif Binary files differnew file mode 100644 index 000000000..502fe247e --- /dev/null +++ b/lib/images/smileys/icon_twisted.gif diff --git a/lib/images/smileys/icon_wink.gif b/lib/images/smileys/icon_wink.gif Binary files differnew file mode 100644 index 000000000..d14828804 --- /dev/null +++ b/lib/images/smileys/icon_wink.gif diff --git a/lib/images/thumbup.gif b/lib/images/thumbup.gif Binary files differnew file mode 100644 index 000000000..c96d73c71 --- /dev/null +++ b/lib/images/thumbup.gif diff --git a/lib/images/toolbar/bold.png b/lib/images/toolbar/bold.png Binary files differnew file mode 100644 index 000000000..d12c5710e --- /dev/null +++ b/lib/images/toolbar/bold.png diff --git a/lib/images/toolbar/code.png b/lib/images/toolbar/code.png Binary files differnew file mode 100644 index 000000000..8f74d8101 --- /dev/null +++ b/lib/images/toolbar/code.png diff --git a/lib/images/toolbar/empty.png b/lib/images/toolbar/empty.png Binary files differnew file mode 100644 index 000000000..e606cfd07 --- /dev/null +++ b/lib/images/toolbar/empty.png diff --git a/lib/images/toolbar/extlink.png b/lib/images/toolbar/extlink.png Binary files differnew file mode 100644 index 000000000..22971725c --- /dev/null +++ b/lib/images/toolbar/extlink.png diff --git a/lib/images/toolbar/fonth1.png b/lib/images/toolbar/fonth1.png Binary files differnew file mode 100644 index 000000000..13d52b979 --- /dev/null +++ b/lib/images/toolbar/fonth1.png diff --git a/lib/images/toolbar/fonth2.png b/lib/images/toolbar/fonth2.png Binary files differnew file mode 100644 index 000000000..8e39a14de --- /dev/null +++ b/lib/images/toolbar/fonth2.png diff --git a/lib/images/toolbar/fonth3.png b/lib/images/toolbar/fonth3.png Binary files differnew file mode 100644 index 000000000..80fd308e7 --- /dev/null +++ b/lib/images/toolbar/fonth3.png diff --git a/lib/images/toolbar/fonth4.png b/lib/images/toolbar/fonth4.png Binary files differnew file mode 100644 index 000000000..e3a333535 --- /dev/null +++ b/lib/images/toolbar/fonth4.png diff --git a/lib/images/toolbar/fonth5.png b/lib/images/toolbar/fonth5.png Binary files differnew file mode 100644 index 000000000..e9fc8bb56 --- /dev/null +++ b/lib/images/toolbar/fonth5.png diff --git a/lib/images/toolbar/image.png b/lib/images/toolbar/image.png Binary files differnew file mode 100644 index 000000000..f64493125 --- /dev/null +++ b/lib/images/toolbar/image.png diff --git a/lib/images/toolbar/italic.png b/lib/images/toolbar/italic.png Binary files differnew file mode 100644 index 000000000..f4ecd0ddf --- /dev/null +++ b/lib/images/toolbar/italic.png diff --git a/lib/images/toolbar/link.png b/lib/images/toolbar/link.png Binary files differnew file mode 100644 index 000000000..41fddbb28 --- /dev/null +++ b/lib/images/toolbar/link.png diff --git a/lib/images/toolbar/list.png b/lib/images/toolbar/list.png Binary files differnew file mode 100644 index 000000000..ffae5cfbf --- /dev/null +++ b/lib/images/toolbar/list.png diff --git a/lib/images/toolbar/list_ul.png b/lib/images/toolbar/list_ul.png Binary files differnew file mode 100644 index 000000000..b86bcef7d --- /dev/null +++ b/lib/images/toolbar/list_ul.png diff --git a/lib/images/toolbar/rule.png b/lib/images/toolbar/rule.png Binary files differnew file mode 100644 index 000000000..a432b206e --- /dev/null +++ b/lib/images/toolbar/rule.png diff --git a/lib/images/toolbar/sig.png b/lib/images/toolbar/sig.png Binary files differnew file mode 100644 index 000000000..2917048f6 --- /dev/null +++ b/lib/images/toolbar/sig.png diff --git a/lib/images/toolbar/underline.png b/lib/images/toolbar/underline.png Binary files differnew file mode 100644 index 000000000..db07038fd --- /dev/null +++ b/lib/images/toolbar/underline.png diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php new file mode 100644 index 000000000..f0afcf2ec --- /dev/null +++ b/lib/plugins/info/syntax.php @@ -0,0 +1,110 @@ +<?php +/** + * Info Plugin: Displays information about various DokuWiki internals + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Andreas Gohr <andi@splitbrain.org> + */ + +if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +require_once(DOKU_PLUGIN.'syntax.php'); + +/** + * All DokuWiki plugins to extend the parser/rendering mechanism + * need to inherit from this class + */ +class syntax_plugin_info extends DokuWiki_Syntax_Plugin { + + /** + * What kind of syntax are we? + */ + function getType(){ + return 'substition'; + } + + /** + * Where to sort in? + */ + function getSort(){ + return 155; + } + + + /** + * Connect pattern to lexer + */ + function connectTo($mode) { + $this->Lexer->addSpecialPattern('~~INFO:\w+~~',$mode,'plugin_info'); + } + + + /** + * Handle the match + */ + function handle($match, $state, $pos, &$handler){ + $match = substr($match,7,-2); //strip ~~INFO: from start and ~~ from end + return array(strtolower($match)); + } + + /** + * Create output + */ + function render($mode, &$renderer, $data) { + if($mode == 'xhtml'){ + //handle various info stuff + switch ($data[0]){ + case 'version'; + $renderer->doc .= getVersion(); + break; + case 'syntaxmodes'; + $renderer->doc .= $this->_syntaxmodes_xhtml(); + break; + case 'syntaxtypes'; + $renderer->doc .= $this->_syntaxtypes_xhtml(); + break; + default: + $renderer->doc .= "no info about ".htmlspecialchars($data[0]); + } + return true; + } + return false; + } + + /** + * lists all known syntax types and their registered modes + */ + function _syntaxtypes_xhtml(){ + global $PARSER_MODES; + $doc = ''; + + $doc .= '<table class="inline"><tbody>'; + foreach($PARSER_MODES as $mode => $modes){ + $doc .= '<tr>'; + $doc .= '<td class="leftalign">'; + $doc .= $mode; + $doc .= '</td>'; + $doc .= '<td class="leftalign">'; + $doc .= join(', ',$modes); + $doc .= '</td>'; + $doc .= '</tr>'; + } + $doc .= '</tbody></table>'; + return $doc; + } + + /** + * lists all known syntax modes and their sorting value + */ + function _syntaxmodes_xhtml(){ + $modes = p_get_parsermodes(); + $doc = ''; + + foreach ($modes as $mode){ + $doc .= $mode['mode'].' ('.$mode['sort'].'), '; + } + return $doc; + } +} + +//Setup VIM: ex: et ts=4 enc=utf-8 : diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php new file mode 100644 index 000000000..303c0de33 --- /dev/null +++ b/lib/plugins/syntax.php @@ -0,0 +1,66 @@ +<?php +/** + * Syntax Plugin Prototype + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Andreas Gohr <andi@splitbrain.org> + */ + +if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); +if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +require_once(DOKU_INC.'inc/parser/parser.php'); + +/** + * All DokuWiki plugins to extend the parser/rendering mechanism + * need to inherit from this class + */ +class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { + + /** + * Needs to return one of the mode types defined in $PARSER_MODES in parser.php + */ + function getType(){ + trigger_error('getType() not implemented in '.get_class($this), E_USER_WARNING); + } + + /** + * Handler to prepare matched data for the rendering process + * + * Usually you should only need the $match param. + * + * @param $match string The text matched by the patterns + * @param $state int The lexer state for the match + * @param $pos int The character position of the matched text + * @param $handler ref Reference to the Doku_Handler object + * @return array Return an array with all data you want to use in render + */ + function handle($match, $state, $pos, &$handler){ + trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING); + } + + /** + * Handles the actual output creation. + * + * The function should always check for the given mode and return false + * when a mode isn't supported. + * + * $renderer contains a reference to the renderer object which is + * currently handling the rendering. You need to use it for writing + * the output. How this is done depends on the renderer used (specified + * by $mode + * + * The contents of the $data array depends on what the handler() function above + * created + * + * @param $mode string current Rendermode + * @param $renderer ref reference to the current renderer object + * @param $data array data created by handler() + * @return boolean rendered correctly? + */ + function render($mode, &$renderer, $data) { + trigger_error('render() not implemented in '.get_class($this), E_USER_WARNING); + } + +} + +//Setup VIM: ex: et ts=4 enc=utf-8 : diff --git a/lib/scripts/ajax.js b/lib/scripts/ajax.js new file mode 100644 index 000000000..b3c32e950 --- /dev/null +++ b/lib/scripts/ajax.js @@ -0,0 +1,51 @@ +//prepare class +function ajax_qsearch_class(){ + this.sack = null; + this.inObj = null; + this.outObj = null; + this.timer = null; +} + +//create global object and add functions +var ajax_qsearch = new ajax_qsearch_class(); +ajax_qsearch.sack = new sack(DOKU_BASE + 'lib/exe/ajax.php'); +ajax_qsearch.sack.AjaxFailedAlert = ''; +ajax_qsearch.sack.encodeURIString = false; + +ajax_qsearch.init = function(inID,outID){ + if(ajax_qsearch.inObj == null) + ajax_qsearch.inObj = document.getElementById(inID); + if(ajax_qsearch.outObj == null) + ajax_qsearch.outObj = document.getElementById(outID); +} + +ajax_qsearch.clear = function(){ + ajax_qsearch.outObj.style.display = 'none'; + ajax_qsearch.outObj.innerHTML = ''; + if(ajax_qsearch.timer != null){ + window.clearTimeout(ajax_qsearch.timer); + ajax_qsearch.timer = null; + } +} + +ajax_qsearch.exec = function(){ + ajax_qsearch.clear(); + var value = ajax_qsearch.inObj.value; + if(value == '') return; + ajax_qsearch.sack.runAJAX('call=qsearch&q='+encodeURI(value)); +} + +ajax_qsearch.sack.onCompletion = function(){ + var data = ajax_qsearch.sack.response; + if(data == '') return; + + ajax_qsearch.outObj.innerHTML = data; + ajax_qsearch.outObj.style.display = 'block'; +} + +ajax_qsearch.call = function(inID,outID){ + ajax_qsearch.init(inID,outID); + ajax_qsearch.clear(); + ajax_qsearch.timer = window.setTimeout("ajax_qsearch.exec()",500); +} + diff --git a/lib/scripts/pngbehavior.htc b/lib/scripts/pngbehavior.htc new file mode 100644 index 000000000..d1db8e765 --- /dev/null +++ b/lib/scripts/pngbehavior.htc @@ -0,0 +1,53 @@ +// this is an ugly fix to make Internet Explorer work with transparent +// PNG images - do your self a favour and use a real browser! + +<public:component> +<public:attach event="onpropertychange" onevent="propertyChanged()" /> +<script> + +var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32"; +var realSrc; +var blankSrc = DOKU_BASE+"lib/images/blank.gif"; + +if (supported) fixImage(); + +function propertyChanged() { + if (!supported) return; + + var pName = event.propertyName; + if (pName != "src") return; + // if not set to blank + if ( ! new RegExp(blankSrc).test(src)) + fixImage(); +}; + +function fixImage() { + // get src + var src = element.src; + + // check for real change + if (src == realSrc) { + element.src = blankSrc; + return; + } + + if ( ! new RegExp(blankSrc).test(src)) { + // backup old src + realSrc = src; + } + + // test for png + if ( /\.png$/.test( realSrc.toLowerCase() ) ) { + // set blank image + element.src = blankSrc; + // set filter + element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')"; + } + else { + // remove filter + element.runtimeStyle.filter = ""; + } +} + +</script> +</public:component> diff --git a/lib/scripts/script.js b/lib/scripts/script.js new file mode 100644 index 000000000..5ad930281 --- /dev/null +++ b/lib/scripts/script.js @@ -0,0 +1,456 @@ +/** + * Some of these scripts were taken from wikipedia.org and were modified for DokuWiki + */ + +/** + * Some browser detection + */ +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1)); +var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)); +var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled )); +if (clientPC.indexOf('opera')!=-1) { + var is_opera = true; + var is_opera_preseven = (window.opera && !document.childNodes); + var is_opera_seven = (window.opera && document.childNodes); +} + + +/** + * This function escapes some special chars + */ +function escapeQuotes(text) { + var re=new RegExp("'","g"); + text=text.replace(re,"\\'"); + re=new RegExp('"',"g"); + text=text.replace(re,'"'); + re=new RegExp("\\n","g"); + text=text.replace(re,"\\n"); + return text; +} + +/** + * Prints a animated gif to show the search is performed + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function showLoadBar(){ + if(document.getElementById){ + document.write('<img src="'+DOKU_BASE+'lib/images/loading.gif" '+ + 'width="150" height="12" id="loading" />'); + } +} + +/** + * Disables the animated gif to show the search is done + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function hideLoadBar(){ + if(document.getElementById){ + document.getElementById('loading').style.display="none"; + } +} + +/** + * Checks if a summary was entered - if not the style is changed + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function summaryCheck(){ + if(document.getElementById){ + var sum = document.getElementById('summary'); + if(sum.value == ''){ + sum.className='missing'; + }else{ + sum.className='edit'; + } + } +} + +/** + * This function generates the actual toolbar buttons with localized text + * we use it to avoid creating the toolbar where javascript is not enabled + */ +function formatButton(imageFile, speedTip, tagOpen, tagClose, sampleText, accessKey) { + speedTip=escapeQuotes(speedTip); + tagOpen=escapeQuotes(tagOpen); + tagClose=escapeQuotes(tagClose); + sampleText=escapeQuotes(sampleText); + + document.write("<a "); + if(accessKey){ + document.write("accesskey=\""+accessKey+"\" "); + speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']'; + } + document.write("href=\"javascript:insertTags"); + document.write("('"+tagOpen+"','"+tagClose+"','"+sampleText+"');\">"); + + document.write("<img width=\"24\" height=\"24\" src=\""+ + DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ + speedTip+"\" title=\""+speedTip+"\">"); + document.write("</a>"); + return; +} + +/** + * This function generates the actual toolbar buttons with localized text + * we use it to avoid creating the toolbar where javascript is not enabled + */ +function insertButton(imageFile, speedTip, value, accessKey) { + speedTip=escapeQuotes(speedTip); + value=escapeQuotes(value); + + document.write("<a "); + if(accessKey){ + document.write("accesskey=\""+accessKey+"\" "); + speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']'; + } + document.write("href=\"javascript:insertAtCarret"); + document.write("(document.editform.wikitext,'"+value+"');\">"); + + document.write("<img width=\"24\" height=\"24\" src=\""+ + DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ + speedTip+"\" title=\""+speedTip+"\">"); + document.write("</a>"); + return; +} + +/** + * This adds a button for the MediaSelection Popup + */ +function mediaButton(imageFile, speedTip, accessKey, namespace) { + speedTip=escapeQuotes(speedTip); + document.write("<a "); + if(accessKey){ + document.write("accesskey=\""+accessKey+"\" "); + } + document.write("href=\"javascript:void(window.open('"+DOKU_BASE+"lib/exe/media.php?ns="+ + namespace+"','mediaselect','width=600,height=320,left=70,top=50,scrollbars=yes,resizable=yes'));\">"); + document.write("<img width=\"24\" height=\"24\" src=\""+ + DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ + speedTip+"\" title=\""+speedTip+"\">"); + document.write("</a>"); + return; +} + +/** + * apply tagOpen/tagClose to selection in textarea, use sampleText instead + * of selection if there is none copied and adapted from phpBB + * + * @author phpBB development team + * @author MediaWiki development team + * @author Andreas Gohr <andi@splitbrain.org> + * @author Jim Raynor <jim_raynor@web.de> + */ +function insertTags(tagOpen, tagClose, sampleText) { + var txtarea = document.editform.wikitext; + // IE + if(document.selection && !is_gecko) { + var theSelection = document.selection.createRange().text; + var replaced = true; + if(!theSelection){ + replaced = false; + theSelection=sampleText; + } + txtarea.focus(); + + // This has change + text = theSelection; + if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any + theSelection = theSelection.substring(0, theSelection.length - 1); + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose + " "; + } else { + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose; + } + if(!replaced){ + r.moveStart('character',-text.length-tagClose.length); + r.moveEnd('character',-tagClose.length); + } + r.select(); + // Mozilla + } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { + var replaced = false; + var startPos = txtarea.selectionStart; + var endPos = txtarea.selectionEnd; + if(endPos - startPos) replaced = true; + var scrollTop=txtarea.scrollTop; + var myText = (txtarea.value).substring(startPos, endPos); + if(!myText) { myText=sampleText;} + if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any + subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; + } else { + subst = tagOpen + myText + tagClose; + } + txtarea.value = txtarea.value.substring(0, startPos) + subst + + txtarea.value.substring(endPos, txtarea.value.length); + txtarea.focus(); + + //set new selection + if(replaced){ + var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); + txtarea.selectionStart=cPos; + txtarea.selectionEnd=cPos; + }else{ + txtarea.selectionStart=startPos+tagOpen.length; + txtarea.selectionEnd=startPos+tagOpen.length+myText.length; + } + txtarea.scrollTop=scrollTop; + // All others + } else { + var copy_alertText=alertText; + var re1=new RegExp("\\$1","g"); + var re2=new RegExp("\\$2","g"); + copy_alertText=copy_alertText.replace(re1,sampleText); + copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose); + var text; + if (sampleText) { + text=prompt(copy_alertText); + } else { + text=""; + } + if(!text) { text=sampleText;} + text=tagOpen+text+tagClose; + //append to the end + txtarea.value += "\n"+text; + + // in Safari this causes scrolling + if(!is_safari) { + txtarea.focus(); + } + + } + // reposition cursor if possible + if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); +} + + +/* + * Insert the selected filename and close the window + * + * @see http://www.alexking.org/index.php?content=software/javascript/content.php + */ +function mediaSelect(file){ + insertAtCarret(opener.document.editform.wikitext,'{{'+file+'}}'); + window.close(); +} + +/* + * Insert the given value at the current cursor position + * + * @see http://www.alexking.org/index.php?content=software/javascript/content.php + */ +function insertAtCarret(field,value){ + //IE support + if (document.selection) { + field.focus(); + if(opener == null){ + sel = document.selection.createRange(); + }else{ + sel = opener.document.selection.createRange(); + } + sel.text = value; + //MOZILLA/NETSCAPE support + }else if (field.selectionStart || field.selectionStart == '0') { + var startPos = field.selectionStart; + var endPos = field.selectionEnd; + var scrollTop = field.scrollTop; + field.value = field.value.substring(0, startPos) + + value + + field.value.substring(endPos, field.value.length); + + field.focus(); + var cPos=startPos+(value.length); + field.selectionStart=cPos; + field.selectionEnd=cPos; + field.scrollTop=scrollTop; + } else { + field.value += "\n"+value; + } + // reposition cursor if possible + if (field.createTextRange) field.caretPos = document.selection.createRange().duplicate(); +} + +/** + * For the upload Dialog. Prefills the wikiname. + */ +function suggestWikiname(){ + var file = document.upload.upload.value; + + file = file.substr(file.lastIndexOf('/')+1); + file = file.substr(file.lastIndexOf('\\')+1); + + document.upload.id.value = file; +} + +/** + * This prints the switch to toggle the Table of Contents + */ +function showTocToggle(show,hide) { + if(document.getElementById) { + document.writeln('<div class=\'toctoggle\'><a href="javascript:toggleToc()" class="toc">' + + '<span id="showlink" style="display:none;">' + show + '</span>' + + '<span id="hidelink">' + hide + '</span>' + + '</a></div>'); + } +} + +/** + * This toggles the visibility of the Table of Contents + */ +function toggleToc() { + var toc = document.getElementById('tocinside'); + var showlink=document.getElementById('showlink'); + var hidelink=document.getElementById('hidelink'); + if(toc.style.display == 'none') { + toc.style.display = tocWas; + hidelink.style.display=''; + showlink.style.display='none'; + } else { + tocWas = toc.style.display; + toc.style.display = 'none'; + hidelink.style.display='none'; + showlink.style.display=''; + + } +} + +/** + * Sizecontrol inspired by TikiWiki. This displays the buttons. + */ +function showSizeCtl(){ + if(document.getElementById) { + var textarea = document.getElementById('wikitext'); + var hgt = getCookie('DokuWikisizeCtl'); + if(hgt == null){ + textarea.style.height = '300px'; + }else{ + textarea.style.height = hgt; + } + document.writeln('<a href="javascript:sizeCtl(100)"><img src="'+DOKU_BASE+'lib/images/larger.gif" width="20" height="20" border="0"></a>'); + document.writeln('<a href="javascript:sizeCtl(-100)"><img src="'+DOKU_BASE+'lib/images/smaller.gif" width="20" height="20" border="0"></a>'); + } +} + +/** + * This sets the vertical size of the editbox + */ +function sizeCtl(val){ + var textarea = document.getElementById('wikitext'); + var height = parseInt(textarea.style.height.substr(0,textarea.style.height.length-2)); + height += val; + textarea.style.height = height+'px'; + + var now = new Date(); + fixDate(now); + now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000); //expire in a year + setCookie('DokuWikisizeCtl',textarea.style.height,now); +} + + +/** + * global var used for not saved yet warning + */ +var textChanged = false; + +function svchk(){ + if(textChanged){ + return confirm(notSavedYet); + }else{ + return true; + } +} + +/** + * global variable for the locktimer + */ +var locktimerID; + +/** + * This starts a timer to remind the user of an expiring lock + * Accepts the delay in seconds and a text to display. + */ +function init_locktimer(delay,txt){ + txt = escapeQuotes(txt); + locktimerID = self.setTimeout("locktimer('"+txt+"')", delay*1000); +} + +/** + * This stops the timer and displays a message about the expiring lock + */ +function locktimer(txt){ + clearTimeout(locktimerID); + alert(txt); +} + +/* + * This sets a cookie by JavaScript + * + * @see http://www.webreference.com/js/column8/functions.html + */ +function setCookie(name, value, expires, path, domain, secure) { + var curCookie = name + "=" + escape(value) + + ((expires) ? "; expires=" + expires.toGMTString() : "") + + ((path) ? "; path=" + path : "") + + ((domain) ? "; domain=" + domain : "") + + ((secure) ? "; secure" : ""); + document.cookie = curCookie; +} + +/* + * This reads a cookie by JavaScript + * + * @see http://www.webreference.com/js/column8/functions.html + */ +function getCookie(name) { + var dc = document.cookie; + var prefix = name + "="; + var begin = dc.indexOf("; " + prefix); + if (begin == -1) { + begin = dc.indexOf(prefix); + if (begin != 0) return null; + } else + begin += 2; + var end = document.cookie.indexOf(";", begin); + if (end == -1) + end = dc.length; + return unescape(dc.substring(begin + prefix.length, end)); +} + +/* + * This is needed for the cookie functions + * + * @see http://www.webreference.com/js/column8/functions.html + */ +function fixDate(date) { + var base = new Date(0); + var skew = base.getTime(); + if (skew > 0) + date.setTime(date.getTime() - skew); +} + +/* + * This enables/disables checkboxes for acl-administration + * + * @author Frank Schubert <frank@schokilade.de> + */ +function checkAclLevel(){ + if(document.getElementById) { + var scope = document.getElementById('acl_scope').value; + + //check for namespace + if( (scope.indexOf(":*") > 0) || (scope == "*") ){ + document.getElementsByName('acl_checkbox[4]')[0].disabled=false; + document.getElementsByName('acl_checkbox[8]')[0].disabled=false; + }else{ + document.getElementsByName('acl_checkbox[4]')[0].checked=false; + document.getElementsByName('acl_checkbox[8]')[0].checked=false; + + document.getElementsByName('acl_checkbox[4]')[0].disabled=true; + document.getElementsByName('acl_checkbox[8]')[0].disabled=true; + } + } +} diff --git a/lib/scripts/tw-sack.js b/lib/scripts/tw-sack.js new file mode 100644 index 000000000..8a9d12746 --- /dev/null +++ b/lib/scripts/tw-sack.js @@ -0,0 +1,95 @@ +// ====== Simple Ajax Code Kit ======= +// code by Gregory Wild-Smith (c)2005 +// http://twilightuniverse.com +// If you use this code please keep this credit intact. +// A link or email would be nice, but is not required. +// v1.01 + +function sack(file){ + this.AjaxFailedAlert = "Your browser doesn't support the extended functionality of this website, and therefore you have have an experience that differs from the intended one.\n"; + this.requestFile = file; + this.method = "POST"; + this.URLString = ""; + this.encodeURIString = true; + this.execute = false; + + this.onLoading = function() { }; + this.onLoaded = function() { }; + this.onInteractive = function() { }; + this.onCompletion = function() { }; + + this.createAJAX = function() { + try { + this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (oc) { + this.xmlhttp = null; + } + } + if(!this.xmlhttp && typeof XMLHttpRequest != "undefined") + this.xmlhttp = new XMLHttpRequest(); + if (!this.xmlhttp){ + // no XMLHttpRequest support, so no AJAX. + this.failed = true; + } + }; + + this.encodeURLString = function(string){ + varArray = string.split('&'); + for (i = 0; i < varArray.length; i++){ + urlVars = varArray[i].split('='); + if (urlVars[0].indexOf('amp;') != -1){ + urlVars[0] = urlVars[0].substring(4); + } + urlVars[0] = encodeURIComponent(urlVars[0]); + urlVars[1] = encodeURIComponent(urlVars[1]); + varArray[i] = urlVars.join("="); + } + return varArray.join('&'); + } + + this.runResponse = function(){ + eval(this.response); + } + + this.runAJAX = function(urlstring){ + if (urlstring){ this.URLString = urlstring; } + if (this.element) { this.elementObj = document.getElementById(this.element); } + if (this.xmlhttp) { + var self = this; // wierd fix for odd behavior where "this" wouldn't work in the readystate function. + this.xmlhttp.open(this.method, this.requestFile ,true); + if (this.method == "POST" && this.xmlhttp.setRequestHeader) { + this.xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') + } + if (this.encodeURIString){ this.URLString = this.encodeURLString(this.URLString); } + this.xmlhttp.send(this.URLString); + this.xmlhttp.onreadystatechange = function() { + switch (self.xmlhttp.readyState){ + case 1: // Loading. + self.onLoading(); + break; + case 2: // Loaded. + self.onLoaded(); + break; + case 3: // Interactive - is called every 4096 bytes.. pretty much just tells you it's downloading data. + self.onInteractive(); + break; + case 4: // Completed. + self.response = self.xmlhttp.responseText; + self.responseXML = self.xmlhttp.responseXML; + self.onCompletion(); + if(self.execute){ self.runResponse(); } + if (self.elementObj) { + self.elementObj.innerHTML = self.response; + } + break; + } + }; + } + }; +this.createAJAX(); +//if(this.failed && this.AjaxFailedAlert){ alert(this.AjaxFailedAlert); } +} +//Setup VIM: ex: et ts=2 enc=utf-8 : diff --git a/lib/styles/feed.css b/lib/styles/feed.css new file mode 100644 index 000000000..0fcc222cd --- /dev/null +++ b/lib/styles/feed.css @@ -0,0 +1,63 @@ +rss channel, feed, RDF { + font: 80% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; + background-color: White; + color: Black; + margin: 0; + padding: 0; +} + + +link, description, language, managingEditor, copyright, lastBuildDate, date, +pubDate, generator, webMaster, ttl, docs, tagline, author, copyright, +generator, content, created, issued, modified, subject, id, format, creator, +category { + display: none; +} + +item link, entry id { + display: block; + color:#436976; + text-decoration:underline; +} + +channel title, feed title { + display: block; + font-size:200%; + font-weight:bolder; + color:#436976; + text-decoration:none; + border-bottom: 20px solid #dee7ec; +} + +:root:before, :root:before { + content: "This data file is meant to be read in a XML feed reader. See document source." +} + +item, entry { + display: block; + margin: 1em 180px 1em 1em; + border-bottom: 1px solid #8cacbb; + padding-bottom: 1em; +} + +item title, entry title { + display: block; + background: transparent none; + border: 0px solid #ffffff; + padding: 0; + color: #222; + font-size: 1.4em; + font-weight: bold; +} + +item pubDate, entry modified, item date { + display: inline; + color: #AAA; + font: 1em trebuchet ms, arial, helvetica, sans-serif; +} + +item description, entry summary { + display: block; + clear: both; + padding-top: 0.5em; +} diff --git a/lib/styles/style.css b/lib/styles/style.css new file mode 100644 index 000000000..ff9bdf3ce --- /dev/null +++ b/lib/styles/style.css @@ -0,0 +1,44 @@ +div.clearer {clear: both; line-height: 0; height: 0;} + +div.error{ + background: #ff6666 url(../images/error.png) 0.5em 0px no-repeat; + font-size: 90%; + margin: 0px; + padding-left: 3em; +} + +div.info{ + background: #ffff66 url(../images/info.png) 0.5em 0px no-repeat; + font-size: 90%; + margin: 0; + padding-left: 3em; +} + +div.success{ + background: #66ff66 url(../images/thumbup.gif) 0.5em 0px no-repeat; + font-size: 90%; + margin: 0; + padding-left: 3em; +} + +/* syntax highlighting code */ +.code .br0 { color: #66cc66; } +.code .co1 { color: #808080; font-style: italic; } +.code .co2 { color: #808080; font-style: italic; } +.code .coMULTI { color: #808080; font-style: italic; } +.code .es0 { color: #000099; font-weight: bold; } +.code .kw1 { color: #b1b100; } +.code .kw2 { color: #000000; font-weight: bold; } +.code .kw3 { color: #000066; } +.code .kw4 { color: #993333; } +.code .kw5 { color: #0000ff; } +.code .me0 { color: #006600; } +.code .nu0 { color: #cc66cc; } +.code .re0 { color: #0000ff; } +.code .re1 { color: #0000ff; } +.code .re2 { color: #0000ff; } +.code .re4 { color: #009999; } +.code .sc0 { color: #00bbdd; } +.code .sc1 { color: #ddbb00; } +.code .sc2 { color: #009900; } +.code .st0 { color: #ff0000; } diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css new file mode 100644 index 000000000..14c419df4 --- /dev/null +++ b/lib/tpl/default/design.css @@ -0,0 +1,642 @@ +/** + * Design elements for default Template + * + * @author Andreas Gohr <andi@splitbrain.org> + * @author Anika Henke <henke@cosmocode.de> + */ + +/* -------------- general elements --------------- */ + +body { + font: 80% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; + background-color: White; + color: Black; + margin: 0; + padding: 0; +} + +/* the document */ +div.page { + margin-top: 4px; + margin-left: 1em; + margin-right: 2em; + text-align: justify; +} + +table { + font-size: 100%; + padding:0; + margin:0; +} + +tr,td,th {padding:0; margin:0;} + +img {border:0} + +p {padding:0; margin: 0 0 1.0em 0;} + +hr { + border: 0px; + border-top: 1px solid #8cacbb; + text-align:center; + height: 0px; +} + +div.nothing { + text-align:center; + margin: 2em; +} + +/* ---------------- forms ------------------------ */ + +form { + border: none; + margin: 0; + display: inline; +} + +label { + display: block; + text-align: right; + font-weight: bold; +} + +label.simple { + text-align: left; + font-weight: normal; +} + +label input.edit { + width: 50%; +} + +fieldset { + width: 300px; + text-align: center; + border: 1px solid #8cacbb; + padding: 0.5em; +} + +textarea.edit { + font-family:monospace; + border: 1px solid #8cacbb; + color: Black; + background-color: white; + font-size:14px; + padding: 3px; + width:100%; +} + +input.edit,select.edit { + font-size: 100%; + border: 1px solid #8cacbb; + height: 22px !important; + max-height: 22px !important; + min-height: 22px !important; + color: Black; + background-color: white; + vertical-align: middle; + padding: 1px; + display: inline; +} + +input.missing { + font-size: 100%; + border: 1px solid #8cacbb; + height: 22px !important; + max-height: 22px !important; + min-height: 22px !important; + color: Black; + background-color: #ffcccc; + vertical-align: middle; + padding: 1px; + display: inline; +} + +/* --------- buttons ------------------- */ + + +input.button { + border: 1px solid #8cacbb; + color: Black; + background-color: white; + vertical-align: middle; + text-decoration:none; + font-size: 100%; + cursor: pointer; + height: 22px !important; + max-height: 22px !important; + min-height: 22px !important; + margin: 1px; + display: inline; +} + +div.secedit input.button { + border: 1px solid #8cacbb; + color: Black; + background-color: white; + vertical-align: middle; + text-decoration:none; + margin: 0px; + padding: 0px; + font-size: 10px; + cursor: pointer; + height: 15px; + max-height: 15px !important; + min-height: 15px !important; + float:right; + display: inline; +} + +/* ----------- page navigator ------------- */ + +div.pagenav { + margin-top:1em; +} + +div.pagenav-prev { + text-align:right; + float:left; + width:50% +} + +div.pagenav-prev input.button { + margin-right:5px; +} + +div.pagenav-next { + text-align:left; + float:right; + width:50% +} + +div.pagenav-next input.button { + margin-left:5px; +} + +/* --------------- Links ------------------ */ + +a { + color:#436976; + text-decoration:none; +} +a:hover { + color:#000000; + text-decoration:underline; +} + +/* external link */ +a.urlextern{ + background: transparent url(images/link_icon.gif) 0px 1px no-repeat; + padding: 1px 0px 1px 16px; + color:#436976; + text-decoration:none; +} +a.urlextern:visited { + color:Purple; +} +a.urlextern:hover { + text-decoration:underline; +} + +/* windows share */ +a.windows{ + background: transparent url(images/windows.gif) 0px 1px no-repeat; + padding: 1px 0px 1px 16px; + color:#436976; + text-decoration:none; +} +a.windows:visited { + color:Purple; +} +a.windows:hover { + text-decoration:underline; +} + +/* interwiki link */ +a.interwiki{ + background: transparent url(images/interwiki.png) 0px 1px no-repeat; + padding-left: 16px; + color:#436976; + text-decoration:none; +} +a.interwiki:visited { + color:Purple; +} +a.interwiki:hover { + text-decoration:underline; +} + +/* link to some embedded media */ +a.media { + color:#436976; + text-decoration:none; +} +a.media:hover { + color:#436976; + text-decoration:underline +} + +/* email link */ +a.mail { + background: transparent url(images/mail_icon.gif) 0px 1px no-repeat; + padding: 1px 0px 1px 16px; + color:#436976; + text-decoration:none; +} +a.mail:hover { + text-decoration:underline; +} + +/* existing wikipage */ +a.wikilink1:link { color:#009900; text-decoration:none } +a.wikilink1:visited { color:#009900; text-decoration:none } +a.wikilink1:hover { color:#009900; text-decoration:underline } + +/* not existing wikipage */ +a.wikilink2:link { color:#FF3300; text-decoration:none } +a.wikilink2:visited { color:#FF3300; text-decoration:none } +a.wikilink2:hover { color:#FF3300; text-decoration:underline } + + +/* ------------- Page elements ----------------- */ + +div.preview{ + background:#f7f9fa; + margin-left:2em; + padding: 4px; + border: 1px dashed #000000; +} + +div.breadcrumbs{ + background-color: #f5f5f5; + font-size:80%; + color: #666666; + padding-left: 4px; +} + +span.user{ + color: #cccccc; + font-size: 90%; +} + +/* embedded images */ +img.media { + margin: 3px; +} + +img.medialeft { + border: 0; + float: left; + margin: 0 1.5em 0 0; +} + +img.mediaright { + border: 0; + float: right; + margin: 0 0 0 1.5em; +} + +img.mediacenter { + border: 0; + display: block; + margin-left: auto; + margin-right: auto; +} + +acronym { + cursor: help; + border-bottom: 1px dotted #000; +} + +/* general headline setup */ +h1, h2, h3, h4, h5 { + color: Black; + background-color: transparent; + font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; + font-size: 100%; + font-weight: normal; + margin-left: 0; + margin-right: 0; + margin-top: 0; + margin-bottom: 1em; + padding-left: 0; + padding-right: 0; + padding-top: 0.5em; + padding-bottom: 0; + border-bottom: 1px solid #8cacbb; + clear: left; +} + +/* special headlines */ +h1 {font-size: 160%; margin-left: 0px; font-weight: bold;} +h2 {font-size: 150%; margin-left: 20px;} +h3 {font-size: 140%; margin-left: 40px; border-bottom: none; font-weight: bold;} +h4 {font-size: 120%; margin-left: 60px; border-bottom: none; font-weight: bold;} +h5 {font-size: 100%; margin-left: 80px; border-bottom: none; font-weight: bold;} + +/* indent different sections */ +div.level1 {margin-left: 3px;} +div.level2 {margin-left: 23px;} +div.level3 {margin-left: 43px;} +div.level4 {margin-left: 63px;} +div.level5 {margin-left: 83px;} + +/* unordered lists */ +ul { + line-height: 1.5em; + list-style-type: square; + margin: 0 0 0.5em 1.5em; + padding: 0; + list-style-image: url(images/bullet.gif); +} + +/* ordered lists */ +ol { + line-height: 1.5em; + margin: 0 0 0.5em 1.5em; + padding: 0; + color: #638c9c; + font-weight: bold; + list-style-image: none; +} + +/* the list items overriding the ol definition */ +span.li { + color: #000000; + font-weight: normal; +} + +ol {list-style-type: decimal} +ol ol {list-style-type: upper-roman} +ol ol ol {list-style-type: lower-alpha} +ol ol ol ol {list-style-type: lower-greek} + +li.open { + list-style-image: url(images/open.gif); +} + +li.closed { + list-style-image: url(images/closed.gif); +} + +blockquote { + border-left: 2px solid #8cacbb; + padding-left: 3px; + margin-left: 0; +} + +/* code blocks by indention */ +pre.pre { + font-size: 120%; + padding: 0.5em; + border: 1px dashed #8cacbb; + color: Black; + background-color: #f7f9fa; + overflow: auto; +} + +/* code blocks by code tag */ +pre.code { + font-size: 120%; + padding: 0.5em; + border: 1px dashed #8cacbb; + color: Black; + background-color: #f7f9fa; + overflow: auto; +} + +/* inline code words */ +code { + font-size: 120%; +} + +/* code blocks by file tag */ +pre.file { + font-size: 120%; + padding: 0.5em; + border: 1px dashed #8cacbb; + color: Black; + background-color: #dee7ec; + overflow: auto; +} + +/* inline tables */ +table.inline { + background-color: #ffffff; + border-spacing: 0px; + border-collapse: collapse; +} + +table.inline th { + padding: 3px; + border: 1px solid #8cacbb; + background-color: #dee7ec; +} + +table.inline td { + padding: 3px; + border: 1px solid #8cacbb; +} + +.leftalign{ + text-align: left; +} + +.centeralign{ + text-align: center; +} + +.rightalign{ + text-align: right; +} + +/* ---------- table of contents ------------------- */ + +div.toc { + margin-left: 2em; + margin-top: 1.2em; + margin-bottom: 0; + float:right; + width: 200px; + font-size: 80%; + clear:both; +} + +div.tocheader { + padding: 3px; + border: 1px solid #8cacbb; + background-color: #dee7ec; + text-align: left; + font-weight:bold; + margin-bottom: 2px; +} + +div.toctoggle { + float:right; + margin-top:0.3em; + margin-right:3px; +} + +div.toctoggle img { + width:0.8em; + height:0.8em; +} + +#tocinside { + border: 1px solid #8cacbb; + background-color: #ffffff; + text-align: left; + padding-top: 0.5em; + padding-bottom: 0.7em; +} + +ul.toc { + list-style-type: none; + list-style-image: none; + line-height: 1.2em; + margin: 0; + padding: 0; + padding-left: 1em; +} + +ul.toc li { + background: transparent url(images/tocdot2.gif) 0 0.6em no-repeat; + padding-left:0.4em; +} + +ul.toc li.clear { + background-image: none; + padding-left:0.4em; +} + +a.toc { + color: #436976; + text-decoration:none; +} + +a.toc:hover { + color: #000000; + text-decoration:underline; +} + +/* ---------------------------- Diff rendering --------------------------*/ +table.diff { background:white; } +td.diff-blockheader {font-weight:bold} +td.diff-header { + border-bottom: 1px solid #8cacbb; + font-size:120%; +} +td.diff-addedline { + background:#ddffdd; + font-family: monospace; + font-size: 100%; +} +td.diff-deletedline { + background:#ffffbb; + font-family: monospace; + font-size: 100%; +} +td.diff-context { + background:#f7f9fa; + font-family: monospace; + font-size: 100%; +} +span.diffchange { color: red; } + +/* --------------------- footnotes -------------------------------- */ + +div.footnotes{ + clear:both; + border-top: 1px solid #8cacbb; + padding-left: 1em; + margin-top: 1em; +} + +div.fn{ + font-size:90%; +} + +a.fn_top{ + vertical-align:super; + font-size:80%; +} + +a.fn_bot{ + vertical-align:super; + font-size:80%; + font-weight:bold; +} + + +/* --------------- search result formating --------------- */ +.search_result{ + margin-bottom: 6px; + padding-left: 30px; + padding-right: 10px; +} + +.search_snippet{ + color: #999999; + font-size: 12px; + margin-left: 20px; +} + +.search_sep{ + color: #000000; +} + +.search_hit{ + color: #000000; + background: #FFFF99; +} + +div.search_quickresult{ + margin-bottom: 15px; + padding-bottom: 5px; + border-bottom: 1px dashed #8cacbb; + margin-left: 30px; + padding-right: 10px; +} + +div.search_quickhits { + margin-left: 1em; + float:left; + background: transparent url(images/bullet.gif) 0px 1px no-repeat; + padding: 1px 0px 1px 8px; + width: 30%; +} + +/* ------------------ Additional ---------------------- */ +.footerinc a img { + opacity: 0.5; +} + +.footerinc a:hover img { + opacity: 1; +} + +/* ---- Admin --- */ + +div.acladmin label { + text-align: left; + font-weight: normal; + display: inline; +} + +div.acladmin table{ + margin-left: 10%; + width: 80%; +} + +/* ---------- AJAX quicksearch ----------- */ + +div.ajax_qsearch { + position:absolute; + right:225px;; + text-align:left; + width: 200px; + background-color: #ff9; + opacity: 0.9; + display:none; +} diff --git a/lib/tpl/default/footer.html b/lib/tpl/default/footer.html new file mode 100644 index 000000000..577bb3b3c --- /dev/null +++ b/lib/tpl/default/footer.html @@ -0,0 +1,56 @@ +<?php +/** + * Example footer include + * + * This file shows you how to use the include hooks. However I recommend to + * create your own complete new template instead. + */ +?> + +<div align="center" class="footerinc"> + <a target="_blank" href="<?=DOKU_BASE?>feed.php" title="Recent changes RSS feed"><img src="<?=DOKU_TPL?>images/button-rss.png" width="80" height="15" alt="Recent changes RSS feed" border="0" /></a> + + <a target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/2.0/" rel="license" title="Creative Commons License"><img src="<?=DOKU_TPL?>images/button-cc.gif" width="80" height="15" alt="Creative Commons License" border="0" /></a> + + <a target="_blank" href="https://www.paypal.com/xclick/business=andi%40splitbrain.org&item_name=DokuWiki+Donation&no_shipping=1&no_note=1&tax=0&currency_code=EUR&lc=US" title="Donate"><img src="<?=DOKU_TPL?>images/button-donate.gif" alt="Donate" border="0" /></a> + + <a target="_blank" href="http://www.php.net" title="Powered by PHP"><img src="<?=DOKU_TPL?>images/button-php.gif" width="80" height="15" alt="Powered by PHP" border="0" /></a> + + <a target="_blank" href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0"><img src="<?=DOKU_TPL?>images/button-xhtml.png" width="80" height="15" alt="Valid XHTML 1.0" border="0" /></a> + + <a target="_blank" href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS"><img src="<?=DOKU_TPL?>images/button-css.png" width="80" height="15" alt="Valid CSS" border="0" /></a> + + <a target="_blank" href="http://wiki.splitbrain.org/wiki:dokuwiki" title="Driven by DokuWiki"><img src="<?=DOKU_TPL?>images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" border="0" /></a> + + +<?php +/* + * The following stuff in HTML comments declares a Creative Commons + * License - remove this if you don't want this license for your Wiki + */ +?> + +<!-- + +<rdf:RDF xmlns="http://web.resource.org/cc/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> +<Work rdf:about=""> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> + <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" /> +</Work> + +<License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/"> + <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> + <permits rdf:resource="http://web.resource.org/cc/Distribution" /> + <requires rdf:resource="http://web.resource.org/cc/Notice" /> + <requires rdf:resource="http://web.resource.org/cc/Attribution" /> + <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" /> + <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> + <requires rdf:resource="http://web.resource.org/cc/ShareAlike" /> +</License> + +</rdf:RDF> + +--> +</div> diff --git a/lib/tpl/default/images/bullet.gif b/lib/tpl/default/images/bullet.gif Binary files differnew file mode 100644 index 000000000..b43de48a4 --- /dev/null +++ b/lib/tpl/default/images/bullet.gif diff --git a/lib/tpl/default/images/button-cc.gif b/lib/tpl/default/images/button-cc.gif Binary files differnew file mode 100644 index 000000000..5861d637f --- /dev/null +++ b/lib/tpl/default/images/button-cc.gif diff --git a/lib/tpl/default/images/button-css.png b/lib/tpl/default/images/button-css.png Binary files differnew file mode 100644 index 000000000..706325e1c --- /dev/null +++ b/lib/tpl/default/images/button-css.png diff --git a/lib/tpl/default/images/button-donate.gif b/lib/tpl/default/images/button-donate.gif Binary files differnew file mode 100644 index 000000000..ec682c6b1 --- /dev/null +++ b/lib/tpl/default/images/button-donate.gif diff --git a/lib/tpl/default/images/button-dw.png b/lib/tpl/default/images/button-dw.png Binary files differnew file mode 100644 index 000000000..39d5f56a9 --- /dev/null +++ b/lib/tpl/default/images/button-dw.png diff --git a/lib/tpl/default/images/button-php.gif b/lib/tpl/default/images/button-php.gif Binary files differnew file mode 100644 index 000000000..28f329aaa --- /dev/null +++ b/lib/tpl/default/images/button-php.gif diff --git a/lib/tpl/default/images/button-rss.png b/lib/tpl/default/images/button-rss.png Binary files differnew file mode 100644 index 000000000..b036f7152 --- /dev/null +++ b/lib/tpl/default/images/button-rss.png diff --git a/lib/tpl/default/images/button-xhtml.png b/lib/tpl/default/images/button-xhtml.png Binary files differnew file mode 100644 index 000000000..ec686442c --- /dev/null +++ b/lib/tpl/default/images/button-xhtml.png diff --git a/lib/tpl/default/images/closed.gif b/lib/tpl/default/images/closed.gif Binary files differnew file mode 100644 index 000000000..8414d4d69 --- /dev/null +++ b/lib/tpl/default/images/closed.gif diff --git a/lib/tpl/default/images/interwiki.png b/lib/tpl/default/images/interwiki.png Binary files differnew file mode 100644 index 000000000..73d6f8d39 --- /dev/null +++ b/lib/tpl/default/images/interwiki.png diff --git a/lib/tpl/default/images/link_icon.gif b/lib/tpl/default/images/link_icon.gif Binary files differnew file mode 100644 index 000000000..815ccb1b1 --- /dev/null +++ b/lib/tpl/default/images/link_icon.gif diff --git a/lib/tpl/default/images/mail_icon.gif b/lib/tpl/default/images/mail_icon.gif Binary files differnew file mode 100644 index 000000000..50a87a9a0 --- /dev/null +++ b/lib/tpl/default/images/mail_icon.gif diff --git a/lib/tpl/default/images/open.gif b/lib/tpl/default/images/open.gif Binary files differnew file mode 100644 index 000000000..f5d5c7e56 --- /dev/null +++ b/lib/tpl/default/images/open.gif diff --git a/lib/tpl/default/images/tocdot2.gif b/lib/tpl/default/images/tocdot2.gif Binary files differnew file mode 100644 index 000000000..3d39c2e73 --- /dev/null +++ b/lib/tpl/default/images/tocdot2.gif diff --git a/lib/tpl/default/images/windows.gif b/lib/tpl/default/images/windows.gif Binary files differnew file mode 100644 index 000000000..4f12acce1 --- /dev/null +++ b/lib/tpl/default/images/windows.gif diff --git a/lib/tpl/default/layout.css b/lib/tpl/default/layout.css new file mode 100644 index 000000000..fea7c58ab --- /dev/null +++ b/lib/tpl/default/layout.css @@ -0,0 +1,109 @@ +/** + * Tableless Layout for default template + * + * @author Andreas Gohr <andi@splitbrain.org> + * @author moraes <moraes@tipos.com.br> + */ + + +/* -------------- top row --------------- */ +.header { + height:35px; + padding:3px 0 2px 2px; +} + +.pagename { + height:25px; + float:left; + font-size:200%; + font-weight:bolder; + color:#DEE7EC; + text-align:left; + vertical-align:middle; + padding:1px 0 0 1px; +} + +.pagename a:link, .pagename a:visited { + color:#436976; + text-decoration:none; +} + +.pagename a:hover, .pagename a:active { + color:#FF9933; +} + +.logo { + float:right; + font-size:220%; + font-weight:bolder; + text-align:right; + vertical-align:middle; +} + +.logo a:link, .logo a:visited, .logo a:hover, .logo a:active { + color:#dee7ec; + text-decoration:none; + font-variant:small-caps; + letter-spacing:2pt; +} + +/* --------------- top and bottom bar ---------------- */ +.bar { + height:25px; + border-top:1px solid #8CACBB; + border-bottom:1px solid #8CACBB; + background:#DEE7EC; + padding:2px; + margin:0; + clear: both; +} + +.bar-left { + float:left; +} + +.bar-right { + float:right; + text-align:right; +} + +#bar_bottom { + margin-bottom:3px; +} + +/* ------------- File Metadata ----------------------- */ + +div.meta { + clear: both; + margin-top: 1em; + color:#436976; + font-size:70%; +} + +div.meta div.user { + float:left; +} + +div.meta div.doc{ + text-align:right; +} + +/* --------------- Media Selection ----------------- */ + +div.uploadform { + margin-top: 0.5em; + border-top: 1px solid #8cacbb; +} + +.mediaselect-left { + float:left; + padding: 0.5em; + width:30%; +} + +.mediaselect-right { + float:right; + border-left: 1px solid #8cacbb; + padding: 0.5em; + width:65%; +} diff --git a/lib/tpl/default/main.php b/lib/tpl/default/main.php new file mode 100644 index 000000000..28ad48f6f --- /dev/null +++ b/lib/tpl/default/main.php @@ -0,0 +1,129 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<? +/** + * DokuWiki Default Template + * + * This is the template you need to change for the overall look + * of DokuWiki. + * + * You should leave the doctype at the very top - It should + * always be the very first line of a document. + * + * @link http://wiki.splitbrain.org/wiki:tpl:templates + * @author Andreas Gohr <andi@splitbrain.org> + */ +?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['lang']?>" + lang="<?=$conf['lang']?>" dir="<?=$lang['direction']?>"> +<head> + <title><?=$ID?> [<?=hsc($conf['title'])?>]</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <?tpl_metaheaders()?> + + <link rel="shortcut icon" href="<?=DOKU_BASE?>lib/images/favicon.ico" /> + <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_TPL?>layout.css" /> + <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_TPL?>design.css" /> + + <? if($lang['direction'] == 'rtl') {?> + <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_TPL?>rtl.css" /> + <? } ?> + + <link rel="stylesheet" media="print" type="text/css" href="<?=DOKU_TPL?>print.css" /> + + <!--[if gte IE 5]> + <style type="text/css"> + /* that IE 5+ conditional comment makes this only visible in IE 5+ */ + /* IE bugfix for transparent PNGs */ + //DISABLED img { behavior: url("<?=DOKU_BASE?>lib/scripts/pngbehavior.htc"); } + </style> + <![endif]--> + + <?/*old includehook*/ @include(dirname(__FILE__).'/meta.html')?> +</head> + +<body> +<?/*old includehook*/ @include(dirname(__FILE__).'/topheader.html')?> +<div class="dokuwiki"> + <?html_msgarea()?> + + <div class="stylehead"> + + <div class="header"> + <div class="pagename"> + [[<?tpl_link(wl($ID,'do=backlink'),$ID)?>]] + </div> + <div class="logo"> + <?tpl_link(wl(),$conf['title'],'name="top" accesskey="h" title="[ALT+H]"')?> + </div> + </div> + + <?/*old includehook*/ @include(dirname(__FILE__).'/header.html')?> + + <div class="bar" id="bar_top"> + <div class="bar-left" id="bar_topleft"> + <?tpl_button('edit')?> + <?tpl_button('history')?> + </div> + + <div class="bar-right" id="bar_topright"> + <?tpl_button('recent')?> + <?tpl_searchform()?> + </div> + </div> + + <?if($conf['breadcrumbs']){?> + <div class="breadcrumbs"> + <?tpl_breadcrumbs()?> + <?//tpl_youarehere() //(some people prefer this)?> + </div> + <?}?> + + </div> + <?flush()?> + + <?/*old includehook*/ @include(dirname(__FILE__).'/pageheader.html')?> + + <div class="page"> + <!-- wikipage start --> + <?tpl_content()?> + <!-- wikipage stop --> + </div> + + <div class="clearer"> </div> + + <?flush()?> + + <div class="stylefoot"> + + <div class="meta"> + <div class="user"> + <?tpl_userinfo()?> + </div> + <div class="doc"> + <?tpl_pageinfo()?> + </div> + </div> + + <?/*old includehook*/ @include(dirname(__FILE__).'/pagefooter.html')?> + + <div class="bar" id="bar_bottom"> + <div class="bar-left" id="bar_bottomleft"> + <?tpl_button('edit')?> + <?tpl_button('history')?> + </div> + <div class="bar-right" id="bar_bottomright"> + <?tpl_button('admin')?> + <?tpl_button('login')?> + <?tpl_button('index')?> + <?tpl_button('top')?> + </div> + </div> + + </div> + +</div> +<?/*old includehook*/ @include(dirname(__FILE__).'/footer.html')?> +</body> +</html> diff --git a/lib/tpl/default/media.php b/lib/tpl/default/media.php new file mode 100644 index 000000000..507717463 --- /dev/null +++ b/lib/tpl/default/media.php @@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<? +/** + * DokuWiki Default Template + * + * This is the template for the media selection popup. + * + * You should leave the doctype at the very top - It should + * always be the very first line of a document. + * + * @link http://wiki.splitbrain.org/wiki:tpl:templates + * @author Andreas Gohr <andi@splitbrain.org> + */ +?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['lang']?>" lang="<?=$conf['lang']?>" dir="ltr"> +<head> + <title><?=hsc($lang['mediaselect'])?> [<?=hsc($conf['title'])?>]</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <?tpl_metaheaders()?> + + <link rel="shortcut icon" href="<?=DOKU_BASE?>lib/images/favicon.ico" /> + <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_TPL?>layout.css" /> + <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_TPL?>design.css" /> + + <!--[if gte IE 5]> + <style type="text/css"> + /* that IE 5+ conditional comment makes this only visible in IE 5+ */ + /* IE bugfix for transparent PNGs */ + //DISABLED img { behavior: url("<?=DOKU_BASE?>lib/scripts/pngbehavior.htc"); } + </style> + <![endif]--> +</head> + +<body> +<div class="dokuwiki"> + <?html_msgarea()?> + + <h1><?=hsc($lang['mediaselect'])?> <code><?=hsc($NS)?></code></h1> + + <div class="mediaselect"> + + <div class="mediaselect-left"> + <b><a href="<?=DOKU_BASE?>/lib/exe/media.php?ns="><?=hsc($lang['namespaces'])?></a></b> + + <?tpl_medianamespaces()?> + </div> + + <div class="mediaselect-right"> + <?tpl_mediafilelist()?> + + <div class="uploadform"> + <?tpl_mediauploadform()?> + </div> + </div> + + </div> + +</div> +</body> diff --git a/lib/tpl/default/print.css b/lib/tpl/default/print.css new file mode 100644 index 000000000..77c82a580 --- /dev/null +++ b/lib/tpl/default/print.css @@ -0,0 +1,223 @@ + +body { + font: 12pt "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; + background-color: White; + color: Black; +} + +table { + font-size: 100%; + padding:0; + margin:0; +} + +tr,td,th {padding:0; margin:0;} + +img {border:0} + +a { + color:#000000; + text-decoration:none; +} + + +div.meta { + clear:both; + margin-top: 1em; + font-size:70%; + text-align:right; +} + +div.breadcrumbs{ + display:none; +} + +div.secedit{ + display:none; +} + +/* --------------------- Text formating -------------------------------- */ + +/* external link */ +a.urlextern:after { + content: " [" attr(href) "]"; + font-size: 90%; +} + +/* interwiki link */ +a.interwiki:after { + content: " [" attr(href) "]"; + font-size: 90%; +} + +/* email link */ +a.mail:after { + content: " [" attr(href) "]"; + font-size: 90%; +} + +/* existing wikilink */ +a.wikilink1 {text-decoration:underline } + +/* the document */ +div.page { + text-align: justify; +} + +/* general headline setup */ +h1, h2, h3, h4, h5 { + color: Black; + background-color: transparent; + font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; + font-size: 100%; + font-weight: normal; + margin-left: 0; + margin-right: 0; + margin-top: 0; + margin-bottom: 1em; + padding-left: 0; + padding-right: 0; + padding-top: 0.5em; + padding-bottom: 0; + border-bottom: 1px solid #000000; + clear:left; +} + +/* special headlines */ +h1 {font-size: 160%; font-weight: bold;} +h2 {font-size: 150%; } +h3 {font-size: 140%; border-bottom: none; font-weight: bold;} +h4 {font-size: 120%; border-bottom: none; font-weight: bold;} +h5 {font-size: 100%; border-bottom: none; font-weight: bold;} + +/* embedded images */ +img.media { + margin: 3px; +} + +img.medialeft { + border: 0; + float: left; + margin: 0 1.5em 0 0; +} + +img.mediaright { + border: 0; + float: right; + margin: 0 0 0 1.5em; +} + +/* unordered lists */ +ul { + line-height: 1.5em; + list-style-type: square; + margin: 0 0 1.0em 1.5em; + padding: 0; + +} + +/* ordered lists */ +ol { + line-height: 1.5em; + margin: 0 0 1.0em 1.5em; + padding: 0; + font-weight: bold; +} + +/* the list items overriding the ol definition */ +span.li { + font-weight: normal; +} + +/* code blocks by indention */ +pre.pre { + font-size: 8pt; + padding: 0.5em; + border: 1px dashed #000000; + color: Black; + overflow: visible; +} + +/* code blocks by code tag */ +pre.code { + font-size: 8pt; + padding: 0.5em; + border: 1px dashed #000000; + color: Black; + overflow: visible; +} + +/* inline code words */ +code { + font-size: 120%; +} + +/* code blocks by file tag */ +pre.file { + font-size: 8pt; + padding: 0.5em; + border: 1px dotted #000000; + color: Black; + overflow: visible; +} + +/* footnotes */ +div.footnotes{ + clear:both; + border-top: 1px solid #000000; + padding-left: 1em; + margin-top: 1em; +} + +div.fn{ + font-size:90%; +} + +a.fn_top{ + vertical-align:super; + font-size:80%; +} + +a.fn_bot{ + vertical-align:super; + font-size:80%; + font-weight:bold; +} + +acronym{ + border: 0; +} + +/* ---------- inline tables ------------------- */ + +table.inline { + font-size: 80%; + background-color: #ffffff; + border-spacing: 0px; + border-collapse: collapse; +} + +table.inline th { + padding: 3px; + border: 1px solid #000000; + border-bottom: 2px solid #000000; +} + +table.inline td { + padding: 3px; + border: 1px solid #000000; +} + +.leftalign{ + text-align: left; +} + +.centeralign{ + text-align: center; +} + +.rightalign{ + text-align: right; +} + +.toc, .footerinc, .header, .bar, .user {display:none} diff --git a/lib/tpl/default/rtl.css b/lib/tpl/default/rtl.css new file mode 100644 index 000000000..9a8294774 --- /dev/null +++ b/lib/tpl/default/rtl.css @@ -0,0 +1,111 @@ +/** + * Layout and dedsign corrections for right-to-left languages + * + * @author Andreas Gohr <andi@splitbrain.org> + * @author Dotan Kamber <kamberd@yahoo.com> + */ + +.bar-left { + float: right; + text-align: right; +} + +.bar-right { + float: left; + text-align: left; +} + +.pagename { + float: right; + text-align: right; +} + +.logo { + float: left; + text-align: left; +} + +label { + text-align: left; +} + +label.simple { + text-align: right; +} + +div.meta div.user { + float: right +} + +div.meta div.doc{ + text-align: left; +} + +/* ------------------ Design corrections --------------------------------- */ + +ul,ol { + margin: 0.5em 1.5em 0.5em 0; +} + +a.urlextern,a.interwiki,a.windows{ + /* should work but dosn't - so we just disable icons here*/ + /* + background-position: right 1px; + padding-right: 16px; + */ + background-image: none !important; + padding: 0; +} + +div.secedit input.button { + float: left; +} + +/* headlines */ +h1, h2, h3, h4, h5 { + clear: right; +} + +/* special headlines */ +h1 {margin-left: 0px; margin-right: 0px;} +h2 {margin-left: 0px; margin-right: 20px;} +h3 {margin-left: 0px; margin-right: 40px;} +h4 {margin-left: 0px; margin-right: 60px;} +h5 {margin-left: 0px; margin-right: 80px;} + +/* indent different sections */ +div.level1 {margin-left: 0px; margin-right: 3px;} +div.level2 {margin-left: 0px; margin-right: 23px;} +div.level3 {margin-left: 0px; margin-right: 43px;} +div.level4 {margin-left: 0px; margin-right: 63px;} +div.level5 {margin-left: 0px; margin-right: 83px;} + +/* TOC control */ +div.toc { + float: left; + margin-left: 0; + margin-right: 2em; +} + +div.tocheader { + text-align: right; +} + +#tocinside { + text-align: right; +} + +ul.toc { + padding: 0; + padding-right: 1em; +} + +ul.toc li { + background-position: right 0.6em; + padding-right:0.4em; +} + +ul.toc li.clear { + padding-right:0.4em; +} + |