getURL().'#plugins' : $_REQUEST['redir']; # -- Form combos -- $sortby_combo = array( __('Date') => 'epc_upddt', __('Key') => 'epc_key', __('Value') => 'epc_value', __('ID') => 'epc_id' ); $order_combo = array( __('Ascending') => 'asc', __('Descending') => 'desc' ); # -- Get settings -- $core->blog->settings->addNamespace('enhancePostContent'); $s = $core->blog->settings->enhancePostContent; $active = (boolean) $s->enhancePostContent_active; $list_sortby = (string) $s->enhancePostContent_list_sortby; $list_order = (string) $s->enhancePostContent_list_order; $list_nb = (integer) $s->enhancePostContent_list_nb; $_filters = libEPC::blogFilters(); $allowedtplvalues = libEPC::blogAllowedTplValues(); $allowedpubpages = libEPC::blogAllowedPubPages(); # -- Set settings -- if (!empty($_POST['save'])) { try { $active = !empty($_POST['active']); $list_sortby = in_array($_POST['list_sortby'], $sortby_combo) ? $_POST['list_sortby'] : 'epc_id'; $list_order = in_array($_POST['list_order'], $order_combo) ? $_POST['list_order'] : 'desc'; $list_nb = isset($_POST['list_nb']) && $_POST['list_nb'] > 0 ? $_POST['list_nb'] : 20; $s->put('enhancePostContent_active', $active); $s->put('enhancePostContent_list_sortby', $list_sortby); $s->put('enhancePostContent_list_order', $list_order); $s->put('enhancePostContent_list_nb', $list_nb); $allowedtplvalues = libEPC::explode($_POST['allowedtplvalues']); $allowedpubpages = libEPC::explode($_POST['allowedpubpages']); $s->put( 'enhancePostContent_allowedtplvalues', serialize($allowedtplvalues) ); $s->put( 'enhancePostContent_allowedpubpages', serialize($allowedpubpages) ); $core->blog->triggerBlog(); dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); http::redirect( $list->getURL('module=enhancePostContent&conf=1&redir='. $list->getRedir()) ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # -- Display form -- echo '

'.__('General').'

'.__('This enable public widgets and contents filter.').'

'.__('Record list').'

'.__('This is the default order of records lists.').'

'. form::combo('list_sortby', $sortby_combo, $list_sortby).'

'. form::combo('list_order', $order_combo, $list_order).'

'. form::field('list_nb', 3, 3, $list_nb).'

'.__('Extra').'

'.__('This is a special feature to edit list of allowed template values and public pages where this plugin works.').'

'. form::field('allowedtplvalues', 100,0, libEPC::implode($allowedtplvalues)).'

'.__('Use "readable_name1:template_value1;readable_name2:template_value2;" like "entry content:EntryContent;entry excerpt:EntryExcerpt;".').'

'. form::field('allowedpubpages', 100, 0, libEPC::implode($allowedpubpages)).'

'.__('Use "readable_name1:template_page1;readable_name2:template_page2;" like "post page:post.html;home page:home.html;".').'

';