45 var
$fields = array(
"document_library_id" => Number,
47 "identifier" => String,
48 "description" => Text,
50 "allow_comments" => Boolean,
52 "allow_access" => String,
53 "manage_folders" => String,
54 "upload_files" => String,
55 "delete_files" => String,
56 "create_date" => Timestamp,
57 "last_modified" => Timestamp);
83 $owner = $this->
Owner();
85 return ($owner->user_id ==
$user->user_id) ?
true :
false;
101 $owner = $this->
Owner();
103 return ($owner) ? $owner->getFullName() :
"";
110 $d =
$config[
'uploadbase'] . DIRECTORY_SEPARATOR .
"library_{$this->document_library_id}";
112 if (!is_dir(
$d) && !file_exists(
$d))
114 $docs =
$d.DIRECTORY_SEPARATOR.
"documents";
130 return queryValue(
Document,
"COUNT(1)",
"WHERE document_library_id={$this->document_library_id}");
161 $user = FileshareManager::setVisitor();
177 if(!$this->document_library_id)
return false;
179 return (!count($this->
Documents()) && checkRole($this->delete_files)) ?
true :
false;
217 return ($member) ?
true :
false;
231 if(preg_match(
"/fileshare/i",
$identifier) || $fileshare)
232 $constraint =
"WHERE role like 'admin%' or role like 'fileshare%'";
248 if (file_exists(
$path))
250 return getScaledSize(filesize(
$path));
258 $this->primary_key =
"document_library_id";
259 $this->table =
"document_library";
261 $this->default_format =
"{name}";
262 $this->cacheLocal =
true;
266 $this->relations[
"Owner"] =
$mgr->getUserClass();
268 $this->DataItem(func_get_args());
This class maps the publication table.
static findByIdentifier($identifier)
FileshareUsers($constraint="")
getFileshareUser($user_id)
getFolders($constraint="")
Documents($constraint="")
allowDelete()
Can only delete an empty library.
static getDefaultRole($fileshare=false)
static using()
Import the datamodels, views and manifest for the specified component(s).
Provides the interface to the user model for the application.
if(! $document_id) $document
if(!checkRole($library->allow_access) &&! $library->allowAccess()) if(!checkRole($document->allow_access)) $d
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true