Get the necessary settings, override if necessary.

@return array|string
425243
public function getSettings()
    {
        $lucid = $this->option('lucid');
        $settings = $this->getGeneralSettings();

        // If the --domain was passed, but not --lucid
        if ($this->option('domain') && ! $lucid) {
            return array_replace_recursive($settings, $this->getDomainMapMethod());
        }

        // If --lucid was passed
        if ($lucid) {
            $lucidSettings = array_merge($settings, $this->getLucidSettings());
            unset($lucidSettings['map_method']);
            return $lucidSettings;
        }

        // Return the default general settings
        return $settings;
    }
567373
protected function getSettingsInstance()
    {
        if (isset($this->settings)) {
            return $this->settings;
        }

        $settingsConfig = $this->getSettingsConfig();

        return $this->settings = new Settings($settingsConfig, $this);
    }
272329
protected function getSettingsConfig(): array
    {
        if (!$this->cache instanceof Cache) {
            $this->items = $this->model->getSettings();
        } else {
            $cacheItems = $this->cache->get($this->cacheKey);
            if (!empty($cacheItems)) {
                $this->items = $cacheItems;
            } else {
                $this->items = $this->model->getSettings();
                $this->cache->set($this->cacheKey, $this->items);
            }
        }

        return $this->items;
    }
587817
public function get_setting() {
        $result1 = $this->config_read($this->name);
        $result2 = $this->config_read($this->name2);
        if (is_null($result1) or is_null($result2)) {
            return NULL;
        }

        return array('h' => $result1, 'm' => $result2);
    }
243246
public function settings($passed = null)
    {
        if (is_array($passed)) {
            return $this->setSettings($passed);
        } elseif (!is_null($passed)) {
            $settings = $this->getSettingsInstance();

            return $settings->get($passed);
        }

        return $this->getSettingsInstance();
    }
953338
public function getSamlSettings() {
        $settings = new Maestrano_Saml_Settings();

        // Configure SAML
        $settings->idpPublicCertificate = Maestrano::with($this->_preset)->param('sso.x509_certificate');
        $settings->spIssuer = Maestrano::with($this->_preset)->param('api.id');
        // TODO: default value?
        // $settings->requestedNameIdFormat = Maestrano::with($this->_preset)->param('sso.name_id_format');
        $settings->idpSingleSignOnUrl = $this->getIdpUrl();
        $settings->spReturnUrl = $this->getConsumeUrl();

        return $settings;
    }
553049
protected function getConfig()
    {
        $config = array();
        $config['headers'] = $this->headers;
        $config['config'] = array(
            'curl' => $this->curlConfig
        );
        $config['query'] = $this->parameters;
        $config['cookies'] = true;
        return $config;
    }
847496
public function defaultSettings()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

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

        return [];
    }
1221771
public function getSettings()
    {
        $aValidSettings = $this->getValidSettings();
        $aSettings      = array();

        foreach ( $aValidSettings as $sSettingName ) {
            $aSettings[$sSettingName] = $this->getSetting( $sSettingName );
        }

        return $aSettings;
    }
1086527
public function get_preset_settings() {
        global $DB;

        $fs = $fileobj = null;
        if (!is_directory_a_preset($this->directory)) {
            //maybe the user requested a preset stored in the Moodle file storage

            $fs = get_file_storage();
            $files = $fs->get_area_files(DATA_PRESET_CONTEXT, DATA_PRESET_COMPONENT, DATA_PRESET_FILEAREA);

            //preset name to find will be the final element of the directory
            $explodeddirectory = explode('/', $this->directory);
            $presettofind = end($explodeddirectory);

            //now go through the available files available and see if we can find it
            foreach ($files as $file) {
                if (($file->is_directory() && $file->get_filepath()=='/') || !$file->is_directory()) {
                    continue;
                }
                $presetname = trim($file->get_filepath(), '/');
                if ($presetname==$presettofind) {
                    $this->directory = $presetname;
                    $fileobj = $file;
                }
            }

            if (empty($fileobj)) {
                print_error('invalidpreset', 'data', '', $this->directory);
            }
        }

        $allowed_settings = array(
            'intro',
            'comments',
            'requiredentries',
            'requiredentriestoview',
            'maxentries',
            'rssarticles',
            'approval',
            'defaultsortdir',
            'defaultsort');

        $result = new stdClass;
        $result->settings = new stdClass;
        $result->importfields = array();
        $result->currentfields = $DB->get_records('data_fields', array('dataid'=>$this->module->id));
        if (!$result->currentfields) {
            $result->currentfields = array();
        }


        /* Grab XML */
        $presetxml = $this->data_preset_get_file_contents($fs, $fileobj, $this->directory,'preset.xml');
        $parsedxml = xmlize($presetxml, 0);

        /* First, do settings. Put in user friendly array. */
        $settingsarray = $parsedxml['preset']['#']['settings'][0]['#'];
        $result->settings = new StdClass();
        foreach ($settingsarray as $setting => $value) {
            if (!is_array($value) || !in_array($setting, $allowed_settings)) {
                // unsupported setting
                continue;
            }
            $result->settings->$setting = $value[0]['#'];
        }

        /* Now work out fields to user friendly array */
        $fieldsarray = $parsedxml['preset']['#']['field'];
        foreach ($fieldsarray as $field) {
            if (!is_array($field)) {
                continue;
            }
            $f = new StdClass();
            foreach ($field['#'] as $param => $value) {
                if (!is_array($value)) {
                    continue;
                }
                $f->$param = $value[0]['#'];
            }
            $f->dataid = $this->module->id;
            $f->type = clean_param($f->type, PARAM_ALPHA);
            $result->importfields[] = $f;
        }
        /* Now add the HTML templates to the settings array so we can update d */
        $result->settings->singletemplate     = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"singletemplate.html");
        $result->settings->listtemplate       = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"listtemplate.html");
        $result->settings->listtemplateheader = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"listtemplateheader.html");
        $result->settings->listtemplatefooter = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"listtemplatefooter.html");
        $result->settings->addtemplate        = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"addtemplate.html");
        $result->settings->rsstemplate        = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"rsstemplate.html");
        $result->settings->rsstitletemplate   = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"rsstitletemplate.html");
        $result->settings->csstemplate        = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"csstemplate.css");
        $result->settings->jstemplate         = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"jstemplate.js");
        $result->settings->asearchtemplate    = $this->data_preset_get_file_contents($fs, $fileobj,$this->directory,"asearchtemplate.html");

        $result->settings->instance = $this->module->id;
        return $result;
    }
81775
public function get_setting() {
        global $CFG;

        $config = $this->config_read($this->name);
        if (is_null($config)) {
            return null;
        }

        return $this->prepare_form_data($config);
    }
353030
protected function getConfig()
    {
        if (!$this->table->getDataSource() instanceof Dom) {
            $this->prepareColumnsConfig();
        }
        $this->prepareExtensionsConfig();

        $config = [];
        $config += $this->table->getProperties();

        return json_encode($config);
    }
442183
public function all() {
		if (!isset($this->settings)) {
			$this->settings = array_merge($this->getDefaults(), $this->plugin->getAllSettings());
		}
		return $this->settings;
	}
68203
public function getConfig()
    {
        $config = array(
            'label' => $this->getI18nLabel(),
            'icon' => $this->getIcon(),
            'buttonClasses' => $this->getButtonClasses(),
            'xhr' => $this->getXhr(),
            'destructive' => $this->getDestructive()
        );
        return $config;
    }
346963
public function get_setting() {
        $result = $this->config_read($this->name);
        if (is_null($result)) {
            return NULL;
        }
        if (!$this->load_choices()) {
            return NULL;
        }
        $result = str_pad($result, count($this->choices), '0');
        $result = preg_split('//', $result, -1, PREG_SPLIT_NO_EMPTY);
        $setting = array();
        foreach ($this->choices as $key=>$unused) {
            $value = array_shift($result);
            if ($value) {
                $setting[$key] = 1;
            }
        }
        return $setting;
    }
779503
public static function getOverrides()
    {
        $overrides = [];
        if (TYPO3_MODE === 'FE') {
            if ((array_key_exists('plugin.', $GLOBALS['TSFE']->tmpl->setup))
            && (array_key_exists('tx_dyncss.', $GLOBALS['TSFE']->tmpl->setup['plugin.']))
            && (array_key_exists('overrides.', $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dyncss.']))) {
                // iterate of cObjects and render them to pass them into the vars
                foreach ($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dyncss.']['overrides.'] as $varName => $varCObj) {
                    if (substr($varName, -1, 1) !== '.') {
                        $cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
                        $overrides[$varName] = $cObj->cObjGetSingle($varCObj, $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dyncss.']['overrides.'][$varName.'.']);
                    }
                }
            }
            //
        } elseif (TYPO3_MODE === 'BE') {
            /** @var \KayStrobach\Dyncss\Configuration\BeRegistry $configManager */
            $configManager = GeneralUtility::makeInstance('KayStrobach\Dyncss\Configuration\BeRegistry');
            $overrides = $configManager->getAllOverrides();
        }

        return $overrides;
    }
1299135
public static function getAllSettings()
    {
        $settings = Settings::all();

        $settingsList = [];
        foreach($settings as $setting){
            $settingsList[$setting->settingsKey] = $setting->value;
        }

        return $settingsList;
    }