Changeset 707

Show
Ignore:
Timestamp:
08/13/2007 02:35:31 PM (7 years ago)
Author:
JavaWoman
Message:

preventing a diff can be requested (leading to an error) when there are no revisions for a page at all; adding appropriate message for this situation to the language file.

refs #496

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/handlers/revisions/revisions.php

    r694 r707  
    5555                array_unshift($pages, $pageA); 
    5656        } 
    57         // load revisions for this page 
    58         if ($pages) 
     57        // load revisions for this page - only if there is actually more than one version 
     58        if (count($pages) > 1) 
    5959        { 
    6060                $output  = $this->FormOpen('diff', '', 'get'); 
     
    9999                $output .= $this->FormClose()."\n"; 
    100100        } 
     101        else 
     102        { 
     103                $output  = '<h3>'.sprintf(REVISIONS_CAPTION, $this->Link($this->tag))."</h3>\n"; 
     104                $output .= '<em>'.REVISIONS_NO_REVISIONS_YET.'</em>'."\n"; 
     105        } 
    101106 
    102107        echo '<div class="page">'."\n"; 
    103108        echo $output; 
     109        echo '</div>'."\n"; 
    104110}  
    105111else  
    106112{ 
    107113        echo '<div class="page">'."\n"; 
    108         echo '<em class="error">'.WIKKA_ERROR_ACL_READ.'</em>'; 
     114        echo '<em class="error">'.WIKKA_ERROR_ACL_READ.'</em>'."\n"; 
     115        echo '</div>'."\n"; 
    109116} 
    110 echo '</div>'."\n"; 
    111117?> 
  • trunk/lang/en/en.inc.php

    r681 r707  
    747747// revisions 
    748748define('REVISIONS_CAPTION', 'Revisions for %s'); // %s pagename 
     749define('REVISIONS_NO_REVISIONS_YET', 'There are no revisions for this page yet'); 
    749750define('REVISIONS_SIMPLE_DIFF', 'Simple Diff'); 
    750751define('REVISIONS_MORE_CAPTION', 'There are more revisions that were not shown here, click the button labelled %s below to view these entries'); // %S - text of REVISIONS_MORE_BUTTON