blog->settings->addNamespace('rest'); if (is_null($core->blog->settings->rest->rest_active)) { try { // Default state is active if the comments are configured to allow wiki syntax $core->blog->settings->rest->put('rest_active',false,'boolean',true); $core->blog->settings->rest->put('rest_is_open',false,'boolean',true); $core->blog->triggerBlog(); http::redirect($p_url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } // Getting current parameters $active = (boolean)$core->blog->settings->rest->rest_active; $openApi = (boolean)$core->blog->settings->rest->rest_is_open; //apply if (!empty($_POST['saveconfig'])) { try { $core->blog->settings->addNameSpace('rest'); $active = (empty($_POST['active'])) ? false : true; $core->blog->settings->rest->put('rest_active',$active,'boolean'); $openApi = (empty($_POST['open'])) ? false : true; $core->blog->settings->rest->put('rest_is_open',$openApi,'boolean'); dcPage::addSuccessNotice(__('Configuration successfully updated.')); http::redirect($p_url); }catch (Exception $e) { $core->error->add($e->getMessage()); } } ?>