本文整理汇总了PHP中RevOperations::extractImageToSliderFolder方法的典型用法代码示例。如果您正苦于以下问题:PHP RevOperations::extractImageToSliderFolder方法的具体用法?PHP RevOperations::extractImageToSliderFolder怎么用?PHP RevOperations::extractImageToSliderFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevOperations
的用法示例。
在下文中一共展示了RevOperations::extractImageToSliderFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importSliderFromPost
//.........这里部分代码省略.........
//delete current slides
if ($sliderExists) {
$this->deleteAllSlides();
}
//create all slides
$arrSlides = $arrSlider["slides"];
$alreadyImported = array();
$sliderAlias = UniteFunctionsRev::getVal($sliderParams, "alias");
$sliderAlias = trim($sliderAlias);
if (empty($sliderAlias)) {
$sliderAlias = "defaultslider";
}
foreach ($arrSlides as $slide) {
$params = $slide["params"];
$layers = $slide["layers"];
$image = UniteFunctionsRev::getVal($params, "image");
$image = trim($image);
//convert params images:
if (!empty($image)) {
if ($importZip === true) {
//we have a zip, check if exists
//import from wp format
$entryPath = 'images/' . $image;
$imageEntry = $zip->getStream($entryPath);
//import from joomla format
if (!$imageEntry) {
$entryPath = $image;
$imageEntry = $zip->getStream($entryPath);
}
if (!$imageEntry) {
echo "{$image} not found!<br>";
} else {
try {
$pathImage = RevOperations::extractImageToSliderFolder($zip, $sliderAlias, $entryPath, $image);
$params["image"] = $pathImage;
} catch (Exception $e) {
echo "can't extract image: {$image} <br>";
$params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($image);
}
}
} else {
$params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($image);
}
}
//convert layers images:
foreach ($layers as $key => $layer) {
$image = UniteFunctionsRev::getVal($layer, "image_url");
$image = trim($image);
if (!empty($image)) {
if ($importZip === true) {
//we have a zip, check if exists
//import from wp format
$entryPath = 'images/' . $image;
$imageEntry = $zip->getStream($entryPath);
//import from joomla format
if (!$imageEntry) {
$entryPath = $image;
$imageEntry = $zip->getStream($entryPath);
}
if (!$imageEntry) {
echo $image . ' not found!<br>';
} else {
try {
$pathImage = RevOperations::extractImageToSliderFolder($zip, $sliderAlias, $entryPath, $image);
$layer["image_url"] = $pathImage;
} catch (Exception $e) {