Exemple #1
0
?>
<div class="supportingdocs">
<h3>
	<a name="supportingdocs"></a>
	<?php 
echo Lang::txt('PLG_PUBLICATION_SUPPORTINGDOCS');
?>
</h3>

<?php 
// Get elements in primary and supporting role
$prime = $this->publication->_curationModel->getElements(1);
$second = $this->publication->_curationModel->getElements(2);
$elements = array_merge($prime, $second);
// Get attachment type model
$attModel = new \Components\Publications\Models\Attachments($database);
if ($elements) {
    // Draw list
    $list = $attModel->listItems($elements, $this->publication, $this->authorized);
    echo $list ? $list : '<p class="noresults">' . Lang::txt('PLG_PUBLICATION_SUPPORTINGDOCS_NONE_FOUND') . '</p>';
} else {
    ?>
		<p class="noresults"><?php 
    echo Lang::txt('PLG_PUBLICATION_SUPPORTINGDOCS_NONE_FOUND');
    ?>
</p>
<?php 
}
?>

</div><!-- / .supportingdocs -->
$database = App::get('db');
if (!$pub->_attachments) {
    return '<p class="notice">' . Lang::txt('COM_PUBLICATIONS_NO_CONTENT') . '</p>';
}
$html = '';
$prime = $pub->_attachments[1];
$second = $pub->_attachments[2];
if (isset($pub->_curationModel)) {
    $prime = $pub->_curationModel->getElements(1);
    $second = $pub->_curationModel->getElements(2);
    $gallery = $pub->_curationModel->getElements(3);
    // Get attachment type model
    $attModel = new \Components\Publications\Models\Attachments($database);
    // Draw list of primary elements
    $html .= '<h5>' . Lang::txt('COM_PUBLICATIONS_PRIMARY_CONTENT') . '</h5>';
    $list = $attModel->listItems($prime, $pub, 'administrator');
    $html .= $list ? $list : '<p class="notice">' . Lang::txt('COM_PUBLICATIONS_NO_CONTENT') . '</p>';
    // Draw list of secondary elements
    $html .= '<h5>' . Lang::txt('COM_PUBLICATIONS_SUPPORTING_CONTENT') . '</h5>';
    $list = $attModel->listItems($second, $pub, 'administrator');
    $html .= $list ? $list : '<p class="notice">' . Lang::txt('COM_PUBLICATIONS_NO_CONTENT') . '</p>';
    // Draw list of gallery elements
    $html .= '<h5>' . Lang::txt('COM_PUBLICATIONS_GALLERY') . '</h5>';
    $list = $attModel->listItems($gallery, $pub, 'administrator');
    $html .= $list ? $list : '<p class="notice">' . Lang::txt('COM_PUBLICATIONS_NO_CONTENT') . '</p>';
} else {
    $html .= '<h5>' . Lang::txt('COM_PUBLICATIONS_PRIMARY_CONTENT') . '</h5>';
    if ($prime) {
        $html .= '<ul class="content-list">';
        foreach ($prime as $att) {
            $type = $att->type;