Manage Site Settings

List all site configuration settings to bulk edit
17109
public function showSettings()
    {
        // Get dependencies
        $settingMapper = ($this->container->dataMapper)('SettingMapper');
        $json = $this->container->json;

        // Fetch settings from database
        $allSettings = $settingMapper->findSiteSettings();

        // Fetch custom settings
        $jsonFilePath = ROOT_DIR . "structure/definitions/customSettings.json";
        if (null === $customSettings = $json->getJson($jsonFilePath, 'setting')) {
            $this->setAlert('danger', 'Custom Settings Error', $json->getErrorMessages());
        } else {
            // Merge saved settings with custom settings
            $allSettings = $this->mergeSettings($allSettings, $customSettings->settings);
        }

        return $this->render('editSettings.html', $allSettings);
    }
568445
public function getSettingList(Site $site)
    {
        $settingList = [];
        /** @var $setting \PageBuilder\Entity\Setting */
        foreach ($site->getSettings() as $setting) {
            $code               = $setting->getSettingKey()->getCode();
            $value              = $setting->getSettingValue() ?: $setting->getSettingKey()->getDefaultValue();
            $settingList[$code] = $value;
        }

        $locale                = $site->getLocale() ?: 'en_GB';
        $settingList           = array_merge($settingList, \Locale::parseLocale($locale));
        $settingList['locale'] = $locale;

        return $settingList;
    }
694215
def site_config_dir(self):
        """"""
        directory = appdirs.site_config_dir(self.appname, self.appauthor,
                             version=self.version, multipath=self.multipath)
        if self.create:
            self._ensure_directory_exists(directory)
        return directory
1242843
public function index()
    {
        $configurations = Configuration::all();
        $configurations_by_sections = ['init' => [], 'email' => [], 'tickets' => [], 'perms' => [], 'editor' => [], 'other' => []];
        $init_section = ['main_route', 'main_route_path', 'admin_route', 'admin_route_path', 'master_template', 'bootstrap_version', 'routes'];
        $email_section = ['status_notification', 'comment_notification', 'queue_emails', 'assigned_notification',
        'email.template', 'email.header', 'email.signoff', 'email.signature', 'email.dashboard',
        'email.google_plus_link', 'email.facebook_link', 'email.twitter_link', 'email.footer', 'email.footer_link',
        'email.color_body_bg', 'email.color_header_bg', 'email.color_content_bg', 'email.color_footer_bg',
        'email.color_button_bg', ];
        $tickets_section = ['default_status_id', 'default_close_status_id', 'default_reopen_status_id', 'paginate_items'];
        $perms_section = ['agent_restrict', 'close_ticket_perm', 'reopen_ticket_perm'];
        $editor_section = ['editor_enabled', 'include_font_awesome', 'editor_html_highlighter', 'codemirror_theme',
          'summernote_locale', 'summernote_options_json_file', 'purifier_config', ];

        // Split them into configurations sections for tabs
        foreach ($configurations as $config_item) {
            //trim long values (ex serialised arrays)
            $config_item->value = $config_item->getShortContent(25, 'value');
            $config_item->default = $config_item->getShortContent(25, 'default');

            if (in_array($config_item->slug, $init_section)) {
                $configurations_by_sections['init'][] = $config_item;
            } elseif (in_array($config_item->slug, $email_section)) {
                $configurations_by_sections['email'][] = $config_item;
            } elseif (in_array($config_item->slug, $tickets_section)) {
                $configurations_by_sections['tickets'][] = $config_item;
            } elseif (in_array($config_item->slug, $perms_section)) {
                $configurations_by_sections['perms'][] = $config_item;
            } elseif (in_array($config_item->slug, $editor_section)) {
                $configurations_by_sections['editor'][] = $config_item;
            } else {
                $configurations_by_sections['other'][] = $config_item;
            }
        }

        return view('ticketit::admin.configuration.index', compact('configurations', 'configurations_by_sections'));
    }
823367
def _edit_config(xpath, element):
    '''
    

    '''
    query = {'type': 'config',
             'action': 'edit',
             'xpath': xpath,
             'element': element}

    response = __proxy__['panos.call'](query)

    return _validate_response(response)
350327
def process_settings(pelicanobj):
    """"""

    # Default settings
    inline_settings = {}
    inline_settings['config'] = {'[]':('', 'pelican-inline')}

    # Get the user specified settings
    try:
        settings = pelicanobj.settings['MD_INLINE']
    except:
        settings = None

    # If settings have been specified, add them to the config
    if isinstance(settings, dict):
        inline_settings['config'].update(settings)

    return inline_settings
672102
def list_build_configuration_sets(page_size=200, page_index=0, sort="", q=""):
    
    data = list_build_configuration_sets_raw(page_size, page_index, sort, q)
    if data:
        return utils.format_json_list(data)
69447
protected function updateSettings()
    {
        $this->controlAccess('settings_edit');

        foreach ($this->getSubmitted() as $key => $value) {
            $this->config->set($key, $value);
        }

        $this->redirect('', $this->text('Settings have been updated'), 'success');
    }
863842
public function settings()
    {
        $pages = $this->page->get();
        $site = $this->site->first(); //change method to get active site
        
        return view('chuckcms::backend.settings.index', compact('pages', 'site'));
    }
1092830
protected function generateServerConfig(): void
    {
        $settings = [];

        // Siteaccess match settings

        $settings['ezpublish']['siteaccess']['match']['URIElement'] = '1';

        // Config specific files

        $kernelDir = $this->container->getParameter('kernel.project_dir') . '/' . $this->container->getParameter('kernel.name');
        $serverEnv = $this->container->getParameter('server_environment');

        file_put_contents(
            $kernelDir . '/config/server/' . $serverEnv . '/ezplatform_siteaccess.yml',
            Yaml::dump($settings, 7)
        );

        // Root settings file

        $rootSettings = [
            'imports' => [
                [
                    'resource' => $serverEnv . '/ezplatform_siteaccess.yml',
                ],
            ],
        ];

        file_put_contents(
            $kernelDir . '/config/server/' . $serverEnv . '.yml',
            Yaml::dump($rootSettings, 7)
        );
    }
530918
def bulk_update
      notice = Post.bulk_update params, 'posts'

      respond_to do |format|
        format.html { redirect_to admin_articles_path, notice: notice }
      end
    end
209179
def load_site_config(name):
    """"""
    return _load_config_json(
        os.path.join(
            CONFIG_PATH,
            CONFIG_SITES_PATH,
            name + CONFIG_EXT
        )
    )
1255776
def config(ctx):
    """"""
    home_directory = os.path.expanduser('~')
    default_config_file = os.path.join(home_directory, '.tweetqueue')
    default_database_file = os.path.join(home_directory, '.tweetqueue.db')

    config = {}

    config['API_KEY'] = click.prompt('API Key')
    config['API_SECRET'] = click.prompt('API Secret')
    config['ACCESS_TOKEN'] = click.prompt('Access Token')
    config['ACCESS_TOKEN_SECRET'] = click.prompt('Access Token Secret')
    config['DATABASE_LOCATION'] = click.prompt('Database', default=default_database_file)

    config_file = click.prompt('\nSave to', default=default_config_file)

    if click.confirm('Do you want to save this configuration?', abort=True):
        f = open(config_file, 'wb')
        json.dump(config, f, indent=4, separators=(',',': '))
        f.close()
1370713
public function editSettings()
    {
        $this->setTitleEditSettings();
        $this->setBreadcrumbEditSettings();
        $this->setData('settings', $this->module->getSettings('export'));

        $this->submitSettings();
        $this->setDataEditSettings();
        $this->outputEditSettings();
    }
1223030
public function updateAll() {
    // Disable alias since we are targeting specific uri.
    $this->config->set('drush.alias', '');

    foreach ($this->getConfigValue('multisites') as $multisite) {
      $this->updateSite($multisite);
    }
  }
355829
public function initSettingsData()
    {
        $config = App::make('config');
        $this->locale = $config->get('app.locale', 'en');
        $this->fallback_locale = $this->getFallbackLocale($this->locale);
        $this->timezone = $config->get('cms.backendTimezone', $config->get('app.timezone'));

        $this->editor_font_size = $config->get('editor.font_size', 12);
        $this->editor_word_wrap = $config->get('editor.word_wrap', 'fluid');
        $this->editor_code_folding = $config->get('editor.code_folding', 'manual');
        $this->editor_tab_size = $config->get('editor.tab_size', 4);
        $this->editor_theme = $config->get('editor.theme', static::DEFAULT_THEME);
        $this->editor_show_invisibles = $config->get('editor.show_invisibles', false);
        $this->editor_highlight_active_line = $config->get('editor.highlight_active_line', true);
        $this->editor_use_hard_tabs = $config->get('editor.use_hard_tabs', false);
        $this->editor_show_gutter = $config->get('editor.show_gutter', true);
        $this->editor_auto_closing = $config->get('editor.auto_closing', false);
        $this->editor_autocompletion = $config->get('editor.editor_autocompletion', 'manual');
        $this->editor_enable_snippets = $config->get('editor.enable_snippets', false);
        $this->editor_display_indent_guides = $config->get('editor.display_indent_guides', false);
        $this->editor_show_print_margin = $config->get('editor.show_print_margin', false);
    }
884041
function config (args, cb) {
  var action = args.shift()
  switch (action) {
    case "set": return set(args[0], args[1], cb)
    case "get": return get(args[0], cb)
    case "delete": case "rm": case "del": return del(args[0], cb)
    case "list": case "ls": return list(cb)
    case "edit": return edit(cb)
    default: return unknown(action, cb)
  }
}