if ($this->item->label_updated) {
    $item_class_arr[] = "updated";
}
if ($this->item->label_hot) {
    $item_class_arr[] = "hot";
}
if ($this->item->label_featured) {
    $item_class_arr[] = "featured";
}
$item_class_arr[] = $this->listing_column_class ? $this->listing_column_class : "";
$item_class_arr[] = $this->view_mode == 2 ? "col-md-" . $this->listing_bootstrap_columns[$this->col_counter - 1] : "col-md-12";
$item_class = implode(" ", $item_class_arr);
$listing_grid_col = $this->listing_bootstrap_columns[$this->col_counter - 1];
// Get all list view fields
$additionFields = array();
$fields = JUDirectoryFrontHelperField::getFields($this->item, 1, array(), array(), $additionFields);
// Ignore these fields from summary fields
$ignoredFields = array("title", "description", "image", "publish_up", "created_by", "featured", "cat_id", "tags", "introtext");
$summaryFields = array();
foreach ($fields as $fieldKey => $field) {
    if (!in_array($fieldKey) && is_object($field) && $field->canView(array("view" => "list"))) {
        $summaryFields[] = $field;
        //print_r($field);
    }
}
?>
	<div class="<?php 
echo $item_class;
?>
" data-list-class="col-md-12" data-grid-class="col-md-<?php 
echo $listing_grid_col;
Example #2
0
				</th>
				<th class="center">
					<p class="text-center"><?php 
echo JText::_("COM_JUDIRECTORY_REMOVE");
?>
</p>
				</th>
			</tr>
			</thead>

			<tbody id="table-collection-items-tbody">
			<?php 
if (count($this->items)) {
    $i = 0;
    foreach ($this->items as $item) {
        $specialFields = JUDirectoryFrontHelperField::getFields($item, null, array("description", "created", "title", "cat_id", "icon"));
        ?>
					<tr id="coll-item-row-<?php 
        echo $i;
        ?>
">
						<td>
							<?php 
        $imageField = $specialFields['icon'];
        if (isset($imageFieldd) & $imageFieldld->canView()) {
            ?>
								<div class="collection-item-icon">
									<?php 
            echo $imageFieldeld->getOutput(array('view' => "list"));
            ?>
								</div>
Example #3
0
?>
	</th>
	<th style="width:5%" class="center">
		<?php 
echo JText::_('COM_JUDIRECTORY_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 = JUDirectoryFrontHelperField::getFields($item, null);
        ?>
		<tr>
		<td class="center">
			<input type="checkbox" class="judir-cb" name="cid[]" value="<?php 
        echo $item->id;
        ?>
"
			       id="judir-cb-<?php 
        echo $i;
        ?>
"/>
		</td>
		<td>
			<?php 
        $user = JFactory::getUser();
Example #4
0
 protected function _prepareData()
 {
     $this->token = JSession::getFormToken();
     $this->session = JFactory::getSession();
     $this->item->related_listings = $this->model->getRelatedListings($this->item->id);
     if (count($this->item->related_listings)) {
         foreach ($this->item->related_listings as $listingRelated) {
             $listingRelated->link = JRoute::_(JUDirectoryHelperRoute::getListingRoute($listingRelated->id));
             $listingRelated->image = JUDirectoryHelper::getListingImage($listingRelated->image);
         }
     }
     $additionFields = $ignoredFields = array();
     $this->item->fieldLocations = JUDirectoryFrontHelperField::getField('locations', $this->item);
     $this->item->fieldGallery = JUDirectoryFrontHelperField::getField('gallery', $this->item);
     $this->item->fields = JUDirectoryFrontHelperField::getFields($this->item, 2, array(), array('gallery', 'locations'), $additionFields);
     $user = JFactory::getUser();
     $uri = JUri::getInstance();
     if ($this->item->checked_out > 0 && $this->item->checked_out != $user->get('id')) {
         if (JUDirectoryFrontHelperPermission::canCheckInListing($this->item->id)) {
             $this->item->checkin_link = JRoute::_('index.php?option=com_judirectory&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_judirectory&task=form.edit&id=' . $this->item->id . '&Itemid=' . JUDirectoryHelperRoute::findItemIdOfListing($this->item->id));
         if ($this->item->published == 1) {
             $this->item->editstate_link = JRoute::_('index.php?option=com_judirectory&task=forms.unpublish&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDirectoryHelperRoute::findItemIdOfListing($this->item->id));
         } else {
             $this->item->editstate_link = JRoute::_('index.php?option=com_judirectory&task=forms.publish&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDirectoryHelperRoute::findItemIdOfListing($this->item->id));
         }
     }
     $this->item->delete_link = JRoute::_('index.php?option=com_judirectory&task=forms.delete&id=' . $this->item->id . '&return=' . base64_encode(urlencode($uri)) . '&' . JSession::getFormToken() . '=1&Itemid=' . JUDirectoryHelperRoute::findItemIdOfListing($this->item->id));
     $this->item->contact_link = JRoute::_(JUDirectoryHelperRoute::getContactRoute($this->item->id));
     $this->item->report_link = JRoute::_(JUDirectoryHelperRoute::getReportListingRoute($this->item->id));
     $this->item->claim_link = JRoute::_(JUDirectoryHelperRoute::getClaimListingRoute($this->item->id));
     $this->item->print_link = JRoute::_(JUDirectoryHelperRoute::getListingRoute($this->item->id) . '&layout=print&tmpl=component&print=1');
     $this->item->comment = new stdClass();
     $this->item->comment->total_comments_no_filter = $this->model->getTotalCommentsOfListing($this->item->id);
     $this->root_comment = JUDirectoryFrontHelperComment::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 (JUDirectoryFrontHelperPermission::canCheckInComment($comment->id)) {
             $uri = JUri::getInstance();
             $comment->checkout_link = 'index.php?option=com_judirectory&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_JUDIRECTORY_ASC'), 'DESC' => JText::_('COM_JUDIRECTORY_DESC'));
     $this->total_stars = $this->params->get('number_rating_stars', 5);
     $this->filter_comment_stars = array('' => JText::_('COM_JUDIRECTORY_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_JUDIRECTORY_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('judirectory_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'];
     }
 }