当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSlider::deleteSlider方法代码示例

本文整理汇总了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;
 }
开发者ID:zruiz,项目名称:NG,代码行数:68,代码来源:revslider-admin.class.php


注:本文中的RevSlider::deleteSlider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。