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.

All other Modules

Discuss all other Modules here.

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

Secure Files module in SS v.3


Reply

12 Posts   1677 Views

Avatar
mimamo

15 July 2013 at 11:25pm Community Member, 22 Posts

Hi,
I'm using Silverstripe 3.05

Avatar
tv

15 July 2013 at 11:31pm Community Member, 44 Posts

Beho,

It has been a couple months since I worked with this, but I believe I was able to get the module working in 3.0.x by using normann's pull request on github.

Avatar
mimamo

16 July 2013 at 12:34am (Last edited: 16 July 2013 1:11am), Community Member, 22 Posts

Hi,
ähm, where should i put the extensions.yml and routes.yml?

should i create a new folder in the modules root direcotry called _config?

edit: i put them in cms/_config
was that right?

Avatar
mimamo

16 July 2013 at 1:18am (Last edited: 16 July 2013 9:15am), Community Member, 22 Posts

thx a lot :) it seems to work now.
but one problem is left.
i can't access my page where i upload the files. i always receive an server error ... :/

here that's the pagetype and dataobject code:

<?php
class FilesObject extends DataObject {

static public $db = array(
'SortID' => 'Int',
'Project' => 'Text',
'Date' => 'Date'
);

static public $has_one = array (
   'ProjectFile' => 'File',
'ClientPage' => 'ClientPage'
);

static $summary_fields = array(
'Project',
'Date',
'ProjectFile'
);

public static $default_sort = 'SortID Asc';

public function getCMSFields() {
DateField::set_default_config('showcalendar', true);
      $file = new UploadField('ProjectFile', 'Datei');
   $file->setFolderName('Clients');

return new FieldList(
new TextField('Project', 'Projekt'),
DateField::create('Date', 'Datum')->setConfig('showcalendar', true),
$file
// $visual,
);

}

}

<?php
class ClientPage extends Page {

   
static $has_many = array(
      'Files' => 'FilesObject'
);
   
   public function getCMSFields() {
      $fields = parent::getCMSFields();
      
      $fields->addFieldToTab('Root.Dateien', GridFieldBase::getGridField('Dateien', _t('Dict.Dateien', 'Dateien'), $this->Files()));
      
      return $fields;
   }
}

class ClientPage_Controller extends Page_Controller {

}

is there a mistake in my code?

i hope you could help me.

thx in advance
benni

edit: i added the debug output. but it says nothing to me :/

Attached Files