Ejemplo n.º 1
0
    /**
     * 
     * 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;
    }
Ejemplo n.º 2
0
 /**
  * 
  * set image style and preview url
  */
 private function setEditLayersSettings()
 {
     //get slider id
     if (!empty($this->item->id)) {
         $sliderID = $this->item->sliderid;
     } else {
         $sliderID = JRequest::getCmd("sliderid");
     }
     $this->urlViewItems = HelperUniteRev::getViewUrl_Items($sliderID);
     $this->urlViewItemPattern = HelperUniteRev::getViewUrl_Item($sliderID, "");
     $this->urlViewItemNew = HelperUniteRev::getViewUrl_Item($sliderID);
     $this->slideID = $this->item->id;
     $this->sliderID = $sliderID;
     $slider = HelperUniteRev::getSlider($sliderID);
     $this->slider = $slider;
     $params = $slider["params"];
     $sliderHeight = $params->get("slider_height", 960);
     $sliderWidth = $params->get("slider_width", 350);
     //get image url
     $urlImage = $this->params->get("image");
     if (empty($urlImage)) {
         $urlImage = GlobalsUniteRev::$urlDefaultSlideImage;
     } else {
         $urlImage = UniteFunctionJoomlaRev::getImageUrl($urlImage);
     }
     //create the style:
     $this->styleLayers = "width:{$sliderWidth}px;height:{$sliderHeight}px;";
     if (!empty($urlImage)) {
         $this->styleLayers .= "background-image:url({$urlImage});";
     }
     //create iframe style:
     //set iframe parameters
     $iframeWidth = $sliderWidth + 60;
     $iframeHeight = $sliderHeight + 50;
     $this->styleIframe = "width:{$iframeWidth}px;height:{$iframeHeight}px;";
     //load edit layers
     $this->formLayer = new JForm("layer");
     $this->formLayer->loadFile("layers");
     //set captions list
     //prepare
     $contentCSS = $this->operations->getCaptionsContent();
     $arrCaptionClasses = $this->operations->getArrCaptionClasses($contentCSS);
     $firstCaption = !empty($arrCaptionClasses) ? $arrCaptionClasses[0] : "";
     //set caption field value of the first caption
     $this->formLayer->setValue("layer_caption", "", $firstCaption);
     $jsonLayers = $this->prepareLayersForOutput($this->item->layers);
     $this->jsonCaptions = UniteFunctionsRev::jsonEncodeForClientSide($arrCaptionClasses);
     $this->jsonLayers = UniteFunctionsRev::jsonEncodeForClientSide($jsonLayers);
     $this->arrButtonClasses = $this->operations->getButtonClasses();
     //set slide delay
     $this->slideDelay = $this->params->get("delay");
     if (empty($slideDelay)) {
         $this->slideDelay = $params->get("delay", "9000");
     }
 }