Changeset 625
- Timestamp:
- 07/04/08 15:06:44 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 5 modified
-
controllers/lessons_controller.php (modified) (2 diffs)
-
locale/spa/LC_MESSAGES/default.po (modified) (2 diffs)
-
views/lessons/admin_add.ctp (modified) (5 diffs)
-
views/lessons/admin_edit.ctp (modified) (6 diffs)
-
views/lessons/admin_listing.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/lessons_controller.php
r540 r625 87 87 $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 88 88 89 if (!empty($this->data["Lesson"]))90 { 89 if (!empty($this->data['Lesson'])): 90 91 91 $this->Sanitize = new Sanitize; 92 92 93 $this->Sanitize->html($this->data[ "Lesson"]["title"]);93 $this->Sanitize->html($this->data['Lesson']['title']); 94 94 95 $this->Sanitize->html($this->data[ "Lesson"]["body"]);95 $this->Sanitize->html($this->data['Lesson']['body']); 96 96 97 $this->data[ "Lesson"]["user_id"] = $this->Auth->user('id');;97 $this->data['Lesson']['user_id'] = $this->Auth->user('id');; 98 98 99 if ($this->Lesson->save($this->data["Lesson"])) 100 { 99 if ($this->Lesson->save($this->data['Lesson'])): 101 100 $this->msgFlash('Lesson saved', '/admin/lessons/edit/'.$this->Lesson->getLastInsertID()); 102 }103 }101 endif; 102 endif; 104 103 } 105 104 … … 110 109 $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 111 110 112 if ( empty( $this->data["Lesson"] ) ) 113 { 111 if ( empty( $this->data["Lesson"] ) ): 112 114 113 $this->Lesson->id = $id; 115 114 116 115 $this->data = $this->Lesson->read(); 117 }118 else 119 {116 117 else: 118 120 119 $this->Sanitize = new Sanitize; 121 120 122 $this->Sanitize->html($this->data[ "Lesson"]["title"]);121 $this->Sanitize->html($this->data['Lesson']['title']); 123 122 124 $this->Sanitize->html($this->data[ "Lesson"]["body"]);123 $this->Sanitize->html($this->data['Lesson']['body']); 125 124 126 if ($this->Lesson->save($this->data["Lesson"])) 127 { 128 if ( $this->data["Lesson"]["end"] == 1 ) 129 { 130 $this->redirect('/admin/lessons/listing'); 131 } 132 else 133 { 134 $this->msgFlash('Your story has been saved!', '/admin/lessons/edit/'.$this->data["Lesson"]["id"]); 135 } 136 } 137 } 125 if ($this->Lesson->save($this->data['Lesson'])): 126 if ( $this->data['Lesson']['end'] == 1 ): 127 $this->redirect('/admin/lessons/listing'); 128 129 else: 130 $this->msgFlash(__('Data saved', true), '/admin/lessons/edit/'.$this->data["Lesson"]["id"]); 131 endif; 132 endif; 133 endif; 138 134 } 139 135 // change status enabled/disabled actived -
trunk/app/locale/spa/LC_MESSAGES/default.po
r624 r625 2 2 msgstr "Eliminar" 3 3 4 msgid "Data saved" 5 msgstr "Datos guardados" 6 4 7 msgid "Starting date" 5 8 msgstr "Fecha de inicio" 6 9 10 msgid "Add new" 11 msgstr "Agregar" 12 7 13 msgid "Finishing date" 8 14 msgstr "Fecha de fin de curso" … … 19 25 msgid "Edit" 20 26 msgstr "Editar" 27 28 msgid "Allow comments" 29 msgstr "Habilitar comentarios" 30 31 msgid "Lessons" 32 msgstr "Lecciones" 21 33 22 34 msgid "New Lesson" -
trunk/app/views/lessons/admin_add.ctp
r624 r625 1 1 <?php 2 2 echo $javascript->link('myfunctions'); 3 echo $javascript->link('fckeditor/fckeditor'); 3 echo $javascript->link('fckeditor/fckeditor'); 4 5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 6 echo $html->addCrumb(__('Lessons', true), '/admin/lessons/listing'); 7 echo $html->getCrumbs(' / '); 8 4 9 echo $form->create('Lesson'); 5 10 ?> … … 10 15 <tr><td> 11 16 <?php 12 echo $form->input('Lesson.title', array( "size" => 50, "maxlength" => 120));17 echo $form->input('Lesson.title', array('size' => 50, 'maxlength' => 120, 'label'=>__('Title', true))); 13 18 echo $form->error('Lesson.title', 'Title is required.'); 14 19 ?> … … 19 24 <td> 20 25 <?php 21 echo $form->label('Lesson.subject_id', 'Subject:');26 echo $form->label('Lesson.subject_id', __('Subject', true)); 22 27 echo $form->select('Lesson.subject_id', $subjects, null, null, false); 23 28 ?> … … 26 31 <tr> 27 32 <td colspan="3"> 28 <?php 29 echo $form->label('Lesson.body', 'Body:' ); 33 <?php 30 34 echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 31 35 echo $fck->load('LessonBody', 'Karamelo', 800, 600); … … 35 39 <tr><td> 36 40 <?php 37 echo $form->label('Lesson.status', 'Published:');41 echo $form->label('Lesson.status', __('Published',true) ); 38 42 echo $form->checkbox('Lesson.status', array('value'=>1)); 39 43 ?> 40 44 </td><td colspan="2"> 41 45 <?Php 42 Echo $form->label('Lesson.disc', 'Comments enabled:');46 Echo $form->label('Lesson.disc', __('Allow comments', true)); 43 47 echo $form->checkbox('Lesson.disc', array('value'=>1)); 44 48 ?> -
trunk/app/views/lessons/admin_edit.ctp
r624 r625 1 <script type="text/javascript">2 window.onload = timedMsg;3 </script>4 1 <?php 5 $session->flash(); 6 7 echo $javascript->link('myfunctions'); 8 echo $javascript->link('fckeditor/fckeditor'); 2 echo $javascript->link('myfunctions'); 3 echo $javascript->link('fckeditor/fckeditor'); 4 5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 6 echo $html->addCrumb(__('Lessons', true), '/admin/lessons/listing'); 7 echo $html->getCrumbs(' / '); 9 8 10 9 echo $form->create('Lesson'); … … 15 14 <table> 16 15 <tr><td> 17 <?php echo $form->input('Lesson.title', array( "size" => 50, "maxlength" => 120)); ?>16 <?php echo $form->input('Lesson.title', array('size' => 50, 'maxlength' => 120, 'label'=>__('Title', true))); ?> 18 17 </td> 19 18 <td> … … 22 21 <td> 23 22 <?php 24 echo $form->label('Lesson.subject_id', 'Subject:');23 echo $form->label('Lesson.subject_id', __('Subject', true)); 25 24 echo $form->select('Lesson.subject_id', $subjects, null, null, false); 26 25 ?> … … 30 29 <td colspan="3"> 31 30 <?php 32 echo $form->label('Lesson.body', 'Body:' );33 31 echo $form->textarea('Lesson.body', array('cols'=>80, 'rows'=>20)); 34 32 echo $fck->load('LessonBody', 'Karamelo', 800, 600); … … 37 35 <tr><td> 38 36 <?php 39 echo $form->label( 'Lesson.status', 'Published:');40 echo $form->checkbox('Lesson.status', array( "value"=>1));37 echo $form->label( 'Lesson.status', __('Published',true)); 38 echo $form->checkbox('Lesson.status', array('value'=>1)); 41 39 ?> 42 40 </td><td> 43 41 <?php 44 echo $form->label('Lesson.disc', 'Comments enabled:');45 echo $form->checkbox('Lesson.disc', array( "value"=>1));42 echo $form->label('Lesson.disc', __('Allow comments', true) ); 43 echo $form->checkbox('Lesson.disc', array('value'=>1)); 46 44 ?> 47 45 </td><td> 48 46 <?php 49 echo $form->label('Lesson.end', 'End edition:');50 echo $form->checkbox('Lesson.end', array( "value"=>1));47 echo $form->label('Lesson.end', __('End edition',true)); 48 echo $form->checkbox('Lesson.end', array('value'=>1)); 51 49 ?> 52 50 </td></tr> … … 56 54 </td></tr> 57 55 </table> 58 -
trunk/app/views/lessons/admin_listing.ctp
r312 r625 1 <script type="text/javascript"> 2 window.onload = timedMsg; 3 </script> 4 <?php $session->flash(); ?> 5 <div class="title_section">Lessons</div> 6 7 <p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/lessons/add', null, false, false) ?></p> 1 <?php 2 echo $html->div('title_section', __('Lessons', true)); 3 echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/lessons/add', null, null, false)); 4 ?> 8 5 9 6 <table class="tbadmin"> 7 <?php 10 8 11 <?php 12 //die(print_r($data)); 13 14 $th = array ('Edit', 'Title', 'Status', 'Delete'); 9 $th = array(__('Edit', true), __('Title', true), __('Status', true), __('Delete', true)); 15 10 16 11 echo $html->tableHeaders($th);
