Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Feature Requests


Go to End


75 Posts   32295 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

22 June 2010 at 2:50am

@timwjohn: HasMany and ManyMany FileDOM has existed for well over a year. I never added them for ImageDOM, because it seemed a little pointless.. ImageDOM is nothing more than an FDOM with a little resizing widget and automatically filtered file types. The latter can be added with one line of code.

@howard -- That functionality exists, and I believe I've checked it in. I used it recently on a project and I just need to find out where.

Avatar
brice

Community Member, 52 Posts

22 June 2010 at 4:26am

Edited: 22/06/2010 4:29am

@howard : I'm not sure about a primary sort by associated/related records -- this functionality would be nice && UC may detail. Here's my workaround;

        $dom = new ManyManyFileDataObjectManager(....);
        $relationCount = $this->owner->$relation()->Count();
        $dom->setOnlyRelated((bool) $relationCount );

Basically I check to see if there are related records during the getCMSFields where I instantiate the DOM, and if so, set it so it defaults to showing only related records.

So in the above, you could change $relation() to Videos() if your many-many relation is named "Videos".

NOTE: I'm doing this in a DataObjectDecorator using updateCMSFields() .. thus you'll probably want to do

 $relationCount = $this->Videos()->Count();

in getCMSFields)().

Hope this makes sense.

Avatar
Richard Sjöqvist

Community Member, 4 Posts

22 June 2010 at 11:01pm

@UC: Here's the updated patch. Is this more like what you had in mind?

- ORIGINAL CODE - - - - - - - - - - - - - - - -
$.post($target.attr('href'),params,function() {$($target).parents('li:first').fadeOut();$(".ajax-loader").fadeOut("fast");});

- PATCHED CODE - - - - - - - - - - - - - - - - -
$div.fadeOut("fast");
request = $.ajax({
cache: false,
url: $target.attr('href'),
data: params,
error: function(xhr){statusMessage(xhr.responseText,'bad');},
success: function(message){
statusMessage(message,'good');
$($target).parents('li:first').fadeOut();
$(".ajax-loader").fadeOut("fast");
}
});
- - - - - - - - - - - - - - - - - - - - - - - -

Usage:

class MyClass extends DataObject {
...

function onBeforeDelete()
{
// 2.3 compatibility
$class = class_exists('SS_HTTPResponse') ? 'SS_HTTPResponse' : 'HTTPResponse';
if(<check if object can be deleted>)
{
parent::onBeforeDelete();
// Send success message
$response = new $class("Item successfully deleted");
$response->output();
}
else
{
// Send error message
$response = new $class("Cannot delete this item", 401);
$response->output();
exit; // Stop the object from being deleted
}
}
}

Avatar
Andrew Houle

Community Member, 140 Posts

8 July 2010 at 5:36am

I'd like to second this request that was made a while back by Shawn Parr...

"It would be great if there could be an ics feed for all the calendar events, along with the individual ics and full rss capabilities. This would be especially awesome in conjunction with the ICS feed feature. "

Is this already setup? If not is it possible?

Avatar
otherjohn

Community Member, 125 Posts

5 August 2010 at 6:32am

I would love it if SWFUpload and the DataObjectManager would integrate with Amazon S3 cloud servers.
I would pay for this feature to be developed if someone is interested.
John

Avatar
UncleCheese

Forum Moderator, 4102 Posts

5 August 2010 at 6:39am

Yup. Working on it now, actually.

Avatar
otherjohn

Community Member, 125 Posts

5 August 2010 at 6:55am

SICK! I figured a workaround to allowing it to show progress on upload to S3 in flash (requires a small bit of JS changes) if you are interested.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

5 August 2010 at 7:10am

Sure, go ahead and post 'em.