srchub

srchub Commit Details


Date:2016-10-01 22:10:30 (8 years 2 months ago)
Author:Natalie Adams
Branch:master
Commit:e398a3bbd6fb60ebfa6bb72faf0308c32d52a714
Parents: 39245dc42c60f9d01937b8419e4bc27aa03752dd
Message:Asking for file name

Changes:

File differences

indefero/src/IDF/Form/Upload.php
5353
5454
5555
56
57
58
59
60
61
62
63
64
5665
5766
5867
......
133142
134143
135144
136
145
137146
138147
148
149
150
151
152
153
139154
140155
141156
......
188203
189204
190205
191
206
192207
193208
194209
'size' => 67,
),
));
$this->fields['ext_file_name'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('External File Name'),
'initial' => '',
'widget_attrs' => array(
'maxlength' => 200,
'size' => 67,
),
));
$this->fields['changelog'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Description'),
throw new Pluf_Form_Invalid(__('You provided an invalid label.'));
}
}
if (empty($this->cleaned_data["file"]) && empty($this->cleaned_data["ext_file"])) {
if (empty($this->cleaned_data["file"]) && empty($this->cleaned_data["ext_file"]) && empty($this->cleaned_data["ext_file_name"])) {
throw new Pluf_Form_Invalid(__("Must upload a file or specify an external file"));
}
foreach(explode(".", $this->cleaned_data["ext_file_name"]) as $section) {
if (!ctype_alpha($section)) {
throw new Pluf_Form_Invalid(__("External file name must not contain characters other than a-zA-Z and ."));
}
}
return $this->cleaned_data;
}
$upload->file = $this->cleaned_data['file'];
$upload->filesize = filesize(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']);
} else {
$upload->file = end(explode("/", $this->cleaned_data["ext_file"]));
$upload->file = $this->cleaned_data["ext_file_name"];
$upload->ext_file = $this->cleaned_data['ext_file'];
}
indefero/src/IDF/Upload.php
6363
6464
6565
66
67
68
69
70
71
72
6673
6774
6875
'size' => 250,
'verbose' => __('External File URL'),
),
'ext_file_name' =>
array(
'type' => 'Pluf_DB_Field_Varchar',
'blank' => false,
'size' => 250,
'verbose' => __('External File Name'),
),
'changelog' =>
array(
'type' => 'Pluf_DB_Field_Text',
indefero/src/IDF/templates/idf/downloads/create.html
2525
2626
2727
28
29
30
31
32
33
34
2835
2936
3037
</td>
</tr>
<tr>
<th><strong>{$form.f.ext_file_name.labelTag}:</strong></th>
<td>{if $form.f.ext_file_name.errors}{$form.f.ext_file_name.fieldErrors}{/if}
{$form.f.ext_file_name|unsafe}
</td>
</tr>
<tr>
<th>{$form.f.changelog.labelTag}:</th>
<td>{if $form.f.changelog.errors}{$form.f.changelog.fieldErrors}{/if}
{$form.f.changelog|unsafe}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06631s using 14 queries.