00001 <?php
00002
00017 import('form.Form');
00018
00019 class PhpMyVisitesSettingsForm extends Form {
00020
00022 var $conferenceId;
00023
00025 var $plugin;
00026
00032 function PhpMyVisitesSettingsForm(&$plugin, $conferenceId) {
00033 $this->conferenceId = $conferenceId;
00034 $this->plugin =& $plugin;
00035
00036 parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl');
00037
00038 $this->addCheck(new FormValidatorCustom($this, 'phpmvUrl', 'required', 'plugins.generic.phpmv.manager.settings.phpmvUrlRequired', create_function('$phpmvUrl', 'return strpos(trim(strtolower($phpmvUrl)), \'http:
00039 $this->addCheck(new FormValidator($this, 'phpmvSiteId', 'required', 'plugins.generic.phpmv.manager.settings.phpmvSiteIdRequired'));
00040 }
00041
00045 function initData() {
00046 $conferenceId = $this->conferenceId;
00047 $plugin =& $this->plugin;
00048
00049 $this->_data = array(
00050 'phpmvUrl' => $plugin->getSetting($conferenceId, 0, 'phpmvUrl'),
00051 'phpmvSiteId' => $plugin->getSetting($conferenceId, 0, 'phpmvSiteId')
00052 );
00053 }
00054
00058 function readInputData() {
00059 $this->readUserVars(array('phpmvUrl', 'phpmvSiteId'));
00060 }
00061
00065 function execute() {
00066 $plugin =& $this->plugin;
00067 $conferenceId = $this->conferenceId;
00068
00069 $plugin->updateSetting($conferenceId, 0, 'phpmvUrl', rtrim($this->getData('phpmvUrl'), "/"), 'string');
00070 $plugin->updateSetting($conferenceId, 0, 'phpmvSiteId', $this->getData('phpmvSiteId'), 'int');
00071 }
00072 }
00073
00074 ?>