blog->settings->addNamespace('saba'); $s = $core->blog->settings->saba; $filters_list = array( 'options', 'orders', 'ages', 'categories', 'authors', 'types' ); $saba_active = (boolean) $s->active; $saba_filters = (string) $s->filters; $saba_filters = @unserialize($saba_filters); if (!is_array($saba_filters)) { $saba_filters = array(); } # -- Set settings -- if (!empty($_POST['save'])) { try { $saba_active = !empty($_POST['saba_active']); $saba_filters = array(); foreach($filters_list as $filter) { if (!empty($_POST['saba_filter_'.$filter])) { $saba_filters[] = $filter; } } $s->put( 'active', $saba_active, 'boolean', 'Enable extension' ); $s->put( 'filters', serialize($saba_filters), 'string', 'Diabled filters' ); $core->blog->triggerBlog(); dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); http::redirect( $list->getURL('module=saba&conf=1&redir='. $list->getRedir()) ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # -- Display form -- echo '