コード例 #1
1
ファイル: email_opt_out.php プロジェクト: promoso/HVAC
 function handle(&$params)
 {
     if (!@$_REQUEST['email']) {
         return PEAR::raiseError("No email address  specified");
     }
     import('HTML/QuickForm.php');
     $form = new HTML_QuickForm('opt_out_form', 'post');
     $form->addElement('hidden', 'email', $_REQUEST['email']);
     $form->addElement('hidden', '-action', 'email_opt_out');
     $form->addElement('submit', 'submit', 'Cancel Subscription');
     if ($form->validate()) {
         $res = mysql_query("replace into dataface__email_blacklist (email) values ('" . addslashes($_REQUEST['email']) . "')", df_db());
         if (!$res) {
             trigger_error(mysql_error(df_db()), E_USER_ERROR);
         }
         header('Location: ' . DATAFACE_SITE_HREF . '?--msg=' . urlencode('You have successfully opted out of our mail list.  You will no longer receive emails from us.'));
         exit;
     }
     ob_start();
     $form->display();
     $html = ob_get_contents();
     ob_end_clean();
     $context = array();
     $context['form'] = $html;
     df_register_skin('email', DATAFACE_PATH . '/modules/Email/templates');
     df_display($context, 'email/opt_out_form.html');
 }
コード例 #2
0
ファイル: Venteliste.php プロジェクト: vih/vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('venteliste', 'POST', $this->url());
     $form->addElement('header', 'null', 'Hvor mange personer vil du sætte på venteliste?');
     $form->addElement('select', 'antal', 'Antal deltagere', array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10));
     $form->addElement('header', null, 'Din personlige oplysninger');
     $form->addElement('text', 'navn', 'Navn');
     /*
     $form->addElement('text', 'adresse', 'Adresse');
     $form->addElement('text', 'postnr', 'Postnr');
     $form->addElement('text', 'postby', 'By');
     */
     $form->addElement('text', 'email', 'E-mail');
     $form->addElement('text', 'arbejdstelefon', 'Telefon (ml. 8 og 16)');
     $form->addElement('text', 'telefonnummer', 'Alternativt telefonnummer');
     $form->addElement('textarea', 'besked', 'Besked');
     $form->addElement('submit', null, 'Send');
     $form->addRule("navn", "Du skal udfylde Navn", "required");
     //$form->addRule("adresse", "Du skal udfylde Adresse", "required");
     //$form->addRule("postnr", "Du skal udfylde Postnr", "required");
     //$form->addRule("postby", "Du skal udfylde By", "required");
     $form->addRule("arbejdstelefon", "Du skal udfylde telefon", "required");
     if (is_numeric($this->query('antal'))) {
         $form->setDefaults(array('antal' => $this->query('antal')));
     }
     return $this->form = $form;
 }
コード例 #3
0
 function execute(ActionMapping $map, ActionForm $form, Request $req)
 {
     global $papyrine;
     $papyrine->entries =& $papyrine->getEntries();
     // Instantiate the HTML_QuickForm object
     require_once 'HTML/QuickForm.php';
     require_once 'HTML/QuickForm/group.php';
     $form = new HTML_QuickForm('create_entry');
     $form->addElement('text', 'title', 'Title:');
     $form->addElement('text', 'date', 'Date:');
     $form->addElement('text', 'status', 'Status:');
     // Get the default handler
     $form->addElement('text', 'body', 'Body:');
     $form->addElement('submit', null, 'Create');
     // Define filters and validation rules
     $form->applyFilter('name', 'trim');
     $form->addRule('name', 'Please enter your name', 'required', null, 'client');
     //get classes registered for entry
     //call method
     $plugin = new PapyrinePlugin(BASE . 'plugins/categories/');
     $object = $plugin->getInstance();
     $object->recieveNewEntryForm($form);
     $plugin = new PapyrinePlugin(BASE . 'plugins/comments/');
     $object = $plugin->getInstance();
     $object->recieveNewEntryForm($form);
     // Output the form
     $papyrine->form = $form->toHTML();
     header("Content-Type: application/xhtml+xml;charset=UTF-8");
     $papyrine->display('admin/header.html');
     $papyrine->display($map->getParameter());
     $papyrine->display('admin/footer.html');
 }
コード例 #4
0
ファイル: Rater.php プロジェクト: vih/intranet.vih.dk
 function renderHtml()
 {
     $kursus = new VIH_Model_LangtKursus($this->context->name());
     if ($this->query("addrate")) {
         if (!$kursus->addRate($this->query("addrate"))) {
             throw new Exception('Kunne ikke tilføje rate.', E_USER_ERROR);
         }
     }
     $this->document->setTitle('Opdater rater');
     $pris = array('kursus' => $kursus);
     if ($kursus->antalRater() == 0) {
         $form = new HTML_QuickForm('rater', 'POST', $this->url());
         $form->addElement('text', 'antal', 'Antal rater');
         $form->addElement('text', 'foerste_rate_dato', 'Første rate dato', 'dd-mm-YYYY');
         $form->addElement('submit', 'opret_rater', 'Opret rater');
         $form_html = $form->toHTML();
     } else {
         $data = array('kursus' => $kursus);
         $tpl = $this->template->create('langekurser/rater_form');
         $form_html = $tpl->render($this, $data);
     }
     $this->document->setTitle('Rater for betaling ' . $kursus->get('kursusnavn'));
     $this->document->addOption('Til kurset', $this->context->url());
     $tpl = $this->template->create('langekurser/pris');
     return '<p><strong>Periode</strong>: ' . $kursus->getDateStart()->format('%d-%m-%Y') . ' &mdash; ' . $kursus->getDateEnd()->format('%d-%m-%Y') . '</p>
     ' . $tpl->render($this, $pris) . $form_html;
 }
コード例 #5
0
function makeExportForm($selfurl, $inbox)
{
    global $uid;
    $form = new HTML_QuickForm('export', 'post', "{$selfurl}&op=export&noheaderfooter=true");
    $msg = "<p>You can export this data as a CSV (comma-separated values) file, " . "<br/>which can then be imported into Excel for analysis and graphing." . "</p><br/>";
    $form->addElement('header', '', 'Export');
    $form->addElement('static', '', '', $msg);
    $datatype = $form->addElement('select', 'datatype', "Export What", array(EXPORT_ALLDATA => 'All Data', EXPORT_HISTOGRAM_MSG => 'Histogram by Message', EXPORT_HISTOGRAM_DAY => 'Histogram by Day', EXPORT_HISTOGRAM_MONTH => 'Histogram by Month'));
    $form->addElement('submit', 'submit', 'Export');
    if ($form->validate()) {
        $datatypeval = $datatype->getValue();
        switch ($datatypeval[0]) {
            case EXPORT_ALLDATA:
                exportAllData($inbox);
                break;
            default:
                $uidquery = $uid;
                if (isadmin() && !$uid) {
                    unset($uidquery);
                }
                if ($inbox) {
                    $counts = generateHistogramInbox($datatypeval[0], $uid);
                } else {
                    $counts = generateHistogramOutbox($datatypeval[0], $uid);
                }
                $filename = $inbox ? 'inbox-hist-export.csv' : 'outbox-hist-export.csv';
                exportHistogram($counts, $filename);
                break;
        }
        exit;
    }
    $form->display();
}
コード例 #6
0
ファイル: Modules.php プロジェクト: cretzu89/EPESI
 public function body()
 {
     ob_start();
     //create default module form
     print '<div class="title">Select modules to disable</div>';
     print 'Selected modules will be marked as not installed but uninstall methods will not be called. Any database tables and other modifications made by modules\' install methods will not be reverted.<br><br>';
     print 'To uninstall module please use Modules Administration in Application.';
     print '<hr/><br/>';
     $form = new HTML_QuickForm('modulesform', 'post', $_SERVER['PHP_SELF'] . '?' . http_build_query($_GET), '', null, true);
     $states = array(ModuleManager::MODULE_ENABLED => 'Active', ModuleManager::MODULE_DISABLED => 'Inactive');
     $modules = DB::GetAssoc('SELECT * FROM modules ORDER BY state, name');
     foreach ($modules as $m) {
         $name = $m['name'];
         $state = isset($m['state']) ? $m['state'] : ModuleManager::MODULE_ENABLED;
         if ($state == ModuleManager::MODULE_NOT_FOUND) {
             $state = ModuleManager::MODULE_DISABLED;
         }
         $form->addElement('select', $name, $name, $states);
         $form->setDefaults(array($name => $state));
     }
     $form->addElement('button', 'submit_button', 'Save', array('class' => 'button', 'onclick' => 'if(confirm("Are you sure?")) document.modulesform.submit();'));
     //validation or display
     if ($form->validate()) {
         //uninstall
         $vals = $form->exportValues();
         foreach ($vals as $k => $v) {
             if (isset($modules[$k]['state']) && $modules[$k]['state'] != $v) {
                 ModuleManager::set_module_state($k, $v);
             }
         }
     }
     $form->display();
     return ob_get_clean();
 }
コード例 #7
0
ファイル: Elev.php プロジェクト: vih/intranet.vih.dk
 function renderHtml()
 {
     $type_key = $this->context->getTypeKeys();
     if (is_numeric($this->query('sletbillede'))) {
         $fields = array('date_updated', 'pic_id');
         $values = array('NOW()', 0);
         $sth = $this->db->autoPrepare('langtkursus_tilmelding', $fields, DB_AUTOQUERY_UPDATE, 'id = ' . $this->query('id'));
         $res = $this->db->execute($sth, $values);
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
         }
     }
     $form = new HTML_QuickForm();
     $form->addElement('hidden', 'id', $this->name());
     $form->addElement('file', 'userfile', 'Fil');
     $form->addElement('submit', null, 'Upload');
     if ($form->validate()) {
         $file = new VIH_FileHandler();
         if ($file->upload('userfile')) {
             $fields = array('date_updated', 'pic_id');
             $values = array('NOW()', $file->get('id'));
             $sth = $this->db->autoPrepare('langtkursus_tilmelding', $fields, DB_AUTOQUERY_UPDATE, 'id = ' . $form->exportValue('id'));
             $res = $this->db->execute($sth, $values);
             if (PEAR::isError($res)) {
                 throw new Exception($res->getMessage());
             }
             return new k_SeeOther($this->url('./'));
         }
     }
     $tilmelding = new VIH_Model_LangtKursus_Tilmelding($this->name());
     if ($tilmelding->get('id') == 0) {
         throw new k_http_Response(404);
     }
     $file = new VIH_FileHandler($tilmelding->get('pic_id'));
     $file->loadInstance('small');
     $extra_html = $file->getImageHtml($tilmelding->get('name'), 'width="100""');
     $file->loadInstance('medium');
     $stor = $file->get('file_uri');
     if (empty($extra_html)) {
         $extra_html = $form->toHTML();
     } else {
         $extra_html .= ' <br /><a href="' . $stor . '">stor</a> <a href="' . url('./') . '?sletbillede=' . $this->name() . '" onclick="return confirm(\'Er du sikker\');">slet billede</a>';
     }
     $res = $this->db->query('SELECT *, DATE_FORMAT(date_start, "%d-%m %H:%i") AS date_start_dk, DATE_FORMAT(date_end, "%d-%m %H:%i") AS date_end_dk FROM langtkursus_tilmelding_protokol_item WHERE tilmelding_id = ' . (int) $this->name() . ' ORDER BY date_start DESC, date_end DESC');
     if (PEAR::isError($res)) {
         throw new Exception($res->getMessage());
     }
     $data = array('items' => $res, 'type_key' => $type_key, 'vis_navn' => false);
     $this->document->setTitle($tilmelding->get('navn'));
     $this->document->addOption('Ret', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id')));
     $this->document->addOption('Indtast', $this->url('indtast'));
     $this->document->addOption('Tilmelding', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id')));
     $this->document->addOption('F*g', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id') . '/f*g'));
     $this->document->addOption('Holdliste', $this->context->url());
     $this->document->addOption('Diplom', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id') . '/diplom'));
     $tpl = $this->template->create('protokol/liste');
     return '<div style="border: 1px solid #ccc; padding: 0.5em; float: right;">' . $extra_html . '</div>
         ' . $tpl->render($this, $data);
 }
コード例 #8
0
ファイル: Index.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('search', 'GET', $this->url());
     $form->addElement('text', 'search');
     $form->addElement('submit', null, 'Søg efter bundtnummer');
     return $this->form = $form;
 }
コード例 #9
0
ファイル: Show.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('faciliteter', 'POST', $this->url());
     $form->addElement('file', 'userfile', 'Fil');
     $form->addElement('submit', null, 'Upload');
     return $this->form = $form;
 }
コード例 #10
0
ファイル: Index.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('korte', 'GET', $this->url());
     $form->addElement('select', 'filter', 'Filter', array('alle' => 'alle', 'golf' => 'golf', 'old' => 'gamle'));
     $form->addElement('submit', 'submit', 'Afsted');
     return $this->form = $form;
 }
コード例 #11
0
ファイル: Holdliste.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('holdliste', 'GET', $this->url());
     $form->addElement('date', 'date', 'date');
     $form->addElement('submit', null, 'Hent');
     return $this->form = $form;
 }
コード例 #12
0
 function handle(&$params)
 {
     $app =& Dataface_Application::getInstance();
     $query =& $app->getQuery();
     $this->table =& Dataface_Table::loadTable($query['-table']);
     $translations =& $this->table->getTranslations();
     foreach (array_keys($translations) as $trans) {
         $this->table->getTranslation($trans);
     }
     //print_r($translations);
     if (!isset($translations) || count($translations) < 2) {
         // there are no translations to be made
         trigger_error('Attempt to translate a record in a table "' . $this->table->tablename . '" that contains no translations.', E_USER_ERROR);
     }
     $this->translatableLanguages = array_keys($translations);
     $translatableLanguages =& $this->translatableLanguages;
     $this->languageCodes = new I18Nv2_Language($app->_conf['lang']);
     $languageCodes =& $this->languageCodes;
     $currentLanguage = $languageCodes->getName($app->_conf['lang']);
     if (count($translatableLanguages) < 2) {
         return PEAR::raiseError(df_translate('Not enough languages to translate', 'There aren\'t enough languages available to translate.'), DATAFACE_E_ERROR);
     }
     //$defaultSource = $translatableLanguages[0];
     //$defaultDest = $translatableLanguages[1];
     $options = array();
     foreach ($translatableLanguages as $lang) {
         $options[$lang] = $languageCodes->getName($lang);
     }
     unset($options[$app->_conf['default_language']]);
     $tt = new Dataface_TranslationTool();
     $form = new HTML_QuickForm('StatusForm', 'POST');
     $form->addElement('select', '--language', 'Translation', $options);
     $form->addElement('select', '--status', 'Status', $tt->translation_status_codes);
     //$form->setDefaults( array('-sourceLanguage'=>$defaultSource, '-destinationLanguage'=>$defaultDest));
     $form->addElement('submit', '--set_status', 'Set Status');
     foreach ($query as $key => $value) {
         $form->addElement('hidden', $key);
         $form->setDefaults(array($key => $value));
     }
     if ($form->validate()) {
         $res = $form->process(array(&$this, 'processForm'));
         if (PEAR::isError($res)) {
             return $res;
         } else {
             header('Location: ' . $app->url('-action=list&-sourceLanguage=&-destinationLanguage=&-translate=') . '&--msg=' . urlencode('Translation status successfully set.'));
             exit;
         }
     }
     ob_start();
     $form->display();
     $out = ob_get_contents();
     ob_end_clean();
     $records =& $this->getRecords();
     df_display(array('form' => $out, 'translationTool' => &$tt, 'records' => &$records, 'translations' => &$options, 'context' => &$this), 'Dataface_set_translation_status.html');
 }
コード例 #13
0
ファイル: ExportCSV.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $date_options = array('minYear' => date('Y') - 10, 'maxYear' => date('Y') + 5);
     $form = new HTML_QuickForm('holdliste', 'GET', $this->url() . '.txt');
     $form->addElement('date', 'date', 'date', $date_options);
     $form->addElement('submit', null, 'Hent');
     return $this->form = $form;
 }
コード例 #14
0
ファイル: Edit.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('fotogalleri', 'POST', $this->url());
     $form->addElement('hidden', 'id');
     $form->addElement('text', 'description', 'Beskrivelse');
     $form->addElement('checkbox', 'active', '', 'Aktiv');
     $form->addElement('submit', null, 'Gem og tilføj billeder');
     return $this->form = $form;
 }
コード例 #15
0
ファイル: admin-configinfo.php プロジェクト: palfrey/phplib
 function display($self_link)
 {
     $form = new HTML_QuickForm('adminConfigInfoForm', 'get', $self_link);
     $consts = get_defined_constants();
     $form->addElement('header', '', 'Configuration Settings (from conf/general)');
     foreach ($consts as $const => $value) {
         if (preg_match("/^OPTION_/", $const)) {
             $form->addElement('static', "static{$const}", null, "{$const} = {$value}");
         }
     }
     admin_render_form($form);
 }
コード例 #16
0
ファイル: Confirm.php プロジェクト: vih/vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('confirm', 'POST', $this->url());
     $form->addElement('header', null, 'Accepterer du betingelserne?');
     $form->addElement('checkbox', 'confirm', null, 'Ja, jeg accepterer betingelserne', 'id="confirm"');
     $form->addElement('submit', null, 'Send');
     $form->addRule('confirm', 'Du skal acceptere betingelserne', 'required');
     return $this->form = $form;
 }
コード例 #17
0
ファイル: admin-serverinfo.php プロジェクト: palfrey/phplib
 function display($self_link)
 {
     $form = new HTML_QuickForm('adminServerInfoForm', 'get', $self_link);
     $form->addElement('header', '', 'System Name');
     $form->addElement('html', $this->run("uname -a | fmt"));
     $form->addElement('header', '', 'Time, Uptime, Logins and Load (over last 1, 5, 15 mins)');
     $form->addElement('html', $this->run("uptime"));
     $form->addElement('header', '', 'Disk Space');
     $form->addElement('html', $this->run("df -h"));
     $form->addElement('header', '', 'Recent Logins');
     $form->addElement('html', $this->run("who"));
     $form->addElement('header', '', 'Network Interfaces');
     $form->addElement('html', $this->run("/sbin/ifconfig"));
     admin_render_form($form);
 }
コード例 #18
0
ファイル: index.php プロジェクト: vih/kursuscenter.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('', 'post', $this->url());
     $form->addElement('text', 'email', 'E-mail');
     $radio[0] =& HTML_QuickForm::createElement('radio', null, null, 'tilmeld', '1');
     $radio[1] =& HTML_QuickForm::createElement('radio', null, null, 'frameld', '2');
     $form->addGroup($radio, 'mode', null, null);
     $form->addElement('submit', null, 'Gem');
     $form->setDefaults(array('mode' => 1));
     $form->addRule('email', 'Du skal skrive en e-mail-adresse', 'required', null);
     return $this->form = $form;
 }
コード例 #19
0
 public function __construct()
 {
     parent::__construct('authorize_new_users');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars(true, true);
     $this->users = pdUserList::getNotVerified($this->db);
     echo '<h2>Users Requiring Authentication</h2>';
     if ($this->users == null || count($this->users) == 0) {
         echo 'All users authorized.';
         return;
     }
     $form = new HTML_QuickForm('authorizeUsers', 'post');
     foreach ($this->users as $user) {
         $form->addGroup(array(HTML_QuickForm::createElement('advcheckbox', "submit[auth][{$user->login}]", null, null, null, array('no', 'yes')), HTML_QuickForm::createElement('select', "submit[access][{$user->login}]", null, AccessLevel::getAccessLevels()), HTML_QuickForm::createElement('static', null, null, $user->login), HTML_QuickForm::createElement('static', null, null, $user->name), HTML_QuickForm::createElement('static', null, null, $user->email)), 'all', null, '</td><td class="stats_odd">', false);
     }
     $form->addElement('submit', null, 'Submit');
     $this->form =& $form;
     if ($form->validate()) {
         $this->processForm();
     } else {
         $this->renderForm();
     }
 }
コード例 #20
0
ファイル: aicml_stats.php プロジェクト: papersdb/papersdb
 public function __construct()
 {
     parent::__construct('aicml_stats');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars(true, false);
     if (isset($this->csv_output)) {
         assert('isset($_SESSION["aicml_stats"])');
         $this->stats =& $_SESSION['aicml_stats'];
         return;
     }
     $pubs =& $this->getMachineLearningPapers();
     // populate $this->aicml_pi_authors
     $this->getPiAuthors();
     // populate $this->aicml_pdf_students_staff_authors
     $this->getPdfStudentsAndStaffAuthors();
     $this->collectStats($pubs);
     $_SESSION['aicml_stats'] =& $this->stats;
     $form = new HTML_QuickForm('aicml_stats', 'get', 'aicml_stats.php');
     $form->addElement('submit', 'csv_output', 'Export to CSV');
     // create a new renderer because $form->defaultRenderer() creates
     // a single copy
     $renderer = new HTML_QuickForm_Renderer_Default();
     $form->accept($renderer);
     echo $renderer->toHtml();
     echo $this->allPiPublicationTable();
     echo $this->fiscalYearTotalsTable('pi', 'PI Fiscal Year Totals');
     foreach ($this->aicml_pi_authors as $pi_author) {
         echo $this->piPublicationsTable($pi_author);
     }
     echo $this->staffPublicationsTable();
     echo $this->fiscalYearTotalsTable('staff', 'Staff Fiscal Year Totals');
     echo $this->studentTotalsTable();
 }
コード例 #21
0
ファイル: delete_interest.php プロジェクト: papersdb/papersdb
 public function __construct()
 {
     parent::__construct('delete_interest', 'Delete Interest', 'Admin/delete_interest.php');
     if ($this->loginError) {
         return;
     }
     $form = new HTML_QuickForm('deleter');
     $interest_list = new pdAuthInterests($this->db);
     $form->addElement('select', 'interests', 'Select interest(s) to delete:', $interest_list->list, array('multiple' => 'multiple', 'size' => 15));
     $form->addGroup(array(HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => 'history.back()')), HTML_QuickForm::createElement('submit', 'submit', 'Delete')), null, null, '&nbsp;', false);
     if ($form->validate()) {
         $values = $form->exportValues();
         foreach ($values['interests'] as $interest_id) {
             $names[] = $interest_list->list[$interest_id];
         }
         $interest_list->dbDelete($this->db, $values['interests']);
         echo 'You have successfully removed the following interest from the ', 'database: <br/><b>', implode(', ', $names), '</b></p>', '<br><a href="', $_SERVER['PHP_SELF'], '">Delete another interest</a>';
     } else {
         $renderer =& $form->defaultRenderer();
         $form->accept($renderer);
         $this->form =& $form;
         $this->renderer =& $renderer;
         echo '<h3>Delete Interest </h3>';
     }
 }
コード例 #22
0
ファイル: add_pub2.php プロジェクト: papersdb/papersdb
    public function __construct()
    {
        parent::__construct();
        if ($this->loginError) {
            return;
        }
        $this->use_mootools = true;
        $this->pub =& $_SESSION['pub'];
        if (isset($this->pub->pub_id)) {
            $this->page_title = 'Edit Publication';
        }
        $this->authors = pdAuthorList::create($this->db, null, null, true);
        $form = new HTML_QuickForm('add_pub2', 'post', '', '', array('onsubmit' => 'return check_authors("add_pub2");'));
        $form->addElement('header', null, 'Select from Authors in Database');
        $tooltip = 'Authors::The authors of the publication. Listed in the
same order as in the publication
&lt;p/&gt;
If an author is not already in the database press the &lt;b&gt;Add Author not
in DB&lt;/b&gt; button.';
        $form->addElement('textarea', 'authors', "<div id=\"MYCUSTOMFLOATER\"  class=\"myCustomFloater\" style=\"position:absolute;top:200px;left:600px;background-color:#cecece;display:none;visibility:hidden\"><div class=\"myCustomFloaterContent\"></div></div>" . "<span class=\"Tips1\" title=\"{$tooltip}\">Authors</span>:", array('cols' => 60, 'rows' => 5, 'class' => 'wickEnabled:MYCUSTOMFLOATER', 'wrap' => 'virtual'));
        $form->addElement('static', null, null, '<span class="small">' . 'There are ' . count($this->authors) . ' authors in the database. Type a partial name to ' . 'see a list of matching authors. Separate names ' . 'using commas.</span>');
        $form->addElement('submit', 'add_new_author', 'Add Author not in DB');
        // collaborations radio selections
        $tooltip = 'Collaborations::If the publication is a collaboration,
select the options that apply to this paper.';
        $form->addElement('header', null, "<span class=\"Tips1\" title=\"{$tooltip}\">Collaborations</span>");
        $collaborations = pdPublication::collaborationsGet($this->db);
        foreach ($collaborations as $col_id => $description) {
            $radio_cols[] = HTML_QuickForm::createElement('checkbox', 'paper_col[' . $col_id . ']', null, $description, 1);
        }
        $form->addGroup($radio_cols, 'group_collaboration', null, '<br/>', false);
        $pos = strpos($_SERVER['PHP_SELF'], 'papersdb');
        $url = substr($_SERVER['PHP_SELF'], 0, $pos) . 'papersdb';
        $buttons[] = HTML_QuickForm::createElement('submit', 'prev_step', '<< Previous Step');
        $buttons[] = HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => "cancelConfirm();"));
        $buttons[] = HTML_QuickForm::createElement('submit', 'next_step', 'Next Step >>');
        if ($this->pub->pub_id != '') {
            $buttons[] = HTML_QuickForm::createElement('submit', 'finish', 'Finish');
        }
        $form->addGroup($buttons, 'buttons', '', '&nbsp;', false);
        $this->form =& $form;
        if ($form->validate()) {
            $this->processForm();
        } else {
            $this->renderForm();
        }
    }
コード例 #23
0
 public function __construct()
 {
     parent::__construct('view_publication', 'View Publication', 'view_publication.php');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars();
     if (!isset($this->pub_id) || !is_numeric($this->pub_id)) {
         $this->pageError = true;
         return;
     }
     $pub = new pdPublication();
     $result = $pub->dbLoad($this->db, $this->pub_id);
     if (!$result) {
         echo 'Publication does not exist';
         return;
     }
     if (isset($this->submit_pending) && $this->submit_pending) {
         // check if this pub entry is pending
         $q = $this->db->selectRow('pub_pending', '*', array('pub_id' => $this->pub_id));
         assert('$q');
         $form = new HTML_QuickForm('submit_pending');
         $form->addElement('hidden', 'submit_pending', true);
         $form->addElement('hidden', 'pub_id', $this->pub_id);
         $elements = array();
         $elements[] = HTML_QuickForm::createElement('advcheckbox', 'valid', null, 'Valid', null, array(0, 1));
         $elements[] = HTML_QuickForm::createElement('submit', 'submit', 'Submit');
         $form->addGroup($elements, 'elgroup', '', '&nbsp', false);
         // create a new renderer because $form->defaultRenderer() creates
         // a single copy
         $renderer = new HTML_QuickForm_Renderer_Default();
         $form->accept($renderer);
         if ($form->validate()) {
             $values =& $form->exportValues();
             $pub->markValid($this->db);
             echo 'Publication entry marked as valid.';
             return;
         } else {
             echo "<h2>This publication entry requires validation</h2>\n";
             echo $renderer->toHtml();
         }
     }
     $this->showPublication($pub);
 }
コード例 #24
0
ファイル: search_results.php プロジェクト: papersdb/papersdb
 /**
  *
  */
 public function otherFormatForm($result_pubs)
 {
     if ($result_pubs == null) {
         return;
     }
     $form = new HTML_QuickForm('otherFormatForm');
     $form->addElement('hidden', 'pub_ids', implode(",", $result_pubs));
     $form->addGroup(array(HTML_QuickForm::createElement('submit', 'cv_format', 'Show results in CV format'), HTML_QuickForm::createElement('submit', 'bibtex_format', 'Show results in BibTex format')), null, null, '&nbsp;');
     return $form;
 }
コード例 #25
0
ファイル: Kontakt.php プロジェクト: vih/vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('underviser', 'POST', $this->url());
     $form->addElement('text', 'navn', 'Navn');
     $form->addElement('text', 'email', 'E-mail');
     $form->addElement('textarea', 'besked', 'Besked', array('rows' => 12, 'cols' => 30));
     $form->addElement('submit', null, 'Send');
     $form->addRule('navn', 'Du skal indtaste et navn', 'required');
     $form->addRule('email', 'Du skal indtaste en email', 'required');
     $form->addRule('email', 'Du skal indtaste en gyldig email', 'email');
     $form->addRule('besked', 'Du skal indtaste en gyldig besked', 'required');
     $form->applyFilter('__ALL__', 'trim');
     $form->applyFilter('__ALL__', 'strip_tags');
     $form->applyFilter('__ALL__', 'addslashes');
     return $this->form = $form;
 }
コード例 #26
0
ファイル: Index.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('calendar', 'post', 'http://kalendersiden.dk/generate.php');
     $form->addElement('text', 'month', 'Første måned');
     $form->addElement('text', 'months', 'Antal måneder');
     $form->addElement('text', 'year', 'Årstal');
     $form->addElement('hidden', 'pages');
     $form->addElement('hidden', 'format');
     $form->addElement('hidden', 'head');
     $form->addElement('hidden', 'color');
     $form->addElement('hidden', 'weeks');
     $form->addElement('hidden', 'userdata');
     $form->setDefaults(array('month' => date('m'), 'months' => 6, 'year' => date('Y'), 'pages' => 2, 'format' => 'portrait', 'head' => 'Vejle Idrætshøjskole', 'color' => '90 90 100:100 100 100:', 'weeks' => 't', 'userdata' => $this->getUserData()));
     $form->addElement('submit', null, 'Hent kalender');
     return $this->form = $form;
 }
コード例 #27
0
ファイル: Show.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('venteliste', 'POST', $this->url());
     $form->addElement('hidden', 'id');
     $form->addElement('hidden', 'kursus_id');
     $form->addElement('text', 'navn', 'Navn');
     $form->addElement('text', 'antal', 'Antal');
     $form->addElement('text', 'telefonnummer', 'Telefon');
     $form->addElement('text', 'arbejdstelefon', 'Arbejdstelefon');
     $form->addElement('text', 'email', 'E-mail');
     $form->addElement('textarea', 'besked', 'Besked');
     $form->addElement('submit', NULL, 'Gem');
     return $this->form = $form;
 }
コード例 #28
0
ファイル: tag_non_ml.php プロジェクト: papersdb/papersdb
 public function __construct()
 {
     parent::__construct('tag_non_ml');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars();
     $pubs =& $this->getNonMachineLearningPapers();
     $form = new HTML_QuickForm('tag_non_ml_form', 'post', './tag_ml_submit.php');
     $form->addElement('header', null, 'Citation</th><th style="width:7%">Is ML');
     $count = 0;
     foreach ($pubs as &$pub) {
         $pub->dbLoad($this->db, $pub->pub_id, pdPublication::DB_LOAD_VENUE | pdPublication::DB_LOAD_CATEGORY | pdPublication::DB_LOAD_AUTHOR_FULL);
         ++$count;
         $form->addGroup(array(HTML_QuickForm::createElement('static', null, null, $pub->getCitationHtml() . '&nbsp;' . getPubIcons($this->db, $pub, 0x7)), HTML_QuickForm::createElement('advcheckbox', 'pub_tag[' . $pub->pub_id . ']', null, null, null, array('no', 'yes'))), 'tag_ml_group', $count, '</td><td>', false);
     }
     $form->addElement('submit', 'submit', 'Submit');
     $renderer =& $form->defaultRenderer();
     $form->accept($renderer);
     $this->renderer =& $renderer;
 }
コード例 #29
0
ファイル: Item.php プロジェクト: vih/intranet.vih.dk
 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $options = array('format' => 'd m Y H i', 'optionIncrement' => array('i' => 15), 'minYear' => date('Y') - 2, 'maxYear' => date('Y') + 2);
     $form = new HTML_QuickForm('protokol', 'POST', $this->url());
     $form->addElement('hidden', 'elev_id');
     $form->addElement('hidden', 'id');
     $form->addElement('date', 'date_start', 'Startdato:', $options);
     $form->addElement('date', 'date_end', 'Slutdato:', $options);
     $radio[0] =& HTML_QuickForm::createElement('radio', null, null, 'fri', '1');
     $radio[1] =& HTML_QuickForm::createElement('radio', null, null, 'syg', '2');
     $radio[2] =& HTML_QuickForm::createElement('radio', null, null, 'fraværende', '3');
     $radio[5] =& HTML_QuickForm::createElement('radio', null, null, 'henstilling', '6');
     $radio[3] =& HTML_QuickForm::createElement('radio', null, null, 'mundtlig advarsel', '4');
     $radio[4] =& HTML_QuickForm::createElement('radio', null, null, 'skriftlig advarsel', '5');
     $radio[6] =& HTML_QuickForm::createElement('radio', null, null, 'hjemsendt', '7');
     $radio[7] =& HTML_QuickForm::createElement('radio', null, null, 'andet', '8');
     $form->addGroup($radio, 'type', 'Type:', ' ');
     $form->addElement('textarea', 'text', '');
     $form->addElement('submit', null, 'Send');
     $form->addRule('date_start', 'Husk dato', 'required', null, 'client');
     $form->addRule('date_end', 'Husk dato', 'required', null, 'client');
     $form->addRule('type', 'Husk type', 'required', null, 'client');
     $form->addRule('text', 'Tekst', 'required', null, 'client');
     return $this->form = $form;
 }
コード例 #30
0
 /**
  * function_description
  *
  * @author	John.meng
  * @since    version - Jan 5, 2006
  * @param	datatype paramname description
  * @return   datatype description
  */
 function drawLogin()
 {
     global $__Lang__, $UrlParameter, $SiteDB, $AddIPObj, $FlushPHPObj, $form, $smarty;
     include_once PEAR_DIR . 'HTML/QuickForm.php';
     $form = new HTML_QuickForm('firstForm');
     $replace_str = "../";
     $html_code = str_replace(ROOT_DIR, $replace_str, THEMES_DIR);
     echo "<link href='" . $html_code . "style.css' rel='stylesheet' type='text/css'>";
     $renderer =& $form->defaultRenderer();
     $renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" class=\"log_table\" align=\"center\">\n{content}\n</table>\n</form>");
     $renderer->setHeaderTemplate("\n\t<tr>\n\t\t<td class=\"log_table_head\" align=\"left\" valign=\"top\" colspan=\"2\" ><b>{header}</b></td>\n\t</tr>");
     $form->addElement('header', null, "<img src=\"" . $html_code . "images/logo.gif\" border=\"0\" >");
     $form->addElement('text', 'user_name', $__Lang__['langMenuUser'] . $__Lang__['langGeneralName'] . ' : ');
     $form->addElement('password', 'user_passwd', $__Lang__['langMenuUser'] . $__Lang__['langGeneralPassword'] . ' : ');
     $form->addRule('user_name', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langMenuUser'] . " " . $__Lang__['langGeneralName'], 'required');
     $form->addRule('user_passwd', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langMenuUser'] . " " . $__Lang__['langGeneralPassword'], 'required');
     $form->addElement('hidden', 'Action', 'LOGON');
     $form->setDefaults(array('user_name' => $_COOKIE['UserName']));
     $form->addElement('submit', null, $__Lang__['langGeneralSubmit']);
     $form->addElement('static', 'login_message');
     if ($form->validate() && $_POST['Action'] == 'LOGON') {
         $user_name = $_POST['user_name'];
         $user_password = md5($_POST['user_passwd']);
         $this->checkAuth($user_name, $user_password);
     }
     $form->display();
     exit;
 }