function postMiscellaneous() { $setting = Input::get('setting'); MiscellaneousSetting::i()->setting = to_bool_recursive($setting); MiscellaneousSetting::i()->export(); return redirect()->action('TableController@getMiscellaneous'); }
function extra_config_options($name_prefix, $ui = NULL) { $options = []; if (!$this->is_imported) { $ms = MiscellaneousSetting::i()->setting; if ($this->is_autoinc && @$ms['_autoinc']['apply']) { foreach ($ms['_autoinc'] as $key => $value) { if ($key != 'apply') { $this->{$key} = $value; } } } if ($this->name != '_autoinc' && @$ms[$this->name]['apply']) { foreach ($ms[$this->name] as $key => $value) { if ($key != 'apply') { $this->{$key} = $value; } } } } if (!$ui) { $ui = UI::with_name_prefix($name_prefix); } $options[] = $ui->yes_no_options('is_visible', $this->_is_visible, 'Visible for input.'); if (!$this->is_null) { $options[] = $ui->yes_no_options('is_null_allowed', $this->_is_null_allowed, 'Allow null entry'); } if ($this->is_autoinc) { $options[] = $ui->yes_no_options('is_readonly', $this->_is_readonly, 'Readonly field(Reason(s):Auto increment)'); } if ($this->type == 'datetime' || $this->type == 'date' || $this->type == 'time' || $this->type == 'timestamp') { $options[] = $ui->yes_no_options('is_current_datetime_on_insert', $this->_is_current_datetime_on_insert, "Current " . $this->type . " on INSERT."); $options[] = $ui->yes_no_options('is_current_datetime_on_update', $this->_is_current_datetime_on_update, "Current " . $this->type . " on UPDATE."); } $options[] = $ui->textarea('help_text', $this->_help_text, 'Help text to display to user'); $options[] = $ui->input('placeholder_text', $this->_placeholder_text, 'Placeholder text to display to user'); if ($this->_manual_ref_set || !$this->references_table) { $options[] = $ui->input('set_reference_table_by_name', $this->references_table_name, 'Referencing table'); $options[] = $ui->input('set_reference_col_by_name', $this->references_col_name, 'Referencing column'); } return $options; }