getURL().'#plugins' : $_REQUEST['redir']; # -- Get settings -- $core->blog->settings->addNamespace('zoneclearFeedServer'); $s = $core->blog->settings->zoneclearFeedServer; $active = (boolean) $s->zoneclearFeedServer_active; $pub_active = (boolean) $s->zoneclearFeedServer_pub_active; $post_status_new = (boolean) $s->zoneclearFeedServer_post_status_new; $bhv_pub_upd = (integer) $s->zoneclearFeedServer_bhv_pub_upd; $update_limit = (integer) $s->zoneclearFeedServer_update_limit; $keep_empty_feed = (boolean) $s->zoneclearFeedServer_keep_empty_feed; $tag_case = (integer) $s->zoneclearFeedServer_tag_case; $post_full_tpl = @unserialize($s->zoneclearFeedServer_post_full_tpl); $post_title_redir = @unserialize($s->zoneclearFeedServer_post_title_redir); $feeduser = (string) $s->zoneclearFeedServer_user; if ($update_limit < 1) { $update_limit = 10; } if (!is_array($post_full_tpl)) { $post_full_tpl = array(); } if (!is_array($post_title_redir)) { $post_title_redir = array(); } $zc = new zoneclearFeedServer($core); # -- Set settings -- if (!empty($_POST['save'])) { try { $active = !empty($_POST['active']); $pub_active = !empty($_POST['pub_active']); $post_status_new = !empty($_POST['post_status_new']); $bhv_pub_upd = (integer) $_POST['bhv_pub_upd']; $limit = abs((integer) $_POST['update_limit']); $keep_empty_feed = !empty($_POST['keep_empty_feed']); $tag_case = (integer) $_POST['tag_case']; $post_full_tpl = $_POST['post_full_tpl']; $post_title_redir = $_POST['post_title_redir']; $feeduser = (string) $_POST['feeduser']; if ($limit < 1) { $limit = 10; } $s->put('zoneclearFeedServer_active', $active); $s->put('zoneclearFeedServer_pub_active', $pub_active); $s->put('zoneclearFeedServer_post_status_new', $post_status_new); $s->put('zoneclearFeedServer_bhv_pub_upd', $bhv_pub_upd); $s->put('zoneclearFeedServer_update_limit', $limit); $s->put('zoneclearFeedServer_keep_empty_feed', $keep_empty_feed); $s->put('zoneclearFeedServer_tag_case', $tag_case); $s->put('zoneclearFeedServer_post_full_tpl', serialize($post_full_tpl)); $s->put('zoneclearFeedServer_post_title_redir', serialize($post_title_redir)); $s->put('zoneclearFeedServer_user', $feeduser); $core->blog->triggerBlog(); dcPage::addSuccessNotice( __('Configuration successfully updated.') ); http::redirect( $list->getURL('module=zoneclearFeedServer&conf=1&redir='. $list->getRedir()) ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # -- Form combos -- $combo_admins = $zc->getAllBlogAdmins(); $combo_pubupd = array( __('Disable') => 0, __('Before display') => 1, __('After display') => 2, __('Through Ajax') => 3 ); $combo_status = array( __('Unpublished') => 0, __('Published') => 1 ); $combo_tagcase = array( __('Keep source case') => 0, __('First upper case') => 1, __('All lower case') => 2, __('All upper case') => 3 ); $pub_page_url = $core->blog->url.$core->url->getBase('zoneclearFeedsPage'); # -- Display form -- if (!is_writable(DC_TPL_CACHE)) { echo '

'. __('Dotclear cache is not writable or not well configured!'). '

'; } echo '

'.__('Activation').'

'; echo '
'; if ($core->blog->settings->zoneclearFeedServer->zoneclearFeedServer_pub_active) { echo '

'.__('View the public list of feeds').'

'; } echo '

'.__('Rules').'

'. form::combo('post_status_new', $combo_status, $post_status_new).'

'. form::combo('feeduser', $combo_admins, $feeduser).'

'. form::combo('tag_case', $combo_tagcase, $tag_case).'

'. form::combo('bhv_pub_upd', $combo_pubupd, $bhv_pub_upd).'

'. form::field('update_limit', 6, 4, $update_limit).'

'.__('Redirect to original post on:').'

'.__('Show full content on:').'

'; dcPage::helpBlock('zoneclearFeedServer');