summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-25 09:14:18 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-25 09:19:05 +0100
commita3d5dfe86e51c71a7b29776f48e107ccd6fabb31 (patch)
treeeaf46b6abe318d3fa1602a066e06c86708dff0b5
parent3b907b85a51d489a6a752da80aaddcd854d9e878 (diff)
downloadsqltutor-plugin-a3d5dfe86e51c71a7b29776f48e107ccd6fabb31.tar.gz
sqltutor-plugin-a3d5dfe86e51c71a7b29776f48e107ccd6fabb31.tar.bz2
sqltutor-plugin-a3d5dfe86e51c71a7b29776f48e107ccd6fabb31.zip
Replace all deprecated error() calls with print_error
-rw-r--r--sqlbox/lang/en/sqlbox.php1
-rw-r--r--sqlbox/report.php2
-rw-r--r--sqlbox/reportall.php2
-rw-r--r--sqlbox/version.php2
-rw-r--r--sqlbox/view.php4
5 files changed, 6 insertions, 5 deletions
diff --git a/sqlbox/lang/en/sqlbox.php b/sqlbox/lang/en/sqlbox.php
index 8867d10..f1b4d9e 100644
--- a/sqlbox/lang/en/sqlbox.php
+++ b/sqlbox/lang/en/sqlbox.php
@@ -43,3 +43,4 @@ $string['pluginadministration'] = 'sqlbox administration';
$string['pluginname'] = 'sqlbox';
$string['viewresults'] = 'View Results';
$string['queryfailed'] = 'Query failed: {$a}';
+$string['dbconnectionfailed'] = 'Error: Database connection failed';
diff --git a/sqlbox/report.php b/sqlbox/report.php
index ad907a2..d9371d9 100644
--- a/sqlbox/report.php
+++ b/sqlbox/report.php
@@ -10,7 +10,7 @@ if ($id) {
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$sqlbox = $DB->get_record('sqlbox', array('id' => $cm->instance), '*', MUST_EXIST);
} else {
- error('You must specify a course_module ID or an instance ID');
+ print_error('invalidcourse');
}
require_login($course, true, $cm);
diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php
index 659da9c..b11a422 100644
--- a/sqlbox/reportall.php
+++ b/sqlbox/reportall.php
@@ -10,7 +10,7 @@ if ($id) {
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$sqlbox = $DB->get_record('sqlbox', array('id' => $cm->instance), '*', MUST_EXIST);
} else {
- error('You must specify a course_module ID or an instance ID');
+ print_error('invalidcourse');
}
require_login($course, true, $cm);
diff --git a/sqlbox/version.php b/sqlbox/version.php
index 82e4d06..037f4f4 100644
--- a/sqlbox/version.php
+++ b/sqlbox/version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$module->version = 2013012501; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2013012502; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2010031900; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
$module->component = 'mod_sqlbox'; // To check on upgrade, that module sits in correct place
diff --git a/sqlbox/view.php b/sqlbox/view.php
index f79b8dc..fababb7 100644
--- a/sqlbox/view.php
+++ b/sqlbox/view.php
@@ -44,7 +44,7 @@ if ($id) {
$course = $DB->get_record('course', array('id' => $sqlbox->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance('sqlbox', $sqlbox->id, $course->id, false, MUST_EXIST);
} else {
- error('You must specify a course_module ID or an instance ID');
+ print_error('invalidcourse');
}
require_login($course, true, $cm);
@@ -96,7 +96,7 @@ if (isset($data->sqlbox_query)) {
$db = pg_connect($con);
if (!$db)
- error("Failed to connect to sqlbox db");
+ print_error('dbconnectionfailed', 'sqlbox');
$table = db_table_from_query($db, $data->sqlbox_query);
if (strlen($sqlbox->query) > 0) {