本文整理汇总了PHP中RevSliderOperations::get_preset_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::get_preset_settings方法的具体用法?PHP RevSliderOperations::get_preset_settings怎么用?PHP RevSliderOperations::get_preset_settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderOperations
的用法示例。
在下文中一共展示了RevSliderOperations::get_preset_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAjaxAction
/**
*
* onAjax action handler
*/
public static function onAjaxAction()
{
$slider = new RevSlider();
$slide = new RevSlide();
$operations = new RevSliderOperations();
$action = self::getPostGetVar("client_action");
$data = self::getPostGetVar("data");
$nonce = self::getPostGetVar("nonce");
if (empty($nonce)) {
$nonce = self::getPostGetVar("rs-nonce");
}
try {
//verify the nonce
$isVerified = wp_verify_nonce($nonce, "revslider_actions");
if ($isVerified == false) {
RevSliderFunctions::throwError("Wrong request");
}
switch ($action) {
case 'add_new_preset':
if (!isset($data['settings']) || !isset($data['values'])) {
self::ajaxResponseError(__('Missing values to add preset', 'revslider'), false);
}
$result = $operations->add_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case 'update_preset':
if (!isset($data['name']) || !isset($data['values'])) {
self::ajaxResponseError(__('Missing values to update preset', 'revslider'), false);
}
$result = $operations->update_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case 'remove_preset':
if (!isset($data['name'])) {
self::ajaxResponseError(__('Missing values to remove preset', 'revslider'), false);
}
$result = $operations->remove_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset deleted', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case "export_slider":
$sliderID = self::getGetVar("sliderid");
$dummy = self::getGetVar("dummy");
$slider->initByID($sliderID);
$slider->exportSlider($dummy);
break;
case "import_slider":
$updateAnim = self::getPostGetVar("update_animations");
$updateNav = self::getPostGetVar("update_navigations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderHandle(null, $updateAnim, $updateStatic, $updateNav);
break;
case "import_slider_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
$updateAnim = self::getPostGetVar("update_animations");
$updateNav = self::getPostGetVar("update_navigations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderHandle($viewBack, $updateAnim, $updateStatic, $updateNav);
break;
case "import_slider_online_template_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none');
break;
case "import_slide_online_template_slidersview":
$redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
$viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
$slidenum = intval(self::getPostGetVar("slidenum"));
$sliderid = intval(self::getPostGetVar("slider_id"));
self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none', array('slider_id' => $sliderid, 'slide_id' => $slidenum));
break;
case "import_slider_template_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
$updateAnim = self::getPostGetVar("update_animations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderTemplateHandle($viewBack, $updateAnim, $updateStatic);
break;
case "import_slide_template_slidersview":
$redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
$viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
//.........这里部分代码省略.........
示例2: checked
?>
</span>
<input style="display: none;" type="radio" name="slider-type" value="carousel" <?php
checked($slider_type, 'carousel');
?>
/>
</div>
</div>
<span class="preset-splitter"><?php
_e("Load a Preset from this Slider Type", REVSLIDER_TEXTDOMAIN);
?>
</span>
<div id="preset-selector-wrapper" class="preset-selector-wrapper">
<div id="preselect-horiz-wrapper" class="preselect-horiz-wrapper">
<?php
$presets = RevSliderOperations::get_preset_settings();
//echo '<pre>';
//print_r($presets);
//echo '</pre>';
echo '<span class="rs-preset-selector rs-do-nothing standardpreset heropreset carouselpreset" id="rs-add-new-settings-preset">';
echo '<span class="rs-preset-image" style="background-image: url(' . RS_PLUGIN_URL . '/admin/assets/images/mainoptions/add_preset.png);"></span>';
echo ' <span class="rs-preset-label">' . __('Save Current Settings as Preset', REVSLIDER_TEXTDOMAIN) . '</span>';
echo '</span>';
echo '<script type="text/javascript">';
//$pjs = RevSliderFunctions::jsonEncodeForClientSide($pjs);
$pjs = RevSliderFunctions::jsonEncodeForClientSide($presets);
echo 'var revslider_presets = jQuery.parseJSON(' . $pjs . ');';
echo '</script>';
?>
<span class="tp-clearfix"></span>
</div>