modx->newQuery('cgGroup'); $c->sortby('sortorder','ASC'); $c->sortby('label','ASC'); $groups = $this->modx->getCollection('cgGroup', $c); foreach ($groups as $group) { $grp = $group->toArray(); $grp['items'] = array(); $c = $this->modx->newQuery('cgSetting'); $c->sortby('sortorder','ASC'); $c->sortby('label','ASC'); foreach ($group->getMany('Settings', $c) as $setting) { $sa = $setting->toArray(); if (in_array($sa['xtype'], array('checkbox','xcheckbox'), true)) { $sa['value'] = (bool)$sa['value']; } if ($sa['xtype'] === 'googlefontlist') { $googleFontsApiKey = $this->modx->getOption('clientconfig.google_fonts_api_key', null, ''); $sa['xtype'] = empty($googleFontsApiKey) ? 'textfield' : $sa['xtype']; } elseif ($sa['xtype'] === 'modx-combo' && $setting->get('process_options')) { $inputOpts = $setting->get('options'); $this->modx->getParser(); $this->modx->parser->processElementTags('', $inputOpts, true, true); $sa['options'] = $inputOpts; } $grp['items'][] = $sa; } $tabs[] = $grp; } $this->loadRichTextEditor(); $this->tabs = $tabs; if (array_key_exists('context', $scriptProperties) && $this->modx->getOption('clientconfig.context_aware')) { $key = $scriptProperties['context']; $context = $this->modx->getObject('modContext', ['key' => $key]); if ($context instanceof modContext) { $this->addHtml(''); } } } /** * The pagetitle to put in the