Skip to content
Snippets Groups Projects
Commit 8269441f authored by root's avatar root
Browse files

initialisation plugin admincompetences - fonctionnel

parents
No related branches found
No related tags found
No related merge requests found
<?php
$string['pluginname'] = 'Admin competencies';
<?php
$string['pluginname'] = 'Admin compétences du cours';
lib.php 0 → 100644
<?php
/**
* @category UCN
* @package admincompetences
*
* @author CEMU UCN - Anne Garnavault - anne.remy@unicaen.fr
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @link
*/
/**
* Add a link in settings for selected users.
*
* @param array $settings
* @param object $context
* @return void
*/
function local_admincompetences_extend_settings_navigation($settingsnav, $context) {
global $CFG, $PAGE;
// Only add this settings item on non-site course pages.
if (!$PAGE->course or $PAGE->course->id == 1) {
return;
}
// Only let users with the appropriate capability see this settings item.
if (!has_capability('moodle/competency:coursecompetencymanage', context_course::instance($PAGE->course->id))) {
return;
}
// IF we're viewing course and the course is not the front page
// add the link
if ($settingnode = $settingsnav->find('courseadmin', navigation_node::TYPE_COURSE))
{
$strfoo = get_string('competencies', 'competency');
$url = new moodle_url('/admin/tool/lp/coursecompetencies.php',array('courseid' => $PAGE->course->id));
$foonode = navigation_node::create(
$strfoo,
$url,
navigation_node::NODETYPE_LEAF,
'admincompetences',
'admincompetences'
, new pix_icon('i/competencies', $strfoo)
);
if ($PAGE->url->compare($url, URL_MATCH_BASE)) {
$foonode->make_active();
}
$settingnode->add_node($foonode);
}
}
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Local plugin "admincompetences" - Version file
*
* @package local_admincompetences
* @copyright 2018 Anne Garnavault, Université de Caen Normadie (FR) <anne.remy@unicaen.fr>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018050700; // The (date) version of this module + 2 extra digital for daily versions
// This version number is displayed into /admin/forms.php
$plugin->requires = 2016120500; // Requires this Moodle version - at least 2.0
$plugin->cron = 0;
$plugin->component = 'local_admincompetences';
$plugin->release = '1.0';
$plugin->maturity = MATURITY_BETA;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment