From: Geoffrey T. D. <da...@us...> - 2002-01-15 23:40:28
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv11220/templates Modified Files: browse.html editpage.html message.html Log Message: Beginnings of yet another refactor of the templates: Toolbar.php is out. ButtonFactory.php is in. This is largely a revert to the older pre-Toolbar.php templates, with ButtonFactory helping to clean things up a bit. This is WIP. Next: sub-templates. I've only adjusted the default templates. Some/all (non-default) themes are probably broken now. Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** browse.html 2002/01/15 16:44:19 1.50 --- browse.html 2002/01/15 23:40:25 1.51 *************** *** 1,3 **** ! <?php echo "<?xml version='1.0' encoding='${CHARSET}'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> --- 1,3 ---- ! <?php echo "<?xml version='1.0' encoding='$CHARSET'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> *************** *** 22,33 **** --> </head> <body> ! ${EDIT_FAIL_MESSAGES}${THANK_YOU}<div>${LOGO}</div> <h1><?plugin-link BackLinks page="[pagename]" class="backlinks" linktext="${SPLIT_PAGE}" ?></h1> <div class="br"><br clear="all" class="ignore" /></div> ! ${VIEW_WARNINGS} <div class="wikitext">${CONTENT}</div> <hr class="ignore" noshade="noshade" /> ! ${LASTMODIFIED} <hr noshade="noshade" class="toolbar" /> <!-- I would like not to have to use these tables, and managed to --- 22,81 ---- --> </head> + <?php + $BF = &$ButtonFactory; + + if (!$page->get('locked') || $user->is_admin()) + $EditB = $BF->makeActionButton("edit", + $IS_CURRENT ? _("Edit") : _("Edit old revision")); + else + $EditB = $BF->makeActionPageButton(_("ViewSource")); + + $LockPageB = $BF->makeActionButton($page->get('locked') ? 'unlock' : 'lock'); + $RemovePageB = $BF->makeActionButton('remove'); + + //<?plugin-link PageHistory page="[pagename]" ?> + $PageHistoryB = $BF->makeActionPageButton(_("PageHistory")); + $DiffB = $BF->makeActionButton(array('action' => 'diff', 'previous' => 'major')); + + $RecentChangesB = $BF->makeLinkButton(_("RecentChanges")); + $FindPageB = $BF->makeLinkButton(_("FindPage")); + + $LikePagesB = $BF->makeActionPageButton(_("LikePages")); + $BackLinksB = $BF->makeActionPageButton(_("BackLinks")); + $DebugInfoB = $BF->makeActionPageButton(_("DebugInfo")); + + $SignInB = $BF->makeActionButton($user->is_authenticated() ? 'logout' : 'login'); + + if ($IS_CURRENT) + $LastModifiedMsg = sprintf(_("Last edited on %s."), $LASTMODIFIED); + else + $LastModifiedMsg = __sprintf("Version %s, saved on %s.", + $VERSION, $LASTMODIFIED); + ?> <body> ! ! <div><a class="wikilink" ! href="${BROWSE}$_("HomePage")" ! ><img src="${LOGO}" ! border="0" alt="${WIKI_NAME}: $_("HomePage")" ! align="right" /></a></div> ! <h1><?plugin-link BackLinks page="[pagename]" class="backlinks" linktext="${SPLIT_PAGE}" ?></h1> + <div class="br"><br clear="all" class="ignore" /></div> ! ! ${SAVEPAGE_MESSAGES} <!-- FIXME: I don't like this --> ! ! <?php if (! $IS_CURRENT) { ?> ! <p><strong>$_("Note:")</strong> $_("You are viewing an old revision of this page.") ! <a href="${BROWSE}${PAGEURL}">$_("View the current version")</a>.</p> ! <hr class="ignore" noshade="noshade" /> ! <?php } ?> ! <div class="wikitext">${CONTENT}</div> <hr class="ignore" noshade="noshade" /> ! ! <p>${LastModifiedMsg}</p> ! <hr noshade="noshade" class="toolbar" /> <!-- I would like not to have to use these tables, and managed to *************** *** 36,89 **** to cause MSIE4.01/NT to hang. So, we use tables... --> ! <table summary="Toolbar 1: Page actions and search for pages." class="toolbar" width="100%" ! cellpadding="0" cellspacing="0" border="0"><tr valign="baseline"> <td> ! <?php if ($page->get('locked') && !$user->is_admin()) { ?> ! $_("Page locked") | <a class="wikiaction" href="${ACTION}edit">$_("ViewSource")</a> ! <?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 } ?> ! | <?plugin-link PageHistory page="[pagename]" ?> ! <?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">${SEARCH}</td> ! </tr></table> ! <table summary="Toolbar 2: Sign in." class="toolbar" width="100%" ! cellpadding="0" cellspacing="0" border="0"><tr valign="baseline"> ! <td>${SIGNIN}</td> ! <td align="right"></td> </tr></table> ! <?php /* ! <hr class="ignore" noshade="noshade" /> ! <small>${RELATEDPAGES}</small> ! */ ?> <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML(); ?> - <table summary="For debugging only, really." class="toolbar" width="100%" - cellpadding="0" cellspacing="0" border="0"><tr><td> - <?plugin-link _BackendInfo - linktext=_("DebugInfo") - targetpage=_("DebugInfo") - page=[pagename] ?> - </td></tr></table> </form> </body> --- 84,123 ---- to cause MSIE4.01/NT to hang. So, we use tables... --> ! <form action="<?php echo WikiURL(_("TitleSearch"));?>" ! method="get" accept-charset="${CHARSET}"> ! <table summary="Toolbar 1: Page actions and search for pages." ! class="toolbar" width="100%" ! cellpadding="0" cellspacing="0" border="0"> ! <tr valign="baseline"> <td> ! ${EditB} <?php if ($user->is_admin()) { ?> ! | ${LockPageB} | ${RemovePageB} <?php } ?> + | ${PageHistoryB} | ${DiffB} + | ${DebugInfoB} <!-- For debugging only, really --> </td> ! <td align="right"> ! ${RecentChangesB} | ${FindPageB} ! | <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;" /> ! | ${LikePagesB} | ${BackLinksB} ! </td> </tr></table> ! <div class="toolbar"> ! <?php if ($user->is_authenticated()) { ?> ! <?php printf(_("You are signed in as %s"), LinkWikiWord($USERID)); ?> | ! <?php } ?> ! ${SignInB} ! </div> ! ! <!-- RELATEDPAGES were here. --> ! <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML(); ?> </form> </body> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** editpage.html 2002/01/15 16:44:19 1.49 --- editpage.html 2002/01/15 23:40:26 1.50 *************** *** 1,3 **** ! <?php echo "<?xml version='1.0' encoding='${CHARSET}'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> --- 1,3 ---- ! <?php echo "<?xml version='1.0' encoding='$CHARSET'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> *************** *** 13,26 **** <link rel="shortcut icon" href="favicon.ico" /> ${CSS} ! <title>${WIKI_NAME} - <?php printf(_("Edit: %s"),"${SPLIT_PAGE}"); ?></title> </head> <body> ! <div>${LOGO}</div> ! <h1><?php printf(_("Edit: %s"),"<a class=\"backlinks\" href=\"${BROWSE}"._("BackLinks")."?page=${PAGE}\">${PAGE}</a>"); ?></h1> ! <?php printf(_("Return to %s."),"<a href=\"${BROWSE}${PAGEURL}\" class=\"wikilink\"><span class=\"wikiword\">${SPLIT_PAGE}</span></a>"); ?> ! ${EDIT_WARNINGS} <?php if (!empty($PREVIEW_CONTENT)) { ?> <div class="wikitext">${PREVIEW_CONTENT}</div> <?php } ?> <?php /* * FIXME: Hack! --- 13,37 ---- <link rel="shortcut icon" href="favicon.ico" /> ${CSS} ! <title>${WIKI_NAME} - <?php printf(_("Edit: %s"), $SPLIT_PAGE); ?></title> </head> <body> ! <div><a class="wikilink" ! href="${BROWSE}$_("HomePage")" ! ><img src="${LOGO}" ! border="0" alt="${WIKI_NAME}: $_("HomePage")" ! align="right" /></a></div> ! <h1>$_("Edit"): <a href="${BROWSE}${PAGEURL}" class="wiki">${SPLIT_PAGE}</a></h1> ! <?php if (!empty($PREVIEW_CONTENT)) { ?> + <p><strong>$_("Preview only! Changes not saved.")</strong></p> <div class="wikitext">${PREVIEW_CONTENT}</div> <?php } ?> + + <?php if (!$IS_CURRENT) { ?> + <p><strong>$_("Warning: You are editing an old revision.") + $_("Saving this page will overwrite the current version.")</strong></p> + <hr class="ignore" noshade /> + <?php } ?> + <?php /* * FIXME: Hack! *************** *** 29,34 **** * page won't work with some browsers. (NS4 and Mozilla 0.97 won't accept * a redirect from a page to itself.) */ ?> ! <?php //<textarea wrap="virtual"> is not valid xhtml but Netscape 4 requires it to wrap long lines. ?> <form method="post" action="${ACTION}EditPage" accept-charset="${CHARSET}"> <textarea class="wikiedit" --- 40,49 ---- * page won't work with some browsers. (NS4 and Mozilla 0.97 won't accept * a redirect from a page to itself.) + * + * <textarea wrap="virtual"> is not valid xhtml but Netscape 4 requires it + * to wrap long lines. + * */ ?> ! <form method="post" action="${ACTION}EditPage" accept-charset="${CHARSET}"> <textarea class="wikiedit" *************** *** 37,67 **** 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 summary="Toolbar: Page editing options." 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()) { ?> ! <?php printf(_("You are signed in as %s."), LinkWikiWord($USERID)); ?> ! <?php } else { ?> ! <?php printf(_("Author will be logged as %s."),"<em>${USERID}</em>"); ?> ! | <a class="wikiaction" href="${ACTION}login">$_("SignIn")<small>*</small></a> ! <br /><small>*backup and reload after signing in</small> ! <?php } ?> </td> </tr></table> ! <div style="clear: both; padding: 2ex 0ex 0ex;">${EDIT_TIPS}</div> <hr noshade="noshade" /> <div class="wiki-edithelp"> <?plugin IncludePage page=_("TextFormattingRules") section=_("Synopsis") quiet=1?> --- 52,117 ---- cols="${EDIT_AREA_WIDTH}" wrap="virtual">$FORMVARS[content]</textarea> + <?php + $SummaryInput = Element('input', + array('type' => 'text', + 'class' => 'wikitext', + 'name' => 'summary', + 'size' => 50, + 'value' => $FORMVARS['summary'])); + + $MinorEditCb = Element('input', + array('type' => 'checkbox', + 'name' => 'minor_edit', + 'checked' => (bool) $FORMVARS['minor_edit'])); + + $PreviewB = Element('input', + array('type' => 'submit', + 'class' => 'button', + 'name' => 'preview', + 'value' => _("Preview"))); + $SaveB = Element('input', + array('type' => 'submit', + 'class' => 'button', + 'value' => _("Save"))); + if ($user->is_authenticated()) { + $UserMsg = sprintf(_("You are signed in as %s."), LinkWikiWord($USERID)); + } else { + $SignInB = $ButtonFactory->makeActionButton('login'); + $UserMsg = sprintf(_("Author will be logged as %s."), + QElement('em', $USERID)); + $UserMsg .= $SignInB->asHTML(); + $UserMsg .= Element('br'); + $UserMsg .= QElement('small', '*' . _("backup and reload after signing in")); + } + ?> + <div class="toolbar" style="text-align: center;"> ! $_("Summary:") ${SummaryInput} </div> <table summary="Toolbar: Page editing options." class="toolbar" width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="baseline"> ! <td> ! ${MinorEditCb} $_("This is a minor change.") </td> <td align="center"> ! ${PreviewB} | ${SaveB} </td> <td align="right"> ! ${UserMsg} </td> </tr></table> ! ! <div name="#edit-tips"><?php ! // FIXME: convert this to use the IncludePage plugin. ! printf(_("You can change the size of the editing area in %s."), ! LinkExistingWikiWord(_("UserPreferences"))); ! printf(_("See %s tips for editing."), ! LinkExistingWikiWord(_("GoodStyle"))); ! ?></div> ! ! <hr noshade="noshade" /> + <div class="wiki-edithelp"> <?plugin IncludePage page=_("TextFormattingRules") section=_("Synopsis") quiet=1?> *************** *** 73,76 **** --- 123,127 ---- <input type="hidden" name="version" value="$FORMVARS[version]" /> </form> + <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML(); ?> </body> Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** message.html 2002/01/15 16:44:19 1.24 --- message.html 2002/01/15 23:40:26 1.25 *************** *** 1,3 **** ! <?php echo "<?xml version='1.0' encoding='${CHARSET}'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> --- 1,3 ---- ! <?php echo "<?xml version='1.0' encoding='$CHARSET'?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> *************** *** 16,21 **** </head> <body> ! <div>${LOGO}</div> ! <h1><?plugin-link BackLinks page="[pagename]" class="backlinks" linktext="${SPLIT_PAGE}" ?></h1> ${CONTENT} <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML(); ?> --- 16,25 ---- </head> <body> ! <div><a class="wikilink" ! href="${BROWSE}$_("HomePage")" ! ><img src="${LOGO}" ! border="0" alt="${WIKI_NAME}: $_("HomePage")" ! align="right" /></a></div> ! <h1>${TITLE}</h1> ${CONTENT} <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML(); ?> |