diff --git a/.gitignore b/Badges/.gitignore
old mode 100755
new mode 100644
similarity index 100%
rename from .gitignore
rename to Badges/.gitignore
diff --git a/Badges/CHANGEDB.php b/Badges/CHANGEDB.php
index 8fd82c9..616584e 100644
--- a/Badges/CHANGEDB.php
+++ b/Badges/CHANGEDB.php
@@ -163,3 +163,7 @@
++$count;
$sql[$count][0] = '2.5.04';
$sql[$count][1] = "";
+
+++$count;
+$sql[$count][0] = '2.5.05';
+$sql[$count][1] = "";
\ No newline at end of file
diff --git a/Badges/CHANGELOG.txt b/Badges/CHANGELOG.txt
index eed391e..31bffd0 100644
--- a/Badges/CHANGELOG.txt
+++ b/Badges/CHANGELOG.txt
@@ -1,5 +1,9 @@
CHANGELOG
=========
+v2.5.05
+-------
+Table OOification
+
v2.5.04
-------
Form OOification and some session handling improvements
diff --git a/Badges/badges_grant.php b/Badges/badges_grant.php
index ef094ab..f2649ad 100644
--- a/Badges/badges_grant.php
+++ b/Badges/badges_grant.php
@@ -19,6 +19,10 @@
use Gibbon\Forms\Form;
use Gibbon\Forms\DatabaseFormFactory;
+use Gibbon\Tables\DataTable;
+use Gibbon\Services\Format;
+use Gibbon\Module\Badges\Domain\BadgeGateway;
+
//Module includes
include './modules/'.$gibbon->session->get('module').'/moduleFunctions.php';
@@ -35,11 +39,10 @@
returnProcess($guid, $_GET['return'], null, null);
}
- $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? $gibbon->session->get('gibbonSchoolYearID');
- if (isset($_GET['gibbonSchoolYearID'])) {
+ $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? '';
- }
- if ($gibbonSchoolYearID == $gibbon->session->get('gibbonSchoolYearID')) {
+ if ($gibbonSchoolYearID == '' or $gibbonSchoolYearID == $gibbon->session->get('gibbonSchoolYearID')) {
+ $gibbonSchoolYearID = $gibbon->session->get('gibbonSchoolYearID');
$gibbonSchoolYearName = $gibbon->session->get('gibbonSchoolYearName');
}
@@ -83,38 +86,48 @@
}
echo '';
- $gibbonPersonID2 = $_GET['gibbonPersonID2'] ?? '';
- $badgesBadgeID2 = $_GET['badgesBadgeID2'] ?? '';
- $gibbonYearGroupID = $_GET['gibbonYearGroupID'] ?? '';
- $type = $_GET['type'] ?? '';
+ $gibbonPersonID2 = null;
+ if (isset($_GET['gibbonPersonID2'])) {
+ $gibbonPersonID2 = $_GET['gibbonPersonID2'];
+ }
+ $badgesBadgeID2 = null;
+ if (isset($_GET['badgesBadgeID2'])) {
+ $badgesBadgeID2 = $_GET['badgesBadgeID2'];
+ }
+ $gibbonYearGroupID = null;
+ if (isset($_GET['gibbonYearGroupID'])) {
+ $gibbonYearGroupID = $_GET['gibbonYearGroupID'];
+ }
+ $type = null;
+ if (isset($_GET['type'])) {
+ $type = $_GET['type'];
+ }
$form = Form::create('grantbadges',$gibbon->session->get('absoluteURL').'/index.php?q=/modules/Badges/badges_grant.php','GET');
$form->setFactory(DatabaseFormFactory::create($pdo));
- $form->addClass('noIntBorder');
- $form->setTitle(__('Filter'));
+ $form->addRow()->addHeading(__('Filter'));
$form->addRow();
$row = $form->addRow();
- $row->addLabel('gibbonPersonID2',__('User'));
- $row->addSelectStudent('gibbonPersonID2', $gibbon->session->get('gibbonSchoolYearID'))->selected($gibbonPersonID2)->placeholder();
+ $row->addLabel('gibbonPersonIDMulti',__('User'));
+ $row->addSelectStudent('gibbonPersonIDMulti', $gibbon->session->get('gibbonSchoolYearID'))->selectMultiple();
$sql = "SELECT badgesBadgeID as value, name, category FROM badgesBadge WHERE active='Y' ORDER BY category, name";
$row = $form->addRow();
- $row->addLabel('badgesBadgeID2',__('Badges'));
- $row->addSelect('badgesBadgeID2')->fromQuery($pdo, $sql, [], 'category')->selected($badgesBadgeID2)->placeholder();
+ $row->addLabel('badgesBadgeID',__('Badges'));
+ $row->addSelect('badgesBadgeID')->fromQuery($pdo, $sql, [], 'category')->placeholder();
$row = $form->addRow();
$row->addSearchSubmit($gibbon->session);
$form->addHiddenValue('q',$_GET['q']);
- $form->addRow();
echo $form->getOutput();
?>
-
-
+
+
';
echo __('Badges');
@@ -143,123 +156,65 @@
$gibbonHookID = $rowHook['gibbonHookID'];
}
- //Search with filters applied
- try {
- $data = array();
- $sqlWhere = 'AND ';
- if ($gibbonPersonID2 != '') {
- $data['gibbonPersonID'] = $gibbonPersonID2;
- $sqlWhere .= 'badgesBadgeStudent.gibbonPersonID=:gibbonPersonID AND ';
- }
- if ($badgesBadgeID2 != '') {
- $data['badgesBadgeID2'] = $badgesBadgeID2;
- $sqlWhere .= 'badgesBadge.badgesBadgeID=:badgesBadgeID2 AND ';
- }
- $sqlWhere = $sqlWhere == 'AND ' ? '' : substr($sqlWhere, 0, -5);
-
- $data['gibbonSchoolYearID2'] = $gibbonSchoolYearID;
- $sql = "SELECT badgesBadge.*, badgesBadgeStudent.*, surname, preferredName FROM badgesBadge JOIN badgesBadgeStudent ON (badgesBadgeStudent.badgesBadgeID=badgesBadge.badgesBadgeID) JOIN gibbonPerson ON (badgesBadgeStudent.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE badgesBadgeStudent.gibbonSchoolYearID=:gibbonSchoolYearID2 $sqlWhere ORDER BY timestamp DESC";
- $result = $connection2->prepare($sql);
- $result->execute($data);
- } catch (PDOException $e) {
- echo "
" . $row['name'] . "
";
+ });
+ $table
+ ->addColumn('student',__('Student'))
+ ->format(function($row) use ($gibbonHookID,$gibbon)
+ {
+ $link = Format::link($gibbon->session->get('absoluteURL').'/index.php?q=/modules/Students/student_view_details.php?gibbonPersonID=' . $row['gibbonPersonID'] . '&hook=Badges&action=View Badges_all&gibbonHookID=' . $gibbonHookID . '&search=&allStudents=&sort=surname, preferredName',
+ Format::name(null,$row['preferredName'],$row['surname'],'Student',true,false));
+ return $link;
+ });
+
+ $table->addColumn('date',__('Date'))->format(Format::using('date','date'));
+
+ //Setup actions
+ $actions = $table->addActionColumn();
+ $actions->format(function ($row,$actions) use ($gibbon,$gibbonSchoolYearID){
+ $actions->addAction('delete',__('Delete'))
+ ->setURL('/modules/Badges/badges_grant_delete.php')
+ ->addParam('badgesBadgeStudentID',$row['badgesBadgeStudentID'])
+ ->addParam('gibbonSchoolYearID',$gibbonSchoolYearID);
+ });
+ echo $table->render($badges);
}
}
?>
diff --git a/Badges/badges_grant_add.php b/Badges/badges_grant_add.php
index 57f0a08..75c1662 100644
--- a/Badges/badges_grant_add.php
+++ b/Badges/badges_grant_add.php
@@ -30,16 +30,16 @@
echo '';
} else {
//Proceed!
- $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? '';
-
$page->breadcrumbs
- ->add(__('Grant Badges'), 'badges_grant.php&gibbonSchoolYearID='.$gibbonSchoolYearID)
+ ->add(__('Grant Badges'), 'badges_grant.php')
->add(__('Add'));
if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], null, null);
}
+ $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? '';
+
echo "";
+ $badgesBadgeStudentID = $_GET['badgesBadgeStudentID'] ?? '';
+ $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? '';
+ if ($badgesBadgeStudentID == '' || $gibbonSchoolYearID == '') { echo "
";
echo __('You have not specified one or more required parameters.');
echo '
';
} else {
@@ -57,7 +57,7 @@
//Let's go!
$row = $result->fetch();
- $form = DeleteForm::createForm($gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module')."/badges_grant_deleteProcess.php?badgesBadgeStudentID=$badgesBadgeStudentID&gibbonPersonID2=".$_GET['gibbonPersonID2'].'&badgesBadgeID2='.$_GET['badgesBadgeID2']."&gibbonSchoolYearID=$gibbonSchoolYearID");
+ $form = DeleteForm::createForm($gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module')."/badges_grant_deleteProcess.php?badgesBadgeStudentID=$badgesBadgeStudentID&gibbonPersonID2=".$row['gibbonPersonID'].'&badgesBadgeID2='.$row['badgesBadgeID']."&gibbonSchoolYearID=$gibbonSchoolYearID");
echo $form->getOutput();
}
}
diff --git a/Badges/badges_grant_deleteProcess.php b/Badges/badges_grant_deleteProcess.php
index b35ce1c..481e2d2 100644
--- a/Badges/badges_grant_deleteProcess.php
+++ b/Badges/badges_grant_deleteProcess.php
@@ -20,8 +20,8 @@
include '../../gibbon.php';
-$badgesBadgeStudentID = $_GET['badgesBadgeStudentID'] ?? '';
-$gibbonSchoolYearID = $_POST['gibbonSchoolYearID'] ?? '';
+$badgesBadgeStudentID = $_GET['badgesBadgeStudentID'];
+$gibbonSchoolYearID = $_POST['gibbonSchoolYearID'];
$URL = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/'.getModuleName($_POST['address'])."/badges_grant_delete.php&badgesBadgeStudentID=$badgesBadgeStudentID&gibbonPersonID2=".$_GET['gibbonPersonID2'].'&badgesBadgeID2='.$_GET['badgesBadgeID2']."&gibbonSchoolYearID=$gibbonSchoolYearID";
$URLDelete = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/'.getModuleName($_POST['address']).'/badges_grant.php&gibbonPersonID2='.$_GET['gibbonPersonID2'].'&badgesBadgeID2='.$_GET['badgesBadgeID2']."&gibbonSchoolYearID=$gibbonSchoolYearID";
diff --git a/Badges/badges_manage.php b/Badges/badges_manage.php
index fae8bcb..a90eff6 100644
--- a/Badges/badges_manage.php
+++ b/Badges/badges_manage.php
@@ -17,6 +17,9 @@
along with this program. If not, see
.
*/
use Gibbon\Forms\Form;
+use Gibbon\Tables\DataTable;
+use Gibbon\Services\Format;
+use Gibbon\Module\Badges\Domain\BadgeGateway;
//Module includes
include './modules/Badges/moduleFunctions.php';
@@ -57,12 +60,17 @@
$allRoles[$rowRoles['gibbonRoleID']] = $rowRoles['name'];
}
- $search = $_GET['search'] ?? '';
- $category = $_GET['category'] ?? '';
+ $search = null;
+ if (isset($_GET['search'])) {
+ $search = $_GET['search'];
+ }
+ $category = null;
+ if (isset($_GET['category'])) {
+ $category = $_GET['category'];
+ }
$form = Form::create('search', $gibbon->session->get('absoluteURL','').'/index.php', 'get');
$form->setTitle(__('Search & Filter'));
- $form->addClass('noIntBorder');
$form->addHiddenValue('q', '/modules/'.$gibbon->session->get('module').'/badges_manage.php');
$form->addHiddenValue('address', '/modules/' . $gibbon->session->get('address'));
@@ -86,125 +94,48 @@
echo __('View');
echo '';
- try {
- $data = array();
- $sqlWhere = '';
- if ($search != '' || $category != '') {
- $sqlWhere = 'WHERE ';
- if ($search != '') {
- $data['search'] = "%$search%";
- $sqlWhere .= 'badgesBadge.name LIKE :search AND ';
- }
- if ($category != '') {
- $data['category'] = $category;
- $sqlWhere .= 'badgesBadge.category=:category';
- }
- if (mb_substr($sqlWhere, -5) == ' AND ') {
- $sqlWhere = mb_substr($sqlWhere, 0, -5);
- }
- }
- $sql = "SELECT badgesBadge.* FROM badgesBadge $sqlWhere ORDER BY category, badgesBadge.name";
- $sqlPage = $sql . ' LIMIT ' . $gibbon->session->get('pagination') . ' OFFSET ' . (($page - 1) * $gibbon->session->get('pagination'));
- $result = $connection2->prepare($sql);
- $result->execute($data);
- } catch (PDOException $e) {
- echo "
" . $e->getMessage() . '
';
- }
-
- echo "
';
-
- if ($result->rowCount() < 1) {
- echo "
";
- echo 'There are no badges to display.';
- echo '
';
- } else {
- if ($result->rowCount() > $gibbon->session->get('pagination')) {
- printPagination($guid, $result->rowCount(), $page, $gibbon->session->get('pagination'), 'top', "search=$search");
- }
-
- echo "
';
-
- if ($result->rowCount() > $gibbon->session->get('pagination')) {
- printPagination($guid, $result->rowCount(), $page, $gibbon->session->get('pagination'), 'bottom', "search=$search");
+ return $output;
+ });
+ $table->AddColumn('logo',__('Logo'))->width('155px')->format(function($row) use ($gibbon){
+ if ($row['logo'] != '') {
+ echo "
";
+ } else {
+ echo "
session->get('gibbonThemeName') . "/img/anonymous_240_square.jpg'/>";
}
- }
+ });
+ $table->AddColumn('name',__('Name'));
+ $table->AddColumn('category',__('Category'));
+
+ $actions = $table->addActionColumn('actions',__('Actions'))
+ ->addParam('badgesBadgeID')
+ ->addParam('category',$_GET['category'] ?? '')
+ ->addParam('search',$_GET['search'] ?? '');
+ $actions->AddAction('edit',__('Edit'))->setURL('/modules/Badges/badges_manage_edit.php');
+ $actions->AddAction('delete',__('Delete'))->setURL('/modules/Badges/badges_manage_delete.php');
+
+ echo $table->render($badges);
+
+
}
+
?>
diff --git a/Badges/badges_manage_add.php b/Badges/badges_manage_add.php
index fbf4e2f..e0a9cb9 100644
--- a/Badges/badges_manage_add.php
+++ b/Badges/badges_manage_add.php
@@ -35,7 +35,10 @@
->add(__('Add Badges'));
$returns = array();
- $editLink = isset($editLink) ? $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/Badges/badges_manage_edit.php&badgesBadgeID='.$_GET['editID'].'&search='.$_GET['search'].'&category='.$_GET['category'] : '';
+ $editLink = '';
+ if (isset($_GET['editID'])) {
+ $editLink = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/Badges/badges_manage_edit.php&badgesBadgeID='.$_GET['editID'].'&search='.$_GET['search'].'&category='.$_GET['category'];
+ }
if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], $editLink, null);
}
@@ -47,8 +50,8 @@
}
- $form = Form::create('badges', $gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module').'/badges_manage_addProcess.php?search='.$_GET['search'].'&category='.$_GET['category']);
-
+ $form = Form::create('badges', $gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module').'/badges_manage_addProcess.php','POST');
+
$form->addHiddenValue('address', $gibbon->session->get('address'));
$row = $form->addRow();
@@ -58,7 +61,7 @@
$row = $form->addRow();
$row->addLabel('active', __('Active'));
$row->addYesNo('active')->required();
-
+
$categories = getSettingByScope($connection2, 'Badges', 'badgeCategories');
$categories = !empty($categories) ? array_map('trim', explode(',', $categories)) : [];
$row = $form->addRow();
@@ -68,17 +71,17 @@
$row = $form->addRow();
$row->addLabel('description', __('Description'));
$row->addTextArea('description');
-
+
$fileUploader = new FileUploader($pdo, $gibbon->session);
-
+
$row = $form->addRow();
$row->addLabel('file', __('Logo'))->description(__('240px x 240px'));
$row->addFileUpload('file')->accepts($fileUploader->getFileExtensions('Graphics/Design'));
-
+
$row = $form->addRow();
$row->addLabel('logoLicense', __('Logo License/Credits'));
$row->addTextArea('logoLicense');
-
+
$row = $form->addRow();
$row->addSubmit();
diff --git a/Badges/badges_manage_addProcess.php b/Badges/badges_manage_addProcess.php
index b9960b8..859efe0 100644
--- a/Badges/badges_manage_addProcess.php
+++ b/Badges/badges_manage_addProcess.php
@@ -20,8 +20,9 @@
include '../../gibbon.php';
include './moduleFunctions.php';
-
-$URL = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/'.getModuleName($_POST['address']).'/badges_manage_add.php&search='.$_GET['search'].'&category='.$_GET['category'];
+$category = $_GET['category'] ?? '';
+$search = $_GET['search'] ?? '';
+$URL = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/'.getModuleName($_POST['address']).'/badges_manage_add.php&search='. $search .'&category='.$category ?? '';
if (isActionAccessible($guid, $connection2, '/modules/Badges/badges_manage_add.php') == false) {
//Fail 0
diff --git a/Badges/badges_manage_delete.php b/Badges/badges_manage_delete.php
index 304a357..053cb79 100644
--- a/Badges/badges_manage_delete.php
+++ b/Badges/badges_manage_delete.php
@@ -58,7 +58,13 @@
//Let's go!
$row = $result->fetch();
- $form = DeleteForm::createForm($gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module')."/badges_manage_deleteProcess.php?badgesBadgeID=$badgesBadgeID&search=".$_GET['search']."&&category=" . $_GET['category']);
+ if ($_GET['category'] != '') {
+ echo "
';
+ }
+
+ $form = DeleteForm::createForm($gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module')."/badges_manage_deleteProcess.php?badgesBadgeID=$badgesBadgeID&search=".$_GET['category']."&category=" . $_GET['category']);
echo $form->getOutput();
}
}
diff --git a/Badges/badges_manage_edit.php b/Badges/badges_manage_edit.php
index 2ae3534..edf2a7f 100644
--- a/Badges/badges_manage_edit.php
+++ b/Badges/badges_manage_edit.php
@@ -39,7 +39,9 @@
}
//Check if school year specified
- $badgesBadgeID = $_GET['badgesBadgeID'];
+ $badgesBadgeID = $_GET['badgesBadgeID'] ?? '';
+ $search = $_GET['search'] ?? '';
+ $category = $_GET['category'] ?? '';
if ($badgesBadgeID == '') { echo "
";
echo 'You have not specified a policy.';
echo '
';
@@ -61,13 +63,13 @@
//Let's go!
$values = $result->fetch();
- if ($_GET['search'] != '' || $_GET['category'] != '') {
+ if ($category != '' || $category != '') {
echo "
';
}
- $form = Form::create('badges', $gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module').'/badges_manage_editProcess.php?badgesBadgeID='.$badgesBadgeID.'&search='.$_GET['search'].'&category='.$_GET['category']);
+ $form = Form::create('badges', $gibbon->session->get('absoluteURL','').'/modules/'.$gibbon->session->get('module').'/badges_manage_editProcess.php?badgesBadgeID='.$badgesBadgeID.'&search='.$category.'&category='.$category);
$form->addHiddenValue('address', $gibbon->session->get('address'));
diff --git a/Badges/badges_manage_editProcess.php b/Badges/badges_manage_editProcess.php
index f682675..fce45fb 100644
--- a/Badges/badges_manage_editProcess.php
+++ b/Badges/badges_manage_editProcess.php
@@ -21,7 +21,7 @@
include './moduleFunctions.php';
-$badgesBadgeID = $_GET['badgesBadgeID'] ?? '';
+$badgesBadgeID = $_GET['badgesBadgeID'];
$URL = $gibbon->session->get('absoluteURL','').'/index.php?q=/modules/'.getModuleName($_POST['address'])."/badges_manage_edit.php&badgesBadgeID=$badgesBadgeID&search=".$_GET['search']."&category=".$_GET['category'];
if (isActionAccessible($guid, $connection2, '/modules/Badges/badges_manage_edit.php') == false) {
diff --git a/Badges/badges_view.php b/Badges/badges_view.php
index bc7bac8..7fb7944 100644
--- a/Badges/badges_view.php
+++ b/Badges/badges_view.php
@@ -39,9 +39,12 @@
echo '
';
} else {
if ($highestAction == 'View Badges_all') {
- $gibbonPersonID = $_GET['gibbonPersonID'] ?? '';
+ $gibbonPersonID = null;
+ if (isset($_GET['gibbonPersonID'])) {
+ $gibbonPersonID = $_GET['gibbonPersonID'];
+ }
- $form = Form::create('search', $gibbon->session->get('absoluteURL','').'/index.php', 'GET');
+ $form = Form::create('search', $gibbon->session->get('absoluteURL','').'/index.php', 'get');
$form->setTitle(__('Choose Student'));
$form->addClass('noIntBorder');
$form->setFactory(DatabaseFormFactory::create($pdo));
@@ -101,8 +104,10 @@
echo getBadges($connection2, $guid, $gibbon->session->get('gibbonPersonID'));
}
} elseif ($highestAction == 'View Badges_myChildren') {
- $gibbonPersonID = $gibbon->session->get('gibbonPersonID') ?? $_GET['search'];
-
+ $gibbonPersonID = $gibbon->session->get('gibbonPersonID');
+ if (isset($_GET['search'])) {
+ $gibbonPersonID = $_GET['search'];
+ }
//Test data access field for permission
try {
$data = array('gibbonPersonID' => $gibbon->session->get('gibbonPersonID'));
diff --git a/Badges/badges_view_available.php b/Badges/badges_view_available.php
index 16fcd9f..3d5a631 100644
--- a/Badges/badges_view_available.php
+++ b/Badges/badges_view_available.php
@@ -47,24 +47,23 @@
$form = Form::create('grantbadges',$gibbon->session->get('absoluteURL').'/index.php','GET');
$form->setFactory(DatabaseFormFactory::create($pdo));
- $form->addClass('noIntBorder');
$form->addHiddenValue('q','/modules/' . $gibbon->session->get('module') . '/badges_view_available.php');
$form->addHiddenValue('address',$gibbon->session->get('address'));
-
+
$row = $form->addRow();
$row->addLabel('search',__('Search For'))->description("Badge name");
- $row->addTextField('search')->setValue($search);
-
+ $row->addTextField('search');
+
$sql = "SELECT distinct category as value, category as name FROM badgesBadge WHERE active='Y' ORDER BY category, name";
$row = $form->addRow();
$row->addLabel('category',__('Category'));
- $row->addSelect('category')->fromQuery($pdo, $sql, [])->selected($category)->placeholder();
-
+ $row->addSelect('category')->fromQuery($pdo, $sql, [])->placeholder();
+
$row = $form->addRow()->addSearchSubmit($gibbon->session);
echo $form->getOutput();
?>
-
+
";
echo 'View';
diff --git a/Badges/hook_parentalDashboard_badgesView.php b/Badges/hook_parentalDashboard_badgesView.php
index 671daf0..b15a036 100644
--- a/Badges/hook_parentalDashboard_badgesView.php
+++ b/Badges/hook_parentalDashboard_badgesView.php
@@ -23,7 +23,7 @@
$included = false;
$includes = get_included_files();
foreach ($includes as $include) {
- if ($include == $_SESSION[$guid]['absoluteURL'].'/modules/Badges/moduleFunctions.php') {
+ if ($include == $gibbon->session->get('absolutePath','').'/modules/Badges/moduleFunctions.php') {
$included = true;
}
}
diff --git a/Badges/manifest.php b/Badges/manifest.php
index 8f1fdef..bb5a584 100644
--- a/Badges/manifest.php
+++ b/Badges/manifest.php
@@ -25,7 +25,7 @@
$entryURL = 'badges_view.php';
$type = 'Additional';
$category = 'Assess';
-$version = '2.5.04';
+$version = '2.5.05';
$author = 'Ross Parker';
$url = 'http://rossparker.org';
diff --git a/Badges/moduleFunctions.php b/Badges/moduleFunctions.php
index 053120a..d7c507d 100644
--- a/Badges/moduleFunctions.php
+++ b/Badges/moduleFunctions.php
@@ -17,10 +17,18 @@
along with this program. If not, see