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


PHP RevSliderNavigation::add_preset方法代碼示例

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


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

示例1: onAjaxAction

 /**
  *
  * onAjax action handler
  */
 public static function onAjaxAction()
 {
     $role = self::getMenuRole();
     //add additional security check and allow for example import only for admin
     $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 {
         if (RS_DEMO) {
             switch ($action) {
                 case 'import_slider_online_template_slidersview':
                 case 'duplicate_slider':
                 case 'preview_slider':
                 case 'get_static_css':
                 case 'get_dynamic_css':
                 case 'preview_slide':
                     //these are all okay in demo mode
                     break;
                 default:
                     RevSliderFunctions::throwError(__('Function Not Available in Demo Mode', 'revslider'));
                     exit;
                     break;
             }
         }
         if (!RevSliderFunctionsWP::isAdminUser() && apply_filters('revslider_restrict_role', true)) {
             switch ($action) {
                 case 'change_specific_navigation':
                 case 'change_navigations':
                 case 'update_static_css':
                 case 'add_new_preset':
                 case 'update_preset':
                 case 'import_slider':
                 case 'import_slider_slidersview':
                 case 'import_slider_template_slidersview':
                 case 'import_slide_template_slidersview':
                 case 'fix_database_issues':
                     RevSliderFunctions::throwError(__('Function Only Available for Adminstrators', 'revslider'));
                     exit;
                     break;
                 default:
                     $return = apply_filters('revslider_admin_onAjaxAction_user_restriction', true, $action, $data, $slider, $slide, $operations);
                     if ($return !== true) {
                         RevSliderFunctions::throwError(__('Function Only Available for Adminstrators', 'revslider'));
                         exit;
                     }
                     break;
             }
         }
         //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);
//.........這裏部分代碼省略.........
開發者ID:ksan5835,項目名稱:maadithottam,代碼行數:101,代碼來源:revslider-admin.class.php


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