/** * Prints a deletion confirmation form. * @param $obj record whose deletion is being confirmed */ function print_delete_form($obj) { global $CURMAN; if ($CURMAN->db->record_exists('crlm_cluster', 'parent', $obj->id)) { // cluster has sub-clusters $a = new stdClass(); $a->name = $obj->to_string(); $a->subclusters = $CURMAN->db->count_records('crlm_cluster', 'parent', $obj->id); $context = get_context_instance(context_level_base::get_custom_context_level('cluster', 'block_curr_admin'), $obj->id); $like = $CURMAN->db->sql_compare(); $a->descendants = $CURMAN->db->count_records_select('context', "path {$like} '{$context->path}/%'") - $a->subclusters; print_string($a->descendants ? 'confirm_delete_with_subclusters_and_descendants' : 'confirm_delete_with_subclusters', 'block_curr_admin', $a); require_once CURMAN_DIRLOCATION . '/form/clusterform.class.php'; $target = $this->get_new_page(array('action' => 'confirm')); $form = new clusterdeleteform($target->get_moodle_url(), array('obj' => $obj, 'a' => $a)); $form->display(); } else { parent::print_delete_form($obj); } }
function __construct(array $params = null) { parent::__construct($params); $id = $this->optional_param('id', 0, PARAM_INT); $track_params = $id ? array('parent' => $id) : array(); $this->tabs = array(array('tab_id' => 'view', 'page' => get_class($this), 'params' => array('action' => 'view'), 'name' => get_string('detail', 'local_elisprogram'), 'showtab' => true), array('tab_id' => 'edit', 'page' => get_class($this), 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit'), array('tab_id' => 'curriculumstudentpage', 'page' => 'curriculumstudentpage', 'name' => get_string('users', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'user'), array('tab_id' => 'curriculumclusterpage', 'page' => 'curriculumclusterpage', 'name' => get_string('clusters', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'cluster'), array('tab_id' => 'curriculumcoursepage', 'page' => 'curriculumcoursepage', 'name' => get_string('courses', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'course'), array('tab_id' => 'trackpage', 'page' => 'trackpage', 'params' => $track_params, 'name' => get_string('tracks', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'track'), array('tab_id' => 'curriculum_rolepage', 'page' => 'curriculum_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag'), array('tab_id' => 'delete', 'page' => get_class($this), 'params' => array('action' => 'delete'), 'name' => get_string('delete', 'local_elisprogram'), 'showbutton' => true, 'image' => 'delete')); }
public function __construct($params = false) { $this->tabs = array(array('tab_id' => 'view', 'page' => get_class($this), 'params' => array('action' => 'view'), 'name' => 'Detail', 'showtab' => true), array('tab_id' => 'edit', 'page' => get_class($this), 'params' => array('action' => 'edit'), 'name' => 'Edit', 'showtab' => true, 'showbutton' => true, 'image' => 'edit.gif'), array('tab_id' => 'delete', 'page' => get_class($this), 'params' => array('action' => 'delete'), 'name' => 'Delete', 'showbutton' => true, 'image' => 'delete.gif')); parent::__construct($params); }
function __construct($params = false) { $this->tabs = array(array('tab_id' => 'view', 'page' => get_class($this), 'params' => array('action' => 'view'), 'name' => get_string('detail', 'block_curr_admin'), 'showtab' => true), array('tab_id' => 'edit', 'page' => get_class($this), 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit.gif'), array('tab_id' => 'cmclasspage', 'page' => 'cmclasspage', 'params' => array('action' => 'default'), 'name' => get_string('course_classes', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'class.gif'), array('tab_id' => 'elem', 'page' => get_class($this), 'params' => array('action' => 'lelem'), 'name' => get_string('completion_elements', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'grades.gif'), array('tab_id' => 'coursecurriculumpage', 'page' => 'coursecurriculumpage', 'name' => get_string('course_curricula', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'curriculum.gif'), array('tab_id' => 'crstaginstancepage', 'page' => 'crstaginstancepage', 'name' => get_string('tags', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'tag.gif'), array('tab_id' => 'course_rolepage', 'page' => 'course_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag.gif'), array('tab_id' => 'delete', 'page' => get_class($this), 'params' => array('action' => 'delete'), 'name' => get_string('delete_label', 'block_curr_admin'), 'showbutton' => true, 'image' => 'delete.gif')); parent::__construct($params); }
function __construct($params = false) { $this->tabs = array(array('tab_id' => 'view', 'page' => get_class($this), 'params' => array('action' => 'view'), 'name' => get_string('detail', 'block_curr_admin'), 'showtab' => true), array('tab_id' => 'edit', 'page' => get_class($this), 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit.gif'), array('tab_id' => 'curriculumstudentpage', 'page' => 'curriculumstudentpage', 'name' => get_string('users', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'user.gif'), array('tab_id' => 'curriculumclusterpage', 'page' => 'curriculumclusterpage', 'name' => get_string('clusters', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'cluster.gif'), array('tab_id' => 'curriculumcoursepage', 'page' => 'curriculumcoursepage', 'name' => get_string('courses', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'course.gif'), array('tab_id' => 'trackpage', 'page' => 'trackpage', 'name' => get_string('tracks', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'track.gif'), array('tab_id' => 'curtaginstancepage', 'page' => 'curtaginstancepage', 'name' => get_string('tags', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'tag.gif'), array('tab_id' => 'curriculum_rolepage', 'page' => 'curriculum_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag.gif'), array('tab_id' => 'delete', 'page' => get_class($this), 'params' => array('action' => 'delete'), 'name' => get_string('delete', 'block_curr_admin'), 'showbutton' => true, 'image' => 'delete.gif')); parent::__construct($params); }
function __construct($params = false) { $this->tabs = array(array('tab_id' => 'view', 'page' => 'usermanagementpage', 'params' => array('action' => 'view'), 'name' => get_string('detail', 'block_curr_admin'), 'showtab' => true), array('tab_id' => 'edit', 'page' => 'usermanagementpage', 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit.gif'), array('tab_id' => 'studentcurriculumpage', 'page' => 'studentcurriculumpage', 'name' => get_string('curricula', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'curriculum.gif'), array('tab_id' => 'userclusterpage', 'page' => 'userclusterpage', 'name' => get_string('clusters', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'cluster.gif'), array('tab_id' => 'usertrackpage', 'page' => 'usertrackpage', 'name' => get_string('tracks', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'track.gif'), array('tab_id' => 'user_rolepage', 'page' => 'user_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag.gif'), array('tab_id' => 'delete', 'page' => 'usermanagementpage', 'params' => array('action' => 'delete'), 'name' => get_string('delete', 'block_curr_admin'), 'showbutton' => true, 'image' => 'delete.gif'), array('tab_id' => 'report', 'page' => 'linkpage', 'params' => array('linkurl' => 'blocks/php_report/render_report_page.php', 'linkparams' => 'report,userid', 'report' => 'individual_user', 'userid' => '=id'), 'name' => get_string('report', 'block_curr_admin'), 'showbutton' => true, 'image' => 'report.gif')); parent::__construct($params); }
public function __construct(array $params = null) { // Check the course certificate global settings value $showcoursecerttab = isset(elis::$config->local_elisprogram->disablecoursecertificates); $showcoursecerttab = $showcoursecerttab && empty(elis::$config->local_elisprogram->disablecoursecertificates); $numclasses = 1; if (($id = $this->optional_param('id', 0, PARAM_INT)) > 0 && !$this->_has_capability('local/elisprogram:class_create', $id)) { $parentclusterid = $this->optional_param('parent_clusterid', 0, PARAM_INT); $numclasses = pmclass_count_records('', '', $id, false, pmclasspage::get_contexts('local/elisprogram:class_view'), $parentclusterid); } $this->tabs = array(array('tab_id' => 'view', 'page' => get_class($this), 'params' => array('action' => 'view'), 'name' => get_string('detail', 'local_elisprogram'), 'showtab' => true), array('tab_id' => 'edit', 'page' => get_class($this), 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit'), array('tab_id' => 'pmclasspage', 'page' => 'pmclasspage', 'params' => array('action' => 'default'), 'name' => get_string('course_classes', 'local_elisprogram'), 'showtab' => $numclasses > 0, 'showbutton' => $numclasses > 0, 'image' => 'class'), array('tab_id' => 'elem', 'page' => get_class($this), 'params' => array('action' => 'lelem'), 'name' => get_string('completion_elements', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'grades'), array('tab_id' => 'coursecurriculumpage', 'page' => 'coursecurriculumpage', 'name' => get_string('course_curricula', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'curriculum'), array('tab_id' => 'course_rolepage', 'page' => 'course_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag'), array('tab_id' => 'course_enginepage', 'page' => 'course_enginepage', 'name' => get_string('results_engine', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'calculator'), array('tab_id' => 'course_enginestatuspage', 'page' => 'course_enginestatuspage', 'name' => get_string('status_report', 'local_elisprogram'), 'showtab' => false, 'showbutton' => false), array('tab_id' => 'course_certificatepage', 'page' => 'course_certificatepage', 'name' => get_string('certificate_settings', 'local_elisprogram'), 'showtab' => $showcoursecerttab, 'showbutton' => $showcoursecerttab, 'image' => 'certificate'), array('tab_id' => 'delete', 'page' => get_class($this), 'params' => array('action' => 'delete'), 'name' => get_string('delete_label', 'local_elisprogram'), 'showbutton' => true, 'image' => 'delete')); parent::__construct($params); }
/** * Prints a deletion confirmation form. * @param $obj record whose deletion is being confirmed */ function print_delete_form($obj) { global $DB; if ($count = userset::count(new field_filter('parent', $obj->id))) { // cluster has sub-clusters, so ask the user if they want to // promote or delete the sub-clusters $a = new stdClass(); $a->name = $obj; $a->subclusters = $count; $context = \local_elisprogram\context\userset::instance($obj->id); $like = $DB->sql_like('path', '?'); $a->descendants = $DB->count_records_select('context', $DB->sql_like('path', '?'), array("{$context->path}/%")) - $a->subclusters; print_string($a->descendants ? 'confirm_delete_with_usersubsets_and_descendants' : 'confirm_delete_with_usersubsets', 'local_elisprogram', array('name' => $obj->name, 'subclusters' => $count)); $target = $this->get_new_page(array('action' => 'delete', 'confirm' => '1')); $form = new usersetdeleteform($target->url, array('obj' => $obj, 'a' => $a)); $form->display(); } else { parent::print_delete_form($obj); } }
function do_delete() { global $DB; $id = required_param('id', PARAM_INT); $force = optional_param('force', 0, PARAM_INT); $confirm = optional_param('confirm', 0, PARAM_INT); $needconfirm = optional_param('needconfirm', 0, PARAM_INT); if ($DB->count_records(student::TABLE, array('classid' => $id)) && $force != 1 && $confirm != 1) { $this->display('delete'); } else { parent::do_delete(); } }
public function __construct(array $params = null) { $this->tabs = array(array('tab_id' => 'view', 'page' => 'usersetclassificationpage', 'params' => array('action' => 'view'), 'name' => get_string('detail', 'local_elisprogram'), 'showtab' => true), array('tab_id' => 'edit', 'page' => 'usersetclassificationpage', 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit'), array('tab_id' => 'delete', 'page' => 'usersetclassificationpage', 'params' => array('action' => 'delete'), 'name' => get_string('delete_label', 'local_elisprogram'), 'showbutton' => true, 'image' => 'delete')); parent::__construct($params); }
function build_navbar_view($who = null, $id_param = 'id', $extra_params = array()) { $paramname = ''; $curid = $this->get_cm_id(false, $paramname); parent::build_navbar_view(null, 'id', $curid ? array($paramname => $curid) : array()); }
public function __construct($params = false) { $this->tabs = array(array('tab_id' => 'view', 'page' => 'clusterclassificationpage', 'params' => array('action' => 'view'), 'name' => get_string('detail', 'block_curr_admin'), 'showtab' => true), array('tab_id' => 'edit', 'page' => 'clusterclassificationpage', 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'block_curr_admin'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit.gif'), array('tab_id' => 'delete', 'page' => 'clusterclassificationpage', 'params' => array('action' => 'delete'), 'name' => get_string('delete_label', 'block_curr_admin'), 'showbutton' => true, 'image' => 'delete.gif')); parent::__construct($params); }
function action_delete() { $id = required_param('id', PARAM_INT); $force = optional_param('force', 0, PARAM_INT); if (count_records(STUTABLE, 'classid', $id) && $force != 1) { $target = $this->get_new_page(array('action' => 'delete', 'id' => $id, 'force' => 1)); notify(get_string('cmclass_delete_warning', 'block_curr_admin'), 'errorbox'); echo '<center><a href="' . $target->get_url() . '">' . get_string('cmclass_delete_warning_continue', 'block_curr_admin') . '</a></center>'; } else { parent::action_delete(); } }
/** * Overrides the default navigation to include curriculum breadcrumbs if appropriate */ function get_navigation_default() { global $CFG, $CURMAN; $parent = $this->get_cm_id(); $action = $this->optional_param('action', '', PARAM_CLEAN); $cancel = $this->optional_param('cancel', '', PARAM_CLEAN); $navigation = parent::get_navigation_default(); if (empty($parent) || !empty($action) && empty($cancel)) { //not viewing from within curriculum return $navigation; } $curriculumpage = new curriculumpage(array('id' => $parent)); $curriculum_navigation = $curriculumpage->get_navigation_view(); //merge the curriculum and track breadcrumbs return array_merge($curriculum_navigation, $navigation); }
public function __construct(array $params = null) { global $CFG; //tab for the Individual User report //permissions checking happens in the link page if (file_exists($CFG->dirroot . '/local/elisreports/render_report_page.php')) { $report_tab = array('tab_id' => 'report', 'page' => 'linkpage', 'params' => array('linkurl' => 'local/elisreports/render_report_page.php', 'linkparams' => 'report,userid', 'report' => 'individual_user', 'userid' => '=id'), 'name' => get_string('report', 'local_elisprogram'), 'showbutton' => true, 'image' => 'report'); } $this->tabs = array(array('tab_id' => 'view', 'page' => 'userpage', 'params' => array('action' => 'view'), 'name' => get_string('detail', 'local_elisprogram'), 'showtab' => true), array('tab_id' => 'edit', 'page' => 'userpage', 'params' => array('action' => 'edit'), 'name' => get_string('edit', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'edit'), array('tab_id' => 'studentcurriculumpage', 'page' => 'studentcurriculumpage', 'name' => get_string('curricula', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'curriculum'), array('tab_id' => 'userclusterpage', 'page' => 'userclusterpage', 'name' => get_string('clusters', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'cluster'), array('tab_id' => 'usertrackpage', 'page' => 'usertrackpage', 'name' => get_string('tracks', 'local_elisprogram'), 'showtab' => true, 'showbutton' => true, 'image' => 'track'), array('tab_id' => 'user_rolepage', 'page' => 'user_rolepage', 'name' => get_string('roles', 'role'), 'showtab' => true, 'showbutton' => false, 'image' => 'tag'), array('tab_id' => 'delete', 'page' => 'userpage', 'params' => array('action' => 'delete'), 'name' => get_string('delete', 'local_elisprogram'), 'showbutton' => true, 'image' => 'delete')); //tab for the Individual User report //permissions checking happens in the link page if (file_exists($CFG->dirroot . '/local/elisreports/render_report_page.php')) { //script for rendering report pages exists in report block, so reports //are at least installed $report_tab = array('tab_id' => 'report', 'page' => 'induserlinkpage', 'params' => array('linkurl' => 'local/elisreports/render_report_page.php', 'linkparams' => 'report,userid', 'report' => 'individual_user', 'userid' => '=id'), 'name' => get_string('report', 'local_elisprogram'), 'showbutton' => true, 'image' => 'report'); $this->tabs[] = $report_tab; } parent::__construct($params); }