Created
November 20, 2018 09:06
-
-
Save marxjohnson/3abc5e2abecd62b0ed330972ba3a4f13 to your computer and use it in GitHub Desktop.
Course format core-context-menu-item example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace format_oustudyplan\output; | |
defined('MOODLE_INTERNAL') || die(); | |
class mobile { | |
public static function mobile_course_view($args) { | |
global $OUTPUT; | |
$html = $OUTPUT->render_from_template('format_example/mobile'); | |
return [ | |
'templates' => [ | |
[ | |
'id' => 'main', | |
'html' => $html | |
] | |
] | |
]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('MOODLE_INTERNAL') || die(); | |
$addons = [ | |
'format_example' => [ // Plugin identifier. | |
'handlers' => [ // Different places where the plugin will display content. | |
'example' => [ // Handler unique name (alphanumeric). | |
'delegate' => 'CoreCourseFormatDelegate', // Delegate (where to display the link to the plugin) | |
'method' => 'mobile_course_view', // Main function in \format_oustudyplan\output\mobile. | |
] | |
] | |
] | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{=<% %>=}} | |
<core-navbar-buttons> | |
<core-context-menu> | |
<core-context-menu-item [priority]="900" content="link" iconAction="open" autoLogin="no" href="http://example.com"> | |
</core-context-menu-item> | |
</core-context-menu> | |
</core-navbar-buttons> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment