/**
  * 
  * import slider from multipart form
  */
 public function importSliderFromPost($exactfilepath = false)
 {
     try {
         $sliderID = UniteFunctionsBiz::getPostVariable("sliderid");
         $sliderExists = !empty($sliderID);
         if ($sliderExists) {
             $this->initByID($sliderID);
         }
         if ($exactfilepath !== false) {
             $filepath = $exactfilepath;
         } else {
             $filepath = $_FILES["import_file"]["tmp_name"];
         }
         if (file_exists($filepath) == false) {
             UniteFunctionsBiz::throwError("Import file not found!!!");
         }
         //get content array
         $content = @file_get_contents($filepath);
         $arrSlider = @unserialize($content);
         if (empty($arrSlider)) {
             UniteFunctionsBiz::throwError("Wrong export slider file format!");
         }
         //update slider params
         $sliderParams = $arrSlider["params"];
         $sliderParams["title"] = $this->arrParams["title"];
         $sliderParams["alias"] = $this->arrParams["alias"];
         $sliderParams["shortcode"] = $this->arrParams["shortcode"];
         if (isset($sliderParams["background_image"])) {
             $sliderParams["background_image"] = UniteFunctionsWPBiz::getImageUrlFromPath($sliderParams["background_image"]);
         }
         $json_params = json_encode($sliderParams);
         $arrUpdate = array("params" => $json_params);
         $this->db->update(GlobalsShowBiz::$table_sliders, $arrUpdate, array("id" => $sliderID));
         //-------- Slides Handle -----------
         //delete current slides
         $this->deleteAllSlides();
         //create all slides
         $arrSlides = $arrSlider["slides"];
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             //convert params images:
             if (isset($params["image"])) {
                 $params["image"] = UniteFunctionsWPBiz::getImageUrlFromPath($params["image"]);
             }
             //create new slide
             $arrCreate = array();
             $arrCreate["slider_id"] = $sliderID;
             $arrCreate["slide_order"] = $slide["slide_order"];
             $arrCreate["params"] = json_encode($params);
             $this->db->insert(GlobalsShowBiz::$table_slides, $arrCreate);
         }
     } catch (Exception $e) {
         $errorMessage = $e->getMessage();
         return array("success" => false, "error" => $errorMessage, "sliderID" => $sliderID);
     }
     return array("success" => true, "sliderID" => $sliderID);
 }