root/trunk/app/views/forums/display.ctp

Revision 827, 2.7 kB (checked in by aarkerio, 5 weeks ago)

Models extendend

Line 
1<?php
2//die(debug($data));
3
4if ( $belongs === true ):
5 echo $html->div(null, __('Category', true).': ' . $data['Catforum']['title'], array('style'=>'font-weight:bold;'));
6
7 echo  $html->div('titentry', $data["Forum"]["title"]);
8 echo  $html->para(null, $data["Forum"]["description"]);
9
10  $tmp = $ajax->link($html->image("static/new_post.gif", array('alt'=>__('New topic', true), 'title'=>__('New topic', true))),
11'/topics/add/'.$data['Forum']['vclassroom_id'].'/'.$data['Forum']['id'],
12                                array("update" => "qn",
13                              "loading"=>"Element.show('loading3');",
14                          "complete"=>"Element.hide('loading3');Effect.Appear('qn')"),
15                               null,
16                               false
17                               );
18   
19 $tmp .= '<div id="loading3" style="display: none;">'.$html->image('static/loading.gif', array('alt'=>'Loading')).'</div>';
20
21 $tmp .= $ajax->div('qn', array("style"=>"padding:3px")) . $ajax->divEnd('qn');
22 
23 echo $html->div(null, $tmp);
24 
25 //Topics
26 echo '<table style="border-collapse:collapse;width:100%">';
27 if ( count($data['Topic']) == 0):
28   echo '<tr><td colspan="6"><br /><h4>'.__('There is not topic on this forum yet', true).'</h4></td></tr>';
29 else:
30   $th = array(__('Read', true), __('Topics', true), __('Replies', true), __('Author', true), __('Views', true), __('Last Post', true));
31   echo $html->tableHeaders($th, array('style'=>'text-align:center'));
32 endif;
33 //die(print_r($data['Topic']));
34           
35 foreach ($data['Topic'] as $val):       
36    $tr = array (
37         $html->image('static/folder.gif'),
38         $html->link($val['subject'], '/topics/display/'.$data['Forum']['user_id'].'/'.$val['forum_id'].'/'.$val['id']),
39                   count($val['Reply']),
40                   $val['User']['username'],
41                   count($val['Visitor']),
42                   '<span style="font-size:6pt">'.$time->timeAgoInWords($val['created']) .'</span>'
43                );
44    echo $html->tableCells($tr, array("style"=>"border:1px solid gray;padding:6px;background-color:#e8f6fe"),
45                                array("style"=>"border:1px solid gray;padding:6px;background-color:#c0c0c0"));   
46 endforeach;
47 echo '</table>';
48 
49 echo $html->para(null, __('Legend', true).':');
50
51 $tmp  = $html->image('static/board.gif', array('alt'=>'Tema normal', 'title'=>'Tema normal')) . ' Tema normal <br />';
52 $tmp .= $html->image('static/locked.gif', array('alt'=>'Tema bloqueado', 'title'=>'Tema bloqueado')) . ' Tema bloqueado<br />';
53 $tmp .= $html->image('static/new.gif', array('alt'=>'Comentario nuevo', 'title'=>'Comentario nuevo')). ' Comentario nuevo<br />';
54
55 echo $html->para(null, $tmp);
56else:
57  e($html->para(null, __('You must be logged in and belongs to this class to see this section', true)));
58endif;
59?>
Note: See TracBrowser for help on using the browser.