public function __construct($params = FALSE) { parent::__construct($params); //URL parameter specifies the report instance $this->report_shortname = $this->required_param('report'); //convert shortname to report instance $this->report_instance = php_report::get_default_instance($this->report_shortname); }
function build_navbar_default($who = null) { global $CFG; if (!$who) { $who = $this; } parent::build_navbar_default(); $who->navbar->add(true ? get_string('programmanagement', 'local_elisprogram') : get_string('learningplan', 'local_elisprogram'), "{$CFG->wwwroot}/local/elisprogram/"); }
function __construct($params = false) { global $USER; parent::__construct($params); $workflow_id = $this->optional_param('_wfid', null, PARAM_INT); if ($workflow_id) { $this->workflow = _workflow_instance::load($workflow_id); if ($this->workflow->type !== $this->data_class || $this->workflow->userid != $USER->id) { print_error('invalidid', 'elis_core'); } } else { $this->workflow = $this->new_workflow(); } }
protected function _get_page_params() { return array('report' => $this->optional_param('report', '', PARAM_ALPHAEXT)) + parent::_get_page_params(); }
/** * Constructor for a table that displays management page entries * * @param array $items The elements representing the rows of the table * @param array $columns The specifications for the columns of the table * @param elis_page $page An instance of the displayed entity type's page * @param array $extra_params Extra parameters to add to the page URL */ function __construct(&$items, $columns, $page, $extra_params = null) { $namesearch = trim(optional_param('search', '', PARAM_TEXT)); $alpha = optional_param('alpha', '', PARAM_ALPHA); $params = array('search' => $namesearch, 'alpha' => $alpha); //add page params if (!empty($page->params)) { $params += $page->params; } if (!empty($extra_params)) { //ok to use union here since we typically only pass //parameters that can't be accessed within the page class $params += $extra_params; } $this->page = $page; $this->display_date_item = new display_date_item(get_string('pm_date_format', 'local_elisprogram')); $target = $page->get_new_page($params, true); parent::__construct($items, $columns + array('_buttons' => array('sortable' => false, 'wrapped' => false, 'align' => 'center')), $target->url); }
/** * Create a url to the current page. * * @return moodle_url */ function get_moodle_url($extra = array()) { if (!isset($extra['s'])) { $extra['s'] = $this->pagename; } return parent::get_moodle_url($extra); }
/** * Display the final summary */ function print_footer() { parent::print_footer(); if ($this->optional_param('action', '', PARAM_ACTION) == 'finished') { $this->workflow->delete(); } }