1: <?php
 2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 
15: class Jonah_Form_Feed extends Horde_Form
16: {
17:     18: 
19:     function __construct(&$vars)
20:     {
21:         $channel_id = $vars->get('channel_id');
22:         $editing = (!empty($channel_id));
23: 
24:         parent::Horde_Form($vars, ($editing ? _("Edit Feed") : _("New Feed")));
25: 
26:         $this->addHidden('', 'channel_id', 'int', false);
27:         $this->addHidden('', 'old_channel_type', 'text', false);
28: 
29:         $select_type =& $this->addVariable(_("Type"), 'channel_type', 'enum', true, false, null, array(Jonah::getAvailableTypes()));
30:         $select_type->setDefault(Jonah::INTERNAL_CHANNEL);
31:         $select_type->setHelp('feed-type');
32:         $select_type->setAction(Horde_Form_Action::factory('submit'));
33: 
34:         $this->addVariable(_("Name"), 'channel_name', 'text', true);
35:         $this->addVariable(_("Extra information for this feed type"), 'extra_info', 'header', false);
36:     }
37: 
38:     39: 
40:     function ($channel_id = null)
41:     {
42:         $this->addVariable(_("Description"), 'channel_desc', 'text', false);
43:         $this->addVariable(
44:             _("Channel Slug"), 'channel_slug', 'text', true, false,
45:            sprintf(_("Slugs allows direct access to this channel's content by visiting: %s. <br /> Slug names may contain only letters, numbers or the _ (underscore) character."),
46:                     Horde::url('slugname')),
47:             array('/^[a-zA-Z1-9_]*$/'));
48: 
49:         $this->addVariable(_("Include full story content in syndicated feeds?"), 'channel_full_feed', 'boolean', false);
50:         $this->addVariable(_("Channel URL if not the default one. %c gets replaced by the feed ID."), 'channel_link', 'text', false);
51:         $this->addVariable(_("Channel URL for further pages, if not the default one. %c gets replaced by the feed ID, %n by the story offset."), 'channel_page_link', 'text', false);
52:         $this->addVariable(_("Story URL if not the default one. %c gets replaced by the feed ID, %s by the story ID."), 'channel_story_url', 'text', false);
53:     }
54: 
55: }
56: