示例#1
0
    }
    // end permission
    ?>
						
						<div class="clear"></div>
						<?php 
    if ($showLangs == true) {
        ?>
						<ul class="list_slide_icons">
							<?php 
        foreach ($arrChildLangs as $arrLang) {
            $isParent = UniteFunctionsRev::boolToStr($arrLang["isparent"]);
            $childSlideID = $arrLang["slideid"];
            $lang = $arrLang["lang"];
            $urlFlag = UniteWpmlRev::getFlagUrl($lang);
            $langTitle = UniteWpmlRev::getLangTitle($lang);
            ?>
							<li>
								<img id="icon_lang_<?php 
            echo $childSlideID;
            ?>
" class="icon_slide_lang" src="<?php 
            echo $urlFlag;
            ?>
" title="<?php 
            echo $langTitle;
            ?>
" data-slideid="<?php 
            echo $childSlideID;
            ?>
" data-lang="<?php 
 /**
  * 
  * add language (add slide that connected to current slide) from data
  */
 private function addLangFromData($data)
 {
     $sliderID = UniteFunctionsRev::getVal($data, "sliderid");
     $slideID = UniteFunctionsRev::getVal($data, "slideid");
     $lang = UniteFunctionsRev::getVal($data, "lang");
     //duplicate slide
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $newSlideID = $slider->duplicateSlide($slideID);
     //update new slide
     $this->initByID($newSlideID);
     $arrUpdate = array();
     $arrUpdate["lang"] = $lang;
     $arrUpdate["parentid"] = $slideID;
     $this->updateParamsInDB($arrUpdate);
     $urlIcon = UniteWpmlRev::getFlagUrl($lang);
     $title = UniteWpmlRev::getLangTitle($lang);
     $newSlide = new RevSlide();
     $newSlide->initByID($slideID);
     $arrLangCodes = $newSlide->getArrChildLangCodes();
     $isAll = UniteWpmlRev::isAllLangsInArray($arrLangCodes);
     $html = "<li>\n\t\t\t\t\t\t\t\t<img id=\"icon_lang_" . $newSlideID . "\" class=\"icon_slide_lang\" src=\"" . $urlIcon . "\" title=\"" . $title . "\" data-slideid=\"" . $newSlideID . "\" data-lang=\"" . $lang . "\">\n\t\t\t\t\t\t\t\t<div class=\"icon_lang_loader loader_round\" style=\"display:none\"></div>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</li>";
     $response = array();
     $response["operation"] = "add";
     $response["isAll"] = $isAll;
     $response["html"] = $html;
     return $response;
 }
 /**
  * 
  * updatye slide language from data
  */
 public function updateLangFromData($data)
 {
     $slideID = UniteFunctionsRev::getVal($data, "slideid");
     $this->initByID($slideID);
     $lang = UniteFunctionsRev::getVal($data, "lang");
     $arrUpdate = array();
     $arrUpdate["lang"] = $lang;
     $this->updateParamsInDB($arrUpdate);
     $response = array();
     $response["url_icon"] = UniteWpmlRev::getFlagUrl($lang);
     $response["title"] = UniteWpmlRev::getLangTitle($lang);
     return $response;
 }