本文整理汇总了PHP中RevSlider::deleteSlider方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::deleteSlider方法的具体用法?PHP RevSlider::deleteSlider怎么用?PHP RevSlider::deleteSlider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::deleteSlider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importSliderOnlineTemplateHandle
/**
* import slider from TP servers
* @since: 5.0.5
*/
private static function importSliderOnlineTemplateHandle($viewBack = null, $updateAnim = true, $updateStatic = true, $single_slide = false)
{
dmp(__("downloading template slider from server...", 'revslider'));
$uid = esc_attr(RevSliderFunctions::getPostVariable('uid'));
if ($uid == '') {
dmp(__("ID missing, something went wrong. Please try again!", 'revslider'));
echo RevSliderFunctions::getHtmlLink($viewBack, __("Go Back", 'revslider'));
exit;
} else {
//send request to TP server and download file
$tmp = new RevSliderTemplate();
$filepath = $tmp->_download_template($uid);
if ($filepath !== false && !is_array($filepath)) {
//check if Slider Template was already imported. If yes, remove the old Slider Template as we now do an "update" (in reality we delete and insert again)
//get all template sliders
$tmp_slider = $tmp->getThemePunchTemplateSliders();
foreach ($tmp_slider as $tslider) {
if (isset($tslider['uid']) && $uid == $tslider['uid']) {
if (!isset($tslider['installed'])) {
//slider is installed
//delete template Slider!
$mSlider = new RevSlider();
$mSlider->initByID($tslider['id']);
$mSlider->deleteSlider();
//remove the update flag from the slider
$tmp->remove_is_new($uid);
}
break;
}
}
$slider = new RevSlider();
$response = $slider->importSliderFromPost($updateAnim, $updateStatic, $filepath, $uid, $single_slide);
$tmp->_delete_template($uid);
if ($single_slide === false) {
if (empty($viewBack)) {
$sliderID = $response["sliderID"];
$viewBack = self::getViewUrl(self::VIEW_SLIDER, "id=" . $sliderID);
if (empty($sliderID)) {
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
}
}
}
//handle error
if ($response["success"] == false) {
$message = $response["error"];
dmp("<b>Error: " . $message . "</b>");
echo RevSliderFunctions::getHtmlLink($viewBack, __("Go Back", 'revslider'));
} else {
//handle success, js redirect.
dmp(__("Slider Import Success, redirecting...", 'revslider'));
echo "<script>location.href='{$viewBack}'</script>";
}
} else {
if (is_array($filepath)) {
dmp($filepath['error']);
} else {
dmp(__("Could not download from server. Please try again later!", 'revslider'));
}
echo RevSliderFunctions::getHtmlLink($viewBack, __("Go Back", 'revslider'));
exit;
}
}
exit;
}