block-community MDL-19314 Tweaked image gallery CSS and added a firstimageonly property

This commit is contained in:
Sam Hemelryk 2010-06-04 02:46:25 +00:00
parent dad55fc5b3
commit af7c1e29ab
5 changed files with 17 additions and 6 deletions

View File

@ -171,7 +171,9 @@ class block_community_renderer extends plugin_renderer_base {
'alt' => $course->fullname
);
}
$screenshothtml = $this->output->render(new image_gallery($images, $course->shortname));
$imagegallery = new image_gallery($images, $course->shortname);
$imagegallery->displayfirstimageonly = true;
$screenshothtml = $this->output->render($imagegallery);
}
$table->data[] = array($coursenamehtml, $deschtml, $screenshothtml, $language, $addbuttonhtml);
}

View File

@ -23,7 +23,4 @@
#page-blocks-community-communitycourse .prioritisetr {background-color: #ffd4ff;}
#page-blocks-community-communitycourse .additionaldesc {font-size: 80%; color: #aa6666;}
#page-blocks-community-communitycourse .additionaladmindesc {font-size: 80%; color: #6666ff;}
#page-blocks-community-communitycourse .blockdescription {font-size: 80%; color: #555555;}
.path-blocks-community .image_gallery a.imagelink {display:none;}
.path-blocks-community .image_gallery a#imagelink1 {display:inline;}
#page-blocks-community-communitycourse .blockdescription {font-size: 80%; color: #555555;}

View File

@ -2411,6 +2411,11 @@ class image_gallery implements renderable {
*/
public $grouping = null;
/**
* If set to true only the first image is visible.
*/
public $displayfirstimageonly = false;
/**
* Constructs an image gallery component
* @param array $images

View File

@ -2611,7 +2611,11 @@ NONJS;
if (count($imagegallery->images) == 0) {
return '';
}
$content = html_writer::start_tag('div', array('class'=>'image_gallery'));
$classes = array('image_gallery');
if ($imagegallery->displayfirstimageonly) {
$classes[] = 'oneimageonly';
}
$content = html_writer::start_tag('div', array('class'=>join(' ', $classes)));
foreach ($imagegallery->images as $image) {
$content .= html_writer::tag('a', html_writer::empty_tag('img', $image->thumb), $image->link);
}

View File

@ -588,3 +588,6 @@ body.tag .managelink {padding: 5px;}
.smartselect.compactmenu .smartselect_menu {z-index: 1000;overflow:hidden;}
.smartselect.compactmenu .smartselect_submenu .smartselect_submenu {z-index: 1020;}
.smartselect.compactmenu .smartselect_submenuitem:hover > .smartselect_menuitem_label {font-weight:bold;}
.image_gallery.oneimageonly a.imagelink {display:none;}
.image_gallery.oneimageonly a#imagelink1 {display:inline;}