From e6d9384cfa1af9c69636b4bc6bf1108327ea3085 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 21 Nov 2012 13:06:06 +0100 Subject: sqlbox: Add prefixes to form Or it clashes with moodle search box. --- sqlbox/sqlbox_form.php | 6 +++--- sqlbox/view.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sqlbox') diff --git a/sqlbox/sqlbox_form.php b/sqlbox/sqlbox_form.php index c91888c..946fad4 100644 --- a/sqlbox/sqlbox_form.php +++ b/sqlbox/sqlbox_form.php @@ -8,9 +8,9 @@ class mod_sqlbox_form extends moodleform { public function definition() { $mform = &$this->_form; - $mform->addElement('header', 'general', 'SQLBox'); - $mform->addElement('text', 'query', 'SQL Query', 'size="50"'); - $mform->addElement('submit', 'button', 'Submit'); + $mform->addElement('header', 'sqlbox_general', 'SQLBox'); + $mform->addElement('text', 'sqlbox_query', 'SQL Query', 'size="50"'); + $mform->addElement('submit', 'sqlbox_button', 'Submit'); } } diff --git a/sqlbox/view.php b/sqlbox/view.php index b5d613e..1158d7b 100644 --- a/sqlbox/view.php +++ b/sqlbox/view.php @@ -78,13 +78,13 @@ $form = new mod_sqlbox_form($PAGE->url->out(false)); $form->display(); $data = $form->get_data(); -echo $OUTPUT->heading('SQL Query: '.$data->query); -if (isset($data->query)) { +echo $OUTPUT->heading('SQL Query: '.$data->sqlbox_query); +if (isset($data->sqlbox_query)) { $db = pg_connect("host=localhost dbname=sqlbox user=sqlbox password=foobar"); if (!db) error("Failed to connect to sqlbox db"); - $result = pg_query($db, $data->query); + $result = pg_query($db, $data->sqlbox_query); if (!$result) error("Query failed!"); -- cgit