Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ public function savecontentTask()
if ($pContent->load($attachId))
{
$pContent->title = $attach['title'];

if (!empty($attach['attribs']))
{
$pContent->attribs = $attach['attribs'];
}

$pContent->store();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ COM_PUBLICATIONS_ELEMENT_REQUIRED="Required"
COM_PUBLICATIONS_ELEMENT_ROLE="Role"
COM_PUBLICATIONS_ELEMENT_ROLE_PRIMARY="primary"
COM_PUBLICATIONS_ELEMENT_ROLE_SECOND="supporting"
COM_PUBLICATIONS_ELEMENT_ROLE_GALLERY="gallery"
COM_PUBLICATIONS_FIELD_BUNDLE_NAME="Bundle Name"

COM_PUBLICATIONS_FIELD_ID="ID"
Expand Down Expand Up @@ -299,6 +300,7 @@ COM_PUBLICATIONS_FIELD_CUSTOMIZABLE="Customizable"
COM_PUBLICATIONS_FIELD_CUSTOMIZABLE_HINT="Do we allow users to customize license text?"
COM_PUBLICATIONS_FIELD_ATTACHMENT_TITLE="Attachment title"
COM_PUBLICATIONS_FIELD_SUPPORTING="Supporting"
COM_PUBLICATIONS_FIELD_ATTACHMENT_GALLERY_DESCRIPTION="File Description"

COM_PUBLICATIONS_ITEMS_REMOVED="Items removed"
COM_PUBLICATIONS_TYPE_BEING_USED="Selected type(s) used in publications. Failed to delete."
Expand Down Expand Up @@ -667,6 +669,8 @@ COM_PUBLICATIONS_CONFIG_SEARCH_CATEGORY="Search category"
COM_PUBLICATIONS_CONFIG_SEARCH_CATEGORY_DESC="Search category in tag section of publication submission"
COM_PUBLICATIONS_CONFIG_DATA_PUBLISHING_GUIDE="Data Publishing Self Assessment Guide"
COM_PUBLICATIONS_CONFIG_DATA_PUBLISHING_GUIDE_DESC="A self assessment guide for user to understand what is required in data publishing"
COM_PUBLICATIONS_CONFIG_ACCESSIBILITY_DOC="Accessibility document"
COM_PUBLICATIONS_CONFIG_ACCESSIBILITY_DOC_DESC="File accessibility document"

; Types
COM_PUBLICATIONS_TYPES="Types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
<p>[<?php echo $attach->type; ?>] <?php echo $attach->path; ?></p>
<label><?php echo Lang::txt('COM_PUBLICATIONS_FIELD_ATTACHMENT_TITLE'); ?>:</label>
<input type="text" name="attachments[<?php echo $attach->id; ?>][title]" maxlength="250" value="<?php echo $attach->title; ?>" />
<?php if ($attach->role == 3) { ?>
<label><?php echo Lang::txt('COM_PUBLICATIONS_FIELD_ATTACHMENT_GALLERY_DESCRIPTION'); ?>:</label>
<input type="text" name="attachments[<?php echo $attach->id; ?>][attribs]" maxlength="250" value="<?php echo $attach->attribs; ?>" />
<?php } ?>
</div>
<?php } ?>
<?php } else { ?>
Expand All @@ -119,8 +123,8 @@
<tr>
<td class="key"><?php echo Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE'); ?></td>
<td>
<?php echo $element->params->role == 1 ? Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE_PRIMARY') : Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE_SECOND'); ?>
</td>
<?php echo $element->params->role == 1 ? Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE_PRIMARY') : ($element->params->role == 2 ? Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE_SECOND') : ($element->params->role == 3 ? Lang::txt('COM_PUBLICATIONS_ELEMENT_ROLE_GALLERY') : "")); ?>
</td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions core/components/com_publications/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<option value="1">JON</option>
</field>
<field name="data_publishing_self_assessment_guide" type="text" menu="hide" default="" label="COM_PUBLICATIONS_CONFIG_DATA_PUBLISHING_GUIDE" description="COM_PUBLICATIONS_CONFIG_DATA_PUBLISHING_GUIDE_DESC" />
<field name="accessdoc" type="text" menu="hide" default="" label="COM_PUBLICATIONS_CONFIG_ACCESSIBILITY_DOC" description="COM_PUBLICATIONS_CONFIG_ACCESSIBILITY_DOC_DESC" />
</fieldset>
<fieldset name="CURATION">
<field name="curatorreplyto" type="text" menu="hide" default="" label="COM_PUBLICATIONS_CONFIG_CURATOR_REPLYTO" description="COM_PUBLICATIONS_CONFIG_CURATOR_REPLYTO_DESC" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public function drawList($attachments, $element, $elementId, $pub, $blockParams,
if ($handler)
{
// Handler will draw list
$html = $handler->drawList($attachments, $configs, $pub, $authorized);
$html = $handler->drawList($attachments, $configs, $pub, $authorized, $elementId);
if ($html)
{
return $html;
Expand Down Expand Up @@ -1129,6 +1129,7 @@ public function updateAttachment($row, $element, $elementId, $pub, $blockParams)
$title = Request::getString('title', '');
$name = Request::getString('filename', '');
$thumb = Request::getInt('makedefault', 0);
$description = Request::getString('description', '');

// Get configs
$configs = $this->getConfigs($element, $elementId, $pub, $blockParams);
Expand All @@ -1143,6 +1144,7 @@ public function updateAttachment($row, $element, $elementId, $pub, $blockParams)

// Update label
$row->title = $title;
$row->attribs = $description;
$row->modified_by = User::get('id');
$row->modified = Date::toSql();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ public function showImageBand($pub)
{
// Get extentsion
$ext = Filesystem::extension(PATH_APP . DS . $fpath);

$title = $attach->title ? $attach->title : basename($attach->path);
$title = $attach->attribs ? $attach->attribs : ($attach->title ? $attach->title : basename($attach->path));
$link = Route::url($pub->link('versionid')) . '/Image:' . basename($fpath);
$rel = ($ext == 'swf' || $ext == 'mov') ? '' : ' rel="lightbox"';
$class = ($ext == 'swf' || $ext == 'mov') ? ' class="video"' : '';
Expand Down Expand Up @@ -307,9 +306,10 @@ public function showImageBand($pub)
* @param object $attConfigs
* @param object $pub
* @param boolean $authorized
* @param integer $elementId
* @return void
*/
public function drawList($attachments, $attConfigs, $pub, $authorized)
public function drawList($attachments, $attConfigs, $pub, $authorized, $elementId)
{
if (!$attachments)
{
Expand All @@ -329,7 +329,9 @@ public function drawList($attachments, $attConfigs, $pub, $authorized)
foreach ($attachments as $attach)
{
$fpath = $this->getFilePath($attach->path, $attach->id, $attConfigs, $attach->params);
$fpath = str_replace(PATH_APP, '', $fpath);

// File model
$file = new \Components\Projects\Models\File(trim($fpath));

$thumbName = \Components\Publications\Helpers\Html::createThumbName(
basename($fpath),
Expand All @@ -348,7 +350,20 @@ public function drawList($attachments, $attConfigs, $pub, $authorized)
$html .= '"><img src="/publications' . DS . $pub->id . DS . $pub->version_id . '/Image:' . $thumbName . '" alt="' . $title . '" class="thumbima" /></span>';
$html .= '<span class="item-title">' . $title . '<span class="details">' . $attach->path . '</span></span>';
$html .= '</a>';
$html .= '<span class="clear"></span>';

$html .= '<span class="extras">';
$html .= $file->get('ext') ? '(' . strtoupper($file->get('ext')) : '';
$html .= $file->getSize() ? ' | ' . $file->getSize('formatted') : '';
$html .= $file->get('ext') ? ')' : '';
if ($authorized === 'administrator')
{
$html .= ' <span class="edititem">';
$html .= '<a href="index.php?option=com_publications&controller=items&task=editcontent&id=' . $pub->id . '&el=' . $elementId . '&v=' . $pub->version_number . '">';
$html .= Lang::txt('COM_PUBLICATIONS_EDIT');
$html .= '</a>';
$html .= '</span>';
}
$html .= '</span>';
$html .= '</li>';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ PLG_PROJECTS_PUBLICATIONS_CHOOSE_FROM_FILES_PROV="Add file(s)"
PLG_PROJECTS_PUBLICATIONS_LABEL="Label"
PLG_PROJECTS_PUBLICATIONS_FILE_NAME="File Name"
PLG_PROJECTS_PUBLICATIONS_FILE_PATH="File Path"
PLG_PROJECTS_PUBLICATIONS_FILE_DESCRIPTION="File Description"
PLG_PROJECTS_PUBLICATIONS_RELABEL="Edit properties"
PLG_PROJECTS_PUBLICATIONS_RENAME="rename"
PLG_PROJECTS_PUBLICATIONS_REMOVE="Remove"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
$aboutText = '<p>' . $aboutText . '</p>';
}

if (!empty($this->pub->config('accessdoc')) && ($this->elementId == 2))
{
$aboutText .= '<p>Add <a href="' . $this->pub->config('accessdoc') . '" target="_blank">meaningful description</a> to the image</p>';
}

// Get curator status
$curatorStatus = $this->pub->_curationModel->getCurationStatus($this->pub, $this->master->blockId, $this->elementId, 'author');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
<span class="leftshift faded"><?php echo ucfirst(Lang::txt('PLG_PROJECTS_PUBLICATIONS_FILE_PATH')); ?>:</span>
<span class="content-filepath"><?php echo $this->row->path; ?></span>
</p>
<p class="c-wrapper">
<span class="leftshift faded"><?php echo ucfirst(Lang::txt('PLG_PROJECTS_PUBLICATIONS_FILE_DESCRIPTION')); ?>:</span>
<input type="text" name="description" maxlength="250" class="long" value="<?php echo $this->row && $this->row->attribs ? $this->row->attribs : ""; ?>" placeholder="<?php echo $this->row->attribs; ?>" />
</p>
<?php } else { ?>
<p class="c-wrapper">
<span class="leftshift faded"><?php echo ucfirst(Lang::txt('PLG_PROJECTS_PUBLICATIONS_FILE_PATH')); ?>*:</span>
Expand Down