Changeset 1942

Show
Ignore:
Timestamp:
2006-02-02 18:06:31 (3 years ago)
Author:
ctford
Message:

Put clip table outputting in a separate function and wrap long clip descriptions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Anode/trunk/acidfree/class_annodex.inc

    r1941 r1942  
    205205                $output .= "<br />"; 
    206206 
    207                 $result = db_query("SELECT * FROM {acidfree_cmml_clips} WHERE nid={$node->nid} ORDER BY `start`;");      
    208  
    209                 /* Output clip information in a themed table. */ 
    210                 $table_rows = array(); 
    211                 $header = array(); 
    212  
    213                 while( $row = db_fetch_object($result) ) { 
    214  
    215                         $cells = array(); 
    216  
    217                         $cells[] = array('data'=>l($row->id, "node/{$node->nid}",NULL,"$arg_name=annodex&id={$row->id}")."<br />"); 
    218                         if( $row->img ) { 
    219                                 $cells[] = array('data'=>"<a href =\"?q=node/{$node->nid}&$arg_name=annodex&id={$row->id}\"><img height=120 width=120 src=\"{$row->img}\"></a>"); 
    220                         } else { 
    221                                 $cells[] = array('data'=>NULL); 
    222                         } 
    223  
    224                         if( $row->desc ) { 
    225                                 $cells[] = array('data'=>$row->desc); 
    226                         } else { 
    227                                 $cells[] = array('data'=>NULL); 
    228                         } 
    229  
    230                         /* Add cells */ 
    231                         $table_rows[] = $cells; 
    232                 } 
    233                 /* Add table */ 
    234                 $output .= theme_table( $header, $table_rows ); 
     207 
     208                $output .= clip_table( $node ); 
    235209 
    236210                /* Add new clip form */ 
     
    275249        return; 
    276250} 
     251 
     252function clip_table( $node ) { 
     253 
     254                $result = db_query("SELECT * FROM {acidfree_cmml_clips} WHERE nid={$node->nid} ORDER BY `start`;");      
     255 
     256                /* Output clip information in a themed table. */ 
     257                $table_rows = array(); 
     258                $header = array(); 
     259                $header[] = array( 'data'=>'Clip ID'); 
     260                $header[] = array( 'data'=>'Image'); 
     261                $header[] = array( 'data'=>'Description'); 
     262                $header[] = array( 'data'=>'Options'); 
     263 
     264                while( $row = db_fetch_object($result) ) { 
     265 
     266                        $cells = array(); 
     267 
     268                        $cells[] = array('data'=>l($row->id, "node/{$node->nid}",NULL,"$arg_name=annodex&id={$row->id}")."<br />"); 
     269                        if( $row->img ) { 
     270                                $cells[] = array('data'=>"<a href =\"?q=node/{$node->nid}&$arg_name=annodex&id={$row->id}\"><img height=120 width=120 src=\"{$row->img}\"></a>"); 
     271                        } else { 
     272                                $cells[] = array('data'=>NULL); 
     273                        } 
     274 
     275                        if( $row->desc ) { 
     276                                $cells[] = array('data'=>wordwrap($row->desc,40, '<br \>', TRUE)); 
     277                        } else { 
     278                                $cells[] = array('data'=>NULL); 
     279                        } 
     280 
     281                        $cells[] = array('data'=>"dummy edit"); 
     282 
     283                        /* Add cells */ 
     284                        $table_rows[] = $cells; 
     285                } 
     286                /* Add table */ 
     287                return theme_table( $header, $table_rows ); 
     288 
     289}