The method is used to create galleries from one or more images.

Example 1.

[View]
$gallery_pars = array();
$gallery_pars['children'] = array();
//--- image 1
$image = array();
$image['src'] = media_link('d0123b5368a11f8fed76');
$image['caption'] = 'My caption for image 1';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('011ab21242e86e7d7635');
$image['caption'] = 'My caption for image 2';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('3e1861d3864ba55b27a8');
$image['caption'] = 'My caption for image 3';
$gallery_pars['children'][] = $image;
//===
$str .= ui::gallery($gallery_pars);

Example 2.

[My text for preview block]
$gallery_pars = array();
$gallery_pars['children'] = array();
$gallery_pars['preview_text'] = 'My text for preview block';
$gallery_pars['preview_first_only'] = true;
//--- image 1
$image = array();
$image['src'] = media_link('d0123b5368a11f8fed76');
$image['caption'] = 'My caption for image 1';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('011ab21242e86e7d7635');
$image['caption'] = 'My caption for image 2';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('3e1861d3864ba55b27a8');
$image['caption'] = 'My caption for image 3';
$gallery_pars['children'][] = $image;
//===
$str .= ui::gallery($gallery_pars);
$gallery_pars = array();
$gallery_pars['children'] = array();
$gallery_pars['preview_text'] = false;
$gallery_pars['preview_max_width'] = 400;
$gallery_pars['preview_max_height'] = 100;
//--- image 1
$image = array();
$image['src'] = media_link('d0123b5368a11f8fed76');
$image['caption'] = 'My caption for image 1';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('011ab21242e86e7d7635');
$image['caption'] = 'My caption for image 2';
$gallery_pars['children'][] = $image;
//--- image 2
$image = array();
$image['src'] = media_link('3e1861d3864ba55b27a8');
$image['caption'] = 'My caption for image 3';
$image['text'] = 'Preview text image 3';
$gallery_pars['children'][] = $image;
//===
$str .= ui::gallery($gallery_pars);