本文整理汇总了PHP中RevSlider::updatePostsSortbyFromData方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::updatePostsSortbyFromData方法的具体用法?PHP RevSlider::updatePostsSortbyFromData怎么用?PHP RevSlider::updatePostsSortbyFromData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::updatePostsSortbyFromData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAjaxAction
//.........这里部分代码省略.........
break;
case "change_slide_image":
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
// case "preview_slider":
// $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
// $operations->previewOutput($sliderID);
// break;
// case "preview_slider":
// $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
// $operations->previewOutput($sliderID);
// break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
sdsconfig::getgeneratecssfile();
self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$new_data = array();
// print_r($data);
foreach ($data as $key => $value) {
$new_data[$key] = $value;
}
$operations->updateGeneralSettings($new_data);
// sdsconfig::getgeneratecssfile();
self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__("Sortby updated", REVSLIDER_TEXTDOMAIN));
break;
case "replace_image_urls":
$slider->replaceImageUrlsFromData($data);
self::ajaxResponseSuccess(__("Image urls replaced", REVSLIDER_TEXTDOMAIN));
break;
case "reset_slide_settings":
$slider->resetSlideSettings($data);
sdsconfig::getgeneratecssfile();
self::ajaxResponseSuccess(__("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
break;
case 'delete_uploaded_image':
self::delete_uploaded_file($data);
break;
case 'get_uploaded_images':
self::get_uploaded_files_json();
break;
case 'add_slider_pos_val':
$newdata = array();
if (!empty($data)) {
$k = array_keys($data);
$k = preg_replace_callback('/\\[[0-9]+/', create_function('$match', 'return "";'), $k[0]);
foreach ($data as $key => $arr) {
$newdata[$k][] = $arr;
}
$data = $newdata;
}
sdsconfig::editSetting('revslideropencart', $data);
self::ajaxResponseSuccess(__("Slider Position Save SuccessFully", REVSLIDER_TEXTDOMAIN));
break;
default:
self::ajaxResponseError("wrong ajax action: {$action} ");
break;
}
} catch (Exception $e) {
$message = $e->getMessage();
if ($action == "preview_slide" || $action == "preview_slider") {
echo $message;
exit;
}
self::ajaxResponseError($message);
}
//it's an ajax action, so exit
//self::ajaxResponseError("No response output on <b> $action </b> action. please check with the developer.");
exit;
}
示例2: onAjaxAction
//.........这里部分代码省略.........
case "update_captions_css":
$arrCaptions = $operations->updateCaptionsContentData($data);
self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
break;
case "delete_captions_css":
$arrCaptions = $operations->deleteCaptionsContentData($data);
self::ajaxResponseSuccess(__ug("Style deleted succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
break;
case "update_static_css":
$staticCss = $operations->updateStaticCss($data);
self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
break;
case "insert_custom_anim":
$arrAnims = $operations->insertCustomAnim($data);
//$arrCaptions =
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_custom_anim":
$arrAnims = $operations->updateCustomAnim($data);
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "delete_custom_anim":
$arrAnims = $operations->deleteCustomAnim($data);
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_slides_order":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__ug("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__ug("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
self::ajaxResponseSuccess(__ug("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__ug("General settings updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__ug("Sortby updated", REVSLIDER_TEXTDOMAIN));
break;
case "replace_image_urls":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDER_OPERATIONS);
$slider->replaceImageUrlsFromData($data);
self::ajaxResponseSuccess(__ug("Image urls replaced", REVSLIDER_TEXTDOMAIN));
break;
case "reset_slide_settings":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slider->resetSlideSettings($data);
self::ajaxResponseSuccess(__ug("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
break;
default:
self::ajaxResponseError("wrong ajax action: {$action} ");
break;
}
} catch (Exception $e) {
$message = $e->getMessage();
if ($action == "preview_slide" || $action == "preview_slider") {
echo $message;
exit;
}
self::ajaxResponseError($message);
}
//it's an ajax action, so exit
self::ajaxResponseError("No response output on <b> {$action} </b> action. please check with the developer.");
exit;
}
示例3: onAjaxAction
//.........这里部分代码省略.........
$slide->updateSlideImageFromData($data);
$sliderID = RevSliderFunctions::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide changed", 'revslider'), self::getViewUrl(self::VIEW_SLIDE, "id=new&slider={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = RevSliderFunctions::getPostGetVariable("sliderid");
$do_markup = RevSliderFunctions::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "toggle_hero_slide":
$currentHero = $slider->setHeroSlide($data);
self::ajaxResponseSuccess(__('Slide is now the new active Hero Slide', 'revslider'));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__("General settings updated", 'revslider'));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__("Sortby updated", 'revslider'));
break;
case "replace_image_urls":
$slider->replaceImageUrlsFromData($data);
self::ajaxResponseSuccess(__("Image urls replaced", 'revslider'));
break;
case "reset_slide_settings":
$slider->resetSlideSettings($data);
self::ajaxResponseSuccess(__("Settings in all Slides changed", 'revslider'));
break;
case "activate_purchase_code":
$result = false;
if (!empty($data['code'])) {
$result = $operations->checkPurchaseVerification($data);
} else {
RevSliderFunctions::throwError(__('The API key, the Purchase Code and the Username need to be set!', 'revslider'));
exit;
}
if ($result) {
self::ajaxResponseSuccessRedirect(__("Purchase Code Successfully Activated", 'revslider'), self::getViewUrl(self::VIEW_SLIDERS));
} else {
RevSliderFunctions::throwError(__('Purchase Code is invalid', 'revslider'));
}
break;
case "deactivate_purchase_code":
$result = $operations->doPurchaseDeactivation($data);
if ($result) {
self::ajaxResponseSuccessRedirect(__("Successfully removed validation", 'revslider'), self::getViewUrl(self::VIEW_SLIDERS));
} else {
RevSliderFunctions::throwError(__('Could not remove Validation!', 'revslider'));
}
break;
示例4: onAjaxAction
//.........这里部分代码省略.........
break;
case "delete_custom_anim":
$arrAnims = $operations->deleteCustomAnim($data);
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_slides_order":
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__("Sortby updated", REVSLIDER_TEXTDOMAIN));
break;
case "replace_image_urls":
$slider->replaceImageUrlsFromData($data);
self::ajaxResponseSuccess(__("Image urls replaced", REVSLIDER_TEXTDOMAIN));
break;
case "reset_slide_settings":
$slider->resetSlideSettings($data);
self::ajaxResponseSuccess(__("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
break;
case "activate_purchase_code":
$result = false;
if (!empty($data['username']) && !empty($data['api_key']) && !empty($data['code'])) {
$result = $operations->checkPurchaseVerification($data);
} else {
UniteFunctionsRev::throwError(__('The API key, the Purchase Code and the Username need to be set!', REVSLIDER_TEXTDOMAIN));
exit;
}
if ($result) {
self::ajaxResponseSuccessRedirect(__("Purchase Code Successfully Activated", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
} else {
UniteFunctionsRev::throwError(__('Purchase Code is invalid', REVSLIDER_TEXTDOMAIN));
}
break;
case "deactivate_purchase_code":
$result = $operations->doPurchaseDeactivation($data);
if ($result) {
self::ajaxResponseSuccessRedirect(__("Successfully removed validation", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
} else {
UniteFunctionsRev::throwError(__('Could not remove Validation!', REVSLIDER_TEXTDOMAIN));
}
break;
case "dismiss_notice":
update_option('revslider-valid-notice', 'false');
self::ajaxResponseSuccess(__(".", REVSLIDER_TEXTDOMAIN));
break;
default:
self::ajaxResponseError("wrong ajax action: {$action} ");
break;
}
} catch (Exception $e) {
$message = $e->getMessage();
if ($action == "preview_slide" || $action == "preview_slider") {
echo $message;
exit;
}
self::ajaxResponseError($message);
}
//it's an ajax action, so exit
self::ajaxResponseError("No response output on <b> {$action} </b> action. please check with the developer.");
exit;
}