action) . ' ' . $this->title?>

current_page_data; if(empty($row_data)) $row_data = $_GET; foreach($this->form_fields as $field_name) { $field_info = $this->fields[$field_name]; extract($field_info); $value = i($row_data, $field); if($field_type != 'hidden') print "
"; // Enum - Select tag if($field_type == 'select') { $html->buildInput($field, $name, 'select', $value, array('options' => $data)); // Date Field. } elseif($field_type == 'datetime' or $field_type == 'date') { if($field_type == 'datetime') $js_date_format = $GLOBALS['config']['time_format']; else $js_date_format = $GLOBALS['config']['date_format']; if($value and $value != '0000-00-00 00:00:00' and $value != '0000-00-00') $value = date(phpDateFormat($js_date_format), strtotime($value)); elseif($this->action == 'add' and $field == 'added_on') $value = date(phpDateFormat($js_date_format)); // Its the good old added_on field. If we are creating a new row, put the current time there. elseif($this->action == 'edit' and $field == 'edited_on') $value = date(phpDateFormat($js_date_format)); // Same for edited_on field. else $value = ''; $js_date_format = jsDateFormat($js_date_format); $html->buildInput($field, $name, 'text', $value, array('class'=>'text-long'), ""); $print_time = 1; // I use this method to make sure this is called only after the calendar.js files are loaded. $js_code .= <<buildInput($field, '', 'hidden', $hidden_value); } else { //if($field_type == 'checkbox' and $value === false) $value = $data; if($field_type == 'checkbox' or $field_type == 'radio' or $field_type == 'textarea') $attributes = array(); else $attributes = array('class'=>'text-long'); if($data and !$value) $value = $data; $html->buildInput($field, $name, $field_type, isset($PARAM[$field]) ? $PARAM[$field] : $value, $attributes); } if(isset($this->validation_errors[$field])) { if(count($this->validation_errors[$field]) > 1) { print "
  • " . implode("
  • ", $this->validation_errors[$field]) . "
"; } else print "". $this->validation_errors[$field][0] . ""; } if($field_type != 'hidden') print "
\n"; } $html->buildInput("row_id", "", "hidden", i($QUERY, 'id')); $html->buildInput("id", "", "hidden", i($QUERY, 'id')); $save_current_state = array('search','search_in', 'sp_page','sp_items_per_page', 'sortasc', 'sortdesc'); foreach($save_current_state as $state_name) { if(!empty($QUERY[$state_name])) $html->buildInput($state_name, "", "hidden", $QUERY[$state_name]); } // The action area. print "
 "; if($QUERY['action'] == 'edit' or $QUERY['action'] == 'edit_save') print "i($QUERY, 'id'), 'action'=>'delete')) . "' title='Delete this row' class='delete-current-item confirm with-icon delete'>Delete"; print ""; print ""; print "
"; if($QUERY['action'] == 'edit' or $QUERY['action'] == 'add') $form_action = $QUERY['action'] . "_save"; else $form_action = $QUERY['action']; $html->buildInput("action", "", "hidden", $form_action); ?>
'%M', '%p' => '%a', '%P' => '%A', ); return str_replace(array_keys($replace_rules), array_values($replace_rules), $format_string); }