From: Geoffrey T. D. <da...@us...> - 2001-09-18 19:16:28
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv2684/templates Modified Files: README browse.html editpage.html message.html Log Message: Jeff's hacks II. This is a major change, to say the least. Some highlights: o Completely new database API. WARNING: all database schemas (currently MySQL, Postgres and DBA support is working) use completely revised schema, so you must start this new code with a new blank database... o WikiPlugins o New template engine. In addition, some more incremental changes: o Cascading Style Sheets reworked. o Expanded syntax for text search: e.g. "wiki OR wacky AND NOT page". o PhpWiki should now work with register_globals off. (Security issue.) o Edit preview button. (and probably more, which I'm forgetting about now.) Much of this code is still in a state of flux (particularly the new template engine code, and to a lesser extent the API for the plugins.) Feel free to play and hack on this, just be warned that some of it may still change quite a bit... See pgsrc/ReleaseNotes for a few more notes. And feel free to post questions or comments either publicly on <php...@li...>, or privately, to <da...@da...>. Index: README =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** README 2001/04/06 18:21:37 1.6 --- README 2001/09/18 19:16:24 1.7 *************** *** 18,21 **** --- 18,32 ---- The specification is relative to the index.php script. + + ========= + Tue Sep 18 12:00:12 PDT 2001 Jeff Dairiki <da...@da...> + + The rest of this file is currently obsolete, and should be ignored. + The template situation is in a state of flux, and will probably be + changed again very soon. See lib/Template.php for more, but mostly + just "stay tuned" for details. + + ========= + Template files are regular HTML files, which contain special placeholders. Placeholders are surrounded by '###'. Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** browse.html 2001/07/20 17:40:12 1.19 --- browse.html 2001/09/18 19:16:24 1.20 *************** *** 1,58 **** ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <!-- phpwiki source: ! ###RCS_IDS### --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! ###ROBOTS_META### ! <base href="###BASE_URL###"> ! <title>###SPLIT_PAGE###</title> ! <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> ! <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a class="wikilink" href="###BROWSE###HomePage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> ! <a class='wikiaction' ! href="###ACTION###search&searchtype=full&searchterm=###PAGEURL###" ! ><span class='wikiword'>###PAGE###</span></a></h1> ! ! ###IF:!ANONYMOUS### ! <p>You are logged in as <em>###USERID###</em>. ! [<a class="wikiaction" href="###ACTION###logout">Log Out</a>]</p> ! ###IF:ADMIN### ! ###IF LOCK###[<a class="wikiadmin" href="###ACTION###unlock">Unlock page</a>] ! ###IF !LOCK###[<a class="wikiadmin" href="###ACTION###lock">Lock page</a>] ! - - ! [<a class="wikiadmin" href="###ACTION###remove">Remove page</a>] ! ###ENDIF:ADMIN### ! <hr noshade> ! ###ENDIF:!ANONYMOUS### ! ! ###IF:ANONYMOUS### ! If you would like to, you may ! <a class="wikiaction" href="###ACTION###login">log in</a> ! (use any WikiWord as a user ID, any password.)</p> ! ###ENDIF:ANONYMOUS### ! ! <table class="outer" width="100%" cellspacing=2 border=0> ! <tr><td><table class="inner" width="100%" border=0 cellspacing=0 cellpadding=5> ! <tr><td class="wikitext">###CONTENT###</td></tr> ! </table></td></tr> ! </table> ! <hr noshade> ! ###IF ADMIN###<a class="wikiaction" href="###ACTION###edit&version=###VERSION###">Edit</a> Revision ###VERSION### ! ###IF:!ADMIN### ! ###IF LOCK###Page locked, revision ###VERSION### ! ###IF !LOCK###<a class="wikiaction" href="###ACTION###edit&version=###VERSION###">Edit</a> Revision ###VERSION### ! ###ENDIF:!ADMIN### ! | Created ###LASTMODIFIED### ! | <a href="###ACTION###info">Info</a> ! | <a href="###ACTION###diff&ver2=###VERSION###">Diff</a> ! <br><a class="wikilink" href="###BROWSE###FindPage"><span class="wikiword">FindPage</span></a> ! by browsing or searching ! ! <hr noshade> ! <small>###RELATEDPAGES###</small> </body> </html> --- 1,129 ---- ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ! "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <!-- phpwiki source: ! ${RCS_IDS} --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <meta name="robots" content="index,follow"> --> ! <base href="${BASE_URL}"> ! <title>${SPLIT_PAGE}</title> ! <!-- ! --> ! <link rel="stylesheet" title="phpwiki" href="${CSS_URL}" type="text/css"> </head> ! <body> ! <h1> ! <div><a class="wikilink" ! href="${BROWSE}HomePage" ! ><img src="${LOGO}" ! border=0 alt="[phpwiki]" ! align="right" width=50 height=50></a></div> ! <!--FIXME: this link is broken unless pages are in pathinfo --> ! <!--<a title="Get BackLinks for ${PAGE}" ! onmouseover="window.status='Get BackLinks for ${PAGE}';return true;" ! class="backlinks" ! href="${BROWSE}BackLinks?page=${PAGEURL}" ! ><span class="wikiword">${SPLIT_PAGE}</span></a>--> ! <?plugin-link BackLinks description="Get BackLinks for [pagename]" ! page="[pagename]" class="backlinks" ! linktext="${SPLIT_PAGE}" ?> ! </h1> ! <div class="br"><br clear="both" class="ignore"></div> ! <?php if (! $IS_CURRENT) { ?> ! <p><b>Note</b>: You are viewing an old revision of this page. ! Click <a href="${BROWSE}${PAGEURL}">here</a> to view the current version.</p> ! <hr class="ignore" noshade> ! <?php } ?> ! <div class="wikitext">${CONTENT}</div> ! <hr class="ignore" noshade> ! <form action="<?php echo WikiURL('TitleSearch'); ?>" method="get"> ! <!-- I would like not to have to use these tables, and managed to ! get this stuff to work more or less correctly using ! CSS's float:left; and float:right;. However float:right; seems ! to cause MSIE4.01/NT to hang. ! So, we use tables... --> ! <table class="toolbar" width="100%" ! cellpadding=0 cellspacing=0 border=0><tr valign="baseline"> ! <td> ! <?php if ($IS_CURRENT) { ?> ! Last edited on ${LASTMODIFIED} ! <?php } else { ?> ! Version ${VERSION}, saved on ${LASTMODIFIED} ! <?php } ?> ! </td> ! <td align="right"> ! <?php echo LinkExistingWikiWord('FindPage') ?> ! | <span><input type="hidden" name="auto_redirect" value="1"> ! <input type="text" name="s" size="12" ! title="Quick Search" ! onmouseover="window.status='Quick Search'; return true;" ! onmouseout="window.status=''; return true;"></span> ! <!-- | <a class="wikiaction" href="${BROWSE}LikePages?page=${PAGEURL}">LikePages</a> --> ! | <?plugin-link LikePages page="[pagename]" description="List LikePages for [pagename]"?> ! </td> ! </tr></table> ! <table class="toolbar" width="100%" ! cellpadding=0 cellspacing=0 border=0><tr valign="baseline"> ! <td> ! <?php if ($page->get('locked') && !$user->is_admin()) { ?> ! Page locked ! <?php } else { ?> ! <?php if ($IS_CURRENT) { ?> ! <a class="wikiaction" href="${ACTION}edit">Edit</a> ! <?php } else { ?> ! <a class="wikiaction" href="${ACTION}edit&version=${VERSION}" ! >Edit old revision</a> ! <?php } ?> ! <?php } ?> ! <?php if ($user->is_admin()) { ?> ! <?php if ($page->get('locked')) { ?> ! | <a class="wikiadmin" href="${ACTION}unlock">Unlock page</a> ! <?php } else { ?> ! | <a class="wikiadmin" href="${ACTION}lock">Lock page</a> ! <?php } ?> ! | <a class="wikiadmin" href="${ACTION}remove">Remove page</a> ! <?php } ?> ! | <a class="wikiaction" href="${ACTION}info">History</a> ! <?php if ($IS_CURRENT) { ?> ! | <a class="wikiaction" href="${ACTION}diff&previous=major">Diff</a> ! <?php } else { ?> ! | <a class="wikiaction" ! href="${ACTION}diff&version=${VERSION}&previous=major">Diff</a> ! <?php } ?> ! </td> ! <td align="right"> ! <?php if ($user->is_authenticated()) { ?> ! You are signed in as <?php echo LinkWikiWord($USERID); ?> ! | <a class="wikiaction" href="${ACTION}logout">SignOut</a> ! <?php } else { ?> ! <a class="wikiaction" href="${ACTION}login">SignIn</a> ! <?php } ?> ! </td> ! </tr></table> + <?php /* + <hr class="ignore" noshade> + <small>${RELATEDPAGES}</small> + */ ?> + <?php // FIXME:hack + ob_start(); + global $ErrorManager; + $ErrorManager->flushPostponedErrors(); + $errmsgs = ob_get_contents(); + ob_end_clean(); + if ($errmsgs) + echo "<div class='errors'><h4>PHP Warnings</h4>$errmsgs</div>"; + ?> + <div class="toolbar"> + <!-- For debugging only, really: --> + <?plugin-link _BackendInfo + linktext=DebugInfo + targetpage=DebugInfo + page=[pagename] + description="Get debugging information for [pagename]."?> + </div> + </form> </body> </html> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** editpage.html 2001/06/26 18:14:41 1.19 --- editpage.html 2001/09/18 19:16:24 1.20 *************** *** 1,57 **** ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <!-- phpwiki source: ! ###RCS_IDS### --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! ###ROBOTS_META### ! <base href="###BASE_URL###"> ! <title>Edit: ###SPLIT_PAGE###</title> ! <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> ! <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <form class="wikiaction" method="POST" action="###BROWSE_PAGE###"> ! <h1><a class="wikilink" href="###BROWSE###HomePage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ! Edit <span="wikiword">###PAGE###</span> ! <input type="submit" value=" Save "></h1> ! ! ###IF !CURRENT###<b>Editing old revision ###VERSION###. Saving this page will replace the current version with this text.</b> ! ! <textarea name="content" ! rows="###EDIT_AREA_HEIGHT###" ! cols="###EDIT_AREA_WIDTH###" ! wrap="virtual">###CONTENT###</textarea> ! <br> ! ###IF:MINOR_EDIT_CHECKBOX### ! ###MINOR_EDIT_CHECKBOX### This is a minor change, don't archive old version. ! <br> ! ###ENDIF:MINOR_EDIT_CHECKBOX### ! <input type="checkbox" name="convert" value="tabs" > ! I can't type tabs. ! Please <a class="wikilink" href="###BROWSE###ConvertSpacesToTabs"><span class="wikiword">ConvertSpacesToTabs</span></a> ! for me when I save. ! <p>You can change the size of the editing area. ! See <a class="wikilink" href="###BROWSE###UserPreferences"><span class="wikiword">UserPreferences</span></a>.</p> ! <p><a class="wikilink" href="###BROWSE###GoodStyle"><span class="wikiword">GoodStyle</span></a> tips for editing.</p> <hr noshade> <small> ! <b>Emphasis:</b> '' for italics, __ for bold, ''__ for both ! <br><b>Lists:</b> * for bullet lists, # for numbered lists, ''; term : definition'' for definition lists ! <br><b>References:</b> JoinCapitalizedWords or use square brackets for a [page link] or URL [http://cool.wiki.int/]. ! <br><b>Footnotes:</b> Use [1],[2],[3],... ! <br><b>Preventing linking:</b> Avoid linking with "!": ! !DoNotHyperlink, name links like [[text | URL] (double up on the "[") ! <br><b>Misc:</b>"!", "!!", "!!!" make headings, ! "%%%" makes a linebreak, "- - - -" makes a horizontal rule ! <br>more on ! <a class="wikilink" href="###BROWSE###TextFormattingRules"><b><span class="wikiword">TextFormattingRules</span></b></a> </small> <input type="hidden" name="action" value="save"> ! <input type="hidden" name="pagename" value="###PAGE###"> ! <input type="hidden" name="editversion" value="###CURRENT_VERSION###"> </form> </body> --- 1,111 ---- ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ! "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <!-- phpwiki source: ! ${RCS_IDS} --> + <base href="${BASE_URL}"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <meta name="robots" content="noindex,nofollow"> ! <link rel="stylesheet" title="phpwiki" href="${CSS_URL}" type="text/css"> ! ! <title>Edit: ${SPLIT_PAGE}</title> </head> ! <body> ! <h1> ! <div><a class="wikilink" ! href="${BROWSE}HomePage" ! ><img src="${LOGO}" border=0 align="right" ! alt="[phpwiki]" width=50 height=50></a></div> ! Edit <a href="${BROWSE}${PAGEURL}" ! class="wikilink"><span class="wikiword">${PAGE}</span></a> ! </h1> ! ! <?php if (!empty($PREVIEW_CONTENT)) { ?> ! <p><b>Preview only! Changes not saved.</b></p> ! <div class="wikitext">${PREVIEW_CONTENT}</div> ! <hr class="ignore" noshade> ! <?php } ?> ! ! <?php if (!$IS_CURRENT) { ?> ! <p><b>Warning: You are editing an old revision. ! Saving this page will overwrite the current version.</b></p> ! <hr class="ignore" noshade> ! <?php } ?> + <?php /* + * FIXME: Hack! + * The URL used for the form action parameter is bogus. + * This is needed, otherwise the redirect to the real browser + * page won't work with some browsers (NS4). (NS4 won't accept + * a redirect from a page to itself.) + */ ?> + + <form method="POST" action="${BROWSE}EditPage"> + <textarea class="wikiedit" + name="content" + rows="${EDIT_AREA_HEIGHT}" + cols="${EDIT_AREA_WIDTH}" + wrap="virtual">$FORMVARS[content]</textarea> + + <div class="toolbar" style="text-align: center;"> + Summary:<input type="text" class="wikitext" + name="summary" value="$FORMVARS[summary]" size=50> + </div> + <table class="toolbar" width="100%" + cellpadding=0 cellspacing=0 border=0><tr valign="baseline"> + <td> + <input type="checkbox" name="minor_edit" value="checked" $FORMVARS[minor_edit]> + This is a minor change. + </td> + <td align="center"> + <input type="submit" class="button" name="preview" value="Preview"> + | <input type="submit" class="button" value="Save"> + </td> + <td align="right"> + <?php if ($user->is_authenticated()) { ?> + You are signed in as <?php echo LinkWikiWord($USERID); ?> + <?php } else { ?> + Author will be logged as <i>${USERID}</i>. + <?php } ?> + </td> + </tr></table> + <p style="clear: both; padding: 2ex 0ex 0ex;"> + You can change the size of the editing area. + See <?php echo LinkExistingWikiWord('UserPreferences'); ?>. + Also see <?php echo LinkExistingWikiWord('GoodStyle') ?> tips for editing. + </p> <hr noshade> <small> ! <b>Emphasis:</b> ! '' for italics, ! __ for bold, ! ''__ for both ! <br><b>Lists:</b> ! * for bullet lists, ! # for numbered lists, ! ''; term : definition'' for definition lists ! <br><b>References:</b> ! JoinCapitalizedWords or use square brackets for a [page link] ! or URL [http://cool.wiki.int/]. ! <br><b>Footnotes:</b> ! Use [1],[2],[3],... ! <br><b>Preventing linking:</b> ! Avoid linking with "!": !DoNotHyperlink, ! name links like [[text | URL] (double up on the "[") ! <br><b>Misc:</b> ! "!", "!!", "!!!" make headings, ! "%%%" makes a linebreak, ! "- - - -" makes a horizontal rule ! <br> ! more on <?php echo LinkExistingWikiWord('TextFormattingRules') ?> </small> <input type="hidden" name="action" value="save"> ! <input type="hidden" name="pagename" value="$FORMVARS[pagename]"> ! <input type="hidden" name="editversion" value="$FORMVARS[editversion]"> ! <input type="hidden" name="version" value="$FORMVARS[version]"> </form> </body> Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** message.html 2001/04/06 18:21:37 1.11 --- message.html 2001/09/18 19:16:24 1.12 *************** *** 1,20 **** ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <!-- phpwiki source: ! ###RCS_IDS### --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! ###ROBOTS_META### ! <base href="###BASE_URL###"> ! <title>###SPLIT_PAGE###</title> ! <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> ! <body bgcolor=linen text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a class="wikilink" href="###BROWSE###HomePage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ! ###PAGE###</h1> ! ! ###CONTENT### </body> --- 1,27 ---- ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ! "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <!-- phpwiki source: ! ${RCS_IDS} --> + <base href="${BASE_URL}"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <meta name="robots" content="noindex,nofollow"> ! <link rel="stylesheet" title="phpwiki" href="${CSS_URL}" type="text/css"> ! <title>${TITLE}</title> </head> + <body> + <h1> + <div><a class="wikilink" + href="${BROWSE}HomePage" + ><img src="${LOGO}" align="right" + border=0 alt="[phpwiki]" + width=50 height=50 + ></a></div> + ${TITLE} + </h1> ! ${CONTENT} </body> |