Changeset 1170

Show
Ignore:
Timestamp:
06/26/07 10:49:03 (1 year ago)
Author:
icewing
Message:

Marcus Povey <marcus@dushka.co.uk>
* Generic comments: Support added for upcoming mediastream integration.

Files:

Legend:

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

    r1168 r1170  
    4545        if ($object_type == 'file::file') 
    4646                return file_get_friendly_name($object_type, $object_id); 
     47                 
     48        if ($object_type == 'mediastream::media') 
     49                return mediastream_get_friendly_name($object_type, $object_id); 
    4750 
    4851        return ""; 
     
    5356        $return = ""; 
    5457 
    55         if ($object_type == "file::file"
     58        if (($object_type == "file::file") || ($object_type == "mediastream::media")
    5659        { 
    5760                $txt = __gettext('Click to add or view comments on this file.'); 
    58                 $int = implode('',action('annotate',$object->ident,'file::file',NULL, 
     61                $int = implode('',action('annotate',$object->ident,$object_type,NULL, 
    5962                        array('comment_form_type'=>'inline', 'comment_sort'=>'DESC', 'comment_form_text'=>$txt))); 
    6063 
     
    6770                        <noscript> 
    6871END; 
    69                 $return .= implode('',action('annotate',$object->ident,'file::file',NULL, 
     72                $return .= implode('',action('annotate',$object->ident,$object_type,NULL, 
    7073                        array('comment_form_type'=>'summary', 'comment_sort'=>'DESC', 'comment_form_text'=>$txt))); 
    7174 
     
    448451                        $table = 'weblog_posts'; 
    449452                        break; 
     453                case 'mediastream::media': 
     454                        $table = 'mediastream_objects'; 
     455                        break; 
    450456                default: 
    451457                        // this table does not exist (yet) 
     
    480486                        $table = 'weblog_posts'; 
    481487                        break; 
     488                case 'mediastream::media': 
     489                        $table = 'mediastream_objects'; 
     490                        break; 
    482491                default: 
    483492                        // this table does not exist (yet) 
     
    510519                case 'blog::weblog': 
    511520                        $title = get_field('weblog_posts','title','ident',$object_id); 
     521                        break; 
     522                case 'mediastream::media': 
     523                        $title = get_field('mediastream_objects','name','ident',$object_id); 
    512524                        break; 
    513525                case 'profile::profile': 
     
    555567                        $username = user_info('username',$object_record->weblog); 
    556568                        $url = $CFG->wwwroot.$username.'/weblog/'.$object_record->ident.'.html'; 
     569                        break; 
     570                case 'mediastream::media': 
     571                        $object_record = get_record('mediastream_objects','ident',$object_id); 
     572                        $username = user_info('username',$object_record->owner); 
     573                        $url = $CFG->wwwroot."/mod/mediastream/display.php?ident={$object_record->ident}&owner={$object_record->owner}&media={$object_record->mediatype}"; 
    557574                        break; 
    558575                case 'profile::profile':