diff --git a/admin/tool/mobile/lib.php b/admin/tool/mobile/lib.php new file mode 100644 index 00000000000..9717c5372d9 --- /dev/null +++ b/admin/tool/mobile/lib.php @@ -0,0 +1,45 @@ +. + +/** + * Lib functions, mostly callbacks. + * + * @package tool_mobile + * @copyright 2017 Juan Leyva + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * Callback to add head elements. + * + * @return str valid html head content + * @since Moodle 3.3 + */ +function tool_mobile_before_standard_html_head() { + global $CFG, $PAGE; + $output = ''; + // Smart App Banners meta tag is only displayed if mobile services are enabled and configured. + if (!empty($CFG->enablemobilewebservice)) { + $mobilesettings = get_config('tool_mobile'); + if (!empty($mobilesettings->enablesmartappbanners) and !empty($mobilesettings->iosappid)) { + $output .= ''; + } + } + return $output; +} diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 5495f90cb33..2385e7ada75 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -592,15 +592,6 @@ class core_renderer extends renderer_base { $output .= ''; } - // Smart App Banners meta tag is only displayed if mobile services are enabled and configured. - if (!empty($CFG->enablemobilewebservice)) { - $mobilesettings = get_config('tool_mobile'); - if (!empty($mobilesettings->enablesmartappbanners) and !empty($mobilesettings->iosappid)) { - $output .= ''; - } - } - // Set up help link popups for all links with the helptooltip class $this->page->requires->js_init_call('M.util.help_popups.setup');