mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
community block MDL-25141 hub description is now format in FORMAT_PLAIN + xhtml strict code + remove BR tags
This commit is contained in:
parent
215d7cb84e
commit
2031735b1b
@ -138,7 +138,6 @@ class community_hub_search_form extends moodleform {
|
|||||||
//TODO: sort hubs by trusted/prioritize
|
//TODO: sort hubs by trusted/prioritize
|
||||||
//Public hub list
|
//Public hub list
|
||||||
$options = array();
|
$options = array();
|
||||||
$brtag = html_writer::empty_tag('br');
|
|
||||||
$firsthub = false;
|
$firsthub = false;
|
||||||
foreach ($hubs as $hub) {
|
foreach ($hubs as $hub) {
|
||||||
if (key_exists('id', $hub)) {
|
if (key_exists('id', $hub)) {
|
||||||
@ -149,30 +148,27 @@ class community_hub_search_form extends moodleform {
|
|||||||
$ascreenshothtml = html_writer::empty_tag('img',
|
$ascreenshothtml = html_writer::empty_tag('img',
|
||||||
array('src' => $imgurl, 'alt' => $hub['name']));
|
array('src' => $imgurl, 'alt' => $hub['name']));
|
||||||
|
|
||||||
$hubdescription = ' ' . html_writer::tag('a', $hub['name'],
|
$hubdescription = html_writer::tag('a', $hub['name'],
|
||||||
array('class' => 'hublink', 'href' => $hub['url'],
|
array('class' => 'hublink clearfix', 'href' => $hub['url'],
|
||||||
'onclick' => 'this.target="_blank"'));
|
'onclick' => 'this.target="_blank"'));
|
||||||
$hubdescription .= $brtag;
|
|
||||||
$hubdescription .= html_writer::tag('span', $ascreenshothtml,
|
$hubdescription .= html_writer::tag('span', $ascreenshothtml,
|
||||||
array('class' => 'hubscreenshot'));
|
array('class' => 'hubscreenshot'));
|
||||||
$hubdescription .= html_writer::tag('span', $hub['description'],
|
$hubdescription .= html_writer::tag('span', format_text($hub['description'], FORMAT_PLAIN),
|
||||||
array('class' => 'hubdescription'));
|
array('class' => 'hubdescription'));
|
||||||
$hubdescription .= $brtag;
|
|
||||||
$additionaldesc = get_string('sites', 'block_community') . ': ' . $hub['sites'] . ' - ' .
|
$additionaldesc = get_string('sites', 'block_community') . ': ' . $hub['sites'] . ' - ' .
|
||||||
get_string('courses', 'block_community') . ': ' . $hub['courses'];
|
get_string('courses', 'block_community') . ': ' . $hub['courses'];
|
||||||
$hubdescription .= html_writer::tag('span', $additionaldesc,
|
$hubdescription .= html_writer::tag('span', $additionaldesc,
|
||||||
array('class' => 'hubadditionaldesc'));
|
array('class' => 'hubadditionaldesc'));
|
||||||
$hubdescription .= $brtag;
|
$hubtrusted = $hub['trusted'] ? get_string('hubtrusted', 'block_community') :
|
||||||
|
get_string('hubnottrusted', 'block_community');
|
||||||
$hubdescription .= html_writer::tag('span',
|
$hubdescription .= html_writer::tag('span',
|
||||||
$hub['trusted'] ? get_string('hubtrusted', 'block_community') :
|
$hubtrusted . ' ' . $OUTPUT->doc_link('trusted_hubs'),
|
||||||
get_string('hubnottrusted', 'block_community'),
|
|
||||||
array('class' => $hub['trusted'] ? 'trusted' : 'nottrusted'));
|
array('class' => $hub['trusted'] ? 'trusted' : 'nottrusted'));
|
||||||
|
|
||||||
$hubdescription = html_writer::tag('span',
|
$hubdescription = html_writer::tag('span',
|
||||||
$hubdescription,
|
$hubdescription,
|
||||||
array('class' => $hub['trusted'] ? 'hubtrusted' : 'hubnottrusted'));
|
array('class' => $hub['trusted'] ? 'hubtrusted' : 'hubnottrusted'));
|
||||||
$hubdescription .= ' ' . $OUTPUT->doc_link('trusted_hubs');
|
|
||||||
} else {
|
} else {
|
||||||
$hubdescription = ' ';
|
|
||||||
$hubdescription .= html_writer::tag('a', $hub['name'],
|
$hubdescription .= html_writer::tag('a', $hub['name'],
|
||||||
array('class' => 'hublink', 'href' => $hub['url']));
|
array('class' => 'hublink', 'href' => $hub['url']));
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,19 @@
|
|||||||
|
|
||||||
/* HUB SELECTOR */
|
/* HUB SELECTOR */
|
||||||
#page-blocks-community-communitycourse .hubscreenshot {float: left; }
|
#page-blocks-community-communitycourse .hubscreenshot {float: left; }
|
||||||
#page-blocks-community-communitycourse .hubdescription {color: #003333;font-size: 95%;}
|
#page-blocks-community-communitycourse .hubdescription {
|
||||||
#page-blocks-community-communitycourse .hubadditionaldesc {color: #666666;font-size: 90%;}
|
color: #003333;
|
||||||
|
font-size: 95%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
#page-blocks-community-communitycourse .hubadditionaldesc {
|
||||||
|
color: #666666;
|
||||||
|
font-size: 90%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
#page-blocks-community-communitycourse .hubscreenshot {margin-right: 10px;}
|
#page-blocks-community-communitycourse .hubscreenshot {margin-right: 10px;}
|
||||||
#page-blocks-community-communitycourse .nottrusted {}
|
#page-blocks-community-communitycourse .nottrusted {}
|
||||||
#page-blocks-community-communitycourse .hubtrusted {}
|
#page-blocks-community-communitycourse .hubtrusted {display:inline;}
|
||||||
#page-blocks-community-communitycourse .hubnottrusted {}
|
#page-blocks-community-communitycourse .hubnottrusted {}
|
||||||
#page-blocks-community-communitycourse .trustedtr {background-color: #ffe1c3;}
|
#page-blocks-community-communitycourse .trustedtr {background-color: #ffe1c3;}
|
||||||
#page-blocks-community-communitycourse .prioritisetr {background-color: #ffd4ff;}
|
#page-blocks-community-communitycourse .prioritisetr {background-color: #ffd4ff;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user