當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UniteFunctionsRev::ajaxResponseError方法代碼示例

本文整理匯總了PHP中UniteFunctionsRev::ajaxResponseError方法的典型用法代碼示例。如果您正苦於以下問題:PHP UniteFunctionsRev::ajaxResponseError方法的具體用法?PHP UniteFunctionsRev::ajaxResponseError怎麽用?PHP UniteFunctionsRev::ajaxResponseError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UniteFunctionsRev的用法示例。


在下文中一共展示了UniteFunctionsRev::ajaxResponseError方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: operate

 /**
  * 
  * operate actions
  */
 public function operate()
 {
     $this->operations = new HelperUniteOperationsRev();
     $this->action = UniteFunctionsRev::getPostVariable("action");
     if (empty($this->action)) {
         $this->action = UniteFunctionsRev::getPostVariable("client_action");
     }
     $this->data = UniteFunctionsRev::getPostVariable("data", array());
     try {
         switch ($this->action) {
             case "add_slide":
                 $slideID = $this->operations->addSlideFromData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("");
                 break;
             case "update_slider_duplicate":
                 $sliderID = $this->saveSlider();
                 $newSliderID = $this->operations->duplicateSlider($sliderID);
                 UniteFunctionsRev::ajaxResponseData(array("newSliderID" => $newSliderID));
                 break;
             case "update_slider":
                 $sliderID = $this->saveSlider();
                 UniteFunctionsRev::ajaxResponseData(array("sliderID" => $sliderID));
                 break;
             case "update_slide_close":
             case "update_slide_new":
             case "update_slide":
                 $slideID = $this->saveSlide();
                 UniteFunctionsRev::ajaxResponseData(array("slideID" => $slideID));
                 break;
             case "update_slide_duplicate":
                 $slideID = $this->saveSlide();
                 $newSlideID = $this->operations->duplicateSlide($slideID);
                 UniteFunctionsRev::ajaxResponseData(array("slideID" => $newSlideID));
                 break;
             case "get_captions_css":
                 $contentCSS = $this->operations->getCaptionsContent();
                 UniteFunctionsRev::ajaxResponseData($contentCSS);
                 break;
             case "update_captions_css":
                 $arrCaptions = $this->operations->updateCaptionsContentData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("CSS file saved succesfully!", array("arrCaptions" => $arrCaptions));
                 break;
             case "restore_captions_css":
                 $this->operations->restoreCaptionsCss();
                 $contentCSS = $this->operations->getCaptionsContentOgirinal();
                 UniteFunctionsRev::ajaxResponseData($contentCSS);
                 break;
             case "get_release_log":
                 $content = HelperUniteRev::getReleaseLogContent();
                 UniteFunctionsRev::ajaxResponseData($content);
                 break;
             case "preview_slide":
                 $this->operations->putSlidePreviewByData($this->data);
                 break;
             case "preview_slider":
                 $sliderID = UniteFunctionsRev::getPostVariable("sliderid");
                 UniteFunctionsRev::validateNotEmpty($sliderID, "SliderID");
                 $this->operations->previewOutput($sliderID);
                 break;
             case "update_items_order":
                 $this->operations->updateSlidesOrderFromData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("order updated");
                 break;
             case "toggle_publish_state":
                 //publish / unpublish item
                 $newState = $this->operations->publishUnpublishItemFromData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("state updated", array("newstate" => $newState));
                 break;
             case "delete_slide":
                 $this->operations->deleteSlideFromData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("Slide Deleted");
                 break;
             case "duplicate_slide":
                 $this->operations->duplicateSlideFromData($this->data);
                 UniteFunctionsRev::ajaxResponseSuccess("Slide Duplicated");
                 break;
             default:
                 UniteFunctionsRev::ajaxResponseError("ajax action not found: " . $this->action);
                 break;
         }
     } catch (Exception $e) {
         $message = $e->getMessage();
         UniteFunctionsRev::ajaxResponseError($message);
     }
     exit;
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:90,代碼來源:actions.class.php


注:本文中的UniteFunctionsRev::ajaxResponseError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。