示例#1
0
文件: notice.php 项目: maesson/lyft
    public static function render_notices()
    {
        foreach (EModal_Admin_Notice::get_messages() as $key => $message) {
            ?>
<div class="<?php 
            esc_html_e($message['type']);
            ?>
">
				<p><?php 
            esc_html_e($message['message']);
            ?>
</p>
			</div><?php 
            unset($_SESSION[EMCORE_SLUG . '_notices'][$key]);
        }
    }
示例#2
0
 public function action_edit()
 {
     global $current_theme;
     $current_theme = new EModal_Model_Theme($this->check_id());
     if ($this->check_post_nonce()) {
         $new_values = apply_filters('emodal_theme_pre_save', $current_theme->as_array());
         $current_theme->set_fields(apply_filters("emodal_model_theme_meta_defaults", $new_values));
         $current_theme->save();
         do_action('emodal_theme_save', $current_theme);
         EModal_Admin_Notice::add(__('Theme Updated.', EMCORE_SLUG), 'updated');
         $this->redirect_to_edit();
     }
     $view = new EModal_View_Admin_Theme_Form();
     $view->set('title', __('Edit Theme', EMCORE_SLUG));
     $view->set('tabs', apply_filters('emodal_admin_theme_form_tabs', array()));
     self::$instance->view = $view;
 }
示例#3
0
 public function action_edit()
 {
     if ($this->check_post_nonce() && isset($_POST['publish'])) {
         /*
         $EModal_License = new EModal_License;
         $EModal_License->check_license(empost('license.key'));
         if(!empty(empost('access_key')))
         {
         	$new = empost('access_key');
         	$old = emodal_get_option( EMCORE_SLUG. '_access_key' );
         	if($new != '')
         	{
         		if($old === null || $old == '')
         		{
         			$new = SHA1($new);		
         		}
         		elseif($old && $old != $new && $old != SHA1($new))
         		{
         			$new = SHA1($new);		
         		}
         		emodal_update_option(EMCORE_SLUG. '_access_key', $new);
         	}
         	else
         	{
         		emodal_delete_option(EMCORE_SLUG. '_access_key');
         	}
         }
         */
         $new_values = apply_filters('emodal_settings_pre_save', emodal_get_option('emodal_settings'));
         emodal_update_option('emodal_settings', $new_values);
         do_action('emodal_settings_save', $new_values);
         EModal_Admin_Notice::add(__('Settings Updated.', EMCORE_SLUG), 'updated');
         //EModal_Admin::check_updates();
         $this->redirect_to_edit();
     }
     $view = new EModal_View_Admin_Settings_Form();
     $view->set('title', __('Easy Modal Settings', EMCORE_SLUG));
     $view->set('tabs', apply_filters('emodal_admin_settings_form_tabs', array()));
     self::$instance->view = $view;
 }
示例#4
0
文件: modals.php 项目: maesson/lyft
 public function action_trash()
 {
     if ($this->check_get_nonce()) {
         global $wpdb;
         $wpdb->delete($wpdb->prefix . 'em_modals', array('is_trash' => 1));
         EModal_Admin_Notice::add(__('Modal trash has been permanantly removed.', EMCORE_SLUG), 'updated');
         do_action('emodal_modal_trash');
     }
     wp_redirect($this->index_url(), 302);
     exit;
 }