本文整理汇总了PHP中FieldManager::saveSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldManager::saveSettings方法的具体用法?PHP FieldManager::saveSettings怎么用?PHP FieldManager::saveSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldManager
的用法示例。
在下文中一共展示了FieldManager::saveSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commit
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);
}
示例2: commit
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);
}
示例3: commit
/**
* 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);
}
示例4: commit
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);
}
示例5: commit
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);
}
示例6: commit
/**
* 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;
}
示例7: commit
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);
}
示例8: commit
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);
}
示例9: commit
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);
}
示例10: commit
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);
}
示例11: commit
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);
}
示例12: commit
/**
*
* 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);
}
示例13: commit
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);
}
示例14: commit
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);
}
示例15: commit
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);
}