<div class="djc_image"> <?php if ($params->get('linkimage', '1') == '1') { ?> <a href="<?php echo $product_url; ?> "> <?php } ?> <img class="img-polaroid" alt="<?php echo $item->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getProcessedImage($item->item_image, (int) $params->get('imagewidth', '120'), (int) $params->get('imageheight', '120'), !(bool) $params->get('imageprocess', true), $item->image_path); ?> "/> <?php if ($params->get('linkimage', '1') == '1') { ?> </a> <?php } ?> </div> <?php } ?> <?php if ($params->get('showtitle', '1') == '1') {
function getXml() { $app = JFactory::getApplication(); $jinput = $app->input; $this->_cparams = $app->getParams('com_djcatalog2'); $moduleclass_sfx = $jinput->get('moduleclass_sfx', null, 'string'); $mid = (int) $jinput->get('moduleId', null, 'int'); $stitle = $jinput->get('stitle', '1', 'string'); $ltitle = $jinput->get('ltitle', '1', 'string'); $modal = $jinput->get('modal', 1, 'int'); $scattitle = $jinput->get('scattitle', null, 'string'); $sproducer = $jinput->get('sproducer', '0', 'string'); $sprice = $jinput->get('sprice', '0', 'string'); $spag = $jinput->get('spag', null, 'int'); //$orderby = $jinput->get( 'orderby', null, 'get', 'int', 0); //$orderdir = $jinput->get( 'orderdir', 0, 'get', 'int', 0); //$featured_only = $jinput->get( 'featured_only', 0, 'get', 'int', 0); //$featured_first = $jinput->get( 'featured_first', 0, 'get', 'int', 0); $cols = (int) $jinput->get('cols', null, 'int'); $rows = (int) $jinput->get('rows', null, 'int'); //$mainimage = $jinput->get( 'mainimg', 'large', 'get', 'string', 0); $trunc = (int) $jinput->get('trunc', '0', 'int'); $trunclimit = (int) $jinput->get('trunclimit', '0', 'int'); $showreadmore = (int) $jinput->get('showreadmore', '1', 'int'); $readmoretext = $jinput->get('readmoretext', '', 'string'); $readmoretext = $readmoretext != '' ? urldecode($readmoretext) : JText::_('COM_DJCATALOG2_READMORE'); $paginationStart = (int) $jinput->get('pagstart', null, 'int'); $categories = $jinput->get('categories', null, 'string'); $catsw = $jinput->get('catsw', 0, 'int'); $categories = explode('|', $categories); $largewidth = $jinput->get('largewidth', '400', 'int'); $largeheight = $jinput->get('largeheight', '240', 'int'); $largecrop = $jinput->get('largecrop', 1, 'int') ? true : false; $smallwidth = $jinput->get('smallwidth', '90', 'int'); $smallheight = $jinput->get('smallheight', '70', 'int'); $smallcrop = $jinput->get('smallcrop', 1, 'int') ? true : false; $Itemid = $jinput->get('Itemid', 0, 'int'); $path = JURI::base(); $itemsCount = $this->getTotal(); $itemsPerPage = $rows * $cols; $paginationBar = null; //if ($spag == 1) { $paginationBar = '<pagination><![CDATA['; if ($itemsCount > $itemsPerPage && $itemsPerPage > 0) { if ((int) $spag == 1) { for ($i = 0; $i < $itemsCount; $i = $i + $itemsPerPage) { $counter = (int) (($i + $itemsPerPage) / $itemsPerPage); if ($paginationStart == $i) { $active = ' active'; } else { $active = ''; } $paginationBar .= '<span class="btn' . $active . ' button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $i . '); return false;">' . $counter . '</span> '; } } else { $prevPage = $paginationStart - $itemsPerPage; $nextPage = $paginationStart + $itemsPerPage; $firstPage = 0; $lastPage = $itemsPerPage * (ceil($itemsCount / $itemsPerPage) - 1); if ($paginationStart == 0) { $prevPage = $lastPage; } if ($paginationStart == $lastPage) { $nextPage = $firstPage; } $paginationBar .= '<span class="djcf_prev_button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $prevPage . '); return false;"></span> '; $paginationBar .= '<span class="djcf_next_button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $nextPage . '); return false;"></span>'; } } $paginationBar .= ']]></pagination>'; //} $items = $this->getList($paginationStart, $itemsPerPage); $output = '<?xml version="1.0" encoding="utf-8" ?><contents>'; $gallery = ''; for ($i = 0; $i < count($items); $i++) { $title = ''; $readmore = JRoute::_(DJCatalogHelperRoute::getItemRoute($items[$i]->slug, $items[$i]->catslug)); if ($stitle == '1') { if ($ltitle) { $title = '<h3><a href="' . $readmore . '">' . $items[$i]->name . '</a></h3>'; } else { $title = '<h3>' . $items[$i]->name . '</h3>'; } } $cattitle = ''; if ($scattitle == 1) { $cattitle = '<h2>' . $items[$i]->category . '</h2>'; } $producer = ''; if ($sproducer == 1 && $items[$i]->producer) { $producer = '<div class="djc_producer">' . JText::_('COM_DJCATALOG2_PRODUCER') . ': ' . $items[$i]->producer . '</div>'; } $price = ''; if ($sprice == 1 && $items[$i]->price > 0) { if ($items[$i]->special_price) { $price = JText::_('COM_DJCATALOG2_PRICE') . ': <span class="djc_price_old">' . $items[$i]->price . '</span> <span class="djc_price_new">' . $items[$i]->special_price . '</span>'; } else { $price = JText::_('COM_DJCATALOG2_PRICE') . ': <span class="djc_price">' . $items[$i]->price . '</span>'; } $price = '<div class="djc_price">' . $price . '</div>'; } if ($trunc > 0 && $trunclimit > 0) { $items[$i]->intro_desc = DJCatalog2HtmlHelper::trimText($items[$i]->intro_desc, $trunclimit); } else { if ($trunc > 0 && $trunclimit == -1) { $items[$i]->intro_desc = ''; } } $items[$i]->intro_desc = $producer . $price . $items[$i]->intro_desc; $output .= '<content>'; if ($scattitle == 1) { $output .= '<category><![CDATA[' . $cattitle . ']]></category>'; } $output .= '<text><![CDATA[' . $title . '<div class="djf_desc">' . $items[$i]->intro_desc . '</div>'; if ($showreadmore == '1') { $output .= '<a class="btn btn-primary btn-large" href="' . $readmore . '">' . $readmoretext . '</a>'; } $output .= ']]></text>'; $output .= '<image><![CDATA[' . DJCatalog2ImageHelper::getProcessedImage($items[$i]->item_image, $largewidth, $largeheight, !$largecrop, $items[$i]->image_path) . ']]></image>'; if ($modal == 1) { $output .= '<src><![CDATA[' . DJCatalog2ImageHelper::getImageUrl($items[$i]->image_fullpath, 'fullscreen') . ']]></src>'; } else { $output .= '<src><![CDATA[' . $readmore . ']]></src>'; } $output .= '</content>'; if ($items[$i]->item_image) { $gallery .= '<thumb><![CDATA[<div class="djf_cell img-polaroid"><a href="' . $readmore . '" onclick="DJFrontpage_' . $mid . '.loadItem(' . $i . '); return false;"><img src="' . DJCatalog2ImageHelper::getProcessedImage($items[$i]->item_image, $smallwidth, $smallheight, !$smallcrop, $items[$i]->image_path) . '" alt="' . $items[$i]->image_caption . '" /></a></div>]]></thumb>'; } else { $gallery .= '<thumb><![CDATA[]]></thumb>'; } } $all = $output . $gallery . $paginationBar; $all .= '</contents>'; return $all; }