Updates to get the plugin to work side-by-side with the basicLTI plugin

This commit is contained in:
Chris Scribner
2011-11-06 20:41:53 -05:00
parent 7023b65ef5
commit 795dff011f
6 changed files with 97 additions and 87 deletions
-81
View File
@@ -51,87 +51,6 @@ global $PAGE, $CFG, $SITE;
require_once($CFG->dirroot.'/mod/lti/locallib.php');
function lti_get_tool_table($tools, $id){
global $CFG, $USER;
$html = '';
$typename = get_string('typename', 'lti');
$baseurl = get_string('baseurl', 'lti');
$action = get_string('action', 'lti');
$createdon = get_string('createdon', 'lti');
if($id == 'lti_configured'){
$html .= '<div><a style="margin-top:.25em" href="'.$CFG->wwwroot.'/mod/lti/typessettings.php?action=add&amp;sesskey='.$USER->sesskey.'">'.get_string('addtype', 'lti').'</a></div>';
}
if (!empty($tools)) {
$html .= <<<HTML
<div id="{$id}_container" style="margin-top:.5em;margin-bottom:.5em">
<table id="{$id}_tools">
<thead>
<tr>
<th>$typename</th>
<th>$baseurl</th>
<th>$createdon</th>
<th>$action</th>
</tr>
</thead>
HTML;
foreach ($tools as $type) {
$date = userdate($type->timecreated);
$accept = get_string('accept', 'lti');
$update = get_string('update', 'lti');
$delete = get_string('delete', 'lti');
$accepthtml = <<<HTML
<a class="editing_accept" href="{$CFG->wwwroot}/mod/lti/typessettings.php?action=accept&amp;id={$type->id}&amp;sesskey={$USER->sesskey}&amp;tab={$id}" title="{$accept}">
<img class="iconsmall" alt="{$accept}" src="{$CFG->wwwroot}/pix/t/clear.gif"/>
</a>
HTML;
$deleteaction = 'delete';
if($type->state == LTI_TOOL_STATE_CONFIGURED){
$accepthtml = '';
}
if($type->state != LTI_TOOL_STATE_REJECTED) {
$deleteaction = 'reject';
$delete = get_string('reject', 'lti');
}
$html .= <<<HTML
<tr>
<td>
{$type->name}
</td>
<td>
{$type->baseurl}
</td>
<td>
{$date}
</td>
<td align="center">
{$accepthtml}
<a class="editing_update" href="{$CFG->wwwroot}/mod/lti/typessettings.php?action=update&amp;id={$type->id}&amp;sesskey={$USER->sesskey}&amp;tab={$id}" title="{$update}">
<img class="iconsmall" alt="{$update}" src="{$CFG->wwwroot}/pix/t/edit.gif"/>
</a>
<a class="editing_delete" href="{$CFG->wwwroot}/mod/lti/typessettings.php?action={$deleteaction}&amp;id={$type->id}&amp;sesskey={$USER->sesskey}&amp;tab={$id}" title="{$delete}">
<img class="iconsmall" alt="{$delete}" src="{$CFG->wwwroot}/pix/t/delete.gif"/>
</a>
</td>
</tr>
HTML;
}
$html .= '</table></div>';
} else {
$html .= get_string('no_' . $id, 'lti');
}
return $html;
}
if ($ADMIN->fulltree) {
$configuredtoolshtml = '';
$pendingtoolshtml = '';