Get default config field settings
@return array
435093
protected function getDefaultConfigSettings() : array
    {
        $arResult = [
            'tab'   => 'lovata.toolbox::lang.tab.properties',
            'span'  => 'left',
            'label' => $this->name,
            'comment' => $this->description,
        ];

        //Get property tab
        $sTabName = $this->getSettingValue('tab');
        if (!empty($sTabName)) {
            $arResult['tab'] = $sTabName;
        }

        return $arResult;
    }
1038842
protected function getFieldConfig()
    {
        $config = parent::getFieldConfig();
        
        if ($values = $this->getValueArray()) {
            
            $data = [];
            
            foreach ($values as $value) {
                
                if ($record = $this->getValueRecord($value)) {
                    $data[] = $this->getResultData($record, true);
                }
                
            }
            
            $config['data'] = $data;
            
        }
        
        return $config;
    }
274544
public function parseFieldParameters()
    {
        $parameters = $this->getFieldParameters();
        $default_params = $this->getDefaultParameters();

        return is_array($parameters) ? array_replace_recursive($default_params, $parameters) : $default_params;
    }
1322282
protected function getSettings() {
        if (!$this->_settings) {
            $this->_settings = new SettingsList($this->version);
        }

        return $this->_settings;
    }
1318664
private function getFileFields() : array
    {
        $config = new ModuleConfig(ConfigType::MIGRATION(), $this->table->getAlias());
        $config = json_encode($config->parse());
        if (false === $config) {
            return [];
        }

        $fields = json_decode($config, true);

        if (empty($fields)) {
            return [];
        }

        $fields = array_filter($fields, function ($params) {
            return in_array($params['type'], self::FIELD_TYPES);
        });

        return array_keys($fields);
    }
847496
public function defaultSettings()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->defaultSettings($this);
        }

        return [];
    }
1231827
public function getConfigurations() {
		if ($this->crops_internal === null) {
			/** @var BaseActiveRecord $model */
			$model = $this->owner;

			if (!empty($this->crops)) {
				$this->crops_internal = $this->crops;
			} else {
				$o = [];
				foreach (['cropped_field', 'crop_field', 'crop_width', 'ratio'] as $f) {
					if ($this->$f) {
						$o[$f] = $this->$f;
					}
				}
				$this->crops_internal = [$o];
			}

			foreach ($this->crops_internal as &$crop) {
				if (empty($crop['cropped_field'])) {
					$crop['value'] = false;
					$crop['image'] = $model->getOldAttribute($this->attribute);
				} else if (empty($crop['crop_field'])) {
					$crop['value'] = false;
					$crop['image'] = $model->getAttribute($crop['cropped_field']);
				} else {
					$crop['value'] = $model->getAttribute($crop['crop_field']);
					$crop['image'] = $model->getOldAttribute($this->attribute);
				}
			}
		}
		return $this->crops_internal;
	}
1139641
protected function getConfig()
    {
        $configPath = $this->input->getOption('config') ?: (getcwd().'/flatbase.json');

        $defaults = new \stdClass();
        $defaults->path = null;

        if (file_exists($configPath)) {
            foreach (json_decode(file_get_contents($configPath)) as $property => $value) {
                $defaults->{$property} = $value;
            }
        }

        return $defaults;
    }
829670
protected function _setDefaults()
    {
        $defaults = [
            'authenticate' => [
                'Form' => [
                    'finder'    => 'auth',
                    'userModel' => 'Community.Users',
                    'fields'    => [
                        'username' => 'login',
                        'password' => 'password'
                    ],
                ]
            ],
            'flash' => [
                'key'       => 'auth',
                'element'   => 'error',
                'params'    => ['class' => 'error']
            ],
            'loginAction' => [
                'controller' => 'Users',
                'action'     => 'login',
                'plugin'     => 'Community'
            ],
            'unauthorizedRedirect' => [
                'action'     => 'login',
                'controller' => 'Users',
                'plugin'     => 'Community'
            ],
            'authorize'      => ['Community.Base'],
            'loginRedirect'  => $this->_getLoginRedirect(),
            'logoutRedirect' => $this->_config['loginAction'],
            'authError'      => __d('community', 'You are not authorized to access that location.')
        ];

        $config = $this->getConfig();
        foreach ($config as $key => $value) {
            if ($value !== null) {
                unset($defaults[$key]);
            }
        }

        $this->setConfig($defaults);
    }
1287778
protected function setDefaultOptions()
    {
        $default = [
            'colors' => $this->getDefaultColors(),
            'disableCustomColors' => false
        ];

        if (function_exists('_x')) {
            $default['l10n'] = [
                'clear' => _x('Clear', 'field', Application::TEXTDOMAIN)
            ];
        }

        return array_merge($this->defaultOptions, $default);
    }
1306995
private function getDefaultOptions()
    {
        // the list of default options if no config is found or specified
        return array(
            self::OPTIONS_KEY_IMAGES => array(
                'vectorface/php5.4',
                'vectorface/php5.5',
                'vectorface/php5.6',
                'vectorface/hhvm'
            ),
            self::OPTIONS_KEY_SYNTAX => true,
            self::OPTIONS_KEY_SYNTAXCOMMAND => 'find /opt/source -type f -name "*.php" !  -path "*/vendor/*" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v "No syntax errors"',
            self::OPTIONS_KEY_UNITTESTS => true,
            self::OPTIONS_KEY_UNITTESTSCOMMAND => '/opt/source/vendor/bin/phpunit',
            self::OPTIONS_KEY_PULL => false,
        );
    }
672176
public function getSettings(): array
    {
        $result = [];
        $settings = static::find()->select(['type', 'section', 'key', 'value'])->active()->asArray()->all();

        foreach ($settings as $setting) {
            $section = $setting['section'];
            $key = $setting['key'];
            $settingOptions = ['type' => $setting['type'], 'value' => $setting['value']];

            if (isset($result[$section][$key])) {
                ArrayHelper::merge($result[$section][$key], $settingOptions);
            } else {
                $result[$section][$key] = $settingOptions;
            }
        }

        return $result;
    }
1221432
public function getDefaultOptions(): array
    {
        // Setup default validation rules.
        $this->defaultOptions['rules'] = $this->rules;

        // Setup default messages.
        $this->defaultOptions['messages'] = $this->messages;

        // Setup default placeholder.
        $this->defaultOptions['placeholder'] = $this->placeholder ?? $this->getBaseName();

        // Setup default label.
        $this->defaultOptions['label'] = $this->label ?? ucfirst(str_replace(['-', '_'], ' ', $this->getBaseName()));

        return $this->defaultOptions;
    }
181923
public function getConfig(): array
	{
		global $txt, $modSettings;

		$file = $this->_app->boardDir .'/_config'. $this->_app->name .'.json';

		// Already loaded or does not use config?
		if ($this->_config || !$this->_app->useConfig)
			return $this->_config;

		// Check for a $modSettings key first.
		if (!empty($modSettings['_config'. $this->_app->name]))
			return $this->_config = smf_json_decode($modSettings['_config'. $this->_app->name], true);

		// Get the json file. Must be located in $boarddir folder.
		if (!$this->_config && !file_exists($file))
		{
			loadLanguage('Errors');
			log_error(sprintf($txt['error_bad_file'], $file));
		}

		else
			$this->_config = smf_json_decode(file_get_contents($file), true);

		return $this->_config;
	}
1133946
public function getOptionDefaults()
    {
        $values = array();
        foreach ($this->options as $option) {
            $values[$option->getName()] = $option->getDefault();
        }

        return $values;
    }
674456
protected function getFields(): array
    {
        $fields = $this->getConfig('fields');
        $defaults = [
            'decrypt' => false,
        ];
        $result = [];
        foreach ($fields as $field => $values) {
            if (is_numeric($field)) {
                $field = $values;
                $values = [];
            }
            $values = array_merge($defaults, $values);
            $result[$field] = $values;
        }

        return $result;
    }
606365
public function defaults()
    {
        $defaults = $this->config;
        if (!isset($defaults['width'])) {
            $defaults['width'] = $defaults['default_width'];
        }
        if (!isset($defaults['height'])) {
            $defaults['height'] = $defaults['default_height'];
        }
        return $defaults;
    }