It looks like you're new here. If you want to get involved, click one of these buttons!
function form_fields($values = array())
{
$fields = parent::form_fields($values);
$fields['published']['order'] = 1000;
return $fields;
}
$this->load->module_helper(FUEL_FOLDER,'fuel');
$this->load->library('form_builder', array('id'=>'fieldtrip_edit_form','row_id_prefix'=>'id_','textarea_cols'=>'47','form_attrs'=>array('method'=>'post','action'=>'conference/updatefieldtrip'),'submit_value' => 'Save', 'textarea_rows' => '10', 'multi_select_mode'=>'checkbox','single_select_mode'=>'enum'));
.
.
.
$this->load->model('conference_fieldtrips_model');
$fieldtrip = fuel_model('conference_fieldtrips', array('find' => 'one', 'where' => 'id = '.$id));
// since type casting didn't do anything desirable, set enough values manually to test
$val_arr['id'] = $fieldtrip->id;
$val_arr['Title'] = $fieldtrip->Title;
$val_arr['Latitude'] = $fieldtrip->Latitude;
$fields = $this -> conference_fieldtrips_model->form_fields($val_arr);
$data['form'] = $this->form_builder->render($fields);
Comments
Are you ajaxing these?
If yes, is there a way to turn off ajax on specific pages?
Alternatively, is there a way I can throw the links myself and still have fuel handle the actual editing?
function form_fields($values = array()) { $fields = parent::form_fields($values); ...... $fields['published']['value'] = $values['published']; $fields['published']['order'] = 1000; return $fields; }
The easier method would be to do the following from the controller:
$this->load->model('conference_fieldtrips_model'); $fieldtrip = fuel_model('conference_fieldtrips', array('find' => 'one', 'where' => 'id = '.$id)); // since type casting didn't do anything desirable, set enough values manually to test $val_arr['id'] = $fieldtrip->id; $val_arr['Title'] = $fieldtrip->Title; $val_arr['Latitude'] = $fieldtrip->Latitude; $fields = $this -> conference_fieldtrips_model->form_fields($val_arr); $this->form_builder->set_fields($fields); $this->form_builder->set_field_values($val_arr); $data['form'] = $this->form_builder->render();
Note the use of the set_field_values after the set_fields method call on the form_builder object.
With regards to the inline editing markers, it can indeed take a while for it to render if you have a lot (especially 100+). The main reason is because of the calculations it needs to absolute position the pencil icons so they don't overlap each other. Also, if the window resizes, it needs to recalculate that positioning.
You can define a constant in your page layout of "USE_FUEL_MARKERS" which will prevent them from rendering. Or you could simply not use the fuel_var function or fuel_edit functions in your layout and just use a straight variable merge like so:
<?php echo $my_var?>
Instead of
<?php echo fuel_var('my_var')?>
<?=fuel_edit($naturetrail->id, 'Edit Naturetrail', 'naturetrails');?>
and I clearly do need either a marker or a more blatant link ..
If the "too much time issue" is due to the math, and if I'm willing to do something like boxing the markers into a fixed location relative to the item or displaying them on an otherwise blank line above the item, why would I not want to just "manually" duplicate the code that is around line 592-601 just hard coding the offsets? I'm assuming I might also need to check if fuelified first so I only show them for those who should see them.
Thanks
I do need on page editing. I'd greatly prefer it be done via Fuel's in_line editing so that the site stays reasonably self consistent. So far as I can see, the pages reload fine after the save up until time to display the edit markers...then depending on how many there are, I've seen it take up to 5 minutes to get those markers displayed. I'd like in_line edit to work but that I handle the markers/links to edit forms some faster way.
I have a fair amount of formatting flexibility -- the problem pages are just lists of titles and paragraphs with space between. So, I'm OK with some non-fancy way to provide the edit form links so long as the user experience stays similar (shorter pages are just fine).
Thanks.