You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(107) |
Feb
(48) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
(29) |
Jul
(14) |
Aug
(9) |
Sep
(34) |
Oct
(14) |
Nov
(6) |
Dec
(18) |
2004 |
Jan
|
Feb
(4) |
Mar
(12) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(43) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
2007 |
Jan
(1) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Scott M. <sm...@us...> - 2002-01-02 21:30:20
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv14593/parse Modified Files: html.php transforms.php Log Message: Change anchor reference syntax; tweak free link performance. Index: html.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/html.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- html.php 2002/01/02 21:10:08 1.17 +++ html.php 2002/01/02 21:30:17 1.18 @@ -120,7 +120,7 @@ } return "<a href=\"$url\">$text</a>"; } -function html_ref($page, $appearance, $hover = '', $anchor = '') +function html_ref($page, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $db; @@ -132,7 +132,7 @@ if($p->exists()) { return '<a href="' . viewURL($page) . $anchor . '"' . $hover . '>' - . $appearance . $anchor . '</a>'; + . $appearance . $anchor_appearance . '</a>'; } else { Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- transforms.php 2002/01/02 21:10:08 1.16 +++ transforms.php 2002/01/02 21:30:17 1.17 @@ -59,10 +59,10 @@ if($validate) { $ptn = "/(^|[^A-Za-z])($LinkPtn)(())(\"\")?/e"; } else - { $ptn = "/(^|[^A-Za-z])($LinkPtn)((\#[-A-Za-z0-9]+))?(\"\")?/e"; } + { $ptn = "/(^|[^A-Za-z])($LinkPtn)(\#[-A-Za-z0-9]+)?(\"\")?/e"; } return preg_replace($ptn, - "q1('\\1').new_entity(array('ref',q1('\\2'),q1('\\2'),'','\\5'))", + "q1('\\1').new_entity(array('ref',q1('\\2'),q1('\\2'),'','\\4','\\4'))", $text, -1); } @@ -73,26 +73,24 @@ if(!$EnableFreeLinks) { return $text; } if($validate) - { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)(())/e"; } + { + $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,']+)(\|([-A-Za-z0-9 _+\\/.,']+))?()\\)\\)/e"; + } else - { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)((\#[-A-Za-z0-9]+)(\"\")?)?/e"; } + { + $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,']+)(\|([-A-Za-z0-9 _+\\/.,']+))?(\#[-A-Za-z0-9]+)?\\)\\)/e"; + } return preg_replace($ptn, - "freelink_token(q1('\\1'), '\\3')", $text, -1); + "freelink_token(q1('\\1'), q1('\\3'), '\\4', '')", $text, -1); } -function freelink_token($text, $anchor = '') +function freelink_token($link, $appearance, $anchor, $anchor_appearance) { - $parts = array(); - $parts = preg_split("/[|]+/", $text); - $link = trim($parts[0]); - if(count($parts) > 1 && trim($parts[1]) != "") - { $text = trim($parts[1]); } - else - { $text = $link; } - if(preg_match('/^\\s*\\$/', $link)) - { return '((' . $text . '))'; } - return new_entity(array('ref', $link, $text, '', $anchor)); + if($appearance == '') + { $appearance = $link; } + return new_entity(array('ref', $link, $appearance, '', + $anchor, $anchor_appearance)); } function parse_interwiki($text) @@ -489,7 +487,8 @@ return $DisplayEngine[$Entity[$text][0]]($Entity[$text][1], $Entity[$text][2], $Entity[$text][3], - $Entity[$text][4]); + $Entity[$text][4], + $Entity[$text][5]); } function parse_diff_skip($text) |
From: Scott M. <sm...@us...> - 2002-01-02 21:10:11
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv8812/parse Modified Files: html.php transforms.php Log Message: Anchor efficiency tweak. Index: html.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/html.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- html.php 2002/01/02 21:07:21 1.16 +++ html.php 2002/01/02 21:10:08 1.17 @@ -126,8 +126,6 @@ if($hover != '') { $hover = ' title="' . $hover . '"'; } - if($anchor != '') - { $anchor = '#' . $anchor; } $p = new WikiPage($db, $page); Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- transforms.php 2002/01/02 21:07:21 1.15 +++ transforms.php 2002/01/02 21:10:08 1.16 @@ -59,7 +59,7 @@ if($validate) { $ptn = "/(^|[^A-Za-z])($LinkPtn)(())(\"\")?/e"; } else - { $ptn = "/(^|[^A-Za-z])($LinkPtn)(\#([-A-Za-z0-9]+))?(\"\")?/e"; } + { $ptn = "/(^|[^A-Za-z])($LinkPtn)((\#[-A-Za-z0-9]+))?(\"\")?/e"; } return preg_replace($ptn, "q1('\\1').new_entity(array('ref',q1('\\2'),q1('\\2'),'','\\5'))", @@ -75,7 +75,7 @@ if($validate) { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)(())/e"; } else - { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)(\#([-A-Za-z0-9]+)(\"\")?)?/e"; } + { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)((\#[-A-Za-z0-9]+)(\"\")?)?/e"; } return preg_replace($ptn, "freelink_token(q1('\\1'), '\\3')", $text, -1); |
From: Scott M. <sm...@us...> - 2002-01-02 21:07:24
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv8053/parse Modified Files: html.php transforms.php Log Message: Implement anchor reference syntax. Index: html.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/html.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- html.php 2002/01/02 20:20:30 1.15 +++ html.php 2002/01/02 21:07:21 1.16 @@ -120,18 +120,21 @@ } return "<a href=\"$url\">$text</a>"; } -function html_ref($page, $appearance, $hover = '') +function html_ref($page, $appearance, $hover = '', $anchor = '') { global $db; if($hover != '') { $hover = ' title="' . $hover . '"'; } + if($anchor != '') + { $anchor = '#' . $anchor; } $p = new WikiPage($db, $page); if($p->exists()) { - return '<a href="' . viewURL($page) . '"' . $hover . '>' . $appearance . '</a>'; + return '<a href="' . viewURL($page) . $anchor . '"' . $hover . '>' + . $appearance . $anchor . '</a>'; } else { Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- transforms.php 2002/01/02 18:07:23 1.14 +++ transforms.php 2002/01/02 21:07:21 1.15 @@ -25,10 +25,10 @@ { global $FlgChr; - $p = parse_wikiname($page); + $p = parse_wikiname($page, 1); if(preg_match('/^' . $FlgChr . '\\d+' . $FlgChr . '$/', $p)) { return 1; } - $p = parse_freelink('((' . $page . '))'); + $p = parse_freelink('((' . $page . '))', 1); if(preg_match('/^' . $FlgChr . '\\d+' . $FlgChr . '$/', $p)) { return 2; } return 0; @@ -50,28 +50,38 @@ return $FlgChr . (count($Entity) - 1) . $FlgChr; } -function parse_wikiname($text) +function parse_wikiname($text, $validate = 0) { global $LinkPtn, $EnableWikiLinks; if(!$EnableWikiLinks) { return $text; } - return preg_replace("/(^|[^A-Za-z])($LinkPtn)(\"\")?/e", - "q1('\\1').new_entity(array('ref',q1('\\2'),q1('\\2')))", + if($validate) + { $ptn = "/(^|[^A-Za-z])($LinkPtn)(())(\"\")?/e"; } + else + { $ptn = "/(^|[^A-Za-z])($LinkPtn)(\#([-A-Za-z0-9]+))?(\"\")?/e"; } + + return preg_replace($ptn, + "q1('\\1').new_entity(array('ref',q1('\\2'),q1('\\2'),'','\\5'))", $text, -1); } -function parse_freelink($text) +function parse_freelink($text, $validate = 0) { global $EnableFreeLinks; if(!$EnableFreeLinks) { return $text; } - return preg_replace("/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)/e", - "freelink_token(q1('\\1'))", $text, -1); + if($validate) + { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)(())/e"; } + else + { $ptn = "/\\(\\(([-A-Za-z0-9 _+\\/.,'|]+)\\)\\)(\#([-A-Za-z0-9]+)(\"\")?)?/e"; } + + return preg_replace($ptn, + "freelink_token(q1('\\1'), '\\3')", $text, -1); } -function freelink_token($text) +function freelink_token($text, $anchor = '') { $parts = array(); $parts = preg_split("/[|]+/", $text); @@ -82,7 +92,7 @@ { $text = $link; } if(preg_match('/^\\s*\\$/', $link)) { return '((' . $text . '))'; } - return new_entity(array('ref', $link, $text)); + return new_entity(array('ref', $link, $text, '', $anchor)); } function parse_interwiki($text) @@ -478,7 +488,8 @@ return $DisplayEngine[$Entity[$text][0]]($Entity[$text][1], $Entity[$text][2], - $Entity[$text][3]); + $Entity[$text][3], + $Entity[$text][4]); } function parse_diff_skip($text) |
From: Scott M. <sm...@us...> - 2002-01-02 21:07:24
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv8053 Modified Files: ChangeLog config.php index.php Log Message: Implement anchor reference syntax. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ChangeLog 2002/01/02 20:21:29 1.21 +++ ChangeLog 2002/01/02 21:07:21 1.22 @@ -13,6 +13,8 @@ * Applied patch from Kimmo Suominen to accomodate register_globals=off. * Implemented HTML anchor macro, [[Anchor name]]. + * Implemented anchor reference syntax: PageName#anchor and + ((free links))#anchor. 2002-01-01 Scott Moonen <sm...@an...> Index: config.php =================================================================== RCS file: /cvsroot/tavi/tavi/config.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- config.php 2002/01/02 20:20:29 1.12 +++ config.php 2002/01/02 21:07:21 1.13 @@ -79,6 +79,8 @@ $StyleSheet = $TemplateDir . '/wiki.css'; // The following variables establish the format for WikiNames in this wiki. +// Note that changing this might require a change to parse/transforms.php so +// that parse_wikiname knows how many parentheses are included in $LinkPtn. $UpperPtn = "[A-Z\xc0-\xde]"; $LowerPtn = "[a-z\xdf-\xff]"; $AlphaPtn = "[A-Za-z\xc0-\xff]"; Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/index.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index.php 2002/01/02 20:20:29 1.7 +++ index.php 2002/01/02 21:07:21 1.8 @@ -13,31 +13,24 @@ $page = $HTTP_GET_VARS['page']; $ver1 = $HTTP_GET_VARS['ver1']; $ver2 = $HTTP_GET_VARS['ver2']; - - if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'GET') - { - $find = $HTTP_GET_VARS['find']; - } + $find = $HTTP_GET_VARS['find']; - if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST') - { - $Preview = $HTTP_POST_VARS['Preview']; - $Save = $HTTP_POST_VARS['Save']; - $archive = $HTTP_POST_VARS['archive']; - $auth = $HTTP_POST_VARS['auth']; - $categories = $HTTP_POST_VARS['categories']; - $cols = $HTTP_POST_VARS['cols']; - $comment = $HTTP_POST_VARS['comment']; - $days = $HTTP_POST_VARS['days']; - $discard = $HTTP_POST_VARS['discard']; - $document = $HTTP_POST_VARS['document']; - $hist = $HTTP_POST_VARS['hist']; - $min = $HTTP_POST_VARS['min']; - $nextver = $HTTP_POST_VARS['nextver']; - $rows = $HTTP_POST_VARS['rows']; - $tzoff = $HTTP_POST_VARS['tzoff']; - $user = $HTTP_POST_VARS['user']; - } + $Preview = $HTTP_POST_VARS['Preview']; + $Save = $HTTP_POST_VARS['Save']; + $archive = $HTTP_POST_VARS['archive']; + $auth = $HTTP_POST_VARS['auth']; + $categories = $HTTP_POST_VARS['categories']; + $cols = $HTTP_POST_VARS['cols']; + $comment = $HTTP_POST_VARS['comment']; + $days = $HTTP_POST_VARS['days']; + $discard = $HTTP_POST_VARS['discard']; + $document = $HTTP_POST_VARS['document']; + $hist = $HTTP_POST_VARS['hist']; + $min = $HTTP_POST_VARS['min']; + $nextver = $HTTP_POST_VARS['nextver']; + $rows = $HTTP_POST_VARS['rows']; + $tzoff = $HTTP_POST_VARS['tzoff']; + $user = $HTTP_POST_VARS['user']; } require('lib/init.php'); |
From: Scott M. <sm...@us...> - 2002-01-02 21:07:24
|
Update of /cvsroot/tavi/tavi/admin In directory usw-pr-cvs1:/tmp/cvs-serv8053/admin Modified Files: index.php Log Message: Implement anchor reference syntax. Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/admin/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 2002/01/02 19:44:23 1.5 +++ index.php 2002/01/02 21:07:21 1.6 @@ -12,30 +12,25 @@ if(!ini_get('register_globals')) { - if($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'GET') - { - $locking = $HTTP_GET_VARS['locking']; - $blocking = $HTTP_GET_VARS['blocking']; - } - else if($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST') - { - $Block = $HTTP_POST_VARS['Block']; - $Unblock = $HTTP_POST_VARS['Unblock']; - $Save = $HTTP_POST_VARS['Save']; - $address = $HTTP_POST_VARS['address']; - $blocking = $HTTP_POST_VARS['blocking']; - $count = $HTTP_POST_VARS['count']; - $locking = $HTTP_POST_VARS['locking']; + $locking = $HTTP_GET_VARS['locking']; + $blocking = $HTTP_GET_VARS['blocking']; - if($locking && $count > 0) + $Block = $HTTP_POST_VARS['Block']; + $Unblock = $HTTP_POST_VARS['Unblock']; + $Save = $HTTP_POST_VARS['Save']; + $address = $HTTP_POST_VARS['address']; + $blocking = $HTTP_POST_VARS['blocking']; + $count = $HTTP_POST_VARS['count']; + $locking = $HTTP_POST_VARS['locking']; + + if($locking && $count > 0) + { + for($i = 1; $i <= $count; $i++) { - for($i = 1; $i <= $count; $i++) - { - $var = 'name' + $i; - $$var = $HTTP_POST_VARS[$var]; - $var = 'lock' + $i; - $$var = $HTTP_POST_VARS[$var]; - } + $var = 'name' + $i; + $$var = $HTTP_POST_VARS[$var]; + $var = 'lock' + $i; + $$var = $HTTP_POST_VARS[$var]; } } } |
From: Scott M. <sm...@us...> - 2002-01-02 20:21:32
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv21284 Modified Files: ChangeLog Log Message: Changelog for anchor macro Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ChangeLog 2002/01/02 19:44:23 1.20 +++ ChangeLog 2002/01/02 20:21:29 1.21 @@ -12,6 +12,7 @@ macros. * Applied patch from Kimmo Suominen to accomodate register_globals=off. + * Implemented HTML anchor macro, [[Anchor name]]. 2002-01-01 Scott Moonen <sm...@an...> |
From: Scott M. <sm...@us...> - 2002-01-02 20:20:35
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv20683 Modified Files: config.php index.php Log Message: Anchor macro. Index: config.php =================================================================== RCS file: /cvsroot/tavi/tavi/config.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- config.php 2002/01/02 18:35:52 1.11 +++ config.php 2002/01/02 20:20:29 1.12 @@ -266,6 +266,7 @@ 'code' => 'html_code', 'hr' => 'html_hr', 'nowiki' => 'html_nowiki', + 'anchor' => 'html_anchor', 'bullet_list_start' => 'html_ul_start', 'bullet_list_end' => 'html_ul_end', 'bullet_item_start' => 'html_li_start', @@ -294,6 +295,7 @@ // See parse/macros.php $ViewMacroEngine = array( '!' => 'view_macro_category', + 'Anchor' => 'view_macro_anchor', 'PageSize' => 'view_macro_pagesize', 'LinkTable' => 'view_macro_linktab', 'OrphanedPages' => 'view_macro_orphans', Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index.php 2002/01/02 19:50:05 1.6 +++ index.php 2002/01/02 20:20:29 1.7 @@ -1,25 +1,6 @@ <?php // $Id$ -require('lib/init.php'); -require('parse/transforms.php'); - -// To add an action=x behavior, add an entry to this array. First column -// is the file to load, second is the function to call, and third is how -// to treat it for rate-checking purposes ('view', 'edit', or 'search'). -$ActionList = array( - 'view' => array('action/view.php', 'action_view', 'view'), - 'edit' => array('action/edit.php', 'action_edit', 'view'), - 'save' => array('action/save.php', 'action_save', 'edit'), - 'diff' => array('action/diff.php', 'action_diff', 'search'), - 'find' => array('action/find.php', 'action_find', 'search'), - 'history' => array('action/history.php', 'action_history', - 'search'), - 'prefs' => array('action/prefs.php', 'action_prefs', 'view'), - 'macro' => array('action/macro.php', 'action_macro', 'search'), - 'rss' => array('action/rss.php', 'action_rss', 'view') - ); - // If register_globals is off, we need to harvest the script parameters // at this point. @@ -58,6 +39,25 @@ $user = $HTTP_POST_VARS['user']; } } + +require('lib/init.php'); +require('parse/transforms.php'); + +// To add an action=x behavior, add an entry to this array. First column +// is the file to load, second is the function to call, and third is how +// to treat it for rate-checking purposes ('view', 'edit', or 'search'). +$ActionList = array( + 'view' => array('action/view.php', 'action_view', 'view'), + 'edit' => array('action/edit.php', 'action_edit', 'view'), + 'save' => array('action/save.php', 'action_save', 'edit'), + 'diff' => array('action/diff.php', 'action_diff', 'search'), + 'find' => array('action/find.php', 'action_find', 'search'), + 'history' => array('action/history.php', 'action_history', + 'search'), + 'prefs' => array('action/prefs.php', 'action_prefs', 'view'), + 'macro' => array('action/macro.php', 'action_macro', 'search'), + 'rss' => array('action/rss.php', 'action_rss', 'view') + ); // Default action and page names. if(empty($page) && empty($action)) |
From: Scott M. <sm...@us...> - 2002-01-02 20:20:35
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv20683/parse Modified Files: html.php macros.php Log Message: Anchor macro. Index: html.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/html.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- html.php 2002/01/02 18:07:23 1.14 +++ html.php 2002/01/02 20:20:30 1.15 @@ -56,6 +56,8 @@ { return '<pre>' . $text . '</pre>'; } function html_raw($text) { return $text; } +function html_anchor($name) + { return '<a name="' . $name . '"></a>'; } function html_diff_old_start() { return "<table class=\"diff\"><tr><td class=\"diff-removed\">\n"; } function html_diff_new_start() Index: macros.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/macros.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- macros.php 2002/01/02 18:07:23 1.5 +++ macros.php 2002/01/02 20:20:30 1.6 @@ -229,4 +229,15 @@ return html_code($text); } + +// This macro inserts an HTML anchor into the text. +function view_macro_anchor($args) +{ + preg_match('/([-A-Za-z0-9]*)/', $args, $result); + + if($result[1] != '') + { return html_anchor($result[1]); } + else + { return ''; } +} ?> |
From: Scott M. <sm...@us...> - 2002-01-02 19:50:08
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv5962 Modified Files: index.php Log Message: Tweak post-var harvesting. Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 2002/01/02 19:44:23 1.5 +++ index.php 2002/01/02 19:50:05 1.6 @@ -50,7 +50,6 @@ $days = $HTTP_POST_VARS['days']; $discard = $HTTP_POST_VARS['discard']; $document = $HTTP_POST_VARS['document']; - $find = $HTTP_POST_VARS['find']; $hist = $HTTP_POST_VARS['hist']; $min = $HTTP_POST_VARS['min']; $nextver = $HTTP_POST_VARS['nextver']; |
From: Scott M. <sm...@us...> - 2002-01-02 19:44:26
|
Update of /cvsroot/tavi/tavi/admin In directory usw-pr-cvs1:/tmp/cvs-serv4381/admin Modified Files: index.php Log Message: Accomodate register_globals=off. Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/admin/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.php 2002/01/01 20:13:19 1.4 +++ index.php 2002/01/02 19:44:23 1.5 @@ -4,7 +4,41 @@ chdir('..'); require('lib/init.php'); require('parse/html.php'); +require('parse/transforms.php'); require('template/admin.php'); + +// If register_globals is off, we need to harvest the script parameters +// at this point. + +if(!ini_get('register_globals')) +{ + if($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'GET') + { + $locking = $HTTP_GET_VARS['locking']; + $blocking = $HTTP_GET_VARS['blocking']; + } + else if($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST') + { + $Block = $HTTP_POST_VARS['Block']; + $Unblock = $HTTP_POST_VARS['Unblock']; + $Save = $HTTP_POST_VARS['Save']; + $address = $HTTP_POST_VARS['address']; + $blocking = $HTTP_POST_VARS['blocking']; + $count = $HTTP_POST_VARS['count']; + $locking = $HTTP_POST_VARS['locking']; + + if($locking && $count > 0) + { + for($i = 1; $i <= $count; $i++) + { + $var = 'name' + $i; + $$var = $HTTP_POST_VARS[$var]; + $var = 'lock' + $i; + $$var = $HTTP_POST_VARS[$var]; + } + } + } +} if($AdminEnabled != 1) { die($ErrorAdminDisabled); } |
From: Scott M. <sm...@us...> - 2002-01-02 19:44:26
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv4381 Modified Files: ChangeLog index.php Log Message: Accomodate register_globals=off. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ChangeLog 2002/01/02 18:07:23 1.19 +++ ChangeLog 2002/01/02 19:44:23 1.20 @@ -10,6 +10,8 @@ * Fixed security hole in template system. * Tweak macro behavior wrt newlines to better facilitate in-line macros. + * Applied patch from Kimmo Suominen to accomodate + register_globals=off. 2002-01-01 Scott Moonen <sm...@an...> Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.php 2001/12/14 20:48:08 1.4 +++ index.php 2002/01/02 19:44:23 1.5 @@ -20,6 +20,46 @@ 'rss' => array('action/rss.php', 'action_rss', 'view') ); +// If register_globals is off, we need to harvest the script parameters +// at this point. + +if(!ini_get('register_globals')) +{ + $HTTP_REFERER = $HTTP_SERVER_VARS['HTTP_REFERER']; + $QUERY_STRING = $HTTP_SERVER_VARS['QUERY_STRING']; + + $action = $HTTP_GET_VARS['action']; + $page = $HTTP_GET_VARS['page']; + $ver1 = $HTTP_GET_VARS['ver1']; + $ver2 = $HTTP_GET_VARS['ver2']; + + if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'GET') + { + $find = $HTTP_GET_VARS['find']; + } + + if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST') + { + $Preview = $HTTP_POST_VARS['Preview']; + $Save = $HTTP_POST_VARS['Save']; + $archive = $HTTP_POST_VARS['archive']; + $auth = $HTTP_POST_VARS['auth']; + $categories = $HTTP_POST_VARS['categories']; + $cols = $HTTP_POST_VARS['cols']; + $comment = $HTTP_POST_VARS['comment']; + $days = $HTTP_POST_VARS['days']; + $discard = $HTTP_POST_VARS['discard']; + $document = $HTTP_POST_VARS['document']; + $find = $HTTP_POST_VARS['find']; + $hist = $HTTP_POST_VARS['hist']; + $min = $HTTP_POST_VARS['min']; + $nextver = $HTTP_POST_VARS['nextver']; + $rows = $HTTP_POST_VARS['rows']; + $tzoff = $HTTP_POST_VARS['tzoff']; + $user = $HTTP_POST_VARS['user']; + } +} + // Default action and page names. if(empty($page) && empty($action)) { $page = $QUERY_STRING; } |
From: Scott M. <sm...@us...> - 2002-01-02 18:35:54
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv18146 Modified Files: config.php Log Message: Reorganize order of configuration variables. Index: config.php =================================================================== RCS file: /cvsroot/tavi/tavi/config.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- config.php 2002/01/02 17:43:21 1.10 +++ config.php 2002/01/02 18:35:52 1.11 @@ -2,8 +2,82 @@ // $Id$ // $Admin specifies the administrator e-mail address used in error messages. -$Admin = 'mo...@ma...'; +$Admin = 'us...@ho...'; + +// If $DBPersist is not set to 0, then *persistent* database connections will +// be used. Note that this will not work with all hosting providers. +$DBPersist = 1; + +// $DBServer indicates the hostname of the server on which your database is +// located. Normally this is the same host as the script is on, in which +// case set it to ''. +$DBServer = ''; + +// $DBName indicates what database name the wiki should use. +$DBName = ''; + +// $DBUser indicates the username for database operations. +$DBUser = ''; + +// $DBPasswd indicates the pasword to use for database access. +$DBPasswd = ''; + +// $DBTablePrefix is used to start table names for the wiki's tables. If your +// hosting provider only allows you one database, you can set up multiple +// wikis in the same database by creating tables that have different prefixes. +$DBTablePrefix = ''; + +// $ScriptBase determines the location of your wiki script. It should indicate +// the full URL of the main index.php script itself. +$ScriptBase = 'http://host.net/wiki/index.php'; + +// $AdminScript indicates the location of your admin wiki script. It should +// indicate the full URL of the admin/index.php script itself. +$AdminScript = 'http://host.net/wiki/admin/index.php'; + +// $WikiName determines the name of your wiki. This name is used in the +// browser title bar. Often, it will be the same as $HomePage. +$WikiName = 'MyWiki'; + +// $HomePage determines the "main" page of your wiki. If browsers do not ask +// to see a specific page they will be shown the home page. This should be +// a wiki page name, like 'ProjectWiki'. +$HomePage = 'MyWiki'; + +// $InterWikiPrefix determines what interwiki prefix you recommend other +// wikis use to link to your wiki. Usually it is similar to your WikiName. +$InterWikiPrefix = 'MyWiki'; +// If $EnableFreeLinks is set to 1, links of the form "((page name))" will be +// turned on for this wiki. If it is set to 0, they will be disallowed. +$EnableFreeLinks = 1; + +// If $EnableWikiLinks is set to 1, normal WikiNames will be treated as links +// in this wiki. If it is set to 0, they will not be treated as links +// (forcing all pages to be linked to using free links). +$EnableWikiLinks = 1; + +// $WikiLogo determines the location of your wiki logo. If you use a template +// other than the default wiki template, you may have to set other variables +// to configure it. +$WikiLogo = '/images/logo.png'; + +// $MetaKeywords indicates what keywords to report on the meta-keywords tag. +// This is useful to indicate to help search engines find your wiki. +$MetaKeywords = 'me project wiki experiment doodle'; + +// $MetaDescription should be a sentence or two describing your wiki. Like +// $MetaKeywords, it helps search engines find your wiki. +$MetaDescription = 'Wiki devoted to my project.'; + +// $TemplateDir indicates what directory your wiki templates are located in. +// You may use this to install other templates than the default template. +$TemplateDir = 'template'; + +// $StyleSheet contains the URL for your wiki's CSS style sheet. It is +// typically a relative URL, such as '/wiki/wiki.css'. +$StyleSheet = $TemplateDir . '/wiki.css'; + // The following variables establish the format for WikiNames in this wiki. $UpperPtn = "[A-Z\xc0-\xde]"; $LowerPtn = "[a-z\xdf-\xff]"; @@ -23,15 +97,6 @@ $InterwikiPtn = "([A-Za-z0-9]+):" . "(([^ \\/\"\']*\\/)*[^ \\t\\n\\/\"\']*[\\/=&~A-Za-z0-9])"; -// If $EnableFreeLinks is set to 1, links of the form "((page name))" will be -// turned on for this wiki. If it is set to 0, they will be disallowed. -$EnableFreeLinks = 1; - -// If $EnableWikiLinks is set to 1, normal WikiNames will be treated as links -// in this wiki. If it is set to 0, they will not be treated as links -// (forcing all pages to be linked to using free links). -$EnableWikiLinks = 1; - // !!!WARNING!!! // If $AdminEnabled is set to 1, the script admin/index.php will be accessible. // This allows administrators to lock pages and block IP addresses. If you @@ -42,67 +107,17 @@ // If $AdminEnabled is set to 0, administrator control will be disallowed. $AdminEnabled = 0; -// Set $Charset to indicate the character set used for storage, editing, -// and display in your wiki. The default is "ISO-8859-1" (Latin-1). -// "utf-8" is supported, and is recommended for international text, -// however you should be cautioned that Netscape does not behave correctly -// when editing utf-8 text. Hence, "utf-8" is not currently the default. -$Charset = 'ISO-8859-1'; - // Old versions of pages will be deleted after $ExpireLen days. If $ExpireLen // is set to 0, old versions of pages (and pages set to empty) will never // be removed from the database. $ExpireLen = 14; - -// $TemplateDir indicates what directory your wiki templates are located in. -// You may use this to install other templates than the default template. -$TemplateDir = 'template'; - -// If $DBPersist is not set to 0, then *persistent* database connections will -// be used. Note that this will not work with all hosting providers. -$DBPersist = 1; - -// $DBServer indicates the host on which your database is located. Normally -// this is the same host as the script is on, in which case set it to ''. -$DBServer = 'mysql.sourceforge.net'; - -// $DBName indicates what database name the wiki should use. -$DBName = 'tavi'; - -// $DBUser indicates the username for database operations. -$DBUser = 'tavi'; - -// $DBPasswd indicates the pasword to use for database access. -$DBPasswd = ''; - -// $DBTablePrefix is used to start table names for the wiki's tables. If your -// hosting provider only allows you one database, you can set up multiple -// wikis in the same database by creating tables that have different prefixes. -$DBTablePrefix = 'wiki_'; - -// $WikiLogo determines the location of your wiki logo. If you use a template -// other than the default wiki template, you may have to set other variables -// to configure it. -$WikiLogo = '/tavi.png'; -// $StyleSheet contains the URL for your wiki's CSS style sheet. It is -// typically a relative URL, such as '/wiki/wiki.css'. -$StyleSheet = ''; - -// $WikiName determines the name of your wiki. If you use a template other -// than the default wiki template, you may have to set other variables to -// configure it. This name is used in the browser title bar. Often, it -// will be the same as $HomePage. -$WikiName = 'WikkiTikkiTavi'; - -// $HomePage determines the "main" page of your wiki. If browsers do not ask -// to see a specific page they will be shown the home page. This should be -// a wiki page name, like 'ProjectWiki'. -$HomePage = 'WikkiTikkiTavi'; - -// $InterWikiPrefix determines what interwiki prefix you recommend other -// wikis use to link to your wiki. Usually it is similar to your WikiName. -$InterWikiPrefix = 'Tavi'; +// Set $Charset to indicate the character set used for storage, editing, +// and display in your wiki. The default is "ISO-8859-1" (Latin-1). +// "utf-8" is supported, and is recommended for international text; +// however you should be cautioned that Netscape does not behave correctly +// when editing utf-8 text. Hence, "utf-8" is not currently the default. +$Charset = 'ISO-8859-1'; // $SeparateTitleWords determines whether spaces should be inserted in page // titles. If nonzero, the page title (but not header) of WikiName would @@ -170,15 +185,6 @@ // $MaxPostLen determines the size, in bytes, of the largest edit allowed. $MaxPostLen = 204800; -// $MetaKeywords indicates what keywords to report on the meta-keywords tag. -// This is useful to indicate to help search engines find your wiki. -$MetaKeywords = 'wiki php mysql database edit source gpl free software ' . - 'wikki tikki tavi wikkitikkitavi'; - -// $MetaDescription should be a sentence or two describing your wiki. Like -// $MetaKeywords, it helps search engines find your wiki. -$MetaDescription = 'Wiki devoted to the WikkiTikkiTavi wiki engine.'; - // $MaxNesting determines the maximum allowed nesting of lists. $MaxNesting = 20; @@ -303,14 +309,6 @@ 'parse_define_sisterwiki', 'parse_define_links' ); - -// $ScriptBase determines the location of your wiki script. It should indicate -// the full URL of the main index.php script itself. -$ScriptBase = 'http://tavi.sourceforge.net/playground/index.php'; - -// $AdminScript indicates the location of your admin wiki script. It should -// indicate the full URL of the admin/index.php script itself. -$AdminScript = 'http://tavi.sourceforge.net/playground/admin/index.php'; //----- // Variables and functions below this line are used to generate links to |
From: Scott M. <sm...@us...> - 2002-01-02 18:25:30
|
Update of /cvsroot/tavi/tavi/action In directory usw-pr-cvs1:/tmp/cvs-serv14548/action Modified Files: rss.php Log Message: Fix template reference. Index: rss.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/rss.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rss.php 2002/01/01 20:13:19 1.2 +++ rss.php 2002/01/02 18:25:28 1.3 @@ -1,7 +1,10 @@ <?php // $Id$ -require('template/rss.php'); +if(file_exists($TemplateDir . '/rss.php')) + { require($TemplateDir . '/rss.php'); } +else + { die; } require('parse/html.php'); require('parse/macros.php'); |
From: Scott M. <sm...@us...> - 2002-01-02 18:07:26
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv9639/parse Modified Files: html.php macros.php transforms.php Log Message: Tweak macro behavior wrt newlines. Index: html.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/html.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- html.php 2001/12/31 15:58:13 1.13 +++ html.php 2002/01/02 18:07:23 1.14 @@ -175,7 +175,7 @@ ']' . html_bold_end(); } - return $text . html_newline(); + return $text; } function html_fulllist($page, $count) { Index: macros.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/macros.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- macros.php 2001/12/18 16:57:20 1.4 +++ macros.php 2002/01/02 18:07:23 1.5 @@ -47,6 +47,8 @@ $text = $text . html_category($list[$i][0], $list[$i][1], $list[$i][2], $list[$i][3], $list[$i][5]); + if($i < count($list) - 1) // Don't put a newline on the last one. + { $text = $text . html_newline(); } } if($i < count($list)) @@ -69,6 +71,7 @@ { global $pagestore; + $first = 1; $list = $pagestore->allpages(); usort($list, 'sizeSort'); @@ -77,8 +80,13 @@ foreach($list as $page) { + if(!$first) // Don't prepend newline to first one. + { $text = $text . "\n"; } + else + { $first = 0; } + $text = $text . - $page[4] . ' ' . html_ref($page[1], $page[1]) . "\n"; + $page[4] . ' ' . html_ref($page[1], $page[1]); } return html_code($text); @@ -107,7 +115,7 @@ $text = $text . ' ' . html_ref($result[1], $result[1]); } - return html_code($text . "\n"); + return html_code($text); } // Prepare a list of pages with no incoming links. @@ -116,6 +124,7 @@ global $pagestore, $LkTbl; $text = ''; + $first = 1; $pages = $pagestore->allpages(); usort($pages, 'nameSort'); @@ -125,7 +134,14 @@ $q2 = $pagestore->dbh->query("SELECT page FROM $LkTbl " . "WHERE link='$page[1]' AND page!='$page[1]'"); if(!($r2 = $pagestore->dbh->result($q2)) || empty($r2[0])) - { $text = $text . html_ref($page[1], $page[1]) . "\n"; } + { + if(!$first) // Don't prepend newline to first one. + { $text = $text . "\n"; } + else + { $first = 0; } + + $text = $text . html_ref($page[1], $page[1]); + } } return html_code($text); @@ -137,6 +153,7 @@ global $pagestore, $LkTbl, $PgTbl; $text = ''; + $first = 1; $q1 = $pagestore->dbh->query("SELECT link, SUM(count) AS ct FROM $LkTbl " . "GROUP BY link ORDER BY ct DESC, link"); @@ -146,9 +163,15 @@ "WHERE title='$result[0]'"); if(!($r2 = $pagestore->dbh->result($q2)) || empty($r2[0])) { + if(!$first) // Don't prepend newline to first one. + { $text = $text . "\n"; } + else + { $first = 0; } + $text = $text . '(' . html_url(findURL($result[0]), $result[1]) . - ') ' . html_ref($result[0], $result[0]) . "\n"; } + ') ' . html_ref($result[0], $result[0]); + } } return html_code($text); @@ -160,13 +183,19 @@ global $pagestore, $LkTbl; $text = ''; + $first = 1; $q1 = $pagestore->dbh->query("SELECT page, SUM(count) AS ct FROM $LkTbl " . "GROUP BY page ORDER BY ct DESC, page"); while(($result = $pagestore->dbh->result($q1))) { + if(!$first) // Don't prepend newline to first one. + { $text = $text . "\n"; } + else + { $first = 0; } + $text = $text . - '(' . $result[1] . ') ' . html_ref($result[0], $result[0]) . "\n"; + '(' . $result[1] . ') ' . html_ref($result[0], $result[0]); } return html_code($text); @@ -178,6 +207,7 @@ global $pagestore, $LkTbl, $PgTbl; $text = ''; + $first = 1; $q1 = $pagestore->dbh->query("SELECT link, SUM(count) AS ct FROM $LkTbl " . "GROUP BY link ORDER BY ct DESC, link"); while(($result = $pagestore->dbh->result($q1))) @@ -186,9 +216,14 @@ "WHERE title='$result[0]'"); if(($r2 = $pagestore->dbh->result($q2)) && !empty($r2[0])) { + if(!$first) // Don't prepend newline to first one. + { $text = $text . "\n"; } + else + { $first = 0; } + $text = $text . '(' . html_url(findURL($result[0]), $result[1]) . ') ' . - html_ref($result[0], $result[0]) . "\n"; + html_ref($result[0], $result[0]); } } Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- transforms.php 2002/01/01 18:36:54 1.13 +++ transforms.php 2002/01/02 18:07:23 1.14 @@ -142,7 +142,7 @@ function parse_macros($text) { - return preg_replace('/\\[\\[([^] ]+( [^]]+)?)]](\\n)?/e', + return preg_replace('/\\[\\[([^] ]+( [^]]+)?)]]/e', "macro_token(q1('\\1'), q1('\\3'))", $text, -1); } |
From: Scott M. <sm...@us...> - 2002-01-02 18:07:26
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv9639 Modified Files: ChangeLog Log Message: Tweak macro behavior wrt newlines. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChangeLog 2002/01/02 17:43:21 1.18 +++ ChangeLog 2002/01/02 18:07:23 1.19 @@ -8,6 +8,8 @@ * Introduced new option to $SeparateTitleWords in page titles. * Refactored common code in default template. * Fixed security hole in template system. + * Tweak macro behavior wrt newlines to better facilitate in-line + macros. 2002-01-01 Scott Moonen <sm...@an...> |
From: Scott M. <sm...@us...> - 2002-01-02 17:48:47
|
Update of /cvsroot/tavi/tavi/template In directory usw-pr-cvs1:/tmp/cvs-serv5010/template Modified Files: diff.php find.php history.php Log Message: Code trimming. Index: diff.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/diff.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- diff.php 2002/01/02 17:43:24 1.7 +++ diff.php 2002/01/02 17:48:43 1.8 @@ -17,8 +17,6 @@ function template_diff($args) { - global $FindScript; - template_common_prologue(array('norobots' => 1, 'title' => 'Differences in ' . $args['page'], 'heading' => 'Differences in ', Index: find.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/find.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- find.php 2002/01/02 17:43:24 1.7 +++ find.php 2002/01/02 17:48:43 1.8 @@ -15,8 +15,6 @@ function template_find($args) { - global $FindScript; - template_common_prologue(array('norobots' => 1, 'title' => 'Find ' . $args['find'], 'heading' => 'Find ' . $args['find'], Index: history.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/history.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- history.php 2002/01/02 17:43:24 1.8 +++ history.php 2002/01/02 17:48:43 1.9 @@ -15,7 +15,7 @@ function template_history($args) { - global $FindScript, $DiffScript; + global $DiffScript; template_common_prologue(array('norobots' => 1, 'title' => 'History of ' . $args['page'], |
From: Scott M. <sm...@us...> - 2002-01-02 17:43:29
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv3564 Modified Files: ChangeLog config.php Log Message: Refactor default template. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ChangeLog 2002/01/01 20:13:19 1.17 +++ ChangeLog 2002/01/02 17:43:21 1.18 @@ -3,6 +3,12 @@ WikkiTikkiTavi - ChangeLog -------------------------- +2002-01-02 Scott Moonen <sm...@an...> + + * Introduced new option to $SeparateTitleWords in page titles. + * Refactored common code in default template. + * Fixed security hole in template system. + 2002-01-01 Scott Moonen <sm...@an...> * Change raw HTML processing to allow <html> tags to be uppercase. Index: config.php =================================================================== RCS file: /cvsroot/tavi/tavi/config.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- config.php 2001/12/28 18:32:42 1.9 +++ config.php 2002/01/02 17:43:21 1.10 @@ -104,6 +104,12 @@ // wikis use to link to your wiki. Usually it is similar to your WikiName. $InterWikiPrefix = 'Tavi'; +// $SeparateTitleWords determines whether spaces should be inserted in page +// titles. If nonzero, the page title (but not header) of WikiName would +// show 'Wiki Name' instead. Pages that have free link titles will not +// be changed. +$SeparateTitleWords = 1; + // $CookieName determines the name of the cookie that browser preferences // (like user name, etc.) are stored in. $CookieName = 'prefs'; |
Update of /cvsroot/tavi/tavi/template In directory usw-pr-cvs1:/tmp/cvs-serv3564/template Modified Files: admin.php conflict.php diff.php edit.php find.php history.php prefs.php preview.php view.php Added Files: common.php Log Message: Refactor default template. --- NEW FILE: common.php --- <?php // $Id: common.php,v 1.1 2002/01/02 17:43:24 smoonen Exp $ // This function generates the common prologue and header // for the various templates. // // Its parameters are passed as an associative array with the following // members: // // 'norobots' => An integer; if nonzero, robots will be forbidden to // index the page or follow links from the page. // 'title' => A string containing the page title. This function // will append ' - WikiName' to the title. // 'heading' => A string containing the page's heading. // 'headlink' => A string. If not empty, it will be appended to the // page's heading as a link to find the contents of the // string in the database. // 'headsufx' => A string containing the heading suffix. If not // empty, it will be printed after the heading link. // 'toolbar' => An integer; if nonzero, the toolbar will be displayed. function template_common_prologue($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $StyleSheet, $SeparateTitleWords, $UpperPtn; if($SeparateTitleWords && validate_page($args['title']) == 1) { $args['title'] = preg_replace("/(.)($UpperPtn)/", "\\1 \\2", $args['title'], -1); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <?php if($args['norobots']) { ?> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <?php } ?> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> <title><?php print $args['title'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> <div class="logo"> <a href="<?php print viewURL($HomePage); ?>"><img src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> <?php print $args['heading']; if($args['headlink'] != '') { ?> <a class="title" href="<?php print findURL($args['headlink']); ?>"> <?php print $args['headlink']; ?></a> <?php } print $args['headsufx']; ?> </h1> <?php if($args['toolbar']) { print html_toolbar_top(); } ?> <hr /> </div> <?php } // This function generates the common prologue and header // for the various templates. // // Its parameters are passed as an associative array with the following // members: // // 'twin' => A string containing the page's name; if not empty, // twin pages will be sought and printed. // 'edit' => A string containing the page's name; if not empty, // an edit link will be printed. // 'editver' => An integer containing the page's version; if not // zero, the edit link will be directed at the given // version. If it is -1, the page cannot be edited, // and a message to that effect will be printed. // 'history' => A string containing the page's name; if not empty, // a history link will be printed. // 'timestamp' => Timestamp for the page. If not empty, a 'document // last modified' note will be printed. function template_common_epilogue($args) { global $FindScript, $pagestore; ?> <div id="footer"> <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> <?php if($args['edit']) { if($args['editver'] == 0) { ?> <a href="<?php print editURL($args['edit']); ?>">Edit this document</a><?php } else if($args['editver'] == -1) { ?> This document cannot be edited <?php } else { ?> <a href="<?php print editURL($args['edit'], $args['editver']); ?>"> Edit this <em>ARCHIVE VERSION</em> of this document</a> <?php } if($args['history']) { print ' | '; } } if($args['history']) { ?> <a href="<?php print historyURL($args['history']); ?>">View document history</a><br /> <?php } if($args['timestamp']) { ?> Document last modified <?php print html_time($args['timestamp']); ?><br /> <?php } if($args['twin'] != '') { if(count($twin = $pagestore->twinpages($args['twin']))) { ?>Twin pages: <?php for($i = 0; $i < count($twin); $i++) { print html_twin($twin[$i][0], $twin[$i][1]) . ' '; } ?> <br /><?php } } ?> <input type="hidden" name="action" value="find" /> Search: <input type="text" name="find" size="20" /> </div> </form> </div> </body> </html> <?php } ?> Index: admin.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/admin.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- admin.php 2002/01/01 20:13:19 1.6 +++ admin.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The admin template is passed an associative array with the following // elements: // @@ -9,29 +14,14 @@ function template_admin($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $StyleSheet; + template_common_prologue(array('norobots' => 1, + 'title' => 'Administration', + 'heading' => 'Administration', + 'headlink' => '', + 'headsufx' => '', + 'toolbar' => 0)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Administering <?php print $WikiName; ?></title> -</head> -<body> <div id="body"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1>Administering <?php print $WikiName; ?></h1> -<hr /> -<div id="page"> <?php print $args['html']; ?> </div> <hr /> Index: conflict.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/conflict.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- conflict.php 2002/01/01 20:13:19 1.6 +++ conflict.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The conflict template is passed an associative array with the following // elements: // @@ -16,33 +21,15 @@ function template_conflict($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $EditRows, $EditCols, $UserName, $PrefsScript, $StyleSheet; + global $EditRows, $EditCols, $UserName, $PrefsScript; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Editing ' . $args['page'], + 'heading' => 'Editing ', + 'headlink' => $args['page'], + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Editing <?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - Editing <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <p class="warning"> Warning: since you started editing, this document has been changed by someone @@ -86,19 +73,11 @@ print $args['html']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> - <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> - Document last modified <?php print html_time($args['timestamp']); ?><br /> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => '', + 'editver' => 0, + 'history' => $args['page'], + 'timestamp' => $args['timestamp'])); } ?> Index: diff.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/diff.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- diff.php 2002/01/01 20:13:19 1.6 +++ diff.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The diff template is passed an associative array with the following // elements: // @@ -12,63 +17,26 @@ function template_diff($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $FindScript, $StyleSheet; + global $FindScript; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Differences in ' . $args['page'], + 'heading' => 'Differences in ', + 'headlink' => $args['page'], + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title><?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <strong>Difference between versions:</strong><br /><br /> <?php print $args['diff_html']; ?> <hr /> <?php print $args['html']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> -<?php - if($args['editable']) - { -?> <a href="<?php print editURL($args['page']); ?>">Edit this document</a> -<?php - } - else - { -?> This document cannot be edited -<?php - } -?> | <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> - Document last modified <?php print html_time($args['timestamp']); ?><br /> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => $args['page'], + 'editver' => $args['editable'] ? 0 : -1, + 'history' => $args['page'], + 'timestamp' => $args['timestamp'])); } ?> Index: edit.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/edit.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- edit.php 2002/01/01 20:13:19 1.6 +++ edit.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The edit template is passed an associative array with the following // elements: // @@ -13,33 +18,15 @@ function template_edit($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $EditRows, $EditCols, $UserName, $PrefsScript, $StyleSheet; + global $EditRows, $EditCols, $UserName, $PrefsScript; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Editing ' . $args['page'], + 'heading' => 'Editing ', + 'headlink' => $args['page'], + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Editing <?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - Editing <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <form method="post" action="<?php print saveURL($args['page']); ?>"> <div class="form"> @@ -71,19 +58,11 @@ </div> </form> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> - <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> - Document last modified <?php print html_time($args['timestamp']); ?><br /> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => '', + 'editver' => '', + 'history' => $args['page'], + 'timestamp' => $args['timestamp'])); } ?> Index: find.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/find.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- find.php 2002/01/01 20:13:19 1.6 +++ find.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The find template is passed an associative array with the following // elements: // @@ -10,44 +15,23 @@ function template_find($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $FindScript, $StyleSheet; + global $FindScript; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Find ' . $args['find'], + 'heading' => 'Find ' . $args['find'], + 'headlink' => '', + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Find <?php print $args['find'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1>Find <?php print $args['find']; ?></h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <?php print $args['pages']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => '', + 'edit' => '', + 'editver' => 0, + 'history' => '', + 'timestamp' => '')); } ?> Index: history.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/history.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- history.php 2002/01/01 20:13:19 1.7 +++ history.php 2002/01/02 17:43:24 1.8 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The history template is passed an associative array with the following // elements: // @@ -10,33 +15,15 @@ function template_history($args) { - global $FindScript, $DiffScript, $WikiName, $HomePage, $WikiLogo; - global $StyleSheet; + global $FindScript, $DiffScript; + + template_common_prologue(array('norobots' => 1, + 'title' => 'History of ' . $args['page'], + 'heading' => 'History of ', + 'headlink' => $args['page'], + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>History of <?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - History of <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <form method="get" action="<?php print $DiffScript; ?>"> <div class="form"> @@ -60,17 +47,11 @@ <?php print $args['diff']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => '', + 'editver' => 0, + 'history' => '', + 'timestamp' => '')); } ?> Index: prefs.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/prefs.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- prefs.php 2001/12/31 15:58:13 1.6 +++ prefs.php 2002/01/02 17:43:24 1.7 @@ -1,32 +1,23 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + function template_prefs() { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $PrefsScript, $HTTP_REFERER, $HistMax, $TimeZoneOff, $StyleSheet; + global $PrefsScript, $HTTP_REFERER, $HistMax, $TimeZoneOff; global $AuthorDiff, $EditRows, $EditCols, $UserName, $DayLimit, $MinEntries; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Preferences', + 'heading' => 'Preferences', + 'headlink' => '', + 'headsufx' => '', + 'toolbar' => 0)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Preferences - <?php print $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1>Preferences</h1> -<hr /> -</div> <div id="body"> <form action="<?php print $PrefsScript; ?>" method="post"> <div class="form"> Index: preview.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/preview.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- preview.php 2002/01/01 20:13:19 1.6 +++ preview.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The preview template is passed an associative array with the following // elements: // @@ -14,34 +19,15 @@ function template_preview($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $EditRows, $EditCols, $categories, $UserName, $comment, $PrefsScript; - global $StyleSheet; + + template_common_prologue(array('norobots' => 1, + 'title' => 'Previewing ' . $args['page'], + 'heading' => 'Previewing ', + 'headlink' => $args['page'], + 'headsufx' => '', + 'toolbar' => 1)); ?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Previewing <?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - Previewing <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <form method="post" action="<?php print saveURL($args['page']); ?>"> <div class="form"> @@ -78,19 +64,11 @@ <hr /> <?php print $args['html']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> - <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> - Document last modified <?php print html_time($args['timestamp']); ?><br /> - <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => '', + 'editver' => 0, + 'history' => $args['page'], + 'timestamp' => $args['timestamp'])); } ?> Index: view.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/view.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- view.php 2002/01/01 20:13:19 1.6 +++ view.php 2002/01/02 17:43:24 1.7 @@ -1,6 +1,11 @@ <?php // $Id$ +if(file_exists($TemplateDir . '/common.php')) + { require($TemplateDir . '/common.php'); } +else + { die; } + // The view template is passed an associative array with the following // elements: // @@ -14,81 +19,26 @@ function template_view($args) { - global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; - global $FindScript, $pagestore, $StyleSheet; -?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns = "http://www.w3.org/1999/xhtml"> -<head> -<meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> -<meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" -/><?php - if($args['archive']) - {?> -<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /><?php - }?> -<link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title><?php print $args['page'] . ' - ' . $WikiName; ?></title> -</head> -<body> -<div id="header"> - <div class="logo"> - <a href="<?php print viewURL($HomePage); ?>"><img - src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> - </div> - <h1> - <a class="title" href="<?php print findURL($args['page']); ?>"> - <?php print $args['page']; ?></a> - <?php - if($args['archive']) - { print '(' . html_timestamp($args['timestamp']) . ')'; } + template_common_prologue(array('norobots' => $args['archive'], + 'title' => $args['page'], + 'heading' => '', + 'headlink' => $args['page'], + 'headsufx' => $args['archive'] ? + ' (' . html_timestamp($args['timestamp']) . ')' + : '', + 'toolbar' => 1)); + ?> - </h1> -<?php print html_toolbar_top(); ?> -<hr /> -</div> <div id="body"> <?php print $args['html']; ?> </div> -<div id="footer"> -<hr /> -<form method="get" action="<?php print $FindScript; ?>"> -<div class="form"> -<?php - if($args['editable']) - { - if(!$args['archive']) - { -?> <a href="<?php print editURL($args['page']); ?>">Edit this document</a><?php - } - else - { -?> <a href="<?php print editURL($args['page'], $args['version']); ?>"> - Edit this <em>ARCHIVE VERSION</em> of this document</a><?php - } - } - else - { -?> This document cannot be edited -<?php } -?> | <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> - Document last modified <?php print html_time($args['timestamp']); ?><br /><?php - if(count($twin = $pagestore->twinpages($args['page']))) - { -?>Twin pages: <?php - for($i = 0; $i < count($twin); $i++) - { print html_twin($twin[$i][0], $twin[$i][1]) . ' '; } ?> -<br /><?php - } -?> <input type="hidden" name="action" value="find" /> - Search: <input type="text" name="find" size="20" /> -</div> -</form> -</div> -</body> -</html> <?php + template_common_epilogue(array('twin' => $args['page'], + 'edit' => $args['page'], + 'editver' => !$args['editable'] ? -1 + : ($args['archive'] + ? $args['version'] : 0), + 'history' => $args['page'], + 'timestamp' => $args['timestamp'])); } ?> |
From: Scott M. <sm...@us...> - 2002-01-02 17:43:29
|
Update of /cvsroot/tavi/tavi/action In directory usw-pr-cvs1:/tmp/cvs-serv3564/action Modified Files: conflict.php diff.php edit.php find.php history.php prefs.php preview.php save.php view.php Log Message: Refactor default template. Index: conflict.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/conflict.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- conflict.php 2002/01/01 20:13:19 1.4 +++ conflict.php 2002/01/02 17:43:24 1.5 @@ -1,7 +1,10 @@ <?php // $Id$ -require($TemplateDir . '/conflict.php'); +if(file_exists($TemplateDir . '/conflict.php')) + { require($TemplateDir . '/conflict.php'); } +else + { die; } // Conflict editor. Someone accidentally almost overwrote something someone // else just saved. Index: diff.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/diff.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- diff.php 2002/01/01 20:13:19 1.4 +++ diff.php 2002/01/02 17:43:24 1.5 @@ -4,7 +4,10 @@ require('parse/main.php'); require('parse/macros.php'); require('parse/html.php'); -require($TemplateDir . '/diff.php'); +if(file_exists($TemplateDir . '/diff.php')) + { require($TemplateDir . '/diff.php'); } +else + { die; } require('lib/diff.php'); // Compute difference between two versions of a page. Index: edit.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/edit.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- edit.php 2002/01/01 20:13:19 1.4 +++ edit.php 2002/01/02 17:43:24 1.5 @@ -2,7 +2,10 @@ // $Id$ require('parse/html.php'); -require($TemplateDir . '/edit.php'); +if(file_exists($TemplateDir . '/edit.php')) + { require($TemplateDir . '/edit.php'); } +else + { die; } // Edit a page (possibly an archive version). function action_edit() Index: find.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/find.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- find.php 2002/01/01 20:13:19 1.4 +++ find.php 2002/01/02 17:43:24 1.5 @@ -2,7 +2,10 @@ // $Id$ require('parse/html.php'); -require($TemplateDir . '/find.php'); +if(file_exists($TemplateDir . '/find.php')) + { require($TemplateDir . '/find.php'); } +else + { die; } // Find a string in the database. function action_find() Index: history.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/history.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- history.php 2002/01/01 20:13:19 1.4 +++ history.php 2002/01/02 17:43:24 1.5 @@ -5,7 +5,10 @@ require('parse/macros.php'); require('parse/html.php'); require('lib/diff.php'); -require($TemplateDir . '/history.php'); +if(file_exists($TemplateDir . '/history.php')) + { require($TemplateDir . '/history.php'); } +else + { die; } require('lib/headers.php'); // Display the known history of a page's edits. Index: prefs.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/prefs.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- prefs.php 2001/12/14 21:04:03 1.4 +++ prefs.php 2002/01/02 17:43:24 1.5 @@ -1,7 +1,10 @@ <?php // $Id$ -require($TemplateDir . '/prefs.php'); +if(file_exists($TemplateDir . '/prefs.php')) + { require($TemplateDir . '/prefs.php'); } +else + { die; } // View or set a user's preferences. function action_prefs() Index: preview.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/preview.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- preview.php 2002/01/01 20:13:19 1.4 +++ preview.php 2002/01/02 17:43:24 1.5 @@ -1,7 +1,10 @@ <?php // $Id$ -require($TemplateDir . '/preview.php'); +if(file_exists($TemplateDir . '/preview.php')) + { require($TemplateDir . '/preview.php'); } +else + { die; } // Preview what a page will look like when it is saved. function action_preview() Index: save.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/save.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- save.php 2002/01/01 20:13:19 1.4 +++ save.php 2002/01/02 17:43:24 1.5 @@ -1,7 +1,10 @@ <?php // $Id$ -require($TemplateDir . '/save.php'); +if(file_exists($TemplateDir . '/save.php')) + { require($TemplateDir . '/save.php'); } +else + { die; } require('lib/category.php'); require('parse/save.php'); Index: view.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/view.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- view.php 2002/01/01 20:13:19 1.4 +++ view.php 2002/01/02 17:43:24 1.5 @@ -4,7 +4,10 @@ require('parse/main.php'); require('parse/macros.php'); require('parse/html.php'); -require($TemplateDir . '/view.php'); +if(file_exists($TemplateDir . '/view.php')) + { require($TemplateDir . '/view.php'); } +else + { die; } require('lib/headers.php'); // Parse and display a page. |
From: Scott M. <sm...@us...> - 2002-01-01 20:13:23
|
Update of /cvsroot/tavi/tavi/action In directory usw-pr-cvs1:/tmp/cvs-serv14266/action Modified Files: conflict.php diff.php edit.php find.php history.php preview.php rss.php save.php view.php Log Message: Rework templates to use associative array instead of hard-coded parameters. Index: conflict.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/conflict.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- conflict.php 2001/11/30 07:49:32 1.3 +++ conflict.php 2002/01/01 20:13:19 1.4 @@ -12,7 +12,11 @@ $pg = $pagestore->page($page); $pg->read(); - template_conflict($page, $pg->text, parseText($pg->text, $ParseEngine), - $document, $pg->time, $pg->version + 1); + template_conflict(array('page' => $page, + 'text' => $pg->text, + 'html' => parseText($pg->text, $ParseEngine), + 'usertext' => $document, + 'timestamp' => $pg->time, + 'nextver' => $pg->version + 1)); } ?> Index: diff.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/diff.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- diff.php 2001/11/30 07:49:32 1.3 +++ diff.php 2002/01/01 20:13:19 1.4 @@ -19,7 +19,10 @@ $diff = diff_compute($p1->read(), $p2->read()); - template_diff($page, diff_parse($diff), parseText($p2->text, $ParseEngine), - $p2->mutable, $p2->time); + template_diff(array('page' => $page, + 'diff_html' => diff_parse($diff), + 'html' => parseText($p2->text, $ParseEngine), + 'editable' => $p2->mutable, + 'timestamp' => $p2->time)); } ?> Index: edit.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/edit.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- edit.php 2001/11/30 07:49:32 1.3 +++ edit.php 2002/01/01 20:13:19 1.4 @@ -23,6 +23,10 @@ $archive = 1; } - template_edit($page, $pg->text, $pg->time, $pg->version + 1, $archive); + template_edit(array('page' => $page, + 'text' => $pg->text, + 'timestamp' => $pg->time, + 'nextver' => $pg->version + 1, + 'archive' => $archive)); } ?> Index: find.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/find.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- find.php 2001/11/30 07:49:32 1.3 +++ find.php 2002/01/01 20:13:19 1.4 @@ -15,6 +15,7 @@ foreach($list as $page) { $text = $text . html_ref($page, $page) . html_newline(); } - template_find($find, $text); + template_find(array('find' => $find, + 'pages' => $text)); } ?> Index: history.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/history.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- history.php 2001/11/30 07:49:32 1.3 +++ history.php 2002/01/01 20:13:19 1.4 @@ -57,6 +57,8 @@ $p2->version = $latest_ver; $diff = diff_compute($p1->read(), $p2->read()); - template_history($page, $text, diff_parse($diff)); + template_history(array('page' => $page, + 'history' => $text, + 'diff' => diff_parse($diff))); } ?> Index: preview.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/preview.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- preview.php 2001/11/30 07:49:32 1.3 +++ preview.php 2002/01/01 20:13:19 1.4 @@ -7,11 +7,17 @@ function action_preview() { global $ParseEngine, $archive; - global $page, $document, $nextver; + global $page, $document, $nextver, $pagestore; $document = str_replace("\r", "", $document); + $pg = $pagestore->page($page); + $pg->read(); - template_preview($page, $document, parseText($document, $ParseEngine), - $nextver, $archive); + template_preview(array('page' => $page, + 'text' => $document, + 'html' => parseText($document, $ParseEngine), + 'timestamp' => $pg->time, + 'nextver' => $nextver, + 'archive' => $archive)); } ?> Index: rss.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/rss.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rss.php 2001/12/14 20:50:30 1.1 +++ rss.php 2002/01/01 20:13:19 1.2 @@ -50,7 +50,8 @@ ' </item>' . "\n"; } - template_rss($itemseq, $itemdesc); + template_rss(array('itemseq' => $itemseq, + 'itemdesc' => $itemdesc)); } ?> Index: save.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/save.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- save.php 2001/11/30 07:49:32 1.3 +++ save.php 2002/01/01 20:13:19 1.4 @@ -65,7 +65,8 @@ add_to_category($page, $categories); } - template_save($page, $document); + template_save(array('page' => $page, + 'text' => $document)); parseText($document, $SaveMacroEngine); // Save processing (e.g., interwiki). Index: view.php =================================================================== RCS file: /cvsroot/tavi/tavi/action/view.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- view.php 2001/11/30 07:49:32 1.3 +++ view.php 2002/01/01 20:13:19 1.4 @@ -19,7 +19,11 @@ gen_headers($pg->time); - template_view($page, parseText($pg->text, $ParseEngine), - $pg->mutable, $pg->time, $version != '', $pg->version); + template_view(array('page' => $page, + 'html' => parseText($pg->text, $ParseEngine), + 'editable' => $pg->mutable, + 'timestamp' => $pg->time, + 'archive' => $version != '', + 'version' => $pg->version)); } ?> |
From: Scott M. <sm...@us...> - 2002-01-01 20:13:23
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv14266 Modified Files: ChangeLog Log Message: Rework templates to use associative array instead of hard-coded parameters. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ChangeLog 2002/01/01 18:36:54 1.16 +++ ChangeLog 2002/01/01 20:13:19 1.17 @@ -6,6 +6,9 @@ 2002-01-01 Scott Moonen <sm...@an...> * Change raw HTML processing to allow <html> tags to be uppercase. + * Rework templates so parameters are passed as an associative array, + rather than a hard-coded set of parameters. This will allow for + much more flexible extensibility. 2001-12-31 Scott Moonen <sm...@an...> |
Update of /cvsroot/tavi/tavi/template In directory usw-pr-cvs1:/tmp/cvs-serv14266/template Modified Files: admin.php conflict.php diff.php edit.php find.php history.php preview.php rss.php save.php view.php wiki.css Log Message: Rework templates to use associative array instead of hard-coded parameters. Index: admin.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/admin.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- admin.php 2001/12/31 15:58:13 1.5 +++ admin.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,13 @@ <?php // $Id$ -function template_admin($html) +// The admin template is passed an associative array with the following +// elements: +// +// html => A string containing the XHTML markup of the form to be +// displayed. + +function template_admin($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $StyleSheet; @@ -26,7 +32,7 @@ <h1>Administering <?php print $WikiName; ?></h1> <hr /> <div id="page"> -<?php print $html; ?> +<?php print $args['html']; ?> </div> <hr /> </div> Index: conflict.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/conflict.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- conflict.php 2001/12/31 15:58:13 1.5 +++ conflict.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,20 @@ <?php // $Id$ -function template_conflict($page, $text, $html, $usertext, $time, $nextver) +// The conflict template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being edited. +// text => A string containing the wiki markup of the version that was +// saved while the user was editing the page. +// html => A string containing the XHTML markup of the version of the +// page that was saved while the user was editing the page. +// usertext => A string containing the wiki markup of the text the user +// tried to save. +// timestamp => Timestamp of last edit to page. +// nextver => An integer; the expected version of this document when saved. + +function template_conflict($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $EditRows, $EditCols, $UserName, $PrefsScript, $StyleSheet; @@ -15,7 +28,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Editing <?php print $page . ' - ' . $WikiName; ?></title> +<title>Editing <?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -24,19 +37,19 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - Editing <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + Editing <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> </h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> -<font color="ff3f3f"> +<p class="warning"> Warning: since you started editing, this document has been changed by someone else. Please merge your edits into the current version of this document. -</font> +</p> <h1>Current Version</h1> -<form method="post" action="<?php print saveURL($page); ?>"> +<form method="post" action="<?php print saveURL($args['page']); ?>"> <div class="form"> <input type="submit" name="Save" value="Save" /> <input type="submit" name="Preview" value="Preview" /> @@ -49,11 +62,11 @@ user name<?php } ?><br /> - <input type="hidden" name="nextver" value="<?php print $nextver; ?>" /> + <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?>" /> <textarea name="document" rows="<?php print $EditRows; ?>" cols="<?php print $EditCols; ?>" wrap="virtual"><?php - print str_replace('<', '<', str_replace('&', '&', $text)); + print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?></textarea><br /> Summary of change: <input type="text" name="comment" size="40" value="" /><br /> @@ -64,21 +77,21 @@ <textarea name="discard" rows="<?php print $EditRows; ?>" cols="<?php print $EditCols; ?>" wrap="virtual"><?php - print str_replace('<', '<', str_replace('&', '&', $usertext)); + print str_replace('<', '<', str_replace('&', '&', $args['usertext'])); ?></textarea><br /> </div> </form> <h1>Preview of Current Version</h1> <?php - print $html; + print $args['html']; ?> </div> <div id="footer"> <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> - <a href="<?php print historyURL($page); ?>">View document history</a><br /> - Document last modified <?php print html_time($time); ?><br /> + <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> + Document last modified <?php print html_time($args['timestamp']); ?><br /> <input type="hidden" name="action" value="find" /> Search: <input type="text" name="find" size="20" /> </div> Index: diff.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/diff.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- diff.php 2001/12/31 15:58:13 1.5 +++ diff.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,16 @@ <?php // $Id$ -function template_diff($page, $diff_html, $html, $editable, $time) +// The diff template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being viewed. +// diff_html => A string containing the XHTML markup for the differences. +// html => A string containing the XHTML markup for the page itself. +// editable => An integer. Will be nonzero if user is allowed to edit page. +// timestamp => Timestamp of last edit to page. + +function template_diff($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $FindScript, $StyleSheet; @@ -15,7 +24,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title><?php print $page . ' - ' . $WikiName; ?></title> +<title><?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -24,26 +33,26 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> </h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> <strong>Difference between versions:</strong><br /><br /> -<?php print $diff_html; ?> +<?php print $args['diff_html']; ?> <hr /> -<?php print $html; ?> +<?php print $args['html']; ?> </div> <div id="footer"> <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> <?php - if($editable) + if($args['editable']) { -?> <a href="<?php print editURL($page); ?>">Edit this document</a> +?> <a href="<?php print editURL($args['page']); ?>">Edit this document</a> <?php } else @@ -51,8 +60,8 @@ ?> This document cannot be edited <?php } -?> | <a href="<?php print historyURL($page); ?>">View document history</a><br /> - Document last modified <?php print html_time($time); ?><br /> +?> | <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> + Document last modified <?php print html_time($args['timestamp']); ?><br /> <input type="hidden" name="action" value="find" /> Search: <input type="text" name="find" size="20" /> </div> Index: edit.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/edit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- edit.php 2001/12/31 15:58:13 1.5 +++ edit.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,17 @@ <?php // $Id$ -function template_edit($page, $text, $time, $nextver, $archive) +// The edit template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being edited. +// text => A string containing the wiki markup of the wiki page. +// timestamp => Timestamp of last edit to page. +// nextver => An integer; the expected version of this document when saved. +// archive => An integer. Will be nonzero if this is not the most recent +// version of the page. + +function template_edit($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $EditRows, $EditCols, $UserName, $PrefsScript, $StyleSheet; @@ -15,7 +25,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Editing <?php print $page . ' - ' . $WikiName; ?></title> +<title>Editing <?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -24,14 +34,14 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - Editing <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + Editing <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> </h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> -<form method="post" action="<?php print saveURL($page); ?>"> +<form method="post" action="<?php print saveURL($args['page']); ?>"> <div class="form"> <input type="submit" name="Save" value="Save" /> <input type="submit" name="Preview" value="Preview" /> @@ -44,15 +54,15 @@ user name<?php } ?><br /> - <input type="hidden" name="nextver" value="<?php print $nextver; ?>" /> -<?php if($archive) + <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?>" /> +<?php if($args['archive']) {?> <input type="hidden" name="archive" value="1" /> <?php }?> <textarea name="document" rows="<?php print $EditRows; ?>" cols="<?php print $EditCols; ?>" wrap="virtual"><?php - print str_replace('<', '<', str_replace('&', '&', $text)); + print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?></textarea><br /> Summary of change: <input type="text" name="comment" size="40" value="" /><br /> @@ -65,8 +75,8 @@ <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> - <a href="<?php print historyURL($page); ?>">View document history</a><br /> - Document last modified <?php print html_time($time); ?><br /> + <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> + Document last modified <?php print html_time($args['timestamp']); ?><br /> <input type="hidden" name="action" value="find" /> Search: <input type="text" name="find" size="20" /> </div> Index: find.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/find.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- find.php 2001/12/31 15:58:13 1.5 +++ find.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,14 @@ <?php // $Id$ -function template_find($find, $pages) +// The find template is passed an associative array with the following +// elements: +// +// find => A string containing the text that was searched for. +// pages => A string containing the XHTML markup for the list of pages +// found containing the given text. + +function template_find($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $FindScript, $StyleSheet; @@ -15,7 +22,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Find <?php print $find . ' - ' . $WikiName; ?></title> +<title>Find <?php print $args['find'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -23,12 +30,12 @@ <a href="<?php print viewURL($HomePage); ?>"><img src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> - <h1>Find <?php print $find; ?></h1> + <h1>Find <?php print $args['find']; ?></h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> -<?php print $pages; ?> +<?php print $args['pages']; ?> </div> <div id="footer"> <hr /> Index: history.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/history.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- history.php 2001/12/31 15:58:13 1.6 +++ history.php 2002/01/01 20:13:19 1.7 @@ -1,7 +1,14 @@ <?php // $Id$ -function template_history($page, $history, $diff) +// The history template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page. +// history => A string containing the XHTML markup for the history form. +// diff => A string containing the XHTML markup for the changes made. + +function template_history($args) { global $FindScript, $DiffScript, $WikiName, $HomePage, $WikiLogo; global $StyleSheet; @@ -15,7 +22,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>History of <?php print $page . ' - ' . $WikiName; ?></title> +<title>History of <?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -24,8 +31,8 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - History of <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + History of <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> </h1> <?php print html_toolbar_top(); ?> <hr /> @@ -34,12 +41,12 @@ <form method="get" action="<?php print $DiffScript; ?>"> <div class="form"> <input type="hidden" name="action" value="diff" /> - <input type="hidden" name="page" value="<?php print $page; ?>" /> + <input type="hidden" name="page" value="<?php print $args['page']; ?>" /> <table border="0"> <tr><td><strong>Older</strong></td> <td><strong>Newer</strong></td><td></td></tr> <?php - print $history; + print $args['history']; ?> <tr><td colspan="3"> @@ -51,7 +58,7 @@ <strong>Changes by last author:</strong><br /><br /> -<?php print $diff; ?> +<?php print $args['diff']; ?> </div> <div id="footer"> <hr /> Index: preview.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/preview.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- preview.php 2001/12/31 15:58:13 1.5 +++ preview.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,18 @@ <?php // $Id$ -function template_preview($page, $text, $html, $nextver, $archive) +// The preview template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being viewed. +// text => A string containing the wiki markup of the wiki page. +// html => A string containing the XHTML rendering of the wiki page. +// timestamp => Timestamp of last edit to page. +// nextver => An integer; the expected version of this document when saved. +// archive => An integer. Will be nonzero if this is not the most recent +// version of the page. + +function template_preview($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $EditRows, $EditCols, $categories, $UserName, $comment, $PrefsScript; @@ -16,7 +27,7 @@ <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title>Previewing <?php print $page . ' - ' . $WikiName; ?></title> +<title>Previewing <?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -25,14 +36,14 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - Previewing <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + Previewing <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> </h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> -<form method="post" action="<?php print saveURL($page); ?>"> +<form method="post" action="<?php print saveURL($args['page']); ?>"> <div class="form"> <input type="submit" name="Save" value="Save" /> <input type="submit" name="Preview" value="Preview" /> @@ -45,15 +56,15 @@ user name<?php } ?><br /> - <input type="hidden" name="nextver" value="<?php print $nextver; ?>" /> -<?php if($archive) + <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?>" /> +<?php if($args['archive']) {?> <input type="hidden" name="archive" value="1" /> <?php }?> <textarea name="document" rows="<?php print $EditRows; ?>" cols="<?php print $EditCols; ?>" wrap="virtual"><?php - print str_replace('<', '<', str_replace('&', '&', $text)); + print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?></textarea><br /> Summary of change: <input type="text" name="comment" size="40" value="<?php @@ -65,14 +76,14 @@ </form> <h1>Preview</h1> <hr /> -<?php print $html; ?> +<?php print $args['html']; ?> </div> <div id="footer"> <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> - <a href="<?php print historyURL($page); ?>">View document history</a><br /> - Document last modified <?php print html_time($time); ?><br /> + <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> + Document last modified <?php print html_time($args['timestamp']); ?><br /> <input type="hidden" name="action" value="find" /> Search: <input type="text" name="find" size="20" /> </div> Index: rss.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/rss.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rss.php 2001/12/14 20:50:30 1.1 +++ rss.php 2002/01/01 20:13:19 1.2 @@ -1,7 +1,13 @@ <?php // $Id$ -function template_rss($itemseq, $itemdesc) +// The RSS template is passed an associative array with the following +// elements: +// +// itemseq => A string containing the rdf:li elements for the syndication. +// itemdesc => A string containing the item elements for the syndication. + +function template_rss($args) { global $ScriptBase, $WikiName, $MetaDescription, $InterWikiPrefix; @@ -32,14 +38,14 @@ <items> <rdf:Seq> <?php - print $itemseq; + print $args['itemseq']; ?> </rdf:Seq> </items> </channel> <?php - print $itemdesc; + print $args['itemdesc']; ?> </rdf:RDF> Index: save.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/save.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- save.php 2001/11/30 22:10:17 1.3 +++ save.php 2002/01/01 20:13:19 1.4 @@ -1,12 +1,18 @@ <?php // $Id$ -function template_save($page, $text) +// The save template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being saved. +// text => A string containing the wiki markup for the given page. + +function template_save($args) { // You might use this to put up some sort of "thank-you" page like Ward -// does in WikiWiki. +// does in WikiWiki, or to display a list of words that fail spell-check. // For now, we simply redirect to the view action for this page. - header('Location: ' . viewURL($page)); + header('Location: ' . viewURL($args['page'])); } ?> Index: view.php =================================================================== RCS file: /cvsroot/tavi/tavi/template/view.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- view.php 2001/12/31 15:58:13 1.5 +++ view.php 2002/01/01 20:13:19 1.6 @@ -1,7 +1,18 @@ <?php // $Id$ -function template_view($page, $html, $editable, $time, $archive, $version) +// The view template is passed an associative array with the following +// elements: +// +// page => A string containing the name of the wiki page being viewed. +// html => A string containing the XHTML rendering of the wiki page. +// editable => An integer. Will be nonzero if user is allowed to edit page. +// timestamp => Timestamp of last edit to page. +// archive => An integer. Will be nonzero if this is not the most recent +// version of the page. +// version => Version number of page version being viewed. + +function template_view($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $FindScript, $pagestore, $StyleSheet; @@ -14,12 +25,12 @@ <meta name="KEYWORDS" content="<?php print $MetaKeywords; ?>" /> <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /><?php - if($archive) + if($args['archive']) {?> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /><?php }?> <link rel="STYLESHEET" href="<? print $StyleSheet; ?>" type="text/css" /> -<title><?php print $page . ' - ' . $WikiName; ?></title> +<title><?php print $args['page'] . ' - ' . $WikiName; ?></title> </head> <body> <div id="header"> @@ -28,33 +39,33 @@ src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> <h1> - <a class="title" href="<?php print findURL($page); ?>"> - <?php print $page; ?></a> + <a class="title" href="<?php print findURL($args['page']); ?>"> + <?php print $args['page']; ?></a> <?php - if($archive) - { print '(' . html_timestamp($time) . ')'; } + if($args['archive']) + { print '(' . html_timestamp($args['timestamp']) . ')'; } ?> </h1> <?php print html_toolbar_top(); ?> <hr /> </div> <div id="body"> -<?php print $html; ?> +<?php print $args['html']; ?> </div> <div id="footer"> <hr /> <form method="get" action="<?php print $FindScript; ?>"> <div class="form"> <?php - if($editable) + if($args['editable']) { - if(!$archive) + if(!$args['archive']) { -?> <a href="<?php print editURL($page); ?>">Edit this document</a><?php +?> <a href="<?php print editURL($args['page']); ?>">Edit this document</a><?php } else { -?> <a href="<?php print editURL($page, $version); ?>"> +?> <a href="<?php print editURL($args['page'], $args['version']); ?>"> Edit this <em>ARCHIVE VERSION</em> of this document</a><?php } } @@ -62,9 +73,9 @@ { ?> This document cannot be edited <?php } -?> | <a href="<?php print historyURL($page); ?>">View document history</a><br /> - Document last modified <?php print html_time($time); ?><br /><?php - if(count($twin = $pagestore->twinpages($page))) +?> | <a href="<?php print historyURL($args['page']); ?>">View document history</a><br /> + Document last modified <?php print html_time($args['timestamp']); ?><br /><?php + if(count($twin = $pagestore->twinpages($args['page']))) { ?>Twin pages: <?php for($i = 0; $i < count($twin); $i++) Index: wiki.css =================================================================== RCS file: /cvsroot/tavi/tavi/template/wiki.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wiki.css 2002/01/01 16:41:59 1.4 +++ wiki.css 2002/01/01 20:13:19 1.5 @@ -37,3 +37,5 @@ margin-bottom: 0px; } form { margin-top: 0px; } +p.warning + { color: #ff3f3f; } |
From: Scott M. <sm...@us...> - 2002-01-01 20:13:23
|
Update of /cvsroot/tavi/tavi/admin In directory usw-pr-cvs1:/tmp/cvs-serv14266/admin Modified Files: index.php Log Message: Rework templates to use associative array instead of hard-coded parameters. Index: index.php =================================================================== RCS file: /cvsroot/tavi/tavi/admin/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.php 2001/11/30 22:10:14 1.3 +++ index.php 2002/01/01 20:13:19 1.4 @@ -17,7 +17,7 @@ $pagelist = $pagestore->allpages(); foreach($pagelist as $page) { $html = $html . html_lock_page($page[1], $page[6]); } - template_admin($html . html_lock_end(count($pagelist))); + template_admin(array('html' => $html . html_lock_end(count($pagelist)))); } else // Lock/unlock pages at admin's request. { @@ -68,7 +68,7 @@ { $html = $html . html_rate_entry($block); } $html = $html . html_rate_end(); - template_admin($html); + template_admin(array('html' => $html)); } else // Block/unblock an address group. { @@ -82,11 +82,12 @@ } else // Display main menu for admin. { - template_admin(html_url($AdminScript . '?locking=1', 'Lock / unlock pages') . - html_newline() . - html_url($AdminScript . '?blocking=1', - 'Block / unblock hosts') . - html_newline()); + template_admin(array('html' => html_url($AdminScript . '?locking=1', + 'Lock / unlock pages') . + html_newline() . + html_url($AdminScript . '?blocking=1', + 'Block / unblock hosts') . + html_newline())); } ?> |
From: Scott M. <sm...@us...> - 2002-01-01 18:36:57
|
Update of /cvsroot/tavi/tavi/parse In directory usw-pr-cvs1:/tmp/cvs-serv30014/parse Modified Files: transforms.php Log Message: Change raw HTML processing to allow <html> tags to be uppercase. Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- transforms.php 2002/01/01 16:41:59 1.12 +++ transforms.php 2002/01/01 18:36:54 1.13 @@ -283,7 +283,7 @@ if($in_html) { - if($text == "</html>\n") + if(strtolower($text) == "</html>\n") { $Entity[count($Entity)] = array('raw', $buffer); $buffer = ''; @@ -296,7 +296,7 @@ } else { - if($text == "<html>\n") + if(strtolower($text) == "<html>\n") { $in_html = 1; return ''; |
From: Scott M. <sm...@us...> - 2002-01-01 18:36:57
|
Update of /cvsroot/tavi/tavi In directory usw-pr-cvs1:/tmp/cvs-serv30014 Modified Files: ChangeLog Log Message: Change raw HTML processing to allow <html> tags to be uppercase. Index: ChangeLog =================================================================== RCS file: /cvsroot/tavi/tavi/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ChangeLog 2001/12/31 18:31:50 1.15 +++ ChangeLog 2002/01/01 18:36:54 1.16 @@ -3,6 +3,10 @@ WikkiTikkiTavi - ChangeLog -------------------------- +2002-01-01 Scott Moonen <sm...@an...> + + * Change raw HTML processing to allow <html> tags to be uppercase. + 2001-12-31 Scott Moonen <sm...@an...> * Fix rendering of {{ .. }} so that it slurps up braces within |