close(403, JText::translate('JINVALID_TOKEN')); } $settings = JFactory::getApplication()->input->get('settings', [], 'array'); if (!$settings) { VBOHttpDocument::getInstance()->close(500, 'Missing data to update'); } // VikBooking configuration object $config = VBOFactory::getConfig(); // prepare settings to be mirrored on VikChannelManager, if available $vcm_settings = [ 'appearance_pref' => null, ]; foreach ($settings as $param => $value) { // update setting on VBO $config->set($param, $value); // check if setting exists in VCM if (array_key_exists($param, $vcm_settings)) { // set value $vcm_settings[$param] = $value; } } // check if any settings should be updated on VCM if (class_exists('VCMFactory')) { $vcm_config = VCMFactory::getConfig(); foreach ($vcm_settings as $param => $value) { if ($value !== null) { // update mirrored setting on VCM $vcm_config->set($param, $value); } } } VBOHttpDocument::getInstance()->json([]); } }