Changeset 1183

Show
Ignore:
Timestamp:
07/02/07 14:10:55 (1 year ago)
Author:
ben
Message:

Created generic comment style.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/generic_comments/lib.php

    r1182 r1183  
    22 
    33function generic_comments_init() { 
    4         global $CFG, $db,$function, $metatags
     4        global $CFG, $db,$function, $metatags, $template
    55 
    66        $metatags .= "<script type=\"text/javascript\" src=\"{$CFG->wwwroot}mod/generic_comments/generic_comments.js\"><!-- generic_comments js --></script>"; 
     
    2121    $function['permissions:check'][] = $CFG->dirroot . "mod/generic_comments/permissions_check.php"; 
    2222 
    23  
    2423    // Add annotation support 
    2524        display_set_display_annotation_function("file::file", "generic_comments_displayobjectannotations"); 
     
    3130                river_register_friendlyname_hook('file::file', 'generic_comments_get_friendly_name'); 
    3231        } 
     32        $template['embeddedcomments'] .= file_get_contents($CFG->dirroot . "mod/generic_comments/comments"); 
     33        $template['embeddedcomment'] .= file_get_contents($CFG->dirroot . "mod/generic_comments/comment"); 
    3334 
    3435} 
     
    121122END; 
    122123 
    123         $field = display_input_field(array("new_comment","","longtext")); 
     124        // $field = display_input_field(array("new_comment","","longtext")); 
     125        $field = <<< END 
     126         
     127        <textarea name="new_comment" id="new_comment"></textarea> 
     128         
     129END; 
    124130        if (logged_on) { 
    125131            $userid = $_SESSION['userid']; 
     
    244250                     
    245251                    $commentsbody .= templates_draw(array( 
    246                                                           'context' => 'weblogcomment', 
     252                                                          'context' => 'embeddedcomment', 
    247253                                                          'postedname' => $comment->postedname, 
    248254                                                          'body' => '<a name="cmt' . $comment->ident . '" id="cmt' . $comment->ident . '"></a>' . $comment->body, 
     
    256262                } 
    257263                $commentsbody = templates_draw(array( 
    258                                                      'context' => 'weblogcomments', 
     264                                                     'context' => 'embeddedcomments', 
    259265                                                     'paging' => $pagelinks, 
    260266                                                     'comments' => $commentsbody 
     
    299305                } 
    300306                 
    301                 $field = display_input_field(array("new_comment","","longtext")); 
     307                // $field = display_input_field(array("new_comment","","longtext")); 
     308                $field = <<< END 
     309                <textarea name="new_comment" id="new_comment"></textarea> 
     310END; 
    302311                if (logged_on) { 
    303312                        $userid = $_SESSION['userid']; 
     
    375384                     
    376385                    $commentsbody .= templates_draw(array( 
    377                                                           'context' => 'weblogcomment', 
     386                                                          'context' => 'embeddedcomment', 
    378387                                                          'postedname' => $comment->postedname, 
    379388                                                          'body' => '<a name="cmt' . $comment->ident . '" id="cmt' . $comment->ident . '"></a>' . $comment->body, 
     
    387396                } 
    388397                $commentsbody = templates_draw(array( 
    389                                                      'context' => 'weblogcomments', 
     398                                                     'context' => 'embeddedcomments', 
    390399                                                     'paging' => $pagelinks, 
    391400                                                     'comments' => $commentsbody 
     
    409418                                </form> 
    410419                                <div id="ajaxmessages_$object_id"></div> 
    411                                 <span style="cursor:hand; cursor:pointer" onclick="sendcomment('{$CFG->wwwroot}mod/generic_comments/action_redirection.php','comment_$object_id', $object_id)">$postcomment</span
     420                                <input type="button" style="cursor:hand; cursor:pointer" onclick="sendcomment('{$CFG->wwwroot}mod/generic_comments/action_redirection.php','comment_$object_id', $object_id)" value="$postcomment" /
    412421                        </div> 
    413422END;