Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from robsonsobral/patch-1
Browse files Browse the repository at this point in the history
Added empty option to the selecte dropdown and validation to the Matrix Cell.
  • Loading branch information
Christopher Imrie committed Sep 27, 2011
2 parents 7ea7965 + 3984ba8 commit 67cc57a
Showing 1 changed file with 15 additions and 1 deletion.
Expand Up @@ -37,7 +37,7 @@ public function display_cell($data)
$this->EE->db->select('entry_id, title, status');
$q = $this->EE->db->get('channel_titles');

$entries = array();
$entries = array( NULL => '--');
foreach($q->result() as $qr){
$entries[$qr->entry_id] = $qr->status == "closed" ? $qr->title . " [closed]" : $qr->title;
}
Expand Down Expand Up @@ -71,6 +71,20 @@ public function display_cell_settings($data = array())
}


// ====================
// = Field validation =
// ====================
public function validate_cell( $data )
{
if ($this->settings['col_required'] == 'y') {
if (! $data) {
return lang('col_required');
}
}
return TRUE;
}


// ===========================
// = Render tag in front end =
// ===========================
Expand Down

0 comments on commit 67cc57a

Please sign in to comment.