51 $validator->add(
new RequiredValidator(
"parent_folder_value",
"Parent Folder"));
52 $validator->add(
new RequiredValidator(
"folder_name",
"Folder Name"));
53 $validator->add(
new RegularExpressionValidator(
"folder_name",
"Folder Name",
"^[A-Za-z0-9_\-]+$",
"Please supply a valid folder name, with only alphanumeric characters, underscore, or dash"));
69 $parent_folder = sanitizePath(
$_POST[
"parent_folder_value"]);
70 $folder_name = sanitizePath(
$_POST[
"folder_name"]);
71 if (!$parent_folder) $parent_folder =
$config[
'uploaddir'];
73 $path =
$library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $parent_folder . DIRECTORY_SEPARATOR . $folder_name;
75 if (file_exists(
$path))
77 Fakoli::end(
"A file or directory already exists with that name");
86 $tree =
new DirectoryTreeControl(
"parent_folder");
95 <script type=
"text/javascript">
98 document.id(
'folder_form').iFrameFormRequest({
'onRequest':
function() {
return validate_folder_form(document.id(
'folder_form')); },
'onComplete': createFolderResult,
'onFailure':
function() { alert(
"Failed to communicate with server"); }});
101 <form name=
"folder_form" id=
"folder_form" method=
"POST" action=
"/action/document/create_folder?document_library_id=<?echo $document_library_id?>">
104 <td
style=
"vertical-align: top"><label>Parent Folder</label></td>
106 <?
$tree->writeHTML(); ?>
110 <td><label>Folder Name</label></td>
111 <td><input type=
"text" name=
"folder_name" value=
"" style=
"width: 320px"/></td>
114 <td
colspan=
"2"><input type=
"submit" class=
"button" value=
"Create Folder"/></td>
The DocumentManager class provides the core API and management functions for uploading documents and ...
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
$method
Pull out a simple reference to the request method.
if(! $document_library_id) global $library