From: Reini U. <ru...@us...> - 2002-08-27 21:51:36
|
Update of /cvsroot/phpwiki/phpwiki/themes/default/templates In directory usw-pr-cvs1:/tmp/cvs-serv26187/themes/default/templates Modified Files: body.tmpl bottom.tmpl content.tmpl debug.tmpl login.tmpl navbar.tmpl top.tmpl userprefs.tmpl Removed Files: top-htmldump.tmpl Log Message: LANG still broken, working on better locale handling. improved PageList: added checkbox, sortby added <?plugin-head for FrameInclude and RedirectTo fixed some minor UserPreferences quirks solidified templates added PhpWeather added a new generic WikiAdminSelect to simulate the commandline: work with sets of pages, pass the request to underlying WikiAdmin* plugins Index: body.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/body.tmpl,v retrieving revision 1.28 retrieving revision 1.29 diff -u -2 -b -p -d -r1.28 -r1.29 --- body.tmpl 20 Aug 2002 16:15:26 -0000 1.28 +++ body.tmpl 27 Aug 2002 21:51:31 -0000 1.29 @@ -2,26 +2,6 @@ <!-- $Id$ --> <body> -<div id="navbar" class="toolbar"> -<?php -global $HIDE_TOOLBARS; -if (!$HIDE_TOOLBARS) { -?> -<!-- The top navigation/search bar --> -<?= Template('navbar') ?> -<?php } ?> -<!-- The logo --> -<div align="right" id="logo"><a class="wikilink" - href="<?=WikiURL(HOME_PAGE)?>" - ><img src="<?=$Theme->getImageURL('logo')?>" - border="0" alt="<?=WIKI_NAME?>: <?=HOME_PAGE?>" - align="right" /></a></div> - -<!-- Page title --> -<h1><?= $HEADER ?></h1> -</div> +<?= Template('top') ?> <?= $CONTENT ?> - -<?= $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML() ?> - -<?php if (defined('DEBUG')) { ?><?= Template('debug') ?><?php } ?> +<?= Template('bottom') ?> </body> Index: bottom.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/bottom.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- bottom.tmpl 23 Aug 2002 18:29:34 -0000 1.1 +++ bottom.tmpl 27 Aug 2002 21:51:31 -0000 1.2 @@ -1,6 +1,5 @@ <?php // -*-html-*- ?> <!-- $Id$ --> - -<? // $CONTENT ?> +<!-- Add your Disclaimer here --> <?= $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML() ?> <?php if (defined('DEBUG')) { ?><?= Template('debug') ?><?php } ?> Index: content.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/content.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- content.tmpl 23 Aug 2002 18:29:34 -0000 1.1 +++ content.tmpl 27 Aug 2002 21:51:31 -0000 1.2 @@ -2,7 +2,4 @@ <!-- $Id$ --> <?= $CONTENT ?> - -<?= $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML() ?> - -<?php if (defined('DEBUG')) { ?><?= Template('debug') ?><?php } ?> +<?= Template('bottom') ?> </body> Index: debug.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/debug.tmpl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -2 -b -p -d -r1.6 -r1.7 --- debug.tmpl 20 Aug 2002 17:43:36 -0000 1.6 +++ debug.tmpl 27 Aug 2002 21:51:31 -0000 1.7 @@ -2,5 +2,6 @@ <!-- $Id$ --> <?php $t = round(getmicrotime()-$GLOBALS['debugclock'], 3); ?> -<span class="debug">Page Execution took <?= $t ?> seconds</span> +<table width="%100" border="0" cellpadding="0" cellspacing="0"> +<tr><td> <?php if ($Theme->_name != 'Portland') { ?> <div id="xhtml-validator"><a href="http://validator.w3.org/check/referer"><img @@ -18,2 +19,5 @@ </div> <?php } ?> +</td><td> +<span class="debug"><?=fmt("Page Execution took %s seconds",$t)?></span> +</td></tr></table> Index: login.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/login.tmpl,v retrieving revision 1.16 retrieving revision 1.17 diff -u -2 -b -p -d -r1.16 -r1.17 --- login.tmpl 23 Aug 2002 18:29:34 -0000 1.16 +++ login.tmpl 27 Aug 2002 21:51:31 -0000 1.17 @@ -10,5 +10,5 @@ <?php if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) { ?> <p><?= _("You may sign in using any WikiWord as a UserId. (ÀÖØöøÿßö etc. may be used too). The UserId will be used as a link in RecentChanges to your UserId page, your HomePage.") ?> - <?php if (! $pass_required ) ?> + <?php if (empty($pass_required)) ?> <?= _("New users may use an empty password.") ?> </p> @@ -44,5 +44,6 @@ <input type="hidden" name="auth[require_level]" value="<?=$require_level?>" /> <input type="hidden" name="auth[login]" value="1" /> -<?= HiddenGets(array('auth')) ?> +<?= HiddenPosts(array('auth')) ?> +<? //HiddenGets(array('auth')) ?> </form> Index: navbar.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/navbar.tmpl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -2 -b -p -d -r1.12 -r1.13 --- navbar.tmpl 22 Aug 2002 23:28:32 -0000 1.12 +++ navbar.tmpl 27 Aug 2002 21:51:31 -0000 1.13 @@ -36,5 +36,5 @@ $s = $Theme->getButtonSeparator(); <?php } ?> <?php if (!empty($user) && $user->isAdmin()) { ?> - <?=$s?><?= WikiLink(_("PhpWikiAdministration"), "button") ?> + <?=$s?><?= WikiLink(_("PhpWikiAdministration"), "button", _("Admin")) ?> <?php } ?> <?php } ?></div> Index: top.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/top.tmpl,v retrieving revision 1.17 retrieving revision 1.18 diff -u -2 -b -p -d -r1.17 -r1.18 --- top.tmpl 23 Aug 2002 18:29:34 -0000 1.17 +++ top.tmpl 27 Aug 2002 21:51:31 -0000 1.18 @@ -20,4 +20,5 @@ if (!$HIDE_TOOLBARS) { </div> <?php if ($request->getArg('frame')) { ?> -<p class="transclusion-title"><?=sprintf(_("Included frame from %s"),$framesrc)?></p> +<!-- The included frame url for safety --> +<p class="transclusion-title"><?fmt("Included frame from %s",$framesrc)?></p> <?php } ?> Index: userprefs.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/userprefs.tmpl,v retrieving revision 1.25 retrieving revision 1.26 diff -u -2 -b -p -d -r1.25 -r1.26 --- userprefs.tmpl 23 Aug 2002 21:59:06 -0000 1.25 +++ userprefs.tmpl 27 Aug 2002 21:51:31 -0000 1.26 @@ -2,13 +2,20 @@ <!-- $Id$ --> <?php -foreach (explode(',', - 'appearance,changePass,email,notifyPages,editAreaSize,timeOffset,relativeDates,errmsg,isForm') as $var) { +// Todo: Move the logic and code to the plugin +// This is very experimental and the read-only part an ugly hack so far. +foreach (explode(',','errmsg,isForm') as $var) { if (empty($$var)) $$var = false; } +$plugin = $request->getArg('pagename'); +if ($request->isActionPage($request->getArg('pagename')) and + $plugin != _("PreferencesInfo")) { + $isForm = true; +} + $time = time(); $offset = $request->getPref('timeOffset') * 3600; $serverTime = $time - $offset; -if ( $timeOffset ) +if ( $isForm ) $timeOffsetInput = HTML::input(array('type' => "text", 'size' => 6, @@ -29,31 +36,46 @@ $RelativeDatesCB = HTML(HTML::input(arra 'checked' => (bool) $request->getPref('relativeDates')))); +function selectedOption ($value, $label = false) { + return HTML::option(array('value' => $value,'selected'=>"selected"), ($label ? $label : $value) . "\n"); +} +function unselectedOption ($value, $label = false) { + return HTML::option(array('value' => $value), ($label ? $label : $value) . "\n"); +} + $SelectThemes = ''; $SelectLanguages = ''; $SelectThemesDesc = ''; $SelectLanguagesDesc = ''; -if ($appearance) { +if ( $isForm ) { $SelectOptions = HTML(); if (!empty($available_themes) and is_array($available_themes)) { + if (! $request->getPref('theme')) + $SelectOptions->pushContent(selectedOption('',_("<default>"))); + else + $SelectOptions->pushContent(unselectedOption('',_("<default>"))); foreach ($available_themes as $theme) { - if ($theme == $request->getPref('theme')) - $SelectOptions->pushContent(HTML::option(array('value' => $theme,'selected'=>"selected"),$theme)); + if ($theme == $request->getPref('theme') and $theme != $GLOBALS['Theme']->_name) + $SelectOptions->pushContent(selectedOption($theme)); else - $SelectOptions->pushContent(HTML::option(array('value' => $theme),$theme)); + $SelectOptions->pushContent(unselectedOption($theme)); } $SelectThemes = HTML::select(array('name' => "pref[theme]",'id' => 'theme'), $SelectOptions); - $SelectThemesDesc = _("Select your theme"); + $SelectThemesDesc = _("Select your personal theme"); } $SelectOptions = HTML(); if (!empty($available_languages) and is_array($available_languages)) { + if (! $request->getPref('lang') ) + $SelectOptions->pushContent(selectedOption('',_("<default>"))); + else + $SelectOptions->pushContent(unselectedOption('',_("<default>"))); foreach ($available_languages as $lang) { - if ($lang == $request->getPref('lang')) - $SelectOptions->pushContent(HTML::option(array('value' => $lang,'selected'=>"selected"),$lang)); + if ($lang == $request->getPref('lang') and $lang != $GLOBALS['LANG']) + $SelectOptions->pushContent(selectedOption($lang)); else - $SelectOptions->pushContent(HTML::option(array('value' => $lang),$lang)); + $SelectOptions->pushContent(unselectedOption($lang)); } $SelectLanguages = HTML::select(array('name' => "pref[lang]",'id' => 'lang'), $SelectOptions); - $SelectLanguagesDesc = _("Select your language"); + $SelectLanguagesDesc = _("Select your personal language"); } else { if ($SelectThemes == '') { @@ -64,17 +86,10 @@ if ($appearance) { } } else { - $SelectThemesDesc = _("Current theme"); - $SelectLanguagesDesc = _("Current language"); + $SelectThemesDesc = _("Personal theme"); + $SelectLanguagesDesc = _("Personal language"); $SelectThemes = $request->getPref('theme'); $SelectLanguages = $request->getPref('lang'); } -$plugin = $request->getArg('pagename'); -if ($request->isActionPage($request->getArg('pagename')) and - $plugin != _("PreferencesInfo")) -{ - $isForm = true; -} - if ($errmsg) $msg = HTML(HTML::h4(array('class' => 'errors'), $errmsg),HTML::hr()); ?> @@ -90,15 +105,15 @@ if ($errmsg) $msg = HTML(HTML::h4(array( sprintf("%12s: [% 10s] %16s: [% 10s] | %8s: [%2s]\n","getId",$user->getId(),"getAuthenticatedId",$user->getAuthenticatedId(),"isSignedIn", $user->isSignedIn()), sprintf("%12s: [% 10s]\n",_("Password"),$request->getPref('passwd')), - sprintf("%12s: [% 10s] %16s: [% 8s]\n", + sprintf("%12s: [% 10s] %15s: [% 8s]\n", _("Auth Level"),$user->_level,_("Auth Method"),$user->_authmethod), sprintf("%12s: [% 10s]\n",_("Homepage"),$user->homePage() ? $user->_homepage->_pagename : ''), sprintf("%12s: [% 10s]\n",_("E-Mail"),$request->getPref('email')), sprintf("%12s: [% 10s]\n",_("Notify"),$request->getPref('notifyPages')), - sprintf("%12s: [% 10s]\n",_("Theme"), $request->getPref('theme')), - sprintf("%12s: [% 10s]\n",_("Language"),$request->getPref('lang')) + sprintf("%12s: [% 10s] %s %8s: [% 10s] \n",_("Theme"), $request->getPref('theme'), _("Current"),_("Theme"),$Theme->_name), + sprintf("%12s: [% 10s] %s %8s: [% 10s] \n",_("Language"),$request->getPref('lang'),_("Current"),_("Language"),$GLOBALS['LANG']) ) ?> <?php } ?> -<?php if ($changePass) { ?> +<?php if ($isForm) { ?> <h2><?=_("Change Password")?></h2> <input type="password" name="pref[passwd]" size="16" maxlength="16" class="text" value="" /> <?=_("New password")?>.<br /> @@ -108,5 +123,5 @@ if ($errmsg) $msg = HTML(HTML::h4(array( <h2><?=_("Email Notification")?></h2> <p><?=_("Your E-Mail:")?> - <?php if ($email) { ?> + <?php if ($isForm) { ?> <input type="text" name="pref[email]" size="30" maxlength="60" value="<?=$request->getPref('email')?>" /> @@ -123,5 +138,6 @@ if ($errmsg) $msg = HTML(HTML::h4(array( <p class="hint">(<?=_("Note, that user accounts with bouncing emails will be disabled.")?>)</p> <p><?=_("Get an email notification at changes of the following pages")?>:<br /> - <?php if ($notifyPages) { ?> + + <?php if ($isForm) { ?> <textarea name="pref[notifyPages]" cols="50" rows="5"><?=$request->getPref('notifyPages')?></textarea> <p class="hint">(<?=_("Enter pages seperated by space or comma. Wildcards (fileglobbing) allowed.")?>)</p> @@ -132,12 +148,15 @@ if ($errmsg) $msg = HTML(HTML::h4(array( <h2><?=_("Appearance")?></h2> - <table> - <tr><td><?=$SelectThemesDesc?>:</td><td><?=$SelectLanguagesDesc?>:</td></tr> - <tr><td><?= $SelectThemes ?></td><td><?= $SelectLanguages ?></td></tr> + <table cellspacing="5" border="1"> + <tr class="hint"><td><?= _("Current <default> theme") ?>:</td><td><?=_("Current <default> language")?>:</td></tr> + <tr align="center"><td><?= $Theme->_name ?></td> <td><?= $GLOBALS['LANG'] ?></td></tr> + <tr class="hint"><td><?= $SelectThemesDesc?>:</td><td><?=$SelectLanguagesDesc?>:</td></tr> + <tr align="center"><td><?= $SelectThemes ?></td> <td><?= $SelectLanguages ?></td></tr> </table> + <p class="hint"><?=_("Here you can override site-specific <default> values. Currently not recommended!")?></p> <h2><?=_("Edit Area Size")?></h2> <p><?=_("Height")?> - <?php if ($editAreaSize) { ?> + <?php if ($isForm) { ?> <input type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric" value="<?=$request->getPref('editHeight')?>" /> --- top-htmldump.tmpl DELETED --- |