filter admin/instructor POST data, add some missing language
authorgreg gay <ggay@ocad.ca>
Wed, 16 Feb 2011 21:45:09 +0000 (21:45 -0000)
committergreg gay <ggay@ocad.ca>
Wed, 16 Feb 2011 21:45:09 +0000 (21:45 -0000)
mods/basiclti/README.txt
mods/basiclti/index_admin.php
mods/basiclti/module.sql
mods/basiclti/tool/admin_create.php
mods/basiclti/tool/admin_delete.php
mods/basiclti/tool/forms.php

index e05827e..2fd0b84 100644 (file)
@@ -65,7 +65,6 @@ http://www.elluminate.com/
 
 ###############
 Known issues in this release
--missing labels for radio buttons in the admin's table listing tools that have been created. Better, in addition to the Label, make the table row toggle the radio.
 -missing error message when a button is clicked in the admin table listing tools, when a tool radio  has not been selected
 - should the view button in the admin's tool listing table display the actual tool instead of the tool settings. Would be more useful I think, given clicking the edit button displays the same information. Or maybe display settings above, and open the tool below in a frame.
 - when "allow frame height to change" setting is enabled, the frame hieght gets set to 0, effectively hiding the tool when added to a page
index ec8684a..b7d7033 100644 (file)
@@ -12,6 +12,9 @@ if (isset($_GET['view'], $_GET['id'])) {
 } else if (isset($_GET['delete'], $_GET['id'])) {
     header('Location: tool/admin_delete.php?id='.$_GET['id']);
     exit;
+} else if ($_GET['delete'] ||$_GET['edit'] || $_GET['view'] && !isset($_GET['id'])){
+       $msg->addError("NO_ITEM_SELECTED");
+
 }
 
 require (AT_INCLUDE_PATH.'header.inc.php');
@@ -43,7 +46,7 @@ $result = mysql_query($sql, $db) or die(mysql_error());
         <tbody>
                 <?php while($row = mysql_fetch_array($result)) { ?><tr>
                <td><input type="radio" name="id" value="<?php echo $row['id']; ?>" id="m<?php echo $row['id']; ?>" /></td>
-                <td><?php echo $row['title']; ?></td>
+                <td><label for="m<?php echo $row['id']; ?>"><?php echo $row['title']; ?></a></td>
                 <td><?php echo $row['toolid']; ?></td>
                 <td><?php echo $row['description']; ?></td>
                 <td><?php echo $row['cnt']; ?></td>
index 3706579..0c3948b 100644 (file)
@@ -127,3 +127,4 @@ INSERT INTO `language_text` VALUES ('en', '_module','proxy','Learning Activity',
 INSERT INTO `language_text` VALUES ('en', '_module','about_content_tools','Select from the available external tools, one that can be associated with this content page as a learning activity. Or, though  Manage>IMS Basic LTI add your own external tools to make them available here.',NOW(),'');
 INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_BASICLTI_SAVED','External tool added as a Learning Activity for this content page.',NOW(),'');
 INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_BASICLTI_DELETED','External tool removed as a Learning Activity from this content page.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_CONFIRM_DELETE_TOOL_1','Are you sure you want to delete the tool <strong> %s</strong>.',NOW(),'');
\ No newline at end of file
index 4686a79..52cb034 100644 (file)
@@ -5,6 +5,30 @@ admin_authenticate(AT_ADMIN_PRIV_BASICLTI);
 
 require_once('forms.php');
 
+$_POST['form_basiclti'] = $addslashes($_POST['form_basiclti']);
+$_POST['title'] = $addslashes($_POST['title']);
+$_POST['toolid'] = $addslashes($_POST['toolid']);
+$_POST['description'] = $addslashes($_POST['description']);
+$_POST['toolurl'] = $addslashes($_POST['toolurl']);
+$_POST['resourcekey'] = $addslashes($_POST['resourcekey']);
+$_POST['password'] = $addslashes($_POST['password']);
+$_POST['preferheight'] = intval($_POST['preferheight']);
+$_POST['allowpreferheight'] = intval($_POST['allowpreferheight']);
+$_POST['launchinpopup'] = intval($_POST['launchinpopup']);
+$_POST['debuglaunch'] = intval($_POST['debuglaunch']);
+$_POST['sendname'] = intval($_POST['sendname']);
+$_POST['sendemailaddr'] = intval($_POST['sendemailaddr']);
+$_POST['acceptgrades'] = intval($_POST['acceptgrades']);
+$_POST['allowroster'] = intval($_POST['allowroster']);
+$_POST['allowsetting'] = intval($_POST['allowsetting']);
+$_POST['allowcustomparameters'] = intval($_POST['allowcustomparameters']);
+$_POST['customparameters'] = $addslashes($_POST['customparameters']);
+$_POST['organizationid'] = $addslashes($_POST['organizationid']);
+$_POST['organizationurl'] = $addslashes($_POST['organizationurl']);
+$_POST['organizationdescr'] = $addslashes($_POST['organizationdescr']);
+$_POST['submit'] = $addslashes($_POST['submit']);
+
+
 if (isset($_POST['cancel'])) {
         $msg->addFeedback('CANCELLED');
         header('Location: '.AT_BASE_HREF.'mods/basiclti/index_admin.php');
@@ -25,6 +49,8 @@ if (isset($_POST['cancel'])) {
             $result = mysql_query($sql, $db) or die(mysql_error());
             write_to_log(AT_ADMIN_LOG_INSERT, 'basiclti_create', mysql_affected_rows($db), $sql);
             $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+
+
             header('Location: '.AT_BASE_HREF.'mods/basiclti/index_admin.php');
             exit;
         }
index 157922d..1e853e2 100644 (file)
@@ -22,7 +22,7 @@ if (isset($_POST['submit_no'])) {
         $msg->addFeedback('CANCELLED');
         header('Location: ../index_admin.php');
         exit;
-} else if (isset($_POST['step']) && ($_POST['step'] == 2) && isset($_POST['submit_yes'])) {
+} else if (isset($_POST['submit_yes'])) {
        $sql = "DELETE FROM ".TABLE_PREFIX."basiclti_tools WHERE id = ".$tool.";";
        $result = mysql_query($sql, $db) or die(mysql_error());
         write_to_log(AT_ADMIN_LOG_DELETE, 'basiclti_delete', mysql_affected_rows($db), $sql);
@@ -34,15 +34,18 @@ if (isset($_POST['submit_no'])) {
 require(AT_INCLUDE_PATH.'header.inc.php'); 
 
 if (!isset($_POST['step'])) {
-        $hidden_vars['step']   = 1;
+        $hidden_vars['step']   = 2;
         $hidden_vars['id'] = $tool;
         $msg->addConfirm(array('DELETE_TOOL_1', $row['title']), $hidden_vars);
         $msg->printConfirm();
-} else if ($_POST['step'] == 1) {
+} 
+/*
+
+else if ($_POST['step'] == 1) {
         $hidden_vars['step']   = 2;
         $hidden_vars['id'] = $tool;
         $msg->addConfirm(array('DELETE_TOOL_2', $row['title']), $hidden_vars);
         $msg->printConfirm();
-}
+}*/
 
 require(AT_INCLUDE_PATH.'footer.inc.php'); 
index f89bed2..004e0f1 100644 (file)
@@ -4,13 +4,13 @@ require_once('../lib/at_form_util.php');
 
 $blti_instructor_form = array(
        'title:text:label=bl_title:required=true:size=25',
-        'toolid:id:label=bl_toolid:required=true:size=16',
+       'toolid:id:label=bl_toolid:required=true:size=16',
        'description:textarea:label=bl_description:required=true:rows=2:cols=25',
        'toolurl:url:label=bl_toolurl:required=true:size=80',
        'resourcekey:text:label=bl_resourcekey:required=true:size=80',
        'password:text:required=true:label=bl_password:size=80',
        'preferheight:integer:label=bl_preferheight:size=80',
-        'preferheight:radio:label=bl_allowpreferheight:choices=off,on',
+       'allowpreferheight:radio:label=bl_allowpreferheight:choices=off,on',
        'launchinpopup:radio:label=bl_launchinpopup:choices=off,on,content',
        'debuglaunch:radio:label=bl_debuglaunch:choices=off,on,content',
        'sendname:radio:label=bl_sendname:choices=off,on,content',
@@ -18,7 +18,7 @@ $blti_instructor_form = array(
        'acceptgrades:radio:label=bl_acceptgrades:choices=off,on',
        'allowroster:radio:label=bl_allowroster:choices=off,on,content',
        'allowsetting:radio:label=bl_allowsetting:choices=off,on,content',
-        'allowcustomparameters:radio:label=bl_allowcustomparameters:choices=off,on',
+    'allowcustomparameters:radio:label=bl_allowcustomparameters:choices=off,on',
        'customparameters:textarea:label=bl_customparameters:rows=5:cols=25',
         );