Merge remote-tracking branch 'origin/3.0' into 3.1

This commit is contained in:
Ingo Schommer 2013-05-31 17:52:24 +02:00
commit 5d97f615ce
2 changed files with 26 additions and 28 deletions

View File

@ -1353,16 +1353,15 @@ HTML;
ErrorDocument 404 /assets/error-404.html ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html ErrorDocument 500 /assets/error-500.html
<IfModule mod_alias.c>
RedirectMatch 403 /silverstripe-cache(/|$)
RedirectMatch 403 /vendor(/|$)
RedirectMatch 403 /composer\.(json|lock)
</IfModule>
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On SetEnv HTTP_MOD_REWRITE On
RewriteEngine On RewriteEngine On
$baseClause $baseClause
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]
RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.php$ RewriteCond %{REQUEST_URI} !\.php$

View File

@ -114,7 +114,7 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
$currentColumn++; $currentColumn++;
$metadata = $gridField->getColumnMetadata($columnField); $metadata = $gridField->getColumnMetadata($columnField);
$title = $metadata['title']; $title = $metadata['title'];
$fields = new FieldGroup();
if($title && $gridField->getList()->canFilterBy($columnField)) { if($title && $gridField->getList()->canFilterBy($columnField)) {
$value = ''; $value = '';
@ -128,34 +128,33 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
$field->setAttribute('placeholder', $field->setAttribute('placeholder',
_t('GridField.FilterBy', "Filter by ") . _t('GridField.'.$metadata['title'], $metadata['title'])); _t('GridField.FilterBy', "Filter by ") . _t('GridField.'.$metadata['title'], $metadata['title']));
$field = new FieldGroup( $fields->push($field);
$field, $fields->push(
GridField_FormAction::create($gridField, 'reset', false, 'reset', null) GridField_FormAction::create($gridField, 'reset', false, 'reset', null)
->addExtraClass('ss-gridfield-button-reset') ->addExtraClass('ss-gridfield-button-reset')
->setAttribute('title', _t('GridField.ResetFilter', "Reset")) ->setAttribute('title', _t('GridField.ResetFilter', "Reset"))
->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField) ->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField)
); );
} else { }
if($currentColumn == count($columns)){
$field = new FieldGroup( if($currentColumn == count($columns)){
GridField_FormAction::create($gridField, 'filter', false, 'filter', null) $fields->push(
->addExtraClass('ss-gridfield-button-filter') GridField_FormAction::create($gridField, 'filter', false, 'filter', null)
->setAttribute('title', _t('GridField.Filter', "Filter")) ->addExtraClass('ss-gridfield-button-filter')
->setAttribute('id', 'action_filter_' . $gridField->getModelClass() . '_' . $columnField), ->setAttribute('title', _t('GridField.Filter', "Filter"))
GridField_FormAction::create($gridField, 'reset', false, 'reset', null) ->setAttribute('id', 'action_filter_' . $gridField->getModelClass() . '_' . $columnField)
->addExtraClass('ss-gridfield-button-close') );
->setAttribute('title', _t('GridField.ResetFilter', "Reset")) $fields->push(
->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField) GridField_FormAction::create($gridField, 'reset', false, 'reset', null)
); ->addExtraClass('ss-gridfield-button-close')
$field->addExtraClass('filter-buttons'); ->setAttribute('title', _t('GridField.ResetFilter', "Reset"))
$field->addExtraClass('no-change-track'); ->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField)
}else{ );
$field = new LiteralField('', ''); $fields->addExtraClass('filter-buttons');
} $fields->addExtraClass('no-change-track');
} }
$forTemplate->Fields->push($field); $forTemplate->Fields->push($fields);
} }
return array( return array(