?>
 </th>			
		</tr>
	</thead>
	<tbody>
		<?php 
foreach ($arrSliders as $slider) {
    $id = $slider->getID();
    $showTitle = $slider->getShowTitle();
    $title = $slider->getTitle();
    $alias = $slider->getAlias();
    $shortCode = $slider->getShortcode();
    $numSlides = $slider->getNumSlides();
    $editLink = self::getViewUrl(BannerRotatorAdmin::VIEW_SLIDER, "id={$id}");
    $editSlidesLink = self::getViewUrl(BannerRotatorAdmin::VIEW_SLIDES, "id={$id}");
    $showTitle = UniteFunctionsBanner::getHtmlLink($editLink, $showTitle);
    ?>
			<tr>
				<td><?php 
    echo $id;
    ?>
<span id="slider_title_<?php 
    echo $id;
    ?>
" class="hidden"><?php 
    echo $title;
    ?>
</span></td>								
				<td><?php 
    echo $showTitle;
    ?>
    }
    $imageFilepath = $slide->getImageFilepath();
    $urlImageForView = $slide->getThumbUrl();
    $slideTitle = $slide->getParam("title", "Slide");
    $title = $slideTitle;
    $filename = $slide->getImageFilename();
    $imageAlt = stripslashes($slideTitle);
    if (empty($imageAlt)) {
        $imageAlt = "slide";
    }
    if ($bgType == "image") {
        $title .= " ({$filename})";
    }
    $slideid = $slide->getID();
    $urlEditSlide = self::getViewUrl(BannerRotatorAdmin::VIEW_SLIDE, "id={$slideid}");
    $linkEdit = UniteFunctionsBanner::getHtmlLink($urlEditSlide, $title);
    $state = $slide->getParam("state", "published");
    ?>
				<li id="slidelist_item_<?php 
    echo $slideid;
    ?>
" class="ui-state-default">
				
					<span class="slide-col col-order">
						<span class="order-text"><?php 
    echo $order;
    ?>
</span>
						<div class="state_loader" style="display:none;"></div>
						<?php 
    if ($state == "published") {
$operations = new BannerOperations();
//Set Layer settings
$contentCSS = $operations->getCaptionsContent();
$arrAnimations = $operations->getArrAnimations();
$arrEndAnimations = $operations->getArrEndAnimations();
$htmlButtonDown = '<div id="layer_captions_down" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-s"></span></div>';
$buttonEditStyles = UniteFunctionsBanner::getHtmlLink("javascript:void(0)", "<i class='icon-magic'></i>Edit CSS File", "button_edit_css", "button-primary btn-blue");
$arrEasing = $operations->getArrEasing();
$arrEndEasing = $operations->getArrEndEasing();
$captionsAddonHtml = $htmlButtonDown . $buttonEditStyles;
//Set Layer settings
$layerSettings = new UniteSettingsAdvancedBanner();
$layerSettings->addSection(__("Layer Params", BANNERROTATOR_TEXTDOMAIN), __("layer_params", BANNERROTATOR_TEXTDOMAIN));
$layerSettings->addSap(__("Layer Params", BANNERROTATOR_TEXTDOMAIN), __("layer_params"));
$layerSettings->addTextBox(__("layer_caption"), __("caption_green"), __("Style", BANNERROTATOR_TEXTDOMAIN), array(UniteSettingsBanner::PARAM_ADDTEXT => $captionsAddonHtml, "class" => "textbox-caption"));
$addHtmlTextarea = UniteFunctionsBanner::getHtmlLink("javascript:void(0)", "insert button", "linkInsertButton", "disabled");
$layerSettings->addTextArea("layer_text", "", __("Text / Html", BANNERROTATOR_TEXTDOMAIN), array("class" => "area-layer-params", UniteSettingsBanner::PARAM_ADDTEXT_BEFORE_ELEMENT => $addHtmlTextarea));
$layerSettings->addTextBox("layer_image_link", "", __("Image Link", BANNERROTATOR_TEXTDOMAIN), array("class" => "text-sidebar-link", "hidden" => true));
$layerSettings->addSelect("layer_link_open_in", array("same" => __("Same Window", BANNERROTATOR_TEXTDOMAIN), "new" => __("New Window", BANNERROTATOR_TEXTDOMAIN)), __("Link Open In", BANNERROTATOR_TEXTDOMAIN), "same", array("hidden" => true));
$layerSettings->addSelect("layer_animation", $arrAnimations, __("Animation", BANNERROTATOR_TEXTDOMAIN), "fade");
$layerSettings->addSelect("layer_easing", $arrEasing, __("Easing", BANNERROTATOR_TEXTDOMAIN), "easeOutExpo");
$params = array("unit" => __("ms", BANNERROTATOR_TEXTDOMAIN));
$layerSettings->addTextBox("layer_speed", "", "Speed", $params);
$layerSettings->addCheckbox("layer_hidden", false, __("Hide Under Width", BANNERROTATOR_TEXTDOMAIN));
//Put left top
$textOffsetX = __("OffsetX", BANNERROTATOR_TEXTDOMAIN);
$textX = __("X", BANNERROTATOR_TEXTDOMAIN);
$params = array("attrib_text" => "data-textoffset='{$textOffsetX}' data-textnormal='{$textX}'");
$layerSettings->addTextBox("layer_left", "", __("X", BANNERROTATOR_TEXTDOMAIN), $params);
$textOffsetY = __("OffsetY", BANNERROTATOR_TEXTDOMAIN);
$textY = __("Y", BANNERROTATOR_TEXTDOMAIN);
 private static function importSliderHandle($viewBack = null)
 {
     dmp(__("importing slider setings and data...", BANNERROTATOR_TEXTDOMAIN));
     $slider = new BannerRotator();
     $response = $slider->importSliderFromPost();
     $sliderID = $response["sliderID"];
     if (empty($viewBack)) {
         $viewBack = self::getViewUrl(self::VIEW_SLIDER, "id=" . $sliderID);
         if (empty($sliderID)) {
             $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
         }
     }
     //Handle error
     if ($response["success"] == false) {
         $message = $response["error"];
         dmp("<b>Error: " . $message . "</b>");
         echo UniteFunctionsBanner::getHtmlLink($viewBack, __("Go Back", BANNERROTATOR_TEXTDOMAIN));
     } else {
         //Handle success, js redirect
         dmp(__("Slider Import Success, redirecting...", BANNERROTATOR_TEXTDOMAIN));
         echo "<script>location.href='{$viewBack}'</script>";
     }
     exit;
 }
 private function drawButtons()
 {
     foreach ($this->arrButtons as $key => $button) {
         if ($key > 0) {
             echo "<span class='hor_sap'></span>";
         }
         echo UniteFunctionsBanner::getHtmlLink("#", $button["title"], $button["id"], $button["class"]);
     }
 }
 protected static function updatePlugin($viewBack = false)
 {
     $linkBack = self::getViewUrl($viewBack);
     $htmlLinkBack = UniteFunctionsBanner::getHtmlLink($linkBack, "Go Back");
     $zip = new UniteZipBanner();
     try {
         if (function_exists("unzip_file") == false) {
             if (UniteZipBanner::isZipExists() == false) {
                 UniteFunctionsBanner::throwError("The ZipArchive php extension not exists, can't extract the update file. Please turn it on in php ini.");
             }
         }
         dmp("Update in progress...");
         $arrFiles = UniteFunctionsBanner::getVal($_FILES, "update_file");
         if (empty($arrFiles)) {
             UniteFunctionsBanner::throwError("Update file don't found.");
         }
         $filename = UniteFunctionsBanner::getVal($arrFiles, "name");
         if (empty($filename)) {
             UniteFunctionsBanner::throwError("Update filename not found.");
         }
         $fileType = UniteFunctionsBanner::getVal($arrFiles, "type");
         /*				
         $fileType = strtolower($fileType);
         
         if($fileType != "application/zip")
         	UniteFunctionsBanner::throwError("The file uploaded is not zip.");
         */
         $filepathTemp = UniteFunctionsBanner::getVal($arrFiles, "tmp_name");
         if (file_exists($filepathTemp) == false) {
             UniteFunctionsBanner::throwError("Can't find the uploaded file.");
         }
         //Crate temp folder
         UniteFunctionsBanner::checkCreateDir(self::$path_temp);
         //Create the update folder
         $pathUpdate = self::$path_temp . "update_extract/";
         UniteFunctionsBanner::checkCreateDir($pathUpdate);
         //Remove all files in the update folder
         if (is_dir($pathUpdate)) {
             $arrNotDeleted = UniteFunctionsBanner::deleteDir($pathUpdate, false);
             if (!empty($arrNotDeleted)) {
                 $strNotDeleted = print_r($arrNotDeleted, true);
                 UniteFunctionsBanner::throwError("Could not delete those files from the update folder: {$strNotDeleted}");
             }
         }
         //Copy the zip file
         $filepathZip = $pathUpdate . $filename;
         $success = move_uploaded_file($filepathTemp, $filepathZip);
         if ($success == false) {
             UniteFunctionsBanner::throwError("Can't move the uploaded file here: {$filepathZip}.");
         }
         if (function_exists("unzip_file") == true) {
             WP_Filesystem();
             $response = unzip_file($filepathZip, $pathUpdate);
         } else {
             $zip->extract($filepathZip, $pathUpdate);
         }
         //Get extracted folder
         $arrFolders = UniteFunctionsBanner::getFoldersList($pathUpdate);
         if (empty($arrFolders)) {
             UniteFunctionsBanner::throwError("The update folder is not extracted");
         }
         if (count($arrFolders) > 1) {
             UniteFunctionsBanner::throwError("Extracted folders are more then 1. Please check the update file.");
         }
         //Get product folder
         $productFolder = $arrFolders[0];
         if (empty($productFolder)) {
             UniteFunctionsBanner::throwError("Wrong product folder.");
         }
         if ($productFolder != self::$dir_plugin) {
             UniteFunctionsBanner::throwError("The update folder don't match the product folder, please check the update file.");
         }
         $pathUpdateProduct = $pathUpdate . $productFolder . "/";
         //Check some file in folder to validate it's the real one:
         $checkFilepath = $pathUpdateProduct . $productFolder . ".php";
         if (file_exists($checkFilepath) == false) {
             UniteFunctionsBanner::throwError("Wrong update extracted folder. The file: {$checkFilepath} not found.");
         }
         //Copy the plugin without the captions file
         $pathOriginalPlugin = self::$path_plugin;
         $arrBlackList = array();
         $arrBlackList[] = "css/caption.css";
         UniteFunctionsBanner::copyDir($pathUpdateProduct, $pathOriginalPlugin, "", $arrBlackList);
         //Delete the update
         UniteFunctionsBanner::deleteDir($pathUpdate);
         dmp("Updated Successfully, redirecting...");
         echo "<script>location.href='{$linkBack}'</script>";
     } catch (Exception $e) {
         $message = $e->getMessage();
         $message .= " <br> Please update the plugin manually via the ftp";
         echo "<div style='color:#B80A0A;font-size:18px;'><b>Update Error: </b> {$message}</div><br>";
         echo $htmlLinkBack;
         exit;
     }
 }