當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。