Changeset 445

Show
Ignore:
Timestamp:
05/02/08 13:22:37 (7 months ago)
Author:
aarkerio
Message:

New hobbit edublog style

Location:
trunk/app
Files:
16 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/postgresql/participations.sql

    r444 r445  
    11CREATE TABLE participations (  -- tests student results 
    2    id serial NOT NULL UNIQUE, 
     2   id serial NOT NULL PRIMARY KEY, 
    33   user_id int NOT NULL REFERENCES users(id) ON DELETE CASCADE, 
    4    points smallint NOT NULL DEFAULT 1, 
     4   points smallint NOT NULL DEFAULT 0, 
     5   participation text NOT NULL, 
    56   forum_id int NOT NULL REFERENCES forums(id) ON DELETE CASCADE, 
    6    vclassroom_id int NOT NULL REFERENCES vclassrooms(id) ON DELETE CASCADE, 
    7    PRIMARY KEY (user_id, forum_id, vclassroom_id) 
     7   vclassroom_id int NOT NULL REFERENCES vclassrooms(id) ON DELETE CASCADE 
    88); 
    99-- Test model tables ends 
  • trunk/app/controllers/vclassrooms_controller.php

    r444 r445  
    2020 public function beforeFilter() 
    2121 { 
    22       $this->Auth->allow(array('show', 'jointoclass', 'display')); 
     22      $this->Auth->allow(array('show', 'jointoclass', 'display', 'participation')); 
    2323      parent::beforeFilter(); 
    2424 } 
     
    7575           $this->Edublog->setSession($user_id); 
    7676      } 
     77 } 
     78 
     79 public function participation() 
     80 { 
     81   $this->layout = 'ajax'; 
     82 
     83   if ( !empty($this->data['Participation'])) 
     84   {   
     85          $this->set('vclassroom_id', $this->data['Participation']['vclassroom_id']); 
     86          $this->render('participation', 'ajax'); 
     87   } 
    7788 } 
    7889 
  • trunk/app/locale/spa/default.po

    r440 r445  
    88msgid  "where_pin" 
    99msgstr "Where is my PIN?" 
     10 
     11msgid  "part_advice" 
     12msgstr "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/acquaintances.ctp

    r313 r445  
    1 <div class="temas">Friend's links</div> 
    21<?php 
     2 
     3echo $html->div('temas', 'Useful links'); 
     4 
    35foreach ($blog["Acquaintance"] as $val)  
    46{ 
  • trunk/app/views/elements/vclassrooms.ctp

    r242 r445  
    1 <div class="temas">Classrooms</div> 
    21<?php 
    3 foreach ($blog["Vclassroom"] as $key => $val)  
     2echo $html->div('temas','Groups'); 
     3 
     4foreach ($blog['Vclassroom'] as $val)  
    45{ 
    56  echo $html->link($val['name'], '/vclassrooms/show/'.$val['user_id'].'/'. $val['id'], array("class"=>"petit")) . "<br />\n"; 
  • trunk/app/views/vclassrooms/show.ctp

    r441 r445  
    11<?php 
    22//exit(debug($data)); 
    3 ?> 
    4 <h2>Classrooms</h2> 
    5 <div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div> 
    6 <?php 
    7   echo  '<h1>' . $data['Vclassroom']['name']      . '</h1>'; 
     3echo $javascript->link('fckeditor/fckeditor');  
     4 
     5 
     6 echo  '<h1>' . $data['Vclassroom']['name']      . '</h1>'; 
    87   
    9   $auth = false; 
     8 $auth = false; 
    109 
    11   if ( $session->check('vclassrooms') ) 
    12   { 
     10 if ( $session->check('vclassrooms') ) 
     11 { 
    1312     $auth = ( in_array($data['Vclassroom']['id'], $session->read('vclassrooms'))) ? true : false;  // students belongs this vclass ? 
    14   } 
     13 } 
    1514 
    1615  if ( $auth === true ) 
     
    6059       } 
    6160     } 
     61      echo $ajax->form(); 
     62      
     63     echo $form->hidden('Participation.vclassroom_id', array('value'=>$data['Vclassroom']['id'])); 
     64     echo $ajax->submit('Compose participation ', array("url" => "/vclassrooms/participation/",  
     65                                         "update"=>"setform", 
     66                                         "loading" => "Element.show('charging');Element.hide('setform')", 
     67                                         "complete" => "Element.hide('charging');Effect.Appear('setform')" 
     68        )); 
     69     echo '</form>';  
     70     // empty ajax div 
     71     echo $ajax->div('setform') . $ajax->divEnd('setform');  
    6272  } 
    6373 
     
    8393   } 
    8494?> 
     95<div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div>