Overview

Packages

  • Jonah
  • None

Classes

  • Jonah
  • Jonah_Api
  • Jonah_Block_Latest
  • Jonah_Driver
  • Jonah_Driver_Sql
  • Jonah_Exception
  • Jonah_Factory_Driver
  • Jonah_Form_Feed
  • Jonah_Form_Story
  • Jonah_Test
  • Jonah_View_ChannelDelete
  • Jonah_View_ChannelEdit
  • Jonah_View_ChannelList
  • Jonah_View_StoryDelete
  • Jonah_View_StoryEdit
  • Jonah_View_StoryList
  • Jonah_View_StoryPdf
  • Jonah_View_StoryView
  • Jonah_View_TagSearchList
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * This class extends Horde_Form to provide the form to add/edit
 4:  * feeds.
 5:  *
 6:  * Copyright 2002-2012 Horde LLC (http://www.horde.org/)
 7:  *
 8:  * See the enclosed file LICENSE for license information (BSD). If you
 9:  * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE.
10:  *
11:  * @author Marko Djukic <marko@oblo.com>
12:  * @author Chuck Hagenbuch <chuck@horde.org>
13:  * @package Jonah
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 setExtraFields($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: 
API documentation generated by ApiGen