Merge remote-tracking branch 'origin/master' into translation-staging

This commit is contained in:
Ingo Schommer 2012-07-18 15:01:42 +02:00
commit 488845879a
7 changed files with 22 additions and 18 deletions

View File

@ -146,7 +146,8 @@ JS
new GridFieldPaginator(15), new GridFieldPaginator(15),
new GridFieldEditButton(), new GridFieldEditButton(),
new GridFieldDeleteAction(), new GridFieldDeleteAction(),
new GridFieldDetailForm() new GridFieldDetailForm(),
GridFieldLevelup::create($folder->ID)->setLinkSpec('admin/assets/show/%d')
); );
$gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig); $gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig);

View File

@ -669,14 +669,16 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function ListViewForm() { public function ListViewForm() {
$params = $this->request->requestVar('q'); $params = $this->request->requestVar('q');
$list = $this->getList($params, $parentID = $this->request->requestVar('ParentID')); $list = $this->getList($params, $parentID = $this->request->requestVar('ParentID'));
$gridFieldConfig = GridFieldConfig::create()->addComponents( $gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldSortableHeader(), new GridFieldSortableHeader(),
new GridFieldDataColumns(), new GridFieldDataColumns(),
new GridFieldPaginator(15) new GridFieldPaginator(15)
); );
if($parentID){ if($parentID){
$gridFieldConfig->addComponent( $gridFieldConfig->addComponent(
new GridFieldLevelup($parentID) GridFieldLevelup::create($parentID)
->setLinkSpec('?ParentID=%d&view=list')
->setAttributes(array('data-pjax' => 'ListViewForm,Breadcrumbs'))
); );
} }
$gridField = new GridField('Page','Pages', $list, $gridFieldConfig); $gridField = new GridField('Page','Pages', $list, $gridFieldConfig);
@ -695,8 +697,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$columns->setDisplayFields($fields); $columns->setDisplayFields($fields);
$columns->setFieldCasting(array( $columns->setFieldCasting(array(
'Created' => 'Date->Ago', 'Created' => 'Datetime->Ago',
'LastEdited' => 'Date->Ago', 'LastEdited' => 'Datetime->Ago',
)); ));
$controller = $this; $controller = $this;

View File

@ -122,7 +122,9 @@ class CMSPageAddController extends CMSPageEditController {
} }
$record = $this->getNewItem("new-$className-$parentID".$suffix, false); $record = $this->getNewItem("new-$className-$parentID".$suffix, false);
if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale']; if(class_exists('Translatable') && $record->hasExtension('Translatable') && isset($data['Locale'])) {
$record->Locale = $data['Locale'];
}
try { try {
$record->write(); $record->write();

View File

@ -25,8 +25,6 @@ class RedirectorPage extends Page {
static $many_many = array( static $many_many = array(
); );
static $allowed_children = array();
/** /**
* Returns this page if the redirect is external, otherwise * Returns this page if the redirect is external, otherwise
* returns the target page. * returns the target page.

View File

@ -2704,8 +2704,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR; if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR; if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;
$types = self::page_type_classes(); $types = ClassInfo::subclassesFor('SiteTree');
foreach($types as $type) { foreach($types as $k => $type) {
$inst = singleton($type); $inst = singleton($type);
$entities[$type . '.DESCRIPTION'] = array( $entities[$type . '.DESCRIPTION'] = array(
$inst->stat('description'), $inst->stat('description'),

View File

@ -191,10 +191,11 @@ class FilesystemPublisher extends StaticPublisher {
Requirements::clear(); Requirements::clear();
singleton('DataObject')->flushCache(); singleton('DataObject')->flushCache();
//skip any responses with a 404 status code. We don't want to turn those into statically cached pages
if (!$response || $response->getStatusCode() == '404') continue;
// Generate file content // Generate file content
// PHP file caching will generate a simple script from a template // PHP file caching will generate a simple script from a template
if($this->fileExtension == 'php') { if($this->fileExtension == 'php') {

View File

@ -127,13 +127,13 @@
* (Function) callback * (Function) callback
*/ */
suggest: function(val, callback) { suggest: function(val, callback) {
var field = this.find(':text'); var field = this.find(':text'), urlParts = $.path.parseUrl(this.closest('form').attr('action')),
url = urlParts.hrefNoSearch + '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val);
if(urlParts.search) url += '&' + urlParts.search.replace(/^\?/, '');
$.get( $.get(
this.closest('form').attr('action') + url,
'/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val), function(data) {callback.apply(this, arguments);}
function(data) {
callback.apply(this, arguments);
}
); );
}, },