Changeset 354

Show
Ignore:
Timestamp:
03/28/08 12:50:07 (10 months ago)
Author:
aarkerio
Message:

Improvs on Lessons and Images

Location:
trunk/app
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/ecourses_controller.php

    r352 r354  
    6565        { 
    6666          $this->Ecourse->filed(); //show filed classrooms 
    67  
     67           
    6868          $this->set('historic', true); 
    6969    } 
    70       
     70         
    7171        $order        =  "Ecourse.id DESC"; 
    7272         
    73         //die( debug($this->Ecourse->find($conditions))); 
    74  
    7573        $this->set('data', $this->Ecourse->find($conditions)); 
    7674  } 
     
    111109        if ($this->Ecourse->save($this->data['Ecourse'])) 
    112110        { 
    113                 $this->msgFlash('Course saved', '/admin/ecourses/listing'); 
     111                $this->msgFlash('Course saved', '/admin/ecourses/edit/'.$this->Ecourse->getLastInsertID()); 
    114112        } 
    115113    } 
     
    118116  public function admin_edit($id = null) 
    119117  { 
    120     $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
     118    $this->layout = 'admin'; 
     119     
     120    $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
    121121     
    122122    $this->set('langs', Set::combine($this->Ecourse->Lang->find('all', array('order' => 'lang')), "{n}.Lang.id","{n}.Lang.lang")); 
     
    124124    if ( empty($this->data['Ecourse']) ) 
    125125    { 
    126         $this->layout = 'admin'; 
    127126         
    128127        $this->Ecourse->id = $id; 
  • trunk/app/controllers/lessons_controller.php

    r353 r354  
    7070    } 
    7171     
    72     /*** 
    73     === ADMIN METHODS 
    74     ****/ 
     72    /***   === ADMIN METHODS   ****/ 
    7573    public function admin_listing() 
    7674    {    
  • trunk/app/views/ecourses/admin_add.ctp

    r342 r354  
    55<fieldset> 
    66  <legend>New Course</legend> 
    7 <?php  
    8   
    9  echo $form->input('Ecourse.title', array("size" => 30, "maxlength" => 90, 'title'=>' e.g. History of Literature')); 
     7  <table><tr><td> 
     8<?php 
     9   echo $form->input('Ecourse.title', array("size" => 37, "maxlength" => 90, 'title'=>' e.g. History of Literature')); 
     10 ?> 
     11</td><td> 
     12 <?php 
     13   echo $form->label('Ecourse.subject_id', 'Subject:'); 
     14   echo $form->select('Ecourse.subject_id', $subjects, null, null, null, false); 
     15 ?> 
     16   </td><td> 
     17<?php 
     18    echo $form->label('Ecourse.lang_id', 'Lang:'); 
     19    echo $form->select('Ecourse.lang_id', $langs, null, null, null, false); 
     20 ?> 
     21</td></tr> 
     22<tr><td colspan="3"> 
     23 <?php  
     24    echo $form->label('Ecourse.description', 'Description:'); 
     25    echo $form->textarea('Ecourse.description', array("cols" => 40, "rows" =>4)); 
     26    echo $fck->load('EcourseDescription', 'Default'); 
     27 ?> 
     28</td></tr> 
    1029 
    11  echo $form->label('Ecourse.description', 'Description:'); 
    12  echo $form->textarea('Ecourse.description', array("cols" => 40, "rows" =>4)); 
    13  echo $fck->load('EcourseDescription', 'Default'); 
    14  echo $form->error('Ecourse.description', 'You must describe course '); 
    15   
    16  echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12, 'title'=>' max. 12 characters. Example: ROM2121', 'error'=>'Code is required')); 
    17   
    18  echo $form->label('Ecourse.subject_id', 'Subject:'); 
    19  echo $form->select('Ecourse.subject_id', $subjects, null, null, null, false); 
     30<tr><td> 
     31  <?php 
     32      echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12, 'title'=>' max. 12 characters. Example: ROM2121')); 
     33  ?> 
     34</td><td colspan="2"> 
     35  <?php 
     36     echo $form->label('Ecourse.status', 'Enabled:' ); 
     37     echo $form->checkbox('Ecourse.status', array("value"=>1, 'title'=>'Enabled course'));  
     38  ?></fieldset> 
     39</td></tr> 
    2040 
    21  echo $form->label('Ecourse.lang_id', 'Lang:'); 
    22  echo $form->select('Ecourse.lang_id', $langs, null, null, null, false); 
    23   
    24  echo $form->label('Ecourse.status', 'Enabled:' ); 
    25  echo $form->checkbox('Ecourse.status', array("value"=>1, 'title'=>'Enabled course'));  
    26 ?> 
    27 </fieldset> 
    28   <br /> 
     41<tr><td colspan="3"> 
    2942  <?php echo $form->end('Save'); ?> 
     43</td></tr> 
     44</table> 
    3045 
    3146<script type="text/javascript"> 
  • trunk/app/views/ecourses/admin_edit.ctp

    r342 r354  
    66<fieldset> 
    77  <legend>Edit Course</legend> 
    8   <?php  
     8<table><tr><td> 
     9<?php  
    910    echo $form->input('Ecourse.title', array("size" => 30, "maxlength" => 90, 'title'=>' e.g. History of Literature')) ; 
    10      
    11     echo '<br />'; 
     11?> 
     12</td><td> 
     13  <?php 
     14    echo $form->label('Ecourse.subject_id', 'Subject:'); 
     15    echo $form->select('Ecourse.subject_id', $subjects, null, null, null, false); 
     16   ?> 
     17</td><td> 
     18   <?php 
     19    echo $form->label('Ecourse.lang_id', 'Lang:'); 
     20    echo $form->select('Ecourse.lang_id', $langs, null, null, null, false); 
     21    ?> 
     22 </td></tr> 
     23<tr><td colspan="3"> 
     24  <?php 
    1225    echo $form->label('Ecourse.description', 'Description:'); 
    1326    echo $form->textarea('Ecourse.description', array("cols" => 40, "rows" =>4)); 
    14     echo $fck->load('EcourseDescription', 'Default'); 
    15      
    16     echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12, 'title'=>'max. 12 characters, ie.ROM2121')); 
    17      
    18     echo $form->label('Ecourse.subject_id', 'Subject:'); 
    19     echo $form->select('Ecourse.subject_id', $subjects, null, null, null, false); 
    20      
    21     echo $form->label('Ecourse.lang_id', 'Lang:'); 
    22     echo $form->select('Ecourse.lang_id', $langs, null, null, null, false); 
    23 ?> 
    24   <div style="clear:both"></div> 
    25   <?php  
    26      echo $form->label('Ecourse.status', 'Enabled:' ); 
    27      echo $form->checkbox('Ecourse.status', array("value"=>1, 'title'=>'Enabled course'));  
    28      ?> 
    29   <div style="clear:both"></div> 
    30   <br /> 
    31   <?php echo $form->submit('Save'); ?> 
    32 </fieldset> 
    33 </form> 
     27    echo $fck->load('EcourseDescription', 'Default'); 
     28  ?> 
     29 </td></tr> 
     30 <tr><td> 
     31  <?php 
     32    echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12, 'title'=>'max. 12 characters, ie.ROM2121'));     
     33  ?> 
     34  </td> 
     35  <td colspan="2"> 
     36  <?php 
     37    echo $form->label('Ecourse.status', 'Enabled:' ); 
     38    echo $form->checkbox('Ecourse.status', array("value"=>1, 'title'=>'Enabled course'));  
     39  ?> 
     40  </td></tr> 
     41  <tr><td colspan="3"> 
     42  </fieldset><?php echo $form->end('Save'); ?> 
     43</td></tr> 
     44</table> 
    3445<script type="text/javascript"> 
    3546/* <![CDATA[ */ 
  • trunk/app/views/lessons/admin_add.ctp

    r352 r354  
    1717  <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?> 
    1818</td> 
     19 <td> 
     20     <?php 
     21      echo $form->label('Lesson.subject_id', 'Subject:'); 
     22      echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
     23     ?> 
     24  </td> 
    1925</tr> 
    2026<tr> 
    21   <td colspan="2"> 
     27  <td colspan="3"> 
    2228  <?php  
    23       echo $form->label('Lesson.subject_id', 'Subject:'); 
    24       echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
    25  
    2629      echo $form->label('Lesson.body', 'Body:' ); 
    2730      echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 
     
    3538     echo $form->checkbox('Lesson.status', array('value'=>1));  
    3639  ?> 
    37   </td><td> 
     40  </td><td colspan="2"> 
    3841  <?Php  
    39       Echo $form->label('Lesson.disc', 'Comments allowed to this Lesson:' ); 
     42      Echo $form->label('Lesson.disc', 'Comments enabled:' ); 
    4043      echo $form->checkbox('Lesson.disc', array('value'=>1));  
    4144  ?> 
    4245  </td></tr> 
    43   <tr><td colspan="2"> </fieldset> 
     46  <tr><td colspan="3"> </fieldset> 
    4447  <?php echo $form->end('Save'); ?> 
    4548</td></tr> 
  • trunk/app/views/lessons/admin_edit.ctp

    r352 r354  
    44<?php  
    55  $session->flash(); 
    6  
     6   
    77  echo $javascript->link('myfunctions'); 
    88  echo $javascript->link('fckeditor/fckeditor');  
    9   
    10    echo $form->create('Lesson'); 
    11    echo $form->hidden('Lesson.id'); 
     9   
     10  echo $form->create('Lesson'); 
     11  echo $form->hidden('Lesson.id'); 
    1212?> 
    1313<fieldset> 
    14 <legend>Add Lesson</legend> 
     14<legend>Edit Lesson: <?php echo $this->data['Lesson']['title']; ?></legend> 
    1515<table> 
    1616<tr><td> 
     
    2020  <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?> 
    2121</td> 
     22 <td> 
     23     <?php 
     24      echo $form->label('Lesson.subject_id', 'Subject:'); 
     25      echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
     26     ?> 
     27  </td> 
    2228</tr> 
    2329<tr> 
    24   <td colspan="2"> 
     30  <td colspan="3"> 
    2531  <?php  
    26       echo $form->label('Lesson.subject_id', 'Subject:'); 
    27       echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
    28  
    2932      echo $form->label('Lesson.body', 'Body:' ); 
    3033      echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 
     
    3942  </td><td> 
    4043  <?php  
    41       echo $form->label('Lesson.disc', 'Comments allowed to this Lesson:' ); 
     44      echo $form->label('Lesson.disc', 'Comments enabled:' ); 
    4245      echo $form->checkbox('Lesson.disc', array("value"=>1)); 
    43        
    44       echo $form->label( 'Lesson.end', 'End edition:' ); 
     46      ?> 
     47      </td><td> 
     48      <?php 
     49      echo $form->label('Lesson.end', 'End edition:' ); 
    4550      echo $form->checkbox('Lesson.end', array("value"=>1));  
    46   ?> 
     51     ?> 
    4752  </td></tr> 
    48   <tr><td colspan="2"> </fieldset> 
     53  <tr><td colspan="3"> </fieldset> 
    4954  <?php echo $form->end('Save'); ?> 
    5055</td></tr> 
  • trunk/app/webroot/js/fckeditor/editor/filemanager/connectors/php/connector.php

    r300 r354  
    3939function DoResponse() 
    4040{ 
    41     if (!isset($_GET)) { 
     41    if (!isset($_GET))  
     42    { 
    4243        global $_GET; 
    4344    } 
  • trunk/app/webroot/js/fckeditor/fckeditor_php5.php

    r296 r354  
    3737 
    3838    // PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>) 
    39     function __construct( $instanceName ) 
     39    public function __construct( $instanceName ) 
    4040    { 
    4141        $this->InstanceName = $instanceName ;