From badf5c15df0e6a3d49a6ace6af31a82d36e8f390 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Tue, 29 Mar 2011 13:40:02 +0100 Subject: [PATCH 1/7] closed title tags --- templates/DataObjectManager_popup.ss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/DataObjectManager_popup.ss b/templates/DataObjectManager_popup.ss index 4f5c4c9..1292335 100644 --- a/templates/DataObjectManager_popup.ss +++ b/templates/DataObjectManager_popup.ss @@ -12,10 +12,10 @@ <% if HasPagination %> <% end_if %> From 0055c240c52118b4613b69cd287bbecb7199c0c8 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Tue, 5 Apr 2011 10:09:32 +0100 Subject: [PATCH 2/7] MINOR For some reason this showed an error in my IDE --- .../javascript/tiny_mce/plugins/style/props.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/style/props.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/style/props.htm index 3a1582c..539536c 100644 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/style/props.htm +++ b/code/simple_tinymce_field/javascript/tiny_mce/plugins/style/props.htm @@ -82,7 +82,7 @@ - +
 
From 3e08f630a91c2cbf8c9f53e08edb9f5108567413 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Fri, 6 May 2011 11:29:06 +0100 Subject: [PATCH 3/7] BUGFIX Allow for Folder to be extended (not that you probably want to do that) --- code/AssetManager.php | 2 +- code/AssetManagerFolder.php | 2 +- code/FileDataObjectManager.php | 4 ++-- code/ImageAssetManager.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/AssetManager.php b/code/AssetManager.php index 358c2ec..98801ea 100644 --- a/code/AssetManager.php +++ b/code/AssetManager.php @@ -24,7 +24,7 @@ public function __construct($controller, $name, $sourceClass = "File", $headings $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); $fields->push(new HiddenField('ID','',$controller->ID)); - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "Classname != 'Folder'"); + parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"File\".\"ClassName\" != 'Folder'"); } function FieldHolder() diff --git a/code/AssetManagerFolder.php b/code/AssetManagerFolder.php index eb34ea2..9c904c3 100644 --- a/code/AssetManagerFolder.php +++ b/code/AssetManagerFolder.php @@ -15,7 +15,7 @@ public function updateCMSFields(Fieldset $fields) 'Title' => 30, 'Filename' => 70 )); - $folder_filter = "(Classname != 'Folder' AND ParentID = ".$this->owner->ID.")"; + $folder_filter = "(\"File\".\"ClassName\" AND ParentID = ".$this->owner->ID.")"; $filter = $a->sourceFilter ? "({$a->sourceFilter}) AND $folder_filter" : $folder_filter; $a->setSourceFilter($filter); $a->setParentClass("Folder"); diff --git a/code/FileDataObjectManager.php b/code/FileDataObjectManager.php index 1dfe852..0cf96da 100644 --- a/code/FileDataObjectManager.php +++ b/code/FileDataObjectManager.php @@ -143,7 +143,7 @@ protected function getImportFolderHierarchy($parentID, $level = 0) foreach($children as $child) { $indent=""; for($i=0;$i<$level;$i++) $indent .= "  "; - $files = DataObject::get($this->importClass, "ClassName != 'Folder' AND ParentID = $child->ID"); + $files = DataObject::get($this->importClass, "\"File\".\"ClassName\" != 'Folder' AND ParentID = $child->ID"); $count = $files ? $files->Count() : "0"; $options[$this->importLinkFor($child)] = $indent.$child->Title . " ($count files)"; $options += $this->getImportFolderHierarchy($child->ID, $level+1); @@ -582,7 +582,7 @@ protected function getImportFields() protected function ImportForm($folder_id = null) { $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : $this->importFolderID;; - if($files = DataObject::get($this->importClass, "ClassName != 'Folder' AND ParentID = $folder_id")) + if($files = DataObject::get($this->importClass, \"File\".\"ClassName\" != 'Folder' AND ParentID = $folder_id")) $fields = $this->getImportFields(); $fields->push(new HiddenField('folder_id','',$folder_id)); $fields->push(new LiteralField('select','
Select: all | none
')); diff --git a/code/ImageAssetManager.php b/code/ImageAssetManager.php index ad1fd35..e868918 100755 --- a/code/ImageAssetManager.php +++ b/code/ImageAssetManager.php @@ -23,7 +23,7 @@ public function __construct($controller, $name, $sourceClass = "Image", $heading $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); $fields->push(new HiddenField('ID','',$controller->ID)); - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "Classname != 'Folder'"); + parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"File\".\"ClassName\" != 'Folder'"); } } \ No newline at end of file From 4a822374ec738d1afc7edea8319640b02a060c6d Mon Sep 17 00:00:00 2001 From: mattclegg Date: Thu, 26 Jul 2012 14:52:06 +0100 Subject: [PATCH 4/7] MINOR: Added $extraClass for conditional styling --- templates/DataObjectManager.ss | 2 +- templates/FileDataObjectManager.ss | 2 +- templates/ImageDataObjectManager.ss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/DataObjectManager.ss b/templates/DataObjectManager.ss index 941eef6..bbce850 100644 --- a/templates/DataObjectManager.ss +++ b/templates/DataObjectManager.ss @@ -1,4 +1,4 @@ -
+
<% if Can(add) %> diff --git a/templates/FileDataObjectManager.ss b/templates/FileDataObjectManager.ss index 44a5f4c..90600e9 100644 --- a/templates/FileDataObjectManager.ss +++ b/templates/FileDataObjectManager.ss @@ -1,4 +1,4 @@ -
+
<% if Can(add) %> diff --git a/templates/ImageDataObjectManager.ss b/templates/ImageDataObjectManager.ss index bcbbfcd..63612a7 100644 --- a/templates/ImageDataObjectManager.ss +++ b/templates/ImageDataObjectManager.ss @@ -1,4 +1,4 @@ -
+
<% if Can(upload) %> From a4591c912b5918fb936ef39cbe61b16708d0df48 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Thu, 26 Jul 2012 15:03:22 +0100 Subject: [PATCH 5/7] (tidied up some errors) --- code/AssetManager.php | 2 +- code/AssetManagerFolder.php | 2 +- code/FileDataObjectManager.php | 7 +------ code/ImageAssetManager.php | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/code/AssetManager.php b/code/AssetManager.php index 1238d43..3b08fca 100644 --- a/code/AssetManager.php +++ b/code/AssetManager.php @@ -24,7 +24,7 @@ public function __construct($controller, $name, $sourceClass = "File", $headings $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); $fields->push(new HiddenField('ID','',$controller->ID)); - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"File\".\"ClassName\" != 'Folder'"); + parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); } diff --git a/code/AssetManagerFolder.php b/code/AssetManagerFolder.php index d9dbf06..4f76fa7 100644 --- a/code/AssetManagerFolder.php +++ b/code/AssetManagerFolder.php @@ -15,7 +15,7 @@ public function updateCMSFields(Fieldset $fields) 'Title' => 30, 'Filename' => 70 )); - $folder_filter = "(\"File\".\"ClassName\" AND ParentID = ".$this->owner->ID.")"; + $folder_filter = "("\"ClassName\" AND ParentID = ".$this->owner->ID.")"; $filter = $a->sourceFilter ? "({$a->sourceFilter}) AND $folder_filter" : $folder_filter; $a->setSourceFilter($filter); diff --git a/code/FileDataObjectManager.php b/code/FileDataObjectManager.php index 813245e..e9ff24c 100644 --- a/code/FileDataObjectManager.php +++ b/code/FileDataObjectManager.php @@ -148,11 +148,7 @@ protected function getImportFolderHierarchy($parentID, $level = 0) foreach($children as $child) { $indent=""; for($i=0;$i<$level;$i++) $indent .= "  "; -<<<<<<< HEAD - $files = DataObject::get($this->importClass, "\"File\".\"ClassName\" != 'Folder' AND ParentID = $child->ID"); -======= $files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND \"ParentID\" = $child->ID"); ->>>>>>> 8808fda3a4147908e2c1092815f39c988031c8b4 $count = $files ? $files->Count() : "0"; $options[$this->importLinkFor($child)] = $indent.$child->Title . " ($count files)"; $options += $this->getImportFolderHierarchy($child->ID, $level+1); @@ -614,8 +610,7 @@ protected function getImportFields() protected function ImportForm($folder_id = null) { $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : $this->importFolderID;; - if($files = DataObject::get($this->importClass, \"File\".\"ClassName\" != 'Folder' AND ParentID = $folder_id")) - + if($files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND ParentID = $folder_id")) $fields = $this->getImportFields(); $fields->push(new HiddenField('folder_id','',$folder_id)); $fields->push(new LiteralField('select','
Select: all | none
')); diff --git a/code/ImageAssetManager.php b/code/ImageAssetManager.php index 43fdf4e..b0f2b23 100644 --- a/code/ImageAssetManager.php +++ b/code/ImageAssetManager.php @@ -23,7 +23,7 @@ public function __construct($controller, $name, $sourceClass = "Image", $heading $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); $fields->push(new HiddenField('ID','',$controller->ID)); - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"File\".\"ClassName\" != 'Folder'"); + parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); } From 4b01cf188b834d8a7fa9136e9886becb15cb5e49 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Thu, 26 Jul 2012 15:07:55 +0100 Subject: [PATCH 6/7] (tidied up some more errors) --- code/.gitignore | 1 - code/AssetManager.php | 3 +-- code/AssetManagerFolder.php | 5 ++--- code/FileDataObjectManager.php | 2 +- code/ImageAssetManager.php | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/code/.gitignore b/code/.gitignore index 7ae1793..e69de29 100644 --- a/code/.gitignore +++ b/code/.gitignore @@ -1 +0,0 @@ -/AssetManager.php diff --git a/code/AssetManager.php b/code/AssetManager.php index 3b08fca..ccfd3aa 100644 --- a/code/AssetManager.php +++ b/code/AssetManager.php @@ -25,7 +25,6 @@ public function __construct($controller, $name, $sourceClass = "File", $headings $fields->push(new HiddenField('ID','',$controller->ID)); parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); - } function FieldHolder() @@ -38,4 +37,4 @@ function FieldHolder() } -?> \ No newline at end of file +?> diff --git a/code/AssetManagerFolder.php b/code/AssetManagerFolder.php index 4f76fa7..b940b3e 100644 --- a/code/AssetManagerFolder.php +++ b/code/AssetManagerFolder.php @@ -15,8 +15,7 @@ public function updateCMSFields(Fieldset $fields) 'Title' => 30, 'Filename' => 70 )); - $folder_filter = "("\"ClassName\" AND ParentID = ".$this->owner->ID.")"; - + $folder_filter = "(\"ClassName\" != 'Folder' AND \"ParentID\" = ".$this->owner->ID.")"; $filter = $a->sourceFilter ? "({$a->sourceFilter}) AND $folder_filter" : $folder_filter; $a->setSourceFilter($filter); $a->setParentClass("Folder"); @@ -29,4 +28,4 @@ public function updateCMSFields(Fieldset $fields) } } -?> \ No newline at end of file +?> diff --git a/code/FileDataObjectManager.php b/code/FileDataObjectManager.php index e9ff24c..e87e2e0 100644 --- a/code/FileDataObjectManager.php +++ b/code/FileDataObjectManager.php @@ -610,7 +610,7 @@ protected function getImportFields() protected function ImportForm($folder_id = null) { $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : $this->importFolderID;; - if($files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND ParentID = $folder_id")) + if($files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND \"ParentID\" = $folder_id")) $fields = $this->getImportFields(); $fields->push(new HiddenField('folder_id','',$folder_id)); $fields->push(new LiteralField('select','
Select: all | none
')); diff --git a/code/ImageAssetManager.php b/code/ImageAssetManager.php index b0f2b23..978ff1f 100644 --- a/code/ImageAssetManager.php +++ b/code/ImageAssetManager.php @@ -24,7 +24,6 @@ public function __construct($controller, $name, $sourceClass = "Image", $heading $fields->push(new HiddenField('ID','',$controller->ID)); parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); - } -} \ No newline at end of file +} From d7c37d9522e94a0f241908064b2748b5026bc848 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Thu, 26 Jul 2012 15:10:03 +0100 Subject: [PATCH 7/7] removed some whitespace --- code/AssetManager.php | 2 -- code/AssetManagerFolder.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/code/AssetManager.php b/code/AssetManager.php index ccfd3aa..ab76e6f 100644 --- a/code/AssetManager.php +++ b/code/AssetManager.php @@ -36,5 +36,3 @@ function FieldHolder() } - -?> diff --git a/code/AssetManagerFolder.php b/code/AssetManagerFolder.php index b940b3e..3e30e11 100644 --- a/code/AssetManagerFolder.php +++ b/code/AssetManagerFolder.php @@ -27,5 +27,3 @@ public function updateCMSFields(Fieldset $fields) return $fields; } } - -?>