19/08/2012 11:34am

PHP | Problem - GalleryPage.php


<?php

class GalleryPage extends Page {
static $db = array(
);

static $has_many = array(
'Images' => 'ImageResource'
);

function getCMSFields() {
$fields = parent::getCMSFields();

// GridField for Events
$config = GridFieldConfig::create()->addComponents(
new GridFieldToolbarHeader(),
new GridFieldAddNewButton('toolbar-header-right'),
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(10),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
new GridFieldDetailForm()
);


$gridfield = GridField::create(
'Images',
_t('GalleryPage.IMAGELIST','Imagelist'),
$this->Images(),
$config
);

$fields->addFieldToTab("Root.Images", $gridfield); // add the grid field to a tab in the CMS


return $fields;
}



}

class GalleryPage_Controller extends Page_Controller {

}

?>


Post Comment