Show
Ignore:
Timestamp:
03/25/08 01:03:27 (8 months ago)
Author:
aarkerio
Message:

eCourses fixes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/models/ecourse.php

    r282 r342  
    33*  Karamelo E-Learning Platform 
    44*  Chipotle Software 2002-2008 
    5 *  GPLv3 manuel<at>mononeurona<dot>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/ 
    77//File: /app/models/ecourse.php 
    88 
    99class Ecourse extends AppModel { 
    10  
     10   
    1111  public $name = 'Ecourse'; 
    12     
     12   
    1313  public $belongsTo = array('User', 'Subject', 'Lang'); 
    14  
     14   
    1515  public $hasMany   = array('Vclassroom'); 
    16  
     16   
    1717  public $validate = array( 
    18         'title'       => VALID_NOT_EMPTY, 
    19         'access'      => VALID_NOT_EMPTY, 
    20             'description' => VALID_NOT_EMPTY,  
    21         'lang_id'     => VALID_NOT_EMPTY 
    22       ); 
     18        'title' => array( 
     19            'alphanumeric' => array( 
     20                'rule' => array('minLength', 4), 
     21                'required' => true, 
     22                'allowEmpty' => false, 
     23                'message' => 'Mimimum 4 characters long in title' 
     24                ) 
     25        ), 
     26        'description' => array( 
     27            'rule' => array('minLength', 20), 
     28            'allowEmpty' => false, 
     29            'message' => 'Mimimum 8 characters long' 
     30        ), 
     31        'code' => array( 
     32            'rule' => array('minLength', 4), 
     33            'allowEmpty' => false, 
     34            'message' => 'Mimimum 4 characters long' 
     35        ), 
     36        'lang_id' => array( 
     37            'rule' => 'numeric', 
     38            'message' => 'Enter a valid lang', 
     39            'allowEmpty' => true 
     40        ) 
     41    ); 
    2342} 
    2443?>