/** */ function __construct(&$vars) { $channel_id = $vars->get('channel_id'); $editing = !empty($channel_id); parent::__construct($vars, $editing ? _("Edit Feed") : _("New Feed")); $this->addHidden('', 'channel_id', 'int', false); $this->addHidden('', 'old_channel_type', 'text', false); $select_type =& $this->addVariable(_("Type"), 'channel_type', 'enum', true, false, null, array(Jonah::getAvailableTypes())); $select_type->setDefault(Jonah::INTERNAL_CHANNEL); $select_type->setHelp('feed-type'); $select_type->setAction(Horde_Form_Action::factory('submit')); $this->addVariable(_("Name"), 'channel_name', 'text', true); $this->addVariable(_("Extra information for this feed type"), 'extra_info', 'header', false); }
<?php /** * Copyright 2003-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE. * * @author Chuck Hagenbuch <*****@*****.**> * @author Marko Djukic <*****@*****.**> * @author Michael J. Rubinsky <*****@*****.**> * @package Jonah */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('jonah', array('permission' => array('jonah:news', Horde_Perms::EDIT))); $have_news = Jonah::getAvailableTypes(); if (empty($have_news)) { $notification->push(_("News is not enabled."), 'horde.warning'); $url = Horde::url('index.php'); header('Location: ' . $url); exit; } $params = array('notification' => &$notification, 'prefs' => &$prefs, 'registry' => &$registry); $view = new Jonah_View_ChannelList($params); $view->run();