public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     fieldMemberUsername::createSettingsTable();
     $fields = array('field_id' => $id, 'validator' => $this->get('validator'));
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     return FieldManager::saveSettings($id, $fields);
 }
 /**
  * Persist field configuration
  */
 function commit()
 {
     // set up standard Field settings
     if (!parent::commit()) {
         return FALSE;
     }
     $id = $this->get('id');
     if ($id === FALSE) {
         return FALSE;
     }
     $fields = array();
     $fields['field_id'] = $id;
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['pre_populate'] = $this->get('pre_populate') ? $this->get('pre_populate') : 'no';
     $fields['mode'] = $this->get('mode') ? $this->get('mode') : 'normal';
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $state = $this->get('default_state');
     $entries = (int) $this->get('unique_entries');
     $steal = $this->get('unique_steal');
     $fields = array('field_id' => $id, 'default_state' => $state ? $state : 'off', 'unique_entries' => $entries > 0 ? $entries : 1, 'unique_steal' => $steal ? $steal : 'off');
     return FieldManager::saveSettings($id, $fields);
 }
 /**
  * Save the settings panel
  *
  * @return bool
  */
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     if ($this->get('related_field_id') != '') {
         $settings['related_field_id'] = $this->get('related_field_id');
     }
     $settings['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $settings['show_association'] = $this->get('show_association') == 'yes' ? 'yes' : 'no';
     $settings['limit'] = max(1, (int) $this->get('limit'));
     $settings['related_field_id'] = implode(',', $this->get('related_field_id'));
     $settings['view'] = $this->get('view');
     $settings['show_created'] = $this->get('show_created') == 'yes' ? 1 : 0;
     $settings['enable_create'] = $this->get('enable_create') == 'yes' ? 1 : 0;
     $settings['enable_edit'] = $this->get('enable_edit') == 'yes' ? 1 : 0;
     $settings['enable_delete'] = $this->get('enable_delete') == 'yes' ? 1 : 0;
     FieldManager::saveSettings($id, $settings);
     SectionManager::removeSectionAssociation($id);
     foreach ($this->get('related_field_id') as $field_id) {
         SectionManager::createSectionAssociation(null, $id, $field_id, $this->get('show_association') == 'yes' ? true : false);
     }
     return true;
 }
Beispiel #7
0
 public function commit()
 {
     if (!parent::commit()) {
         return FALSE;
     }
     $id = $this->get('id');
     if ($id === FALSE) {
         return FALSE;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['note'] = $this->get('note');
     $fields['editable'] = $this->get('editable') ? 1 : 0;
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     fieldMemberPassword::createSettingsTable();
     $this->rememberSalt();
     $fields = array('field_id' => $id, 'length' => $this->get('length'), 'strength' => $this->get('strength'), 'code_expiry' => $this->get('code_expiry'));
     if ($this->get('salt')) {
         $fields['salt'] = $this->get('salt');
     }
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     fieldMemberActivation::createSettingsTable();
     $fields = array('field_id' => $id, 'code_expiry' => $this->get('code_expiry'), 'activation_role_id' => $this->get('activation_role_id'), 'deny_login' => $this->get('deny_login') == 'yes' ? 'yes' : 'no');
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['expression'] = trim($this->get('expression'));
     $fields['show_errors'] = $this->get('show_errors') == 'yes' ? 'yes' : 'no';
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array('validator' => null);
     $fields['validator'] = $fields['validator'] == 'custom' ? null : $this->get('validator');
     return FieldManager::saveSettings($id, $fields);
 }
 /**
  *
  * Save field settings into the field's table
  */
 public function commit()
 {
     // if the default implementation works...
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     // exit if there is no id
     if ($id == false) {
         return false;
     }
     // we are the child, with multiple parents
     $child_field_id = $id;
     // delete associations, only where we are the child
     self::removeSectionAssociation($child_field_id);
     $sections = $this->getSelectedSectionsArray();
     foreach ($sections as $key => $sectionId) {
         if (empty($sectionId)) {
             continue;
         }
         $parent_section_id = General::intval($sectionId);
         $parent_section = SectionManager::fetch($sectionId);
         $fields = $parent_section->fetchVisibleColumns();
         if (empty($fields)) {
             // no visible field, revert to all
             $fields = $parent_section->fetchFields();
         }
         $parent_field_id = current(array_keys($fields));
         // create association
         SectionManager::createSectionAssociation($parent_section_id, $child_field_id, $parent_field_id, $this->get('show_association') == 'yes');
     }
     // declare an array contains the field's settings
     $settings = array('sections' => $this->get('sections'), 'show_association' => $this->get('show_association'), 'deepness' => $this->get('deepness'), 'elements' => $this->get('elements'), 'mode' => $this->get('mode'), 'min_entries' => $this->get('min_entries'), 'max_entries' => $this->get('max_entries'), 'allow_new' => $this->get('allow_new'), 'allow_edit' => $this->get('allow_edit'), 'allow_link' => $this->get('allow_link'), 'allow_delete' => $this->get('allow_delete'));
     return FieldManager::saveSettings($id, $settings);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['link'] = $this->get('link');
     $fields['hours'] = $this->get('hours');
     $fields['auto_delete'] = $this->get('auto_delete') == 'yes' ? 1 : 0;
     FieldManager::saveSettings($id, $fields);
 }
Beispiel #14
0
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['default_state'] = $this->get('default_state') ? $this->get('default_state') : 'off';
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     if ($this->get('formatter') != 'none') {
         $fields['formatter'] = $this->get('formatter');
     }
     $fields['size'] = $this->get('size');
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     fieldMemberRole::createSettingsTable();
     $fields = array('field_id' => $id, 'default_role' => $this->get('default_role'));
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['default_location'] = $this->get('default_location');
     $fields['default_zoom'] = $this->get('default_zoom');
     $fields['api_key'] = $this->get('api_key');
     if (!$fields['default_location']) {
         $fields['default_location'] = $this->_default_location;
     }
     $fields['default_location_coords'] = self::__geocodeAddress($fields['default_location']);
     if (!$fields['default_zoom']) {
         $fields['default_zoom'] = $this->_default_zoom;
     }
     if (!$fields['api_key']) {
         $fields['api_key'] = $this->get('api_key');
     }
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['destination'] = $this->get('destination');
     $fields['validator'] = $fields['validator'] == 'custom' ? NULL : $this->get('validator');
     $fields['override'] = $this->get('override');
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     // set field instance values
     $fields = array();
     $fields['field_id'] = $id;
     if (!is_null($this->get('related_field_id'))) {
         $fields['related_field_id'] = implode(',', $this->get('related_field_id'));
     }
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['show_association'] = $this->get('show_association') == 'yes' ? 'yes' : 'no';
     $fields['limit'] = max(1, (int) $this->get('limit'));
     $fields['field_type'] = $this->get('field_type') ? $this->get('field_type') : 'select';
     // save/replace field instance
     if (!FieldManager::saveSettings($id, $fields)) {
         return false;
     }
     // build associations
     SectionManager::removeSectionAssociation($id);
     foreach ($this->get('related_field_id') as $field_id) {
         SectionManager::createSectionAssociation(NULL, $id, $field_id, $this->get('show_association') == 'yes' ? true : false);
     }
     return true;
 }
Beispiel #20
0
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     if ($this->get('static_options') != '') {
         $fields['static_options'] = $this->get('static_options');
     }
     if ($this->get('dynamic_options') != '') {
         $fields['dynamic_options'] = $this->get('dynamic_options');
     }
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['sort_options'] = $this->get('sort_options') == 'yes' ? 'yes' : 'no';
     $fields['show_association'] = $this->get('show_association') == 'yes' ? 'yes' : 'no';
     if (!FieldManager::saveSettings($id, $fields)) {
         return false;
     }
     $this->removeSectionAssociation($id);
     // Dynamic Options isn't an array like in Select Box Link
     $field_id = $this->get('dynamic_options');
     if (!is_null($field_id)) {
         $this->createSectionAssociation(NULL, $id, $field_id, $this->get('show_association') == 'yes' ? true : false);
     }
     return true;
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['pre_populate'] = $this->get('pre_populate') ? $this->get('pre_populate') : '';
     $fields['time'] = $this->get('time') ? $this->get('time') : 'no';
     $fields['calendar'] = $this->get('calendar') ? $this->get('calendar') : 'no';
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     if ($this->get('related_field_id') != '') {
         $fields['related_field_id'] = $this->get('related_field_id');
     }
     $fields['related_field_id'] = implode(',', $this->get('related_field_id'));
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['hide_when_prepopulated'] = $this->get('hide_when_prepopulated') == 'yes' ? 'yes' : 'no';
     $fields['limit'] = max(0, (int) $this->get('limit'));
     if (!FieldManager::saveSettings($id, $fields)) {
         return false;
     }
     SectionManager::removeSectionAssociation($id);
     foreach ($this->get('related_field_id') as $field_id) {
         SectionManager::createSectionAssociation(null, $id, (int) $field_id, $this->get('show_association') == 'yes' ? true : false, $this->get('association_ui'), $this->get('association_editor'));
     }
     return true;
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['pre_populate_source'] = is_null($this->get('pre_populate_source')) ? NULL : implode(',', $this->get('pre_populate_source'));
     $fields['validator'] = $fields['validator'] == 'custom' ? NULL : $this->get('validator');
     return FieldManager::saveSettings($id, $fields);
 }
Beispiel #24
0
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array('field_id' => $id, 'column_length' => max((int) $this->get('column_length'), 25), 'text_size' => $this->get('text_size'), 'text_formatter' => $this->get('text_formatter'), 'text_validator' => $this->get('text_validator'), 'text_length' => max((int) $this->get('text_length'), 0), 'text_cdata' => $this->get('text_cdata'), 'text_handle' => $this->get('text_handle'));
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     $handle = $this->handle();
     if ($id === false) {
         return false;
     }
     $fields = array('field_id' => $id, 'xsltfile' => $this->get('xsltfile'), 'expression' => $this->get('expression'), 'formatter' => $this->get('formatter'), 'override' => $this->get('override'), 'fetch_associated_counts' => $this->get('fetch_associated_counts'), 'hide' => $this->get('hide'));
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['bucket'] = $this->get('bucket');
     $fields['cname'] = $this->get('cname');
     $fields['remove_from_bucket'] = $this->get('remove_from_bucket') == '' ? '0' : '1';
     $fields['unique_filename'] = $this->get('unique_filename') == '' ? '0' : '1';
     $fields['ssl_option'] = $this->get('ssl_option') == '' ? '0' : '1';
     $fields['validator'] = $fields['validator'] == 'custom' ? NULL : $this->get('validator');
     return FieldManager::saveSettings($id, $fields);
 }
Beispiel #27
0
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['default_to_current_user'] = $this->get('default_to_current_user') ? $this->get('default_to_current_user') : 'no';
     if ($this->get('author_types') != '') {
         $fields['author_types'] = implode(',', $this->get('author_types'));
     }
     return FieldManager::saveSettings($id, $fields);
 }
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['enable_browser_language_support'] = $this->get('enable_browser_language_support') ? $this->get('enable_browser_language_support') : 'no';
     $fields['allowed_languages'] = $this->get('allowed_languages') ? implode(',', $this->get('allowed_languages')) : '';
     $fields['default_language'] = isset($this->lang[$this->get('default_language')]) ? $this->get('default_language') : '';
     return FieldManager::saveSettings($id, $fields);
 }
Beispiel #29
0
 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['pre_populate_source'] = is_null($this->get('pre_populate_source')) ? null : implode(',', $this->get('pre_populate_source'));
     $fields['validator'] = $fields['validator'] == 'custom' ? null : $this->get('validator');
     if (!FieldManager::saveSettings($id, $fields)) {
         return false;
     }
     SectionManager::removeSectionAssociation($id);
     foreach ($this->get('pre_populate_source') as $field_id) {
         if ($field_id === 'none') {
             continue;
         }
         if (!is_null($field_id) && is_numeric($field_id)) {
             SectionManager::createSectionAssociation(null, $id, (int) $field_id, $this->get('show_association') == 'yes' ? true : false, $this->get('association_ui'), $this->get('association_editor'));
         }
     }
     return true;
 }
 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     fieldMemberTimezone::createSettingsTable();
     $fields = array('field_id' => $id);
     if (is_array($this->get('available_zones'))) {
         $fields['available_zones'] = implode(",", $this->get('available_zones'));
     }
     return FieldManager::saveSettings($id, $fields);
 }