getURL() . '#plugins' : $_REQUEST['redir']; # -- Combos of types of supported public pages -- $types = [ __('home page') => 'default', __('post pages') => 'post', __('tags pages') => 'tag', __('archives pages') => 'archive', __('category pages') => 'category', __('entries feed') => 'feed' ]; if ($core->plugins->moduleExists('muppet')) { foreach(muppet::getPostTypes() as $k => $v) { $types[sprintf( __('"%s" pages from extension muppet'), $v['name'] )] = $k; } } # -- Get settings -- $core->blog->settings->addNamespace('fac'); $s = $core->blog->settings->fac; $fac_active = (boolean) $s->fac_active; $fac_defaultfeedtitle = (string) $s->fac_defaultfeedtitle; $fac_showfeeddesc = (boolean) $s->fac_showfeeddesc; $fac_public_tpltypes = @unserialize($s->fac_public_tpltypes); $fac_formats = @unserialize($s->fac_formats); if (!is_array($fac_public_tpltypes)) { $fac_public_tpltypes = array(); } if (!is_array($fac_formats)) { $fac_formats = array(); } # -- Set settings -- if (!empty($_POST['save'])) { try { $fac_active = !empty($_POST['fac_active']); $fac_defaultfeedtitle = (string) $_POST['fac_defaultfeedtitle']; $fac_showfeeddesc = !empty($_POST['fac_showfeeddesc']); $fac_public_tpltypes = $_POST['fac_public_tpltypes']; $fac_formats = array(); foreach($_POST['fac_formats'] as $uid => $f) { if (!empty($f['name'])) { $fac_formats[$uid] = $f; } } $s->put('fac_active', $fac_active); $s->put('fac_defaultfeedtitle', $fac_defaultfeedtitle); $s->put('fac_showfeeddesc', $fac_showfeeddesc); $s->put('fac_public_tpltypes', serialize($fac_public_tpltypes)); $s->put('fac_formats', serialize($fac_formats)); $core->blog->triggerBlog(); dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); http::redirect( $list->getURL('module=fac&conf=1&redir=' . $list->getRedir()) ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # -- Display form -- echo '
' . form::field('fac_defaultfeedtitle', 65, 255, $fac_defaultfeedtitle) . '
' . __('Use %T to insert title of feed.') . '
' . form::field( array( 'fac_formats[' . $uid . '][name]', 'fac_formats_' . $uid . '_name' ), 20, 255, empty($f['name']) ? '' : $f['name'], 'maximal' ) . '
' . __('In order to remove a format, leave its name empty.') . '
' . form::field( array( 'fac_formats[' . $uid . '][dateformat]', 'fac_formats_' . $uid . '_dateformat' ), 20, 255, empty($f['dateformat']) ? '' : $f['dateformat'], 'maximal' ) . '
' . __('Use date format of Dotclear or leave empty to use default date format of blog.') . '
' . form::field( array( 'fac_formats[' . $uid . '][lineslimit]', 'fac_formats_' . $uid . '_lineslimit' ), 5, 4, empty($f['lineslimit']) ? '' : $f['lineslimit'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitletext]', 'fac_formats_' . $uid . '_linestitletext' ), 20, 255, empty($f['linestitletext']) ? '' : $f['linestitletext'], 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitleover]', 'fac_formats_' . $uid . '_linestitleover' ), 20, 255, empty($f['linestitleover']) ? '' : $f['linestitleover'], 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitlelength]', 'fac_formats_' . $uid . '_linestitlelength' ), 5, 4, empty($f['linestitlelength']) ? '' : $f['linestitlelength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linesdescriptionlength]', 'fac_formats_' . $uid . '_linesdescriptionlength' ), 5, 4, empty($f['linesdescriptionlength']) ? '' : $f['linesdescriptionlength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linescontentlength]', 'fac_formats_' . $uid . '_linescontentlength' ), 5, 4, empty($f['linescontentlength']) ? '' : $f['linescontentlength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][name]', 'fac_formats_' . $uid . '_name' ), 20, 255, '', 'maximal' ) . '
'. __('In order to remove a format, leave its name empty.') . '
' . form::field( array( 'fac_formats[' . $uid . '][dateformat]', 'fac_formats_' . $uid . '_dateformat' ), 20, 255, '', 'maximal' ) . '
' . __('Use date format of Dotclear or leave empty to use default date format of blog.') . '
' . form::field( array( 'fac_formats[' . $uid . '][lineslimit]', 'fac_formats_' . $uid . '_lineslimit' ), 5, 4, 5, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitletext]', 'fac_formats_' . $uid . '_linestitletext' ), 20, 255, '%T', 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitleover]', 'fac_formats_' . $uid . '_linestitleover' ), 20, 255, '%D', 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( array( 'fac_formats[' . $uid . '][linestitlelength]', 'fac_formats_' . $uid . '_linestitlelength' ), 5, 4, 150, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linesdescriptionlength]', 'fac_formats_' . $uid . '_linesdescriptionlength' ), 5, 4, 350, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( array( 'fac_formats[' . $uid . '][linescontentlength]', 'fac_formats_' . $uid . '_linescontentlength' ), 5, 4, 350, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . __('Theme must have behavoir publicEntryAfterContent.') . ' ' . __('To add feed to an entry edit this entry and put in sidebar the url of the feed and select a format.') . '
' . html::escapeHTML('') . '' . __('Title of feed') . '
' . __('Description of feed') . '
- ' . __('Title of entry') . '
- ' . __('Description of entry') . '