public function beforeExecute() { parent::beforeExecute(); // TODO: Change the autogenerated stub $this->form_cfg = ['common' => ['label' => t('Common Settings'), 'settings' => ['site_name' => ['label' => t('Site Name'), 'control' => 'input', 'type' => 'text'], 'site_url' => ['label' => t('Site Url'), 'control' => 'input', 'type' => 'text', 'placeholder' => 'http://'], 'email_address' => ['label' => t('E-mail Address'), 'control' => 'input', 'type' => 'email'], 'contact_phone' => ['label' => t('Company Phone'), 'control' => 'input', 'type' => 'tel'], 'contact_address' => ['label' => t('Company Address'), 'control' => 'input', 'type' => 'text'], 'site_offline' => ['label' => t('Site Offline?'), 'control' => 'checkbox', 'value' => 1]]]]; $other_setting = ConfigHandler::get('site_setting'); if (!empty($other_setting)) { $this->form_cfg['common']['settings'] = Base::mergeArray($this->form_cfg['common']['settings'], $other_setting); } $this->form_cfg = Plugin::applyFilters('custom_system_setting', $this->form_cfg); }
/** * Add Config setting * @param array $config * @param string $namespace */ public static function add($config, $namespace = 'default') { if (!isset(self::$_data[$namespace])) { self::$_data[$namespace] = $config; } else { self::$_data[$namespace] = Base::mergeArray(self::$_data[$namespace], $config); } }