plugins/generic/announcementFeed/SettingsForm.inc.php

00001 <?php
00002 
00017 import('form.Form');
00018 
00019 class SettingsForm extends Form {
00020 
00022    var $conferenceId;
00023 
00025    var $plugin;
00026 
00032    function SettingsForm(&$plugin, $conferenceId) {
00033       $this->conferenceId = $conferenceId;
00034       $this->plugin =& $plugin;
00035 
00036       parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl');
00037       $this->addCheck(new FormValidatorPost($this));
00038    }
00039 
00043    function initData() {
00044       $conferenceId = $this->conferenceId;
00045       $plugin =& $this->plugin;
00046 
00047       $this->setData('displayPage', $plugin->getSetting($conferenceId, 0, 'displayPage'));
00048       $this->setData('limitRecentItems', $plugin->getSetting($conferenceId, 0, 'limitRecentItems'));
00049       $this->setData('recentItems', $plugin->getSetting($conferenceId, 0, 'recentItems'));
00050    }
00051 
00055    function readInputData() {
00056       $this->readUserVars(array('displayPage','limitRecentItems','recentItems'));
00057 
00058       // check that recent items value is a positive integer
00059       if ((int) $this->getData('recentItems') <= 0) $this->setData('recentItems', '');
00060    }
00061 
00065    function execute() {
00066       $plugin =& $this->plugin;
00067       $conferenceId = $this->conferenceId;
00068 
00069       $plugin->updateSetting($conferenceId, 0, 'displayPage', $this->getData('displayPage'));
00070       $plugin->updateSetting($conferenceId, 0, 'limitRecentItems', $this->getData('limitRecentItems') ? $this->getData('limitRecentItems') : 0);
00071       $plugin->updateSetting($conferenceId, 0, 'recentItems', $this->getData('recentItems'));
00072    }
00073 
00074 }
00075 
00076 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7