Hello!
I have problem to display attached files. Files to attach and display a list of DOM (Uploadify). Generated link does not work. Does my template is all ok?
OfertaHolder.ss
-----------------------
<% if Plik %>
<% control Plik %>
pobierz plik: <a href="$MyFile.URL">$MyFile.Title ($MyFile.Size) [$MyFile.Extension]</a>
<% end_control %>
<% end_if %>
------
This is my code:
MyFile.php:
--------------
<?php
class MyFile extends File {
static $has_one = array (
'OfertaPage' => 'OfertaPage'
);
}
------
OfertaPage.php:
--------------
<?php
class OfertaPage extends Page {
static $db = array(
'Pokazemail' => 'Boolean',
'Pokaztel' => 'Boolean',
'Imienazwisko' => 'Text',
'Tel' => 'Text',
'Email' => 'Text'
);
static $has_one = array(
'Zdjecie' => 'Image'
);
static $has_many = array (
'Plik' => 'MyFile'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Images", new ImageField('Zdjecie'));
$fields->addFieldToTab("Root.Content.File", $MFile = new MultipleFileUploadField('Plik'));
$fields->addFieldToTab('Root.Content.Main', new TextField('Imienazwisko', 'Imię i nazwisko'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new CheckboxField ('Pokaztel', 'Pokaż tel lub www'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Tel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new CheckboxField ('Pokazemail', 'Pokaż email'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Email'), 'Content');
$MFile ->allowFolderSelection();
return $fields;
}
}
class OfertaPage_Controller extends Page_Controller {
}