Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Feature Requests

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6 7 8 9 10
Go to End
Author Topic: 13570 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Feature Requests Link to this post

    @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.

  • brice
    Avatar
    Community Member
    51 Posts

    Re: Feature Requests Link to this post

    @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.

  • Richard Sjöqvist
    Avatar
    Community Member
    4 Posts

    Re: Feature Requests Link to this post

    @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
          }
       }
    }

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: Feature Requests Link to this post

    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?

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Feature Requests Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Feature Requests Link to this post

    Yup. Working on it now, actually.

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Feature Requests Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Feature Requests Link to this post

    Sure, go ahead and post 'em.

    13570 Views
Page: 1 2 3 4 5 6 7 8 9 10
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.