/** * * draw imaeg input: * @param $setting */ protected function drawImageInput($setting) { $class = UniteFunctionsRev::getVal($setting, "class"); if (!empty($class)) { $class = "class='{$class}'"; } $settingsID = $setting["id"]; $buttonID = $settingsID . "_button"; $spanPreviewID = $buttonID . "_preview"; $img = ""; $value = UniteFunctionsRev::getVal($setting, "value"); if (!empty($value)) { $urlImage = $value; $imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage); if (file_exists($realPath)) { $filepath = UniteFunctionsWPRev::getImagePathFromURL($urlImage); $urlImage = UniteBaseClassRev::getImageUrl($filepath, 100, 70, true); } $img = "<img width='100' height='70' src='{$urlImage}'></img>"; } ?> <span id='<?php echo $spanPreviewID; ?> ' class='setting-image-preview'><?php echo $img; ?> </span> <input type="hidden" id="<?php echo $setting["id"]; ?> " name="<?php echo $setting["name"]; ?> " value="<?php echo $setting["value"]; ?> " /> <input type="button" id="<?php echo $buttonID; ?> " class='button-image-select <?php echo $class; ?> ' value="Choose Image"></input> <?php }
/** * * get params for export */ public function getParamsForExport() { $arrParams = $this->getParams(); $urlImage = UniteFunctionsRev::getVal($arrParams, "image"); if (!empty($urlImage)) { $arrParams["image"] = UniteFunctionsWPRev::getImagePathFromURL($urlImage); } return $arrParams; }
/** * * set slide image by image id */ private function setImageByImageID($imageID) { $this->imageID = $imageID; $this->imageUrl = UniteFunctionsWPRev::getUrlAttachmentImage($imageID); $this->imageThumb = UniteFunctionsWPRev::getUrlAttachmentImage($imageID, UniteFunctionsWPRev::THUMB_MEDIUM); if (empty($this->imageUrl)) { return false; } $this->params["background_type"] = "image"; if (Mage::helper('nwdrevslider')->isSsl()) { $this->imageUrl = str_replace("http://", "https://", $this->imageUrl); } $this->imageFilepath = UniteFunctionsWPRev::getImagePathFromURL($this->imageUrl); $realPath = UniteFunctionsWPRev::getPathContent() . $this->imageFilepath; if (file_exists($realPath) == false || is_file($realPath) == false) { $this->imageFilepath = ""; } $this->imageFilename = basename($this->imageUrl); }