Changeset 352
- Timestamp:
- 03/28/08 10:03:54 (10 months ago)
- Location:
- trunk/app
- Files:
-
- 2 added
- 17 modified
-
controllers/ecourses_controller.php (modified) (4 diffs)
-
controllers/lessons_controller.php (modified) (5 diffs)
-
controllers/shares_controller.php (modified) (1 diff)
-
controllers/users_controller.php (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (2 diffs)
-
models/ecourse.php (modified) (1 diff)
-
models/lesson.php (modified) (1 diff)
-
views/ecourses/admin_listing.ctp (modified) (1 diff)
-
views/ecourses/admin_vclassrooms.ctp (modified) (2 diffs)
-
views/elements/admin_menu.ctp (modified) (1 diff)
-
views/images/admin_listing.ctp (modified) (3 diffs)
-
views/lessons/admin_add.ctp (modified) (1 diff)
-
views/lessons/admin_edit.ctp (modified) (3 diffs)
-
views/vclassrooms/admin_edit.ctp (modified) (2 diffs)
-
views/vclassrooms/admin_listing.ctp (modified) (3 diffs)
-
views/vclassrooms/admin_members.ctp (modified) (2 diffs)
-
webroot/css/cpanel/cpanel.css (modified) (1 diff)
-
webroot/img/admin/forums_icon.png (added)
-
webroot/img/admin/historic.png (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/ecourses_controller.php
r350 r352 3 3 * Karamelo E-Learning Platform 4 4 * Manuel Montoya 2002-2008 5 * GPLv3 License manuel<a t>mononeurona.org5 * GPLv3 License manuel<arroba>mononeurona<punto>org 6 6 * Chipotle Software TM 7 7 */ … … 54 54 } 55 55 56 public function admin_vclassrooms($ecourse_id, $hi dden = 0)56 public function admin_vclassrooms($ecourse_id, $historic = null) 57 57 { 58 58 $this->layout = 'admin'; … … 61 61 62 62 $conditions = array("Ecourse.user_id"=>$this->Auth->user('id'), "Ecourse.id"=>$ecourse_id); 63 $fields = array('id', 'title', 'status'); 63 64 if ( $historic === 'historic' ) 65 { 66 $this->Ecourse->filed(); //show filed classrooms 67 68 $this->set('historic', true); 69 } 70 64 71 $order = "Ecourse.id DESC"; 72 73 //die( debug($this->Ecourse->find($conditions))); 65 74 66 $this->set('data', $this->Ecourse->find($conditions , $fields));75 $this->set('data', $this->Ecourse->find($conditions)); 67 76 } 68 77 … … 85 94 { 86 95 $this->layout = 'admin'; 87 88 $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title"));96 97 $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 89 98 90 99 $this->set('langs', Set::combine($this->Ecourse->Lang->find('all', array('order' => 'lang')), "{n}.Lang.id","{n}.Lang.lang")); -
trunk/app/controllers/lessons_controller.php
r336 r352 3 3 * Karamelo E-Learning Platform 4 4 * Manuel Montoya 2002-2008 5 * GPLv3 manuel<a t>mononeurona<punto>org5 * GPLv3 manuel<arroba>mononeurona<punto>org 6 6 */ 7 7 … … 95 95 $this->layout = 'admin'; 96 96 97 $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 98 97 99 if (!empty($this->data["Lesson"])) 98 100 { … … 115 117 { 116 118 $this->layout = 'admin'; 119 120 $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 117 121 118 122 if ( empty( $this->data["Lesson"] ) ) … … 146 150 public function admin_delete($id) 147 151 { 148 if ($this->Lesson->del($id))152 if ($this->Lesson->del($id)) 149 153 { 150 154 $this->msgFlash('Lesson deleted', '/admin/lessons/listing'); … … 152 156 else 153 157 { 154 $this->flash('Error, call support', '/admin/lessons/listing');158 $this->flash('Error, call support', '/admin/lessons/listing'); 155 159 } 156 160 } -
trunk/app/controllers/shares_controller.php
r329 r352 13 13 14 14 public $components = array('Edublog', 'Adds'); 15 15 16 public function beforeFilter() 17 { 18 $this->Auth->allow(array('download')); 19 parent::beforeFilter(); 20 } 16 21 public function isAuthorized() 17 22 { -
trunk/app/controllers/users_controller.php
r342 r352 406 406 { 407 407 //die( var_dump($this->data['User']) ); 408 if ( strlen($this->data["User"]["pwd"]) >5) // only if pwd is big enough408 if ( strlen($this->data["User"]["pwd"]) < 5) // only if pwd is big enough 409 409 { 410 $this->data["User"]["pwd"] = md5($this->data["User"]["pwd"]); // MD5 411 } 412 else 413 { 414 unset($this->data["User"]["pwd"]); 410 unset($this->data["User"]["pwd"]); 415 411 } 416 412 -
trunk/app/controllers/vclassrooms_controller.php
r350 r352 77 77 /*** == ADMIN METHODS === ***/ 78 78 79 public function admin_listing( )79 public function admin_listing($historic = null) 80 80 { 81 81 $this->layout = 'admin'; 82 $conditions = array("Vclassroom.user_id"=>$this->Auth->user('id') );83 $fields = array( "Vclassroom.id", "Vclassroom.name", "Vclassroom.created", "Vclassroom.user_id", "Vclassroom.ecourse_id");82 $conditions = array("Vclassroom.user_id"=>$this->Auth->user('id'), "Vclassroom.status"=>1); 83 $fields = array('id', 'name', 'created', 'user_id', 'ecourse_id', 'status'); 84 84 $order = "Vclassroom.id DESC"; 85 85 86 if ($historic === 'historic') 87 { 88 $conditions['Vclassroom.status'] = 0; 89 $this->set('historic', true); 90 } 91 86 92 $this->pageTitle = 'eClass'; 87 93 … … 195 201 } 196 202 } 197 /** 203 204 /** 198 205 * 199 206 * args id 200 207 * 201 **/208 **/ 202 209 public function admin_edit($id = null) 203 210 { -
trunk/app/models/ecourse.php
r342 r352 9 9 class Ecourse extends AppModel { 10 10 11 public $name = 'Ecourse'; 11 public $name = 'Ecourse'; 12 12 13 13 public $belongsTo = array('User', 'Subject', 'Lang'); 14 14 15 public $hasMany = array('Vclassroom'); 15 public $hasMany = array('Vclassroom' => 16 array( 17 'className' => 'Vclassroom', 18 'foreignKey' => 'ecourse_id', 19 'conditions' => 'status = 1' 20 ) 21 ); 16 22 23 public function filed() 24 { 25 $this->unbindModel(array('hasMany'=>array('Vclassroom'))); 26 27 $this->bindModel( array('hasMany' => array('Vclassroom' => 28 array( 29 'className' => 'Vclassroom', 30 'foreignKey' => 'ecourse_id', 31 'conditions' => 'status = 0' 32 ) 33 )) 34 ); 35 return true; 36 } 37 17 38 public $validate = array( 18 39 'title' => array( -
trunk/app/models/lesson.php
r289 r352 11 11 public $name = 'Lesson'; 12 12 13 public $belongsTo = 'User'; 13 public $belongsTo = array('User' => 14 array('className' => 'User', 15 'conditions' => '', 16 'order' => '', 17 'foreignKey' => 'user_id' 18 ), 19 'Subject' => 20 array('className' => 'Subject', 21 'conditions' => '', 22 'order' => null, 23 'foreignKey' => 'subject_id' 24 ) 25 ); 14 26 15 27 public $validate = array( -
trunk/app/views/ecourses/admin_listing.ctp
r340 r352 7 7 echo $html->addCrumb('Courses', '/admin/ecourses/listing'); 8 8 echo $html->getCrumbs(' / '); 9 ?>10 9 11 <p> 12 <?php 13 echo $html->link($html->image('actions/new.png', array("alt"=>"Add new course", "title"=>"Add new course")), '/admin/ecourses/add', null, null, false); 14 ?> 15 </p> 10 echo $html->para(null, $html->link($html->image('actions/new.png', array("alt"=>"Add new course", "title"=>"Add new course")), '/admin/ecourses/add', null, null, false)); 16 11 17 <?php18 //exit(print_r($data));19 12 foreach ($data as $val) 20 13 { 21 echo '<div style="padding:6px 3px 28px 4px;margin:10px 0 5px 0;border:1px dotted gray;">'; 22 echo '<div class="butonright">' .$gags->sendEdit($val['Ecourse']['id'], 'ecourses') . '</div>';23 echo$html->link($val['Ecourse']['title'], '/admin/ecourses/vclassrooms/'.$val['Ecourse']['id']);24 echo '<p>' . $val['Ecourse']['description'] . '</p>';25 echo '<div class="butonright">'. $gags->confirmDel($val['Ecourse']['id'], 'ecourses') .'</div>';26 echo '</div>';14 15 $tmp = $html->div('butonright', $gags->sendEdit($val['Ecourse']['id'], 'ecourses')); 16 $tmp .= $html->link($val['Ecourse']['title'], '/admin/ecourses/vclassrooms/'.$val['Ecourse']['id']); 17 $tmp .= $html->para(null, $val['Ecourse']['description']); 18 $tmp .= $html->div('butonright', $gags->confirmDel($val['Ecourse']['id'], 'ecourses')); 19 echo $html->div('grayblock', $tmp); 27 20 } 28 21 ?> -
trunk/app/views/ecourses/admin_vclassrooms.ctp
r350 r352 6 6 echo $html->getCrumbs(' / '); 7 7 8 echo $html->div('title_section', 'Virtual clasrooms on ' . $data['Ecourse']['title'] . ' e-Course');8 $str = 'Virtual clasrooms on ' . $data['Ecourse']['title'] . ' e-Course'; 9 9 10 if ( isset( $historic ) ) 11 { 12 $str .= ' (filed)'; 13 } 14 15 echo $html->div('title_section', $str); 10 16 11 17 echo $html->para(null, $html->link($html->image('static/vgroups.gif', array("alt"=>"Add new group", "title"=>"Add new group")), '/admin/vclassrooms/add/'.$data['Ecourse']['id'], null, null, false)); … … 25 31 $tmp .= $html->div('butonright', $gags->confirmDel($val['id'], 'Vclassroom')); 26 32 27 echo $html->div('spaced', $tmp); 33 echo $html->div('grayblock', $tmp); 34 } 35 36 if ( !isset( $historic ) ) 37 { 38 echo $html->link( 39 $html->image('admin/historic.png', array('alt'=>'Filed classrooms', 'title'=>'Filed classrooms')), 40 '/admin/ecourses/vclassrooms/'.$data['Ecourse']['id'].'/historic', null, null, false); 28 41 } 29 42 ?> -
trunk/app/views/elements/admin_menu.ctp
r351 r352 7 7 ), 8 8 $html->link('eCourses', '/admin/ecourses/listing') => array( 9 $html->link('Add eCourses', '/admin/ecourses/add') 9 $html->link('Add eCourses', '/admin/ecourses/add'), 10 $html->link('Classrooms', '/admin/vclassrooms/listing') 10 11 ), 11 12 $html->link('Webquests', '/admin/webquests/listing'), -
trunk/app/views/images/admin_listing.ctp
r292 r352 6 6 echo $html->addCrumb('Images', '#'); 7 7 echo $html->getCrumbs(' / '); 8 echo '<div class="title_section">Images</div>';8 echo $html->div('title_section', 'Images'); 9 9 $return = null; 10 10 } … … 29 29 echo $form->error('Image.file', 'Title is required.'); 30 30 echo '</fieldset>'; 31 echo $form->end('Upload'); ?>32 31 echo $form->end('Upload'); 32 ?> 33 33 </td> 34 34 </tr> … … 62 62 { 63 63 echo $form->create('Image', array('action'=>'admin_delete')); 64 echo $form->hidden('Image.return', array('value' => '/admin/images/listing'));64 echo $form->hidden('Image.return', array('value'=>'/admin/images/listing/'.$return)); 65 65 echo $form->hidden('Image.id', array('value' => $val['Image']['id'])); 66 66 echo $form->end('Delete'); -
trunk/app/views/lessons/admin_add.ctp
r333 r352 21 21 <td colspan="2"> 22 22 <?php 23 echo $form->label('Lesson.subject_id', 'Subject:'); 24 echo $form->select('Lesson.subject_id', $subjects, null, null, false); 25 23 26 echo $form->label('Lesson.body', 'Body:' ); 24 echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=> 45));27 echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 25 28 echo $fck->load('LessonBody', 'Karamelo'); 26 29 echo $form->error('Lesson.body', 'Body is required.'); -
trunk/app/views/lessons/admin_edit.ctp
r312 r352 2 2 window.onload = timedMsg; 3 3 </script> 4 <?php $session->flash(); ?> 5 <?php 6 echo $javascript->link('myfunctions'); 7 echo $javascript->link('fckeditor/fckeditor'); 8 ?> 4 <?php 5 $session->flash(); 9 6 10 <?php 11 echo $html->formTag('/admin/lessons/edit','post'); 12 echo $html->hidden('Lesson/id'); 7 echo $javascript->link('myfunctions'); 8 echo $javascript->link('fckeditor/fckeditor'); 9 10 echo $form->create('Lesson'); 11 echo $form->hidden('Lesson.id'); 13 12 ?> 14 13 <fieldset> … … 16 15 <table> 17 16 <tr><td> 18 <?php 19 echo $form->labelTag( 'Lesson/title', 'Title:' ); 20 echo $html->input('Lesson/title', array("size" => 50, "maxlength" => 120, "class"=>"formas")); 21 echo $html->tagErrorMsg('Lesson/title', 'Title is required.'); 22 ?> 17 <?php echo $form->input('Lesson.title', array("size" => 50, "maxlength" => 120)); ?> 23 18 </td> 24 19 <td> … … 29 24 <td colspan="2"> 30 25 <?php 31 echo $form->labelTag( 'Lesson/body', 'Body:' ); 32 echo $html->textarea('Lesson/body', array("class"=>"formas", "cols"=>80, "rows"=>45)); 33 echo $fck->load('Lesson/body', 'Karamelo'); 34 echo $html->tagErrorMsg('Lesson/body', 'Body is required.'); 26 echo $form->label('Lesson.subject_id', 'Subject:'); 27 echo $form->select('Lesson.subject_id', $subjects, null, null, false); 28 29 echo $form->label('Lesson.body', 'Body:' ); 30 echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 31 echo $fck->load('LessonBody', 'Karamelo'); 35 32 ?> 36 33 </td></tr> 37 34 <tr><td> 38 35 <?php 39 echo $form->label Tag( 'Lesson/status', 'Published:' );40 echo $ html->checkbox('Lesson/status');36 echo $form->label( 'Lesson.status', 'Published:' ); 37 echo $form->checkbox('Lesson.status', array("value"=>1)); 41 38 ?> 42 39 </td><td> 43 40 <?php 44 echo $form->label Tag( 'Lesson/disc', 'Comments allowed to this Lesson:' );45 echo $ html->checkbox('Lesson/disc');41 echo $form->label('Lesson.disc', 'Comments allowed to this Lesson:' ); 42 echo $form->checkbox('Lesson.disc', array("value"=>1)); 46 43 47 echo $form->label Tag( 'Lesson/end', 'End edition:' );48 echo $ html->checkbox('Lesson/end', null, array("value"=>1));44 echo $form->label( 'Lesson.end', 'End edition:' ); 45 echo $form->checkbox('Lesson.end', array("value"=>1)); 49 46 ?> 50 47 </td></tr> 51 <tr><td colspan="2"> 52 <?php echo $ html->submit('Save'); ?>48 <tr><td colspan="2"> </fieldset> 49 <?php echo $form->end('Save'); ?> 53 50 </td></tr> 54 51 </table> 55 </fieldset> 56 </form> 52 -
trunk/app/views/vclassrooms/admin_edit.ctp
r307 r352 6 6 echo $html->getCrumbs(' / '); 7 7 8 echo $form->create('Vclassroom', array('action'=>'admin_edit', "onsubmit"=>"chkForm()"));8 echo $form->create('Vclassroom', array('onsubmit'=>'chkForm()')); 9 9 echo $form->hidden('Vclassroom.id'); 10 10 ?> 11 11 12 12 <fieldset> 13 <legend>New Group</legend> 14 <p> 15 <?php 16 echo $form->input('Vclassroom.name', array("size" => 40, "maxlength" => 60)); 17 echo $form->error('Vclassroom.name', 'A name is required.'); 18 ?> 19 </p><br /> 20 21 22 <?php 23 echo $form->label('Vclassroom.status', 'Status:'); 24 echo $form->checkbox('Vclassroom.status', array("value"=>1)); 25 ?> 26 <br /></p> 27 28 <?php 29 $attr = array("value"=>1, "onclick" => "showhide('invi_code')"); 13 <legend>Edit Group</legend> 14 <?php 15 echo $form->input('Vclassroom.name', array('size' => 40, 'maxlength' => 60)); 16 17 18 echo $form->label('Vclassroom.status', 'Status:'); 19 echo $form->checkbox('Vclassroom.status', array('value'=>1)); 20 21 $attr = array("value"=>1, "onclick" => "showhide('invi_code')"); 30 22 31 if ($this->data['Vclassroom']['access'] == 1)32 {23 if ($this->data['Vclassroom']['access'] == 1) 24 { 33 25 $display = 'block'; 34 $attr['checked'] = 'checked'; 35 } 36 else 37 { 38 $display = 'none'; 39 26 $attr['checked'] = 'checked'; 27 } 28 else 29 { 30 $display = 'none'; 40 31 41 } 42 ?> 43 32 } 44 33 45 <?php 46 echo $form->label('Vclassroom.access', 'Members only by invitation:'); 47 echo $form->checkbox('Vclassroom.access', $attr); 34 echo $form->label('Vclassroom.access', 'Members only by invitation:'); 35 echo $form->checkbox('Vclassroom.access', $attr); 48 36 ?> 49 37 <br /><br /> 50 38 51 52 53 39 <div id="invi_code" style="display:<?php echo $display; ?>;"> 54 40 <?php 55 echo $form->label('Vclassroom.secret', 'CODE:');56 echo $html->input('Vclassroom.secret', array("size" => 5, "maxlength" => 6));41 echo $form->label('Vclassroom.secret', 'CODE:'); 42 echo $form->input('Vclassroom.secret', array("size" => 5, "maxlength" => 6)); 57 43 ?> 58 <br /><br />59 44 </div> 60 45 <div style="clear:both"></div> … … 67 52 { 68 53 var Div = document.getElementById(a); 69 54 70 55 if (Div.style.display == "none") 71 56 { -
trunk/app/views/vclassrooms/admin_listing.ctp
r256 r352 1 2 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 3 <?php echo $html->getCrumbs(' / '); ?> 4 5 <div class="title_section">Classrooms</div> 6 7 <p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add classroom", "title"=>"Add classroom")), '/admin/vclassrooms/add', null, false, false) ?></p> 1 <?php 2 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 3 echo $html->getCrumbs(' / '); 4 echo $html->div('title_section', 'Classrooms'); 5 echo $html->link($html->image('actions/new.png', array("alt"=>"Add classroom", "title"=>"Add classroom")), '/admin/vclassrooms/add', null, null, false); 6 ?> 8 7 9 8 <table class="tbadmin"> … … 11 10 //die(print_r($data)); 12 11 13 $th = array ('Edit', 'Virtual classroom', 'View students', ' Delete');12 $th = array ('Edit', 'Virtual classroom', 'View students', 'Status', 'Delete'); 14 13 echo $html->tableHeaders($th); 15 foreach ($data as $key=>$val) 16 { 14 foreach ($data as $val) 15 { 16 $st = ( $val['Vclassroom']['status'] == 1 ) ? 'Active' : 'Filed'; 17 17 $tr = array ( 18 18 $gags->sendEdit($val['Vclassroom']['id'], 'vclassrooms'), 19 19 $val['Vclassroom']['name'], 20 20 $html->link('View students','/admin/vclassrooms/start/'.$val['Vclassroom']['id']), 21 $html->link('File','/admin/vclassrooms/change/'.$val['Vclassroom']['id'].'/'.$val['Vclassroom']['status']), 21 22 $gags->confirmDel($val['Vclassroom']['id'], 'vclassrooms') 22 23 ); … … 28 29 ?> 29 30 </table> 31 <?php echo $html->para(null, $html->link($html->image('admin/historic.png', array('alt'=>'See historic','title'=>'See classrooms historic')), '/admin/vclassrooms/listing/historic', null, null, false)); ?> -
trunk/app/views/vclassrooms/admin_members.ctp
r305 r352 12 12 $r="javascript:window.open('/admin/vclassrooms/treasure/".$data['Vclassroom']['id']."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 13 13 14 //popup window for forums 15 $r="javascript:window.open('/admin/vclassrooms/forum/".$data['Vclassroom']['id']."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 16 14 17 echo $html->link( 15 18 $html->image('static/icon_test.jpg', array("alt"=>"Add test", "title"=>"Add test", "style"=>"margin-right:12px") … … 24 27 ), '#', array("onclick"=>$r), null, null, false); 25 28 29 30 echo $html->link( 31 $html->image('admin/forums_icon.png', array("alt"=>"Add forum", "title"=>"Add forum", "style"=>"margin-right:12px") 32 ), '#', array("onclick"=>$r), null, null, false); 33 26 34 echo '</div>'; 27 35 28 36 29 echo '<div class="title_section">Students belonging to ' . $data['Vclassroom']['name'] . '</div>';37 echo $html->div('title_section', 'Students belonging to ' . $data['Vclassroom']['name']); 30 38 ?> 31 39 -
