Changeset 637

Show
Ignore:
Timestamp:
08/03/2007 02:32:50 PM (3 years ago)
Author:
JavaWoman
Message:
  • implemented StaticHref() for the comment display buttons
  • removed redundant span
  • prevented NOTICE by initializing a variable
  • removed comment about templating class
  • a little coding style cleanup

refs #496

Files:
1 modified

Legend:

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

    r615 r637  
    118118                                $comments = $this->LoadComments($this->tag, $_SESSION['show_comments'][$tag]); 
    119119                                $display_mode = $_SESSION['show_comments'][$tag]; 
     120                                // set up icons 
     121                                $sort_desc_icon_url = StaticHref('images/icons/sort_desc.gif'); 
     122                                $sort_ascc_icon_url = StaticHref('images/icons/sort_asc.gif'); 
     123                                $sort_comment_icon_url = StaticHref('images/icons/comment.gif'); 
     124 
    120125 
    121126                                // display comments header 
     
    124129                                <div class="commentsheader"> 
    125130                                        <div id="commentsnav"> 
    126                                                 <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_DATE_DESC.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_DATE_DESC ?  "icon_on" : "icon").'" alt="flat" title="Flat (newest first)" src="images/icons/sort_desc.gif" />' ?></a> 
    127                                                 <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_DATE_ASC.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_DATE_ASC ?  "icon_on" : "icon").'" alt="flat" title="Flat (oldest first)" src="images/icons/sort_asc.gif" />' ?></a> 
    128                                                 <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_THREADED.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_THREADED ?  "icon_on" : "icon").'" alt="threaded" title="Threaded" src="images/icons/comment.gif" />' ?></a>  
     131                                                <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_DATE_DESC.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_DATE_DESC ?  "icon_on" : "icon").'" alt="flat" title="Flat (newest first)" src="'.$sort_desc_icon_url.'" />' ?></a> 
     132                                                <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_DATE_ASC.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_DATE_ASC ?  "icon_on" : "icon").'" alt="flat" title="Flat (oldest first)" src="'.$sort_asc_icon_url.'" />' ?></a> 
     133                                                <a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_ORDER_THREADED.'#comments') ?>"><?php echo '<img class="'.($display_mode==COMMENT_ORDER_THREADED ?  "icon_on" : "icon").'" alt="threaded" title="Threaded" src="'.$sort_comment_icon_url.'" />' ?></a>  
    129134                                        </div><!-- closing commentsnav div --> 
    130                                 <!--<span id="comments">&nbsp;</span>--><?php echo COMMENTS_CAPTION ?><?php // TODO what is this span for?? ?> 
     135                                <?php echo COMMENTS_CAPTION ?> 
    131136                                [<a href="<?php echo $this->Href('', '', 'show_comments='.COMMENT_NO_DISPLAY) ?>"><?php echo HIDE_COMMENTS_LINK_DESC ?></a>] 
    132137<?php 
     
    152157                        { 
    153158 
     159                                $showcomments_text = '';        // FIXES notice 
    154160                                echo '<!--starting comments header (hide)-->'."\n"; 
    155161                                echo '<div class="commentsheader">'."\n"; 
     
    172178                                        default: 
    173179                                                $comments_message = sprintf(STATUS_SOME_COMMENTS, $commentCount).' '; 
    174                                                 $comment_ordering = null; 
     180                                                $comment_ordering = NULL; 
    175181                                                if (isset($user['default_comment_display'])) 
    176182                                                { 
     
    190196                                echo $comments_message; 
    191197                                echo $showcomments_text; 
    192                                 echo "\n".'</div><!--closing commentsheader (hide)-->'."\n"; //TODO: move to templating class 
     198                                echo "\n".'</div><!--closing commentsheader (hide)-->'."\n"; 
    193199                        } 
    194200                        echo '</div><!--closing comments block-->'."\n\n"; 
     
    263269                        if ($obj->HasAccess('comment_post')) 
    264270                        { 
    265                                 echo "<div class=\"commentaction\">"; 
     271                                echo '<div class="commentaction">'; 
    266272                                echo $obj->FormOpen("processcomment"); 
    267273?>