silverstripe-gallery 

silverstripe-gallery Git Source Tree

Root/code/GalleryPage.php

1<?php
2
3class GalleryPage extends CarouselPage {
4
5 private static $icon = 'gallery/img/image.png';
6 private static $db = array(
7 'ThumbnailWidth' => 'Int default(64)',
8 'ThumbnailHeight' => 'Int default(64)',
9 );
10 private static $defaults = array(
11 // Override the carousel default height to provide
12 // a height value more suitable to galleries
13 'Height' => 400,
14 'ThumbnailWidth' => 64,
15 'ThumbnailHeight' => 64,
16 );
17
18 public function getSettingsFields() {
19 $fields = parent::getSettingsFields();
20
21 // Promove the CarouselPage settings to GalleryPage
22 $field = $fields->fieldByName('Root.Settings.Carousel');
23 $field->setTitle(_t('GalleryPage.SINGULARNAME'));
24 $field->push(TextField::create('ThumbnailWidth', _t('GalleryPage.db_ThumbnailWidth')));
25 $field->push(TextField::create('ThumbnailHeight', _t('GalleryPage.db_ThumbnailHeight')));
26
27 return $fields;
28 }
29}
30
31class GalleryPage_Controller extends CarouselPage_Controller {
32}

Archive Download this file