Commit 12b02717 authored by Son Nguyen's avatar Son Nguyen Committed by Robert Lyon

Add parameter edit=<artefactid> into url (bug #1197175)

This will still open the edit form if validation failed
and javascript is turned off.

Change-Id: Ia3572412b21e1e89942d35d7b365f898f302eb76
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent beff568b
......@@ -468,23 +468,26 @@ function pieform_element_filebrowser_doupdate(Pieform $form, $element) {
$update = param_variable($prefix . '_update', null);
if (is_array($update)) {
$keys = array_keys($update);
$artefactid = (int) ($keys[0]);
$edit_title = param_variable($prefix . '_edit_title');
$namelength = strlen($edit_title);
if (!$namelength) {
return array(
'edit' => $artefactid,
'error' => true,
'message' => get_string('filenamefieldisrequired', 'artefact.file')
'message' => get_string('filenamefieldisrequired1', 'artefact.file')
);
}
else if ($namelength > 1024) {
return array(
'edit' => $artefactid,
'error' => true,
'message' => get_string('nametoolong', 'artefact.file'),
);
}
$keys = array_keys($update);
$data = array(
'artefact' => (int) ($keys[0]),
'artefact' => $artefactid,
'title' => $edit_title,
'description' => param_variable($prefix . '_edit_description'),
'tags' => param_variable($prefix . '_edit_tags'),
......
......@@ -108,6 +108,7 @@ $string['fileexistsoverwritecancel'] = 'A file with that name already exists. Y
$string['filelistloaded'] = 'File list loaded';
$string['filemoved'] = 'File moved successfully';
$string['filenamefieldisrequired'] = 'The file field is required';
$string['filenamefieldisrequired1'] = 'The file/folder name is required';
$string['fileinstructions'] = 'Upload your images, documents or other files for inclusion in pages. You can select multiple files to upload them at once. Drag and drop the icons to move files between folders.';
$string['filethingdeleted'] = '%s deleted';
$string['filewithnameexists'] = 'A file or folder with the name "%s" already exists.';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment