function __construct($student_id = null)
 {
     //set the id of the student that will be displayed by this
     $this->student_id = $student_id;
     //set the name of the directory that holds any files for this plugin
     $this->directory = 'studentinfo';
     parent::__construct();
 }
Ejemplo n.º 2
0
/**
 * Carries out functions needed after installation
 *
 * @copyright © 2011 University of London Computer Centre
 * @author http://www.ulcc.ac.uk, http://moodle.ulcc.ac.uk
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package ILP
 * @version 2.0
 */
function xmldb_block_ilp_install()
{
    global $USER, $CFG, $SESSION, $PARSER;
    // include the ilp db
    require_once $CFG->dirroot . '/blocks/ilp/db/ilp_db.php';
    // instantiate the db
    $dbc = new ilp_db();
    //install the various plugins and templates into the database
    require_once $CFG->dirroot . '/blocks/ilp/classes/form_elements/ilp_element_plugin.php';
    //install new plugins
    ilp_element_plugin::install_new_plugins();
    require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_template.php';
    //install new templates
    ilp_dashboard_template::install_new_plugins();
    require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_plugin.php';
    //install new dashboard plugins
    ilp_dashboard_plugin::install_new_plugins();
    require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_tab.php';
    //install new tabs
    ilp_dashboard_tab::install_new_plugins();
    //create relationships betweendashboard plugins and template regions
    //get the enabled template should be the default temmplate at this stage
    $enabled_template = $dbc->get_enabled_template();
    $regions = $dbc->get_template_regions($enabled_template->id);
    $region_plugins = array();
    //create the association between the plugin and the first region
    $plugin = $dbc->get_dashboard_plugin_by_name('ilp_dashboard_student_info_plugin');
    $rp = new stdClass();
    $rp->plugin_id = $plugin->id;
    $region_plugins[] = $rp;
    $plugin = $dbc->get_dashboard_plugin_by_name('ilp_dashboard_main_plugin');
    $rp = new stdClass();
    $rp->plugin_id = $plugin->id;
    $region_plugins[] = $rp;
    //loop through the regions and assign the region to a plugin
    $i = 0;
    foreach ($regions as $r) {
        $region_plugins[$i]->region_id = $r->id;
        //create the record
        $dbc->create_region_plugin($region_plugins[$i]);
        $i++;
    }
    //create default user status record and subsequent items
    $statusitem = new stdClass();
    $statusitem->selecttype = NULL;
    $id = $dbc->create_plugin_record('block_ilp_plu_sts', $statusitem);
    $statusitems = array('red' => '1', 'orange' => '0', 'green' => '2');
    foreach ($statusitems as $key => $passfail) {
        $si = new stdClass();
        $si->name = $key;
        $si->value = $key;
        $si->passfail = $passfail;
        $si->parent_id = $id;
        $dbc->create_plugin_record('block_ilp_plu_sts_items', $si);
    }
}
Ejemplo n.º 3
0
 * @version 2.0
 */
global $CFG;
// include the assmgr db
require_once $CFG->dirroot . '/blocks/ilp/db/ilp_db.php';
// instantiate the assmgr db
$dbc = new ilp_db();
require_once $CFG->dirroot . '/blocks/ilp/classes/form_elements/ilp_element_plugin.php';
//install new plugins
ilp_element_plugin::install_new_plugins();
require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_template.php';
//install new templates
ilp_dashboard_template::install_new_plugins();
require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_plugin.php';
//install new dashboard plugins
ilp_dashboard_plugin::install_new_plugins();
require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_dashboard_tab.php';
//install new tabs
ilp_dashboard_tab::install_new_plugins();
require_once $CFG->dirroot . '/blocks/ilp/classes/dashboard/ilp_mis_plugin.php';
//install new tabs
ilp_mis_plugin::install_new_plugins();
$globalsettings = new admin_setting_heading('block_ilp/reportconfig', get_string('reports', 'block_ilp'), '');
$settings->add($globalsettings);
$link = '<a href="' . $CFG->wwwroot . '/blocks/ilp/actions/edit_report_configuration.php">' . get_string('reportconfigurationsection', 'block_ilp') . '</a>';
$settings->add(new admin_setting_heading('block_ilp_report_configuration', '', $link));
$link = '<a href="' . $CFG->wwwroot . '/blocks/ilp/actions/edit_status_items.php">' . get_string('editstatusitems', 'block_ilp') . '</a>';
$settings->add(new admin_setting_heading('block_ilp_statusitems', '', $link));
$globalsettings = new admin_setting_heading('block_ilp/userstatus', get_string('userstatus', 'block_ilp'), '');
$settings->add($globalsettings);
$items = $dbc->get_status_items(ILP_DEFAULT_USERSTATUS_RECORD);