/** * * get slide list item html */ public function getSlideHtml($item, $numItem) { $sliderID = $item->sliderid; $itemID = $item->id; //get params $params = new JRegistry(); $params->loadString($item->params, "json"); $urlRoot = JURI::root(); //get image url's: $urlImage = $params->get("image"); if (empty($urlImage)) { $urlImage = GlobalsUniteRev::$urlDefaultSlideImage; } $image = UniteFunctionJoomlaRev::getImageFilename($urlImage); $thumbUrl = UniteFunctionJoomlaRev::getImageOutputUrl($image, 200, 100, true); $imageUrl = $urlRoot . $image; $img_file = pathinfo($imageUrl, PATHINFO_BASENAME); $itemTitle = $item->title . " ({$img_file})"; $itemTitle = htmlspecialchars($itemTitle); $linkItem = HelperUniteRev::getViewUrl_Item($sliderID, $itemID); $isPublished = $item->published; ob_start(); $isJoomla3 = UniteFunctionJoomlaRev::isJoomla3(); ?> <li id="item_<?php echo $itemID; ?> "> <span class="slide-col col-checkbox"> <div class='num-item'> <label class="label_numitem" for="check_item_<?php echo $itemID; ?> "><?php echo $numItem; ?> </label> </div> <div class="published_icon_wrapper"> <?php if ($isPublished) { ?> <?php if ($isJoomla3) { //joomla 3 published ?> <a class="publish_link btn btn-micro active" data-published="true" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <i class="icon-publish"></i> </a> <?php } else { //joomla 2.5 published ?> <a class="jgrid publish_link" data-published="true" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <span class="state publish"> <span class="text"><?php echo JText::_("COM_UNITEREVOLUTION_PUBLISHED"); ?> </span> </span> </a> <?php } ?> <?php } else { ?> <?php if ($isJoomla3) { //joomla3 unpublish ?> <a class="publish_link btn btn-micro active" data-published="false" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_PUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <i class="icon-unpublish"></i> </a> <?php } else { //joomla 2.5 unpublish ?> <a class="jgrid publish_link" data-published="false" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_PUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <span class="state unpublish"> <span class="text"><?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISHED"); ?> </span> </span> </a> <?php } ?> <?php } ?> </div> </span> <span class="slide-col col-title"> <a class='link_slide_title' href="<?php echo $linkItem; ?> "> <?php echo $itemTitle; ?> </a> <a href="<?php echo $linkItem; ?> " data-itemid="<?php echo $itemID; ?> " class="button_edit_slide btn btn-small btn-small">Edit Slide</a> </span> <span class="slide-col col-image"> <a class="modal" href="<?php echo $imageUrl; ?> "> <img src="<?php echo $thumbUrl; ?> " alt="slide image" /> </a> </span> <span class="slide-col col-operations"> <a href="javascript:void(0)" data-itemid="<?php echo $itemID; ?> " class="button_delete_slide btn btn-danger btn-small">Delete</a> <span class="deleting_slide_loader" style="display:none;"> <?php echo jText::_("COM_UNITEREVOLUTION_DELETING_SLIDE"); ?> </span> <a href="javascript:void(0)" data-itemid="<?php echo $itemID; ?> " class="button_duplicate_slide btn btn-small btn-small">Duplicate</a> <span class="duplicate_slide_loader" style="display:none;"><?php echo JText::_("COM_UNITEREVOLUTION_DUPLICATING_SLIDE"); ?> </span> </span> <span class="slide-col col-handle"> <div class="col-handle-inside"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span> </div> </span> </li> <?php $content = ob_get_contents(); ob_clean(); ob_end_clean(); return $content; }
/** * * output the slides */ private function putSlides() { $sliderParams = $this->params; if (empty($this->arrSlides)) { ?> <div class="no-slides-text"> No slides found, please add some slides </div> <?php } $thumbWidth = $sliderParams->get("thumb_width", 100); $thumbHeight = $sliderParams->get("thumb_height", 50); $slideWidth = $sliderParams->get("slider_width", 900); $slideHeight = $sliderParams->get("slider_height", 350); $navigationType = $sliderParams->get("navigaion_type", "none"); $isThumbsActive = $navigationType == "thumb" ? true : false; $flagReize = $sliderParams->get("php_resize", "none"); $flagReize = $flagReize == "on" ? true : false; //for one slide preview if ($this->oneSlideMode == true) { $this->filterOneSlide(); } ?> <ul> <?php foreach ($this->arrSlides as $slide) { $slideParams = $slide["params"]; $transition = $slideParams->get("slide_transition", "random"); $slotAmount = $slideParams->get("slot_amount", "7"); //get slide image url $urlSlideImage = UniteFunctionsRev::getVal($slide, "image"); if (empty($urlSlideImage)) { $urlSlideImage = GlobalsUniteRev::$urlDefaultSlideImage; } $urlSlideImage = UniteFunctionJoomlaRev::getImageUrl($urlSlideImage); $filenameSlideImage = UniteFunctionJoomlaRev::getImageFilename($urlSlideImage); $filepathSlideImage = UniteFunctionJoomlaRev::getImageFilepath($filenameSlideImage); //resize the image file with php resize if needed. if ($flagReize == true) { if (!empty($filenameSlideImage) && file_exists($filepathSlideImage)) { $urlSlideImage = UniteFunctionJoomlaRev::getImageOutputUrl($filenameSlideImage, $slideWidth, $slideHeight, true); } } //get thumb url $htmlThumb = ""; if ($isThumbsActive == true) { $urlThumb = $slideParams->get("slide_thumb", ""); if (empty($urlThumb)) { //try to get resized thumb if (!empty($filenameSlideImage) && file_exists($filepathSlideImage)) { $urlThumb = UniteFunctionJoomlaRev::getImageOutputUrl($filenameSlideImage, $thumbWidth, $thumbHeight, true); } } //if not - put regular image: if (empty($urlThumb)) { $urlThumb = $urlSlideImage; } $urlThumb = UniteFunctionJoomlaRev::getImageUrl($urlThumb); $htmlThumb = 'data-thumb="' . $urlThumb . '" '; } //get link //get link $htmlLink = ""; $enableLink = $slideParams->get("enable_link", "false"); if ($enableLink == "true") { $linkType = $slideParams->get("link_type", "regular"); switch ($linkType) { //---- normal link default: case "regular": $link = $slideParams->get("link", ""); if (!empty($link)) { $linkOpenIn = $slideParams->get("link_open_in", "same"); $htmlTarget = ""; if ($linkOpenIn == "new") { $htmlTarget = ' data-target="_blank"'; } $htmlLink = "data-link=\"{$link}\" {$htmlTarget} "; } break; //---- link to slide //---- link to slide case "slide": $slideLink = $slideParams->get("slide_link"); if (!empty($slideLink) && $slideLink != "nothing") { //get slide index from id if (is_numeric($slideLink)) { $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink); } if (!empty($slideLink)) { $htmlLink = "data-link=\"slide\" data-linktoslide=\"{$slideLink}\" "; } } break; } } //set link position: $linkPos = $slideParams->get("link_pos", "front"); if ($linkPos == "back") { $htmlLink .= ' data-slideindex="back"'; } //set delay $htmlDelay = ""; $delay = $slideParams->get("delay", ""); if (!empty($delay) && is_numeric($delay)) { $htmlDelay = "data-delay=\"{$delay}\" "; } //get duration $htmlDuration = ""; $duration = $slideParams->get("transition_duration", ""); if (!empty($duration) && is_numeric($duration)) { $htmlDuration = "data-masterspeed=\"{$duration}\" "; } //get rotation $htmlRotation = ""; $rotation = $slideParams->get("transition_rotation", ""); if (!empty($rotation)) { $rotation = (int) $rotation; if ($rotation != 0) { if ($rotation > 720 && $rotation != 999) { $rotation = 720; } if ($rotation < -720) { $rotation = -720; } } $htmlRotation = "data-rotate=\"{$rotation}\" "; } $videoData = $this->getSlideFullWidthVideoData($slideParams); $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation; //get the alt text $altText = $slideParams->get("alt_text"); if (!empty($altText)) { $altText = stripslashes($altText); $altText = htmlspecialchars($altText); } //Html ?> <li data-transition="<?php echo $transition; ?> " data-slotamount="<?php echo $slotAmount; ?> " <?php echo $htmlParams; ?> > <img src="<?php echo $urlSlideImage; ?> " alt="<?php echo $altText; ?> " /> <?php //put video: if ($videoData["found"] == true) { $this->putFullWidthVideoLayer($videoData); } $this->putCreativeLayer($slide); ?> </li> <?php } //get foreach ?> </ul> <?php }
//$user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; $canEditOwn = true; //$user->authorise('core.edit.own', 'com_contact.category.'.$item->catid) && $item->created_by == $userId; $canChange = true; //$user->authorise('core.edit.state', 'com_contact.category.'.$item->catid) && $canCheckin; //get params $params = new JRegistry(); $params->loadString($item->params, "json"); $urlRoot = JURI::root(); //get image url's: $urlImage = $params->get("image"); if (empty($urlImage)) { $urlImage = GlobalsUniteRev::$urlDefaultSlideImage; } $image = UniteFunctionJoomlaRev::getImageFilename($urlImage); $thumbUrl = UniteFunctionJoomlaRev::getImageOutputUrl($image, 200, 100, true); $imageUrl = $urlRoot . $image; $img_file = pathinfo($imageUrl, PATHINFO_BASENAME); $itemTitle = $item->title . " ({$img_file})"; ?> <tr class="row<?php echo $i % 2; ?> "> <td class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </td> <td> <a href="<?php