Skip to content
Snippets Groups Projects
Commit 871e7923 authored by Luca Bösch's avatar Luca Bösch
Browse files

Adding "Course Life Cycle" link to course administration fixes #17.

parent 7ec771d4
Branches
Tags
No related merge requests found
...@@ -41,3 +41,54 @@ define('ACTION_WORKFLOW_INSTANCE_FROM', 'workflow_instance_form'); ...@@ -41,3 +41,54 @@ define('ACTION_WORKFLOW_INSTANCE_FROM', 'workflow_instance_form');
define('ACTION_WORKFLOW_DELETE', 'workflow_instance_delete'); define('ACTION_WORKFLOW_DELETE', 'workflow_instance_delete');
define('ACTION_WORKFLOW_DUPLICATE', 'workflow_instance_duplicate'); define('ACTION_WORKFLOW_DUPLICATE', 'workflow_instance_duplicate');
define('ACTION_WORKFLOW_ACTIVATE', 'workflow_instance_activate'); define('ACTION_WORKFLOW_ACTIVATE', 'workflow_instance_activate');
/**
* Adds a tool_lifecycle link to the course admin menu.
*
* @param navigation_node $navigation The navigation node to extend
* @param stdClass $course The course to object for the tool
* @param context $context The context of the course
* @return void|null return null if we don't want to display the node.
*/
function tool_lifecycle_extend_navigation_course($navigation, $course, $context) {
global $PAGE;
// Only add this settings item on non-site course pages.
if (!$PAGE->course || $PAGE->course->id == SITEID) {
return null;
}
$url = null;
$settingnode = null;
$url = new moodle_url('/admin/tool/lifecycle/view.php', array(
'contextid' => $context->id
));
// Add the course life cycle link.
$pluginname = get_string('plugintitle', 'tool_lifecycle');
$node = navigation_node::create(
$pluginname,
$url,
navigation_node::NODETYPE_LEAF,
'tool_lifecycle',
'tool_lifecycle',
new pix_icon('recycle', $pluginname, 'tool_lifecycle')
);
if ($PAGE->url->compare($url, URL_MATCH_BASE)) {
$node->make_active();
}
$navigation->add_node($node);
}
/**
* Map icons for font-awesome themes.
*/
function tool_lifecycle_get_fontawesome_icon_map() {
return [
'tool_lifecycle:recycle' => 'fa-recycle'
];
}
\ No newline at end of file
<svg aria-hidden="true" data-prefix="fas" data-icon="recycle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-recycle fa-w-16 fa-2x"><path fill="#999" d="M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z" class=""></path></svg>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment