17 $this->FieldRenderer(
$form);
33 $documents = $this->library->Documents(
"ORDER BY title");
37 echo
"<a href='#' onclick='{$this->parent->id}_{$field}_selectItem(this, {$document->document_id}); return false;'>";
45 $img = DocumentHandler::getDocIcon(
$document->file);
46 return "<img src='$img' alt='' style='display: inline-block; vertical-align: middle'> {$document->title}";
53 $img = DocumentHandler::getDocIcon(
$document->file);
55 return "<img src='$img' alt='' style='display: inline-block; vertical-align: middle'> ".
56 "<a href='/action/document/download?document_id={$document->document_id}'>{$document->title}</a> $size";
61 if ($this->parent->isReadOnly(
$field))
return;
64 <script type=
"text/javascript">
65 function {$this->parent->id}_{
$field}_showList(e)
67 new DOMEvent(e).stop();
68 var popup = document.id(
'{$this->parent->id}_{$field}_list_popup');
69 var txt = document.id(
'{$this->parent->id}_{$field}');
70 var coords = txt.getCoordinates();
71 popup.setStyles({
'display':
'block'});
72 var doc = document.id(document.body ? document.body : document.documentElement);
73 doc.addEvent(
'click', {$this->parent->id}_{
$field}_hideList);
76 function {$this->parent->id}_{
$field}_hideList()
78 var popup = document.id(
'{$this->parent->id}_{$field}_list_popup');
79 popup.setStyles({
'display':
'none'});
80 var doc = document.id(document.body ? document.body : document.documentElement);
81 doc.removeEvent(
'click', {$this->parent->id}_{
$field}_hideList);
84 function {$this->parent->id}_{
$field}_selectItem(elt,
id)
86 var hidden = document.id(
'{$this->parent->id}_{$field}');
88 var txt = document.id(
'{$this->parent->id}_{$field}_text');
89 hidden.set(
'value',
id);
93 txt.set(
'html', elt.get(
'html'));
96 {$this->parent->id}_{
$field}_hideList();
99 window.addEvent(
'domready',
function()
101 var popup = document.id(
'{$this->parent->id}_{$field}_list_popup');
102 popup.addEvent(
'click',
function(e) {
new DOMEvent(e).stop(); });
119 $this->_startField(
$field);
121 $autocomplete = (!$this->autocomplete) ?
"autocomplete='off' " :
"";
123 $value = $this->parent->data->get(
$field);
135 echo
"<input id='{$this->parent->id}_{$field}' type='hidden' name='$field' value='".htmlspecialchars($value, ENT_QUOTES,
'UTF-8').
"'/>";
136 echo
"<span id='{$this->parent->id}_{$field}_text' class='document_select_text' onclick='{$this->parent->id}_{$field}_showList(event); return false;'>".$text.
"</span>";
137 echo
" <a class='button' href='#' onclick='{$this->parent->id}_{$field}_showList(event); return false;'>Browse</a><br/>";
138 echo
"<div id='{$this->parent->id}_{$field}_list_popup' class='progressive_search' style='display: none;position:absolute; max-height: 150px; overflow-y: auto'>";
147 $this->_startField(
$field);
149 $value = $this->parent->data->get(
$field);
161 if ($this->parent->readOnlyForm)
167 echo
"<input id='{$this->parent->id}_{$field}' type='hidden' name='$field' value='".htmlspecialchars($value, ENT_QUOTES,
'UTF-8').
"'/>";
168 echo
"<span id='{$this->parent->id}_{$field}_text' class='document_select_text'>".$text.
"</span>";
This class maps the publication table.
static findByIdentifier($identifier)
writeDocumentList($field)
formatDocumentLink($document)
DocumentSelectFieldRenderer(&$form, $field, $label, $libraryIdentifier)
renderSearchField($field, $mode="")
formatDocument($document)
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
if(! $document_id) $document