Commit d1a1413a authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review

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

parents 8154e5dc 12b02717
......@@ -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