# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: moodle/lib/outputcomponents.php --- moodle/lib/outputcomponents.php Base (1.152) +++ moodle/lib/outputcomponents.php Locally Modified (Based On 1.152) @@ -2378,98 +2378,3 @@ return ($itema > $itemb) ? +1 : -1; } } - -/** - * Image gallery component - * - * This is the image gallery component that can be used to display several images - * and if JavaScript is enabled uses the gallery-lightbox YUI module to display - * them within a lightbox with appropriate controls and such. - * - * Lib / YUI Module location: lib/gallery/20100601/ - * - * @copyright 2010 Sam Hemelryk - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 - */ -class image_gallery implements renderable { - - /** - * Used to ensure we only initialise the lightbox once... it is shared - * @var bool - */ - protected static $jsinit = false; - /** - * An array of images - * @var array - */ - public $images = array(); - /** - * The grouping to apply in the lightbox - * @var string - */ - public $grouping = null; - - /** - * If set to true only the first image is visible. - */ - public $displayfirstimageonly = false; - - /** - * Constructs an image gallery component - * @param array $images - * @param string $grouping - */ - public function __construct(array $images=null, $grouping=null) { - $this->grouping = $grouping; - if (is_array($images)) { - foreach ($images as $image) { - $image = (array)$image; - if (!array_key_exists('imageurl', $image)) { - throw new coding_exception('Image gallery images must specify a url for every image'); - } - if (!array_key_exists('thumburl', $image)) { - throw new coding_exception('Image gallery images must specify a url for every image'); - } - if (!array_key_exists('title', $image)) { - throw new coding_exception('Image gallery images must specify a title for every image'); - } - if (!array_key_exists('alt', $image)) { - $image['alt'] = null; - } - if (!array_key_exists('attributes', $image)) { - $image['attributes'] = null; - } - $this->add_image($image['thumburl'], $image['imageurl'], $image['title'], $image['alt'], $image['attributes']); - } - } - } - /** - * Adds an image to the gallery - * - * @param moodle_url|string $thumburl - * @param moodle_url|string $imageurl - * @param string $title - * @param string $alt - * @param array $attributes - */ - public function add_image($thumburl, $imageurl, $title, $alt=null, array $attributes=null) { - $image = new stdClass; - $image->link = array('id'=>'imagelink'.(count($this->images)+1), 'class'=>'imagelink'); - $image->thumb = array('id'=>'imagethumb'.(count($this->images)+1), 'class'=>'imagethumb'); - if (is_array($attributes)) { - $image->link = $attributes; - } - $image->link['href'] = new moodle_url($imageurl); - $image->link['title'] = $title; - $image->link['rel'] = 'lightbox'; - if ($this->grouping !== null) { - $image->link['rel'] .= "[{$this->grouping}]"; - } - - $image->thumb['src'] = new moodle_url($thumburl); - $image->thumb['alt'] = $alt; - - $this->images[] = $image; - } -} Index: moodle/lib/outputrenderers.php --- moodle/lib/outputrenderers.php Base (1.262) +++ moodle/lib/outputrenderers.php Locally Modified (Based On 1.262) @@ -2558,31 +2558,7 @@ // Return the sub menu return $content; } - - /** - * Renders the image_gallery component and initialises its JavaScript - * - * @param image_gallery $imagegallery - * @return string - */ - protected function render_image_gallery(image_gallery $imagegallery) { - $this->page->requires->yui_module(array('gallery-lightbox','gallery-lightbox-skin'), - 'Y.Lightbox.init', null, '2010.04.08-12-35'); - if (count($imagegallery->images) == 0) { - return ''; } - $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); - } - $content .= html_writer::end_tag('div'); - return $content; - } -} /// RENDERERS Index: moodle/theme/base/style/core.css --- moodle/theme/base/style/core.css Base (1.69) +++ moodle/theme/base/style/core.css Locally Modified (Based On 1.69) @@ -586,10 +586,6 @@ .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;} -.mform .image_gallery.oneimageonly a.imagelink {float:left;} - /** * Registration */