private function addLangFromData($data) { $sliderID = UniteFunctionsBanner::getVal($data, "sliderid"); $slideID = UniteFunctionsBanner::getVal($data, "slideid"); $lang = UniteFunctionsBanner::getVal($data, "lang"); //duplicate slide $slider = new BannerRotator(); $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 = UniteWpmlBanner::getFlagUrl($lang); $title = UniteWpmlBanner::getLangTitle($lang); $newSlide = new BannerSlide(); $newSlide->initByID($slideID); $arrLangCodes = $newSlide->getArrChildLangCodes(); $isAll = UniteWpmlBanner::isAllLangsInArray($arrLangCodes); $html = "<li>\n\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<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</li>"; $response = array(); $response["operation"] = "add"; $response["isAll"] = $isAll; $response["html"] = $html; return $response; }