From 76ffdd4acbead6da5c45d84cbe80bb2f1f943a9f Mon Sep 17 00:00:00 2001 From: Romain Louis Date: Mon, 24 Sep 2007 22:25:40 +0000 Subject: [PATCH] File modification fior gallery git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.1.0@42515 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/File.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/filesystem/File.php b/filesystem/File.php index 438703658..06fc7be83 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -29,11 +29,7 @@ class File extends DataObject { "Title" => "Varchar(255)", "Filename" => "Varchar(255)", "Content" => "Text", - "Sort" => "Int", - "PopupWidth" => "Int", - "PopupHeight" => "Int", - "Embed" => "Boolean", - 'LimitDimensions' => 'Boolean' + "Sort" => "Int" ); static $indexes = array( "SearchFields" => "fulltext (Filename,Title,Content)", @@ -594,10 +590,13 @@ class File extends DataObject { * be a better way of approaching this? */ public function instance_get($filter = "", $sort = "", $join = "", $limit="", $containerClass = "DataObjectSet", $having="") { + if($this->hasMethod('alternative_instance_get')) return $this->alternative_instance_get($filter, $sort, $join, $limit, $containerClass, $having); + $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.Content","$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);