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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

Secure Files module in SS v.3


Go to End


12 Posts   3434 Views

Avatar
mimamo

Community Member, 22 Posts

15 July 2013 at 11:25pm

Hi,
I'm using Silverstripe 3.05

Avatar
tv

Community Member, 44 Posts

15 July 2013 at 11:31pm

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

Community Member, 22 Posts

16 July 2013 at 12:34am

Edited: 16/07/2013 1:11am

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

Community Member, 22 Posts

16 July 2013 at 1:18am

Edited: 16/07/2013 9:15am

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 :/

Go to Top