Changeset 635
- Timestamp:
- 07/09/08 19:24:21 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 8 modified
- 2 moved
-
config/routes.php (modified) (1 diff)
-
controllers/comments_controller.php (modified) (2 diffs)
-
controllers/entries_controller.php (modified) (2 diffs)
-
controllers/users_controller.php (modified) (2 diffs)
-
locale/eng/LC_MESSAGES/default.po (modified) (1 diff)
-
locale/spa/LC_MESSAGES/default.po (modified) (2 diffs)
-
views/elements/vclassrooms.ctp (modified) (1 diff)
-
views/entries/display.ctp (moved) (moved from trunk/app/views/users/blog.ctp) (1 diff)
-
views/entries/view.ctp (moved) (moved from trunk/app/views/users/entry.ctp) (3 diffs)
-
views/vclassrooms/participation.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/routes.php
r407 r635 9 9 * ...and connect the rest of 'blog' controller's urls. 10 10 */ 11 Router::connect('/blog/*', array('controller' => ' users', 'action' => 'blog'));11 Router::connect('/blog/*', array('controller' => 'entries', 'action' => 'display')); 12 12 /** 13 13 * Then we connect url '/test' to our test controller. This is helpfull in -
trunk/app/controllers/comments_controller.php
r631 r635 32 32 if ($username != null): 33 33 $user_id = $this->User->field('id', array("username"=>$username)); 34 $conditions["user_id"] = $user_id;34 $conditions["user_id"] = $user_id; 35 35 endif; 36 36 … … 51 51 if (!empty($this->data["Comment"]) ): 52 52 53 $this->Sanitize = new Sanitize; 53 $this->Sanitize = new Sanitize; 54 $this->Sanitize->clean($this->data["Comment"]); //Hopefully this is enough 55 $this->Comment->create(); 54 56 55 $this->Sanitize->clean($this->data["Comment"]); //Hopefully this is enough 56 57 $this->Comment->create(); 58 59 if ($this->Comment->save($this->data["Comment"])): 60 $this->msgFlash('Comment added', $this->data['Comment']['redirect_to'].'/#comments'); 61 endif; 57 if ($this->Comment->save($this->data["Comment"])): 58 $this->msgFlash(__('Comment added', true), $this->data['Comment']['redirect_to'].'/#comments'); 59 endif; 62 60 endif; 63 61 } -
trunk/app/controllers/entries_controller.php
r593 r635 19 19 public $components = array('Edublog', 'Portal', 'Search'); 20 20 21 public $paginate = array('limit' => 7, 'page' => 1, 'order' => array('Entry.id' => 'DESC'), 'fields'=> array('Entry.title', 'Entry.body', 'Entry.created', 'Entry.user_id', 'Entry.discution', 'Entry.subject_id', 'Entry.id', 'User.username', 'Subject.title', 'Subject.id') 22 ); 23 21 24 public function beforeFilter() 22 25 { … … 25 28 } 26 29 30 public function display($username = null) 31 { 32 if ($username == null): 33 $this->redirect("/"); 34 return false; 35 endif; 36 37 $this->pageTitle = $username . '\'s Blog'; 38 39 $user_id = $this->Entry->User->field('id', array('username'=>$username)); 40 41 $conditions = array('Entry.user_id'=>$user_id, 'Entry.status'=>1); 42 43 $data = $this->paginate('Entry', $conditions); 44 45 $this->set(compact('data')); 46 47 $this->layout = $this->Edublog->layout($user_id); 48 49 $this->Edublog->blog($user_id); 50 } 51 52 public function view($username, $entry_id) 53 { 54 if ($entry_id == null): 55 $this->redirect('/blog/'.$username); 56 return false; 57 endif; 58 59 $this->pageTitle = $username . '\'s Blog'; 60 61 $user_id = $this->Entry->User->field('User.id', array("username"=>$username)); 62 63 if ($username == null || $user_id == null): 64 $this->redirect("/"); 65 return false; 66 endif; 67 68 $conditions = array('Entry.user_id'=>$user_id, 'Entry.status'=>1, 'Entry.id'=>$entry_id); 69 70 $fields = array("Entry.title", "Entry.body", "Entry.created", "Entry.user_id", "Entry.discution", "Entry.subject_id", "Entry.id", "User.username", "Subject.title", "Subject.id"); 71 72 $this->set('data', $this->Entry->find($conditions, $fields)); 73 74 $this->layout = $this->Edublog->layout($user_id); 75 76 $this->Edublog->blog($user_id); // blogger elements 77 } 78 79 27 80 public function rss($username) 28 81 { -
trunk/app/controllers/users_controller.php
r634 r635 41 41 if ($username == null): 42 42 $this->redirect("/"); 43 return false; 43 44 endif; 44 45 … … 56 57 57 58 $limit = 7; 58 59 $this->set('data', $this->User->Entry->findAll($conditions, $fields, $order, $limit)); 59 60 //$this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 61 $data = $this->paginate('Entry', array('Entry.status = 1')); 62 63 $this->set(compact('data')); 64 65 //$this->set('data', $this->User->Entry->findAll($conditions, $fields, $order, $limit)); 60 66 61 67 $this->layout = $this->Edublog->layout($user_id); -
trunk/app/locale/eng/LC_MESSAGES/default.po
r587 r635 19 19 msgid "where_pin" 20 20 msgstr "Where is my PIN?" 21 22 msgid "participa" 23 msgstr "It's advisable to have your participation recorded on your own computer. Before you write here, write and save your participation using a simple text editor like Wordpad or Gedit. After you have done this, copy it and paste it here. Your participation should be plain text, without any format, tables or images." -
trunk/app/locale/spa/LC_MESSAGES/default.po
r634 r635 1 1 msgid "Group" 2 2 msgstr "Grupo" 3 4 msgid "Groups" 5 msgstr "Grupos" 3 6 4 7 msgid "Email" … … 368 371 msgstr "Recordarme" 369 372 370 msgid "part _advice"373 msgid "participa" 371 374 msgstr "Es una buena costumbre mantener tu propio registro de participaciones, antes de ecribir aquÃ, escribe y guarda tu particación usando un editor de texto sencillo como Wordpad o Gedit, luego copia y pegala aquÃ. La participación debe ser texto plano sin formato, sin tablas ni imágenes." -
trunk/app/views/elements/vclassrooms.ctp
r445 r635 1 1 <?php 2 echo $html->div('temas', 'Groups');2 echo $html->div('temas', __('Groups', true)); 3 3 4 foreach ($blog['Vclassroom'] as $val) 5 { 6 echo $html->link($val['name'], '/vclassrooms/show/'.$val['user_id'].'/'. $val['id'], array("class"=>"petit")) . "<br />\n"; 7 } 4 foreach ($blog['Vclassroom'] as $val): 5 echo $html->link($val['name'], '/vclassrooms/show/'.$val['user_id'].'/'. $val['id'], array("class"=>"petit")) . "<br />\n"; 6 endforeach; 8 7 ?> 9 8 -
trunk/app/views/entries/display.ctp
r634 r635 13 13 e($html->div('body_entry', $val['Entry']['body'])); 14 14 15 $pl = ' Permalink: http://' . $_SERVER['SERVER_NAME'] . '/users/entry/'.$val["User"]["username"].'/'.$val['Entry']['id'];15 $pl = 'http://' . $_SERVER['SERVER_NAME'] . '/entries/view/'.$val['User']['username'].'/'.$val['Entry']['id']; 16 16 17 e($html->div('plink',$html->link( $pl, '/users/entry/'.$val["User"]["username"].'/'.$val['Entry']['id'])));17 e($html->div('plink',$html->link('Permalink: '.$pl, $pl))); 18 18 19 19 if ( $val['Entry']['discution'] == 1): //is the comments in this entry actived and is an individual entry? 20 e($html->div('plink', $html->image('static/comentarios.gif', array('alt'=>__('Add comment', true))).' '.$html->link(__('Add comment', true).' ('.count($val['Comment']).')', '/users/entry/'.$val['User']['username'].'/'.$val['Entry']['id'])));20 e($html->div('plink', $html->image('static/comentarios.gif', array('alt'=>__('Add comment', true))).' '.$html->link(__('Add comment', true).' ('.count($val['Comment']).')', $pl))); 21 21 endif; 22 22 endforeach; 23 24 $paginator->options(array('url' => $val['User']['username'])); 25 26 $t = $html->div(null,$paginator->prev('« Previous ',null,null,array('class'=>'disabled')),array('style'=>'width:100px;float:left')); 27 $t .= $html->div(null,$paginator->next(' Next »', null, null, array('class' => 'disabled')),array('style'=>'width:100px;float:right')); 28 $t .= $html->div(null,$paginator->counter(), array('style'=>'width:200px;float:center')); 29 echo $html->div(null,$t, array('style'=>'font-size:9pt;width:400px;margin:15px auto;')); 23 30 ?> -
trunk/app/views/entries/view.ctp
r634 r635 10 10 e($html->div('body_entry', $data['Entry']['body'])); 11 11 12 $pl = ' Permalink: http://' . $_SERVER['SERVER_NAME'] . '/users/entry/'.$blog['User']['username'].'/'.$entry_id;12 $pl = 'http://' . $_SERVER['SERVER_NAME'] . '/entries/view/'.$blog['User']['username'].'/'.$entry_id; 13 13 14 e($html->div('plink', $html->link( $pl, '/users/entry/'.$blog['User']['username'].'/'.$entry_id)));14 e($html->div('plink', $html->link('Permalink: '. $pl, $pl))); 15 15 16 if ( $discution == 1 ) //is the comments in this entry actived by blogger?17 {16 if ( $discution == 1 ): //is the comments in this entry actived by blogger? 17 18 18 if ( $session->check('Auth.User') ): // if user logged, anchor to textarea 19 19 echo $html->div(null, $html->image('static/comment.gif', array('alt'=>'Comments')) . ' Comments:', array('id'=>'comments')); … … 39 39 40 40 echo $form->create('Comment', array('onsubmit'=>'return chkForm()', 'action'=>'add')); 41 echo $form->hidden('Comment.redirect_to', array('value'=>'/ users/entry/'.$blog['User']['username'].'/'.$entry_id));41 echo $form->hidden('Comment.redirect_to', array('value'=>'/entries/view/'.$blog['User']['username'].'/'.$entry_id)); 42 42 echo $form->hidden('Comment.entry_id', array('value'=>$entry_id)); 43 43 … … 55 55 echo $form->error('Comment.comment', 'A comment is required.'); 56 56 57 echo $form->end( 'Send');57 echo $form->end(__('Send', true)); 58 58 echo '</fieldset>'; 59 59 else: 60 echo $html->para(null, $html->link( 'You must be logged in to write a comment', '/users/login'));60 echo $html->para(null, $html->link(__('You must be logged in to write a comment', true), '/users/login')); 61 61 endif; 62 62 63 63 echo "</div>"; 64 }64 endif; 65 65 ?> 66 66 <script type="text/javascript"> -
trunk/app/views/vclassrooms/participation.ctp
r561 r635 1 1 <?php 2 echo $html->div('hint', 'It\'s advisable to have your participation recorded on your own computer. Before you write here, write and save your participation using a simple text editor like Wordpad or Gedit. After you have done this, copy it and paste it here. Your participation should be plain text, without any format, tables or images.');2 echo $html->div('hint', __('participa', true)); 3 3 4 4 echo $form->create('Participation', array('action'=>'add', 'onsubmit'=>'return validateForm()'));
