From: <var...@us...> - 2010-09-22 14:39:30
|
Revision: 7706 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7706&view=rev Author: vargenau Date: 2010-09-22 14:39:24 +0000 (Wed, 22 Sep 2010) Log Message: ----------- Better handle nonexistent revisions Modified Paths: -------------- trunk/themes/fusionforge/templates/actionbar.tmpl trunk/themes/fusionforge/templates/browse.tmpl Modified: trunk/themes/fusionforge/templates/actionbar.tmpl =================================================================== --- trunk/themes/fusionforge/templates/actionbar.tmpl 2010-09-21 07:45:12 UTC (rev 7705) +++ trunk/themes/fusionforge/templates/actionbar.tmpl 2010-09-22 14:39:24 UTC (rev 7706) @@ -50,8 +50,16 @@ <td class="spacer"> </td> <td class="spacer"> </td> - <?php if (!($page->get('locked')) and (mayAccessPage('edit', $page->getName())) and $revision) { ?> - <td class="bold"><?php echo Button("edit", $dbh->isWikiPage($page->getName()) ? ($revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) : _("Create Page")) ?></td> + <?php if (!($page->get('locked')) and (mayAccessPage('edit', $page->getName()))) { ?> + <td class="bold"> + <?php if (! $dbh->isWikiPage($page->getName())) { ?> + <?php echo Button("edit", _("Create Page")) ?> + <?php } else if ($revision && (($revision->isCurrent()) || ($revision->hasDefaultContents()))) { ?> + <?php echo Button("edit", _("Edit")) ?> + <?php } else { ?> + <?php echo Button("edit", _("Edit Old Revision")) ?> + <?php } ?> + </td> <?php } else if ($dbh->isWikiPage($page->getName())) { ?> <td><?php echo Button("viewsource", _("View Source")) ?></td> <?php } ?> Modified: trunk/themes/fusionforge/templates/browse.tmpl =================================================================== --- trunk/themes/fusionforge/templates/browse.tmpl 2010-09-21 07:45:12 UTC (rev 7705) +++ trunk/themes/fusionforge/templates/browse.tmpl 2010-09-22 14:39:24 UTC (rev 7706) @@ -5,10 +5,16 @@ $curuserprefs = $user->getPreferences(); ?> +<?php if ($page->exists() and $revision and $revision->hasDefaultContents()) { ?> + <p class="error"><strong><?php echo _("Error:")?></strong> + <?php echo _("This revision of the page does not exist.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> +<?php } else { ?> <?php if ($revision and !$revision->isCurrent()) { ?> <p class="warning_msg"><strong><?php echo _("Note:")?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version"), $page)?>. + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> </p> <?php } ?> <?php if (!empty($redirected)) { ?> @@ -31,6 +37,8 @@ <?php echo $CONTENT?> +<?php } ?> + <div id="footer"><?php // for top & bottom toolbars stylesheet ?> <?php echo Template('browse-footer')?> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |