mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
File Attribute Adding for the gallery module (merged from 2.1.0 branch, r42339)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42919 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
30efb8efc7
commit
bb2a97856f
@ -29,7 +29,11 @@ class File extends DataObject {
|
||||
"Title" => "Varchar(255)",
|
||||
"Filename" => "Varchar(255)",
|
||||
"Content" => "Text",
|
||||
"Sort" => "Int"
|
||||
"Sort" => "Int",
|
||||
"PopupWidth" => "Int",
|
||||
"PopupHeight" => "Int",
|
||||
"Embed" => "Boolean",
|
||||
'LimitDimensions' => 'Boolean'
|
||||
);
|
||||
static $indexes = array(
|
||||
"SearchFields" => "fulltext (Filename,Title,Content)",
|
||||
@ -67,7 +71,7 @@ class File extends DataObject {
|
||||
}
|
||||
|
||||
static function allowedFileType( $extension ) {
|
||||
return !in_array($extension, self::$allowed_file_types);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -593,7 +597,7 @@ class File extends DataObject {
|
||||
$query = $this->extendedSQL($filter, $sort, $limit, $join, $having);
|
||||
$baseTable = reset($query->from);
|
||||
|
||||
$query->select = array("$baseTable.ID","$baseTable.ClassName","$baseTable.Created","$baseTable.LastEdited","$baseTable.Name","$baseTable.Title","$baseTable.ParentID","$baseTable.Filename","if($baseTable.ClassName,$baseTable.ClassName,'File') AS RecordClassName");
|
||||
$query->select = array("$baseTable.ID","$baseTable.ClassName","$baseTable.Created","$baseTable.LastEdited","$baseTable.Name","$baseTable.Title","$baseTable.Content","$baseTable.ParentID","$baseTable.Filename","if($baseTable.ClassName,$baseTable.ClassName,'File') AS RecordClassName","$baseTable.PopupWidth","$baseTable.PopupHeight","$baseTable.Embed","$baseTable.LimitDimensions");
|
||||
$records = $query->execute();
|
||||
$ret = $this->buildDataObjectSet($records, $containerClass);
|
||||
if($ret) $ret->parseQueryLimit($query);
|
||||
|
Loading…
Reference in New Issue
Block a user