<p class="text-center"><?php echo JText::_("COM_JUDOWNLOAD_FIELD_CREATED"); ?></p> </th> <th class="center"> <p class="text-center"><?php echo JText::_("COM_JUDOWNLOAD_REMOVE"); ?></p> </th> </tr> </thead> <tbody id="table-collection-items-tbody"> <?php if (count($this->items)) { $i = 0; foreach ($this->items AS $item) { $specialFields = JUDownloadFrontHelperField::getFields($item, null, array("description", "created", "title", "cat_id", "icon")); ?> <tr id="coll-item-row-<?php echo $i; ?>"> <td> <?php $iconField = $specialFields['icon']; if (isset($iconField) && $iconField->canView()) { ?> <div class="collection-item-icon"> <?php echo $iconField->getOutput(array('view' => "list")); ?> </div> <?php } ?> <?php
$doc_grid_col = $this->document_bootstrap_columns[$this->col_counter - 1]; // Get all list view fields, also add 'external_link', 'license_id', 'confirm_license' $additionFields = array(); if (trim($this->item->external_link)) { $additionFields[] = 'external_link'; } if ($this->item->license_id && $this->item->confirm_license) { $additionFields[] = 'license_id'; $additionFields[] = 'confirm_license'; } $fields = JUDownloadFrontHelperField::getFields($this->item, 1, array(), array(), $additionFields); // Ignore these fields from summary fields $ignoredFields = array("title", "description", "icon", "publish_up", "created_by", "featured", "cat_id", "tags"); $summaryFields = array(); foreach ($fields AS $fieldKey => $field) { if (!in_array($fieldKey, $ignoredFields) && is_object($field) && $field->canView(array("view" => "list"))) { $summaryFields[] = $field; } } ?> <div class="<?php echo $item_class; ?>" data-list-class="col-md-12" data-grid-class="col-md-<?php echo $doc_grid_col; ?>"> <?php $iconField = isset($fields['icon']) ? $fields['icon'] : null;
<?php echo JText::_('COM_JUDOWNLOAD_DOWNLOAD'); ?> </th> <th style="width:5%" class="center"> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_ID'); ?> </th> </tr> </thead> <tbody> <?php if (is_array($this->items) && count($this->items)) { foreach ($this->items AS $i => $item) { $this->item = $item; $fields = JUDownloadFrontHelperField::getFields($item, null); ?> <tr> <td class="center"> <input type="checkbox" class="judl-cb" name="cid[]" value="<?php echo $item->id; ?>" id="judl-cb-<?php echo $i; ?>"/> </td> <td class="title"> <div class="title-wrapper"> <a href="<?php echo JRoute::_(JUDownloadHelperRoute::getDocumentRoute($item->id)); ?>" title="<?php echo $item->title; ?>"> <?php echo $item->title; ?> </a> <?php if ($item->label_unpublished) {
protected function _prepareData() { $this->token = JSession::getFormToken(); $this->session = JFactory::getSession(); $this->item->changelogs = JUDownloadFrontHelper::getChangeLogField($this->item->id); $this->item->versions = $this->model->getVersions($this->item->id); $this->item->related_documents = $this->model->getRelatedDocuments($this->item->id); if (count($this->item->related_documents)) { foreach ($this->item->related_documents AS $documentRelated) { $documentRelated->link = JRoute::_(JUDownloadHelperRoute::getDocumentRoute($documentRelated->id)); $documentRelated->icon = JUDownloadHelper::getDocumentIcon($documentRelated->icon); } } $this->item->files = JUDownloadFrontHelperDocument::getFilesByDocumentId($this->item->id); $this->can_download_document = JUDownloadFrontHelperPermission::canDownloadDocument($this->item->id, false); $this->display_download_rule_msg = $this->params->get('show_rule_messages', 'modal'); $additionFields = array(); if (trim($this->item->external_link)) { $additionFields[] = 'external_link'; } if ($this->item->license_id && $this->item->confirm_license) { $additionFields[] = 'license_id'; $additionFields[] = 'confirm_license'; } $this->item->fieldGallery = JUDownloadFrontHelperField::getField('gallery', $this->item); $this->item->fields = JUDownloadFrontHelperField::getFields($this->item, 2, array(), array('gallery'), $additionFields); $this->item->license = JUDownloadFrontHelper::getLicense($this->item->license_id); $user = JFactory::getUser(); $uri = JUri::getInstance(); if ($this->item->checked_out > 0 && $this->item->checked_out != $user->get('id')) { if (JUDownloadFrontHelperPermission::canCheckInDocument($this->item->id)) { $this->item->checkin_link = JRoute::_('index.php?option=com_judownload&task=forms.checkin&id=' . $this->item->id . '&' . JSession::getFormToken() . '=1' . '&return=' . base64_encode(urlencode($uri))); } } else { $this->item->edit_link = JRoute::_('index.php?option=com_judownload&task=form.edit&id=' . $this->item->id . '&Itemid=' . JUDownloadHelperRoute::findItemIdOfDocument($this->item->id)); if ($this->item->published == 1) { $this->item->editstate_link = JRoute::_('index.php?option=com_judownload&task=forms.unpublish&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDownloadHelperRoute::findItemIdOfDocument($this->item->id)); } else { $this->item->editstate_link = JRoute::_('index.php?option=com_judownload&task=forms.publish&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDownloadHelperRoute::findItemIdOfDocument($this->item->id)); } } $this->item->delete_link = JRoute::_('index.php?option=com_judownload&task=forms.delete&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDownloadHelperRoute::findItemIdOfDocument($this->item->id)); if ($this->item->is_subscriber) { $this->item->unsubscribe_link = $this->model->getUnsubscribeLink($this->item->id); } else { $this->item->subscribe_link = $this->model->getSubscribeLink($this->item->id); } $this->item->contact_link = JRoute::_(JUDownloadHelperRoute::getContactRoute($this->item->id)); $this->item->report_link = JRoute::_(JUDownloadHelperRoute::getReportDocumentRoute($this->item->id)); $this->item->print_link = JRoute::_(JUDownloadHelperRoute::getDocumentRoute($this->item->id) . '&layout=print&tmpl=component&print=1'); $this->item->comment = new stdClass(); $this->item->comment->total_comments_no_filter = $this->model->getTotalCommentsOfDocument($this->item->id); $this->root_comment = JUDownloadFrontHelperComment::getRootComment(); $langArray = JHtml::_('contentlanguage.existing'); $JAll = new JObject(); $JAll->text = JText::_('JALL'); $JAll->value = '*'; array_unshift($langArray, $JAll); $this->langArray = $langArray; $this->item->comment->items = $this->get('Items'); foreach ($this->item->comment->items AS $comment) { if (JUDownloadFrontHelperPermission::canCheckInComment($comment->id)) { $uri = JUri::getInstance(); $comment->checkout_link = 'index.php?option=com_judownload&task=modcomments.checkin&cid=' . $comment->id . '&' . JSession::getFormToken() . '=1' . '&return=' . base64_encode(urlencode($uri)); } else { $comment->checkout_link = ''; } } $this->item->comment->pagination = $this->get('Pagination'); $this->item->comment->total_comments = $this->get('Total'); $this->item->comment->parent_id = $this->root_comment->id; $this->website_field_in_comment_form = $this->params->get('website_field_in_comment_form', 0); $this->min_comment_characters = $this->params->get('min_comment_characters', 20); $this->max_comment_characters = $this->params->get('max_comment_characters', 1000); $this->allow_vote_comment = $this->params->get('allow_vote_comment', 1); $this->allow_vote_down_comment = $this->params->get('allow_vote_down_comment', 1); $this->order_comment_name_array = $this->model->getCommentOrderingOptions(); $this->order_comment_dir_array = array( 'ASC' => JText::_('COM_JUDOWNLOAD_ASC'), 'DESC' => JText::_('COM_JUDOWNLOAD_DESC') ); $this->total_stars = $this->params->get('number_rating_stars', 5); $this->filter_comment_stars = array('' => JText::_('COM_JUDOWNLOAD_ANY_STAR')); for ($i = 0; $i <= $this->total_stars; $i++) { $score = ($i == 0) ? 0 : round((($i - 1) * 10) / $this->total_stars, 5) . ',' . round(($i * 10) / $this->total_stars, 5); $this->filter_comment_stars[$score] = JText::plural('COM_JUDOWNLOAD_N_STAR', $i); } if ($this->params->get('filter_comment_language', 0)) { $this->list_lang_comment = $this->escape($this->state->get('list.lang')); } $this->list_order_comment = $this->escape($this->state->get('list.ordering')); $this->list_dir_comment = $this->escape($this->state->get('list.direction')); $this->filter_comment_star = $this->state->get('list.star_filter', ''); $this->website = $this->title = $this->email = $this->comment = $this->name = ''; $this->language = '*'; $form = $this->session->get('judownload_commentform_' . $this->item->id, null); $this->form = $form; if (!empty($form) && $form['parent_id'] == $this->root_comment->id) { $this->title = $form['title']; $this->name = $form['guest_name']; $this->email = $form['guest_email']; $this->comment = $form['comment']; $this->website = (isset($form['website'])) ? $form['website'] : ''; $this->language = $form['comment_language']; } }
} // Get all list view fields, also add 'external_link', 'license_id', 'confirm_license' $additionFields = array(); if (trim($this->item->external_link)) { $additionFields[] = 'external_link'; } if ($this->item->license_id && $this->item->confirm_license) { $additionFields[] = 'license_id'; $additionFields[] = 'confirm_license'; } $specialFields = JUDownloadFrontHelperField::getFields($this->item, null, array("created", "title", "version", "featured", "downloads"), array(), $additionFields); ?> <tr class="<?php echo $item_class; ?>"> <?php if ($this->params->get('allow_zip_file', 1) && $this->params->get('allow_download_multi_docs', 0)) { ?> <td class="id"> <?php if ($this->item->total_files > 0 || (isset($specialFields['external_link']) && !empty($specialFields['external_link']))) { $canDownloadDocument = JUDownloadFrontHelperPermission::canDownloadDocument($this->item->id, false); if (!$canDownloadDocument) { ?> <input type="checkbox" name="doc_id[]" class="judl-cb-disabled" disabled value="<?php echo $this->item->id; ?>" id="cb<?php echo $this->index; ?>"/>