Commit 1a81d018 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1794912: Fixing W3.org validation issues"

parents 5ff1cd31 e858c032
......@@ -436,6 +436,7 @@ $siteoptionform = array(
'type' => 'passwordpolicy',
'minlength' => 8,
'maxlength' => 20,
'nolabel' => true,
'title' => get_string('passwordpolicy', 'admin'),
'description' => get_string('passwordpolicydesc', 'admin'),
'defaultvalue' => get_config('passwordpolicy'),
......
......@@ -127,7 +127,7 @@ if ($artefact->get('artefacttype') == 'folder') {
$rendered = $artefact->render_self($options);
$content = '';
if (!empty($rendered['javascript'])) {
$content = '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$content = '<script>' . $rendered['javascript'] . '</script>';
}
$content .= $rendered['html'];
......
......@@ -248,7 +248,7 @@ class PluginBlocktypeTaggedposts extends MaharaCoreBlocktype {
$rendered = $artefact->render_self(array('viewid' => $view, 'details' => true, 'blockid' => $instance->get('id')));
$result->html = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result->html .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result->html .= '<script>' . $rendered['javascript'] . '</script>';
}
$attachments = $rendered['attachments'];
if (!empty($attachments)) {
......
......@@ -153,6 +153,7 @@ $string['Type'] = 'Type';
$string['profileinformation'] = 'Profile information';
$string['profilepage'] = 'Profile page';
$string['profileimagefor'] = 'Profile picture for %s';
$string['viewprofilepage'] = 'View profile page';
$string['viewallprofileinformation'] = 'View all profile information';
......
......@@ -44,7 +44,7 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
$rendered = $resumefield->render_self(array('viewid' => $instance->get('view')));
$result = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result .= '<script>' . $rendered['javascript'] . '</script>';
}
$smarty->assign($artefact->artefacttype, $result);
}
......
......@@ -54,7 +54,7 @@ class PluginBlocktypeResumefield extends MaharaCoreBlocktype {
$rendered = $resumefield->render_self($configdata);
$result = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result .= '<script>' . $rendered['javascript'] . '</script>';
}
$smarty->assign('content', $result);
}
......
......@@ -1554,7 +1554,7 @@ function get_login_form_js($form) {
$strcookiesnotenabled = json_encode(get_string('cookiesnotenabled'));
$cookiename = get_config('cookieprefix') . 'ctest';
$js = <<< EOF
<script type="application/javascript">
<script>
var loginbox = jQuery('#loginform_container');
document.cookie = "$cookiename=1";
if (document.cookie) {
......
......@@ -1052,7 +1052,7 @@ class PluginAuthSaml extends PluginAuth {
$entityidps = array('new' => get_string('newidpentity', 'auth.saml')) + $entityidps;
$idpselectjs = <<< EOF
<script type="application/javascript">
<script>
jQuery(function($) {
function update_idp_label(idp) {
......
......@@ -1377,6 +1377,9 @@ class BlockInstance {
if (preg_match('/<script type="(text|application)\/javascript">(new Pieform\(.*\);)<\/script>/', $html, $matches)) {
$js = "var pf_{$form['name']} = " . $matches[2] . "pf_{$form['name']}.init();";
}
else if (preg_match('/<script>(new Pieform\(.*\);)<\/script>/', $html, $matches)) {
$js = "var pf_{$form['name']} = " . $matches[1] . "pf_{$form['name']}.init();";
}
else {
$js = '';
}
......
......@@ -48,7 +48,7 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
$items['tablerows'] = $smarty->fetch($template);
if ($items['limit'] && $pagination) {
if ($items['count'] && $items['limit'] && $pagination) {
$pagination = build_pagination(array(
'id' => $pagination['id'],
'class' => 'center',
......
......@@ -552,7 +552,7 @@ $cfg->plugin_search_elasticsearch_redolimit = '500';
* to use a PHP nowdoc: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc
*/
// $cfg->additionalhtmlhead = <<<'HTML'
// <script type="application/javascript">
// <script>
// var _gaq = _gaq || [];
// _gaq.push(['_setAccount', 'UA-XXXXX-X']);
// _gaq.push(['_trackPageview']);
......
......@@ -64,14 +64,14 @@ function get_cookieconsent_code() {
return <<<CODE
<!-- Begin Cookie Consent plugin by Silktide - https://cookieconsent.insites.com/ -->
{$stylesheets}
<script type="application/javascript">
<script>
jQuery(function() {
window.cookieconsent.initialise(
{$initialisation}
);
});
</script>
<script type="application/javascript" src="{$wwwroot}js/cookieconsent/cookieconsent.min.js"></script>
<script src="{$wwwroot}js/cookieconsent/cookieconsent.min.js"></script>
<!-- End Cookie Consent plugin -->
CODE;
}
......@@ -89,6 +89,6 @@ EOF;
}
function pieform_element_authlist_get_headdata() {
$result = '<script type="application/javascript">' . pieform_element_authlist_js() . "</script>";
$result = '<script>' . pieform_element_authlist_js() . "</script>";
return array($result);
}
......@@ -162,7 +162,7 @@ function pieform_element_autocomplete_get_headdata() {
$lang = pieform_element_autocomplete_language();
$langfile = '';
if ($lang != 'en') {
$langfile = '<script type="application/javascript" src="' .
$langfile = '<script src="' .
get_config('wwwroot') . "js/select2/i18n/{$lang}.js" .
'"></script>';
}
......
......@@ -92,6 +92,6 @@ EOF;
}/*}}}*/
function pieform_element_checkboxes_get_headdata() {/*{{{*/
$result = '<script type="application/javascript">' . pieform_element_checkboxes_js() . "\n</script>";
$result = '<script>' . pieform_element_checkboxes_js() . "\n</script>";
return array($result);
}/*}}}*/
......@@ -30,7 +30,7 @@ function pieform_element_color(Pieform $form, $element) {
// Transparency optional control
if ($transparent) {
$optional = <<<EOF
<script type="application/javascript">
<script>
var {$baseid}_oldval = '';
function {$baseid}_toggle(x) {
if ( x.checked ) {
......@@ -119,7 +119,7 @@ function pieform_element_color_get_value(Pieform $form, $element) {
function pieform_element_color_get_headdata($element, Pieform $form) {
$libfile = get_config('wwwroot') . 'js/jscolor/jscolor.js';
$name = $form->get_property('name') . '_' . $element['name'];
$result = '<script type="application/javascript">';
$result = '<script>';
$result .= "var initjscolor = false; \n";
$result .= "PieformManager.connect('onload', null, function() {\n";
$result .= " jQuery(function($) { \n";
......@@ -132,7 +132,7 @@ function pieform_element_color_get_headdata($element, Pieform $form) {
$result .= " }); \n";
$result .= "});</script>";
$results = array(
'<script type="application/javascript" src="' . $libfile . '"></script>',
'<script src="' . $libfile . '"></script>',
$result
);
return $results;
......
......@@ -1588,13 +1588,13 @@ function pieform_element_filebrowser_views_js(Pieform $form, $element) {
function pieform_element_filebrowser_get_headdata($element) {
global $THEME;
// TODO : need a better dependancy injection, jquery ui might be also inserted by other scripts ...
$headdata = array('<script type="application/javascript" src="' . get_config('wwwroot') . 'js/jquery/jquery-ui/js/jquery-ui.min.js"></script>',
'<script type="application/javascript" src="' . get_config('wwwroot') . 'artefact/file/js/filebrowser.js"></script>');
$headdata = array('<script src="' . get_config('wwwroot') . 'js/jquery/jquery-ui/js/jquery-ui.min.js"></script>',
'<script src="' . get_config('wwwroot') . 'artefact/file/js/filebrowser.js"></script>');
if ($element['config']['upload']) {
// only add dropzone if filebrowser is allowed to upload
$headdata[] = '<script type="application/javascript" src="' . get_config('wwwroot') . 'js/dropzone/dropzone.min.js"></script>';
$headdata[] = '<script src="' . get_config('wwwroot') . 'js/dropzone/dropzone.min.js"></script>';
$headdata[] = '<link href="' . get_config('wwwroot') . 'js/dropzone/css/dropzone.css" type="text/css" rel="stylesheet">';
$headdata[] = '<script type="application/javascript" src="' . get_config('wwwroot') . 'artefact/file/js/filedropzone.js"></script>';
$headdata[] = '<script src="' . get_config('wwwroot') . 'artefact/file/js/filedropzone.js"></script>';
}
if ($element['config']['edit']) {
// Add switchbox css if filebrowser is allowed to edit
......@@ -1608,7 +1608,7 @@ function pieform_element_filebrowser_get_headdata($element) {
$jsstrings .= "strings.$s=" . json_encode(get_raw_string($s, $section)) . ';';
}
}
$headdata[] = '<script type="application/javascript">' . $jsstrings . '</script>';
$headdata[] = '<script>' . $jsstrings . '</script>';
$pluginsheets = $THEME->get_url('style/style.css', true, 'artefact/file');
foreach (array_reverse($pluginsheets) as $sheet) {
......
......@@ -119,7 +119,7 @@ function pieform_element_layout(Pieform $form, $element) {
// close 'createcustomlayout_container' container
$output .= '</div>';
$output .= '<script type="application/javascript">
$output .= '<script>
$( window ).on( "load", function() {
init(\'' . $form->get_property('name') . '\');
});</script>';
......@@ -128,6 +128,6 @@ function pieform_element_layout(Pieform $form, $element) {
}
function pieform_element_layout_get_headdata($element) {
$result = '<script src="' . get_config('wwwroot') . 'js/customlayout.js?v=' . get_config('cacheversion', 0) . '" type="application/javascript"></script>';
$result = '<script src="' . get_config('wwwroot') . 'js/customlayout.js?v=' . get_config('cacheversion', 0) . '"></script>';
return array($result);
}
......@@ -93,9 +93,9 @@ function pieform_element_ratings_get_headdata($element) {
$jsstrings .= "strings.$s=" . json_encode(get_raw_string($s, $section)) . ';';
}
}
$headdata[] = '<script type="application/javascript">' . $jsstrings . '</script>';
$headdata[] = '<script>' . $jsstrings . '</script>';
$libfile = get_config('wwwroot') . 'js/bootstrap-ratings.js';
$headdata[] = '<script type="application/javascript" src="' . $libfile . '"></script>';
$headdata[] = '<script src="' . $libfile . '"></script>';
return $headdata;
}
......@@ -81,7 +81,7 @@ function pieform_element_switchbox_labeltext($element){
function pieform_element_switchbox_get_headdata($element) {
$libfile = get_config('wwwroot') . 'js/switchbox.js';
$scripts = array();
$scripts[] = '<script type="application/javascript" src="' . $libfile . '"></script>';
$scripts[] = '<script src="' . $libfile . '"></script>';
return $scripts;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment