Ejemplo n.º 1
0
<?php

/*-------------------------------------------------------------------
 * Elgg LTI
 *
 * Display the LTI object
 ------------------------------------------------------------------*/
$consumer_instance_guid = $vars['consumer_guid'];
$consumer_instance = new LTI_Tool_Consumer_Instance($consumer_instance_guid, elgg_get_config('dbprefix'));
$consumer_tool = new LTI_Tool_Consumer($consumer_instance->consumer_guid, elgg_get_config('dbprefix'));
$url = elgg_get_site_entity()->url;
if ($consumer_instance->isEnabled()) {
    $enabled = 'yes';
    $info = '<div class="plugin_details active">';
} else {
    $enabled = 'no';
    $info = '<div class="plugin_details not-active">';
}
$icon = '<img src="' . GetImage($consumer_instance->guid, '.png') . '" title="Image of Consumer" />';
$info .= '<table>';
$info .= '<tr><th class = "column1"></th><th class = "column2"></th><th class = "column3">Name</th><th class = "column4">Consumer Name</th><th class = "column5"></th></tr>';
$info .= '<tr>';
$info .= '<td class = "column1">' . $icon . '</td>';
$info .= '<td class = "column2">';
$info .= '<a href="editconsumer?LTIconsumerguid=' . $consumer_instance->guid . '" alt="Edit consumer" title="Edit Consumer"><img src="' . elgg_get_config('wwwroot') . 'mod/blti/images/edit.gif' . '"></a>';
$info .= '<a href="' . $url . 'blti/delete/' . $consumer_instance->guid . '" alt="Delete consumer" title="Delete Consumer"><img src="' . elgg_get_config('wwwroot') . 'mod/blti/images/delete.gif' . '"></a>';
$info .= '</td>';
$info .= '<td class = "column3">' . $consumer_tool->name . '</td>';
$info .= '<td class = "column4">' . $consumer_tool->consumer_name . '</td>';
$url = elgg_add_action_tokens_to_url(elgg_get_config('wwwroot') . 'action/' . elgg_get_config('ltiname') . '/enable?guid=' . $consumer_instance->guid);
$option = $consumer_instance->isEnabled() ? 'Disable' : 'Enable';
Ejemplo n.º 2
0
<?php

/*-------------------------------------------------------------------
 * Elgg LTI
 *
 * Enable/Disable consumer
 ------------------------------------------------------------------*/
// Must be logged in as admin to use this page
admin_gatekeeper();
$consumer_instance = new LTI_Tool_Consumer_Instance(get_input('guid'), elgg_get_config('dbprefix'));
$consumer_tool = new LTI_Tool_Consumer($consumer_instance->consumer_guid, elgg_get_config('dbprefix'));
$consumer_tool->enabled = $consumer_instance->isEnabled() ? False : True;
$consumer_tool->save();
forward(REFERRER);
Ejemplo n.º 3
0
// Have to be logged in to get to here at all
admin_gatekeeper();
elgg_set_context('admin');
// Sort out which LTI provider we are editing
$consumer_instance = new LTI_Tool_Consumer_Instance(get_input('LTIconsumerguid'), elgg_get_config('dbprefix'));
$consumer_tool = new LTI_Tool_Consumer($consumer_instance->consumer_guid, elgg_get_config('dbprefix'));
// Check we have LTI object
if ($consumer_instance) {
    $isBasicLTI = $consumer_instance->state == 'BasicLTI' || $consumer_instance->consumer_guid == $consumer_instance->guid ? true : false;
    $tool_guid = elgg_view('input/hidden', array('name' => 'tool_guid', 'value' => $consumer_tool->guid));
    // Tile
    //$area2 = elgg_view_title(elgg_echo('LTI:edit:consumer:title'));
    // Name
    $name = elgg_view('input/text', array('name' => 'name', 'value' => $consumer_tool->name));
    // Enabled
    $option = $consumer_instance->isEnabled() ? 'yes' : 'no';
    $enable = elgg_view('input/checkboxes', array('name' => 'enable', 'options' => array('' => 'yes'), 'value' => $option));
    if (!$isBasicLTI) {
        // Profile UL
        $profile_url = '<a href="' . $consumer_tool->profile_url . '">' . $consumer_tool->profile_url . '</a>';
        $url = elgg_view('input/hidden', array('name' => 'url', 'value' => $consumer_tool->profile_url));
        // Version
        $version = elgg_view('input/text', array('name' => 'name', 'value' => $consumer_tool->consumer_version));
        // System
        $system = $consumer_tool->consumer_name . '&nbsp;(' . $consumer_tool->consumer_version . ')';
        $consumer_name = elgg_view('input/text', array('name' => 'consumer_name', 'value' => $consumer_tool->consumer_name));
    }
    /*
    // LTI State
    if ($isBasicLTI) {
        $state   = elgg_view('input/select',