Esempio n. 1
0
    /**
     * Generates dashboard page based on the options from options.php file.
     * Supports following hooks:
     *	'rad_<plugin_name>_after_main_options'
     *	'rad_<plugin_name>_after_header_options'
     *	'rad_<plugin_name>_after_save_button'
     *	'rad_<plugin_name>_header_start'
     *	'rad_<plugin_name>_header_end'
     *
     * @return array
     */
    function generate_options_page($sub_array = '')
    {
        $this->dashboard_options = $this->get_options_array();
        $dashboard_options = $this->dashboard_options;
        $dashboard_sections = $this->dashboard_sections;
        $dashboard_options_assigned = $this->assigned_options;
        $dashboard_post_types = $this->dashboard_post_types;
        $dashboard_categories = $this->dashboard_categories;
        printf('<div id="rad_dashboard_wrapper_outer" class="%1$s">
				<div id="rad_dashboard_wrapper" class="rad_dashboard">', esc_attr($this->plugin_class_name));
        // activate screen if not activated
        $activated = get_option('rad_rapidology_activated');
        if ($activated !== 'rapidology_activated') {
            echo '

	<div class="rad_act_scr rad_act_scr_mode_act_code">
				<div class="rad_act_scr_head">
					<div class="rad_act_scr_logo">&nbsp;</div>
					<div class="rad_act_scr_headline rad_act_scr_mode_get_code">Welcome to <i>Rapidology.</i></div>
					<div class="rad_act_scr_headline rad_act_scr_mode_act_code"><i>Rapidology</i></div>
					<div class="rad_act_scr_gift">A Free <span><i>Gift</i></span> From <a href="http://www.leadpages.net?utm_campaign=rp-lp&utm_medium=lock-screen" target="_blank">LeadPages<sup>&reg;</sup></a></div>
					<div class="rad_act_scr_headline rad_act_scr_mode_act_code">Enter your unique activation code below.</div>
					<div class="rad_act_scr_message rad_act_scr_mode_get_code">
						To get started, please enter a few details below so we can send you a unique activation code for plugin access. We’ll also provide you with plugin updates, access to the latest Rapidology designs, and more.
					</div>
					<div class="rad_act_scr_message rad_act_scr_mode_act_code">
						Gain access to the only 100% free WordPress plugin that lets you quickly create beautiful email opt-in forms, popups, and widgets — no design or coding skills required.
					</div>
				 	<div class="rad_act_scr_note rad_act_scr_mode_get_code">
				 		<a href="javascript:;" class="rad_act_scr_code_already">Already have an activation code?</a>
					</div>
				</div>
				<div class="rad_act_scr_form">
					<div class="rad_act_scr_inputs">
						<div class="rad_act_scr_input_box rad_act_scr_mode_act_code">
							<div class="rad_act_scr_holder">
								<input type="text" class="rad_act_scr_input_box_code" placeholder="xxx-xxx" autocomplete="off">
								<div class="rad_act_scr_error rad_act_scr_error_code"><sup>*</sup>please enter valid code</div>
							</div>
						</div>
					 	<div class="rad_act_scr_note2 rad_act_scr_mode_act_code">
					 		<a href="javascript:;" class="rad_act_scr_request_code">I didn\'t get a code.</a>
						</div>
						<div class="rad_act_scr_input_box rad_act_scr_mode_get_code">
				    		<span>Full Name</span>
				    		<div class="rad_act_scr_holder">
				    			<input type="text" class="rad_act_scr_input_box_name" maxlenght="7" placeholder="My Name" autocomplete="off">
								<div class="rad_act_scr_error rad_act_scr_error_name"><sup>*</sup>please enter valid name</div>
				    		</div>
				        </div>
				        <div class="rad_act_scr_input_box rad_act_scr_mode_get_code">
				        	<span>Email Address</span>
				        	<div class="rad_act_scr_holder">
				        		<input type="email" class="rad_act_scr_input_box_email" placeholder="*****@*****.**" autocomplete="off">
				        		<div class="rad_act_scr_error rad_act_scr_error_email"><sup>*</sup>please enter valid email</div>
				        	</div>
				        </div>
				        <div class="rad_act_scr_input_box rad_act_scr_mode_get_code">
				        	<span>What size is your company?</span>
				        	<div class="rad_act_scr_holder">
				            	<div class="rad_act_scr_input_box_company_placeholder">
									<span class="rad_act_input_box_company_text
										rad_act_scr_input_box_company_placeholder_inactive">Select One</span>
									<span class="rad_act_chevron_box"><i class="rad_act_chevron"></i></span>
								</div>
								<div class="rad_act_scr_error rad_act_scr_error_company"><sup>*</sup>please enter a comnpany size</div>
								<div class="rad_act_scr_input_box_company_dropdown
										rad_act_scr_input_box_company_dropdown_inactive">
									<i class="rad_act_chevron_up"></i>
									<a href="javascript:;" data-value="1">1 (solopreneur)</a>
									<a href="javascript:;" data-value="2-5">2 - 5 employees</a>
									<a href="javascript:;" data-value="6-10">6 - 10 employees</a>
									<a href="javascript:;" data-value="11-25">11 - 25 employees</a>
									<a href="javascript:;" data-value="26-50">26 - 50 employees</a>
									<a href="javascript:;" data-value="51-200">51 - 200 employees</a>
									<a href="javascript:;" data-value="200+">200+ employees</a>
								</div>
				         	</div>
							<input type="hidden" value="" class="rad_act_scr_input_box_company" autocomplete="off">
				        </div>
					    <div class="rad_act_scr_check rad_act_scr_mode_get_code">
							<input type="hidden" value="' . site_url() . '" class="rad_act_scr_input_site">
					 		<label>
								<input type="checkbox" autocomplete="off"
									class="rad_act_scr_input_box_checkbox">&nbsp;I agree to the <a target="_blank" href="http://www.rapidology.com/tou">terms of use</a>.
							<label>
							<div class="rad_act_scr_error rad_act_scr_error_check"><sup>*</sup>don\'t forget to check</div>
						</div>
					</div>
				</div>
				<div class="rad_act_scr_big_button rad_act_scr_mode_get_code">
			 		<a class="rad_act_scr_btn rad_act_scr_get_code_button" href="javascript:;">get my activation code</a>
			 	</div>
				<div class="rad_act_scr_big_button rad_act_scr_mode_act_code">
			 		<a class="rad_act_scr_btn rad_act_scr_activate_code_button" href="javascript:;">activate</a>
			 	</div>
				<!--  Thank you screen. -->
<div class="rad_act_scr_thank_you_area rad_act_scr_mode_thx_you">
    <div class="rad_act_thx_you_head">
        <div class="rad_act_thx_you_head_inner">
            <div class="rad_act_scr_logo_thx_you"><img src="' . RAD_PLUGIN_IMAGE_DIR . '/logo.png" /></div>
            <div id="rad_act_scr_thx_you_tagline">
                <p>Thanks for Joining</p> <h2 class="rad_act_scr_thx_you_rapid">Rapidology</h2>
                <div class="rad_act_scr_gift">A Free <span><i>Gift</i></span> From <a href="http://www.leadpages.net?utm_campaign=rp-lp&utm_medium=wp-thank-you-screen" target="_blank">LeadPages<sup>&reg;</sup></a></div>
            </div>
        </div>
    </div>
    <div id="rad_act_thx_you_body">
        <div class="rad_act_thx_you_sec_1">
            <div class="rad_act_thx_you_sec_1_inner">
                <div class="section1_top">
                    <div class="section1_top_left">
                        <p style="font-weight:300; font-size:20px;">FREE LIVE TRAINING:</p>
                        <p style="font-weight:400; font-size:14px;">With LeadPages<sup>&reg;</sup> Conversion Expert Time Paige</p>
                        <h1>4 Steps to Grow Your List Without <br />Spending Your Time on Marketing</h1>
                    </div>
                    <div class="section1_top_right">
                        <div class="box">
                            <img src="' . RAD_PLUGIN_IMAGE_DIR . '/tim-paige.png" />
                            <p style="padding:0; text-align: center">Host</p>
                            <p style="padding:0; color:#FF5E6E; text-align: center; font-weight:bold">Tim Paige</p>
                        </div>
                        <div class="box">
                            <img src="' . RAD_PLUGIN_IMAGE_DIR . '/lp-logo.jpg" />
                            <p style="padding:0; text-align: center">Featuring Strategies by</p>
                            <p style="padding:0; color:#FF5E6E; text-align: center; font-weight:bold">LeadPages<sup>&reg;</sup></p>
                        </div>
                    </div>
                    <div style="clear:both;"></div>
                    <div class="rad_act_thx_you_sec_register" style="margin-top:20px;">
                        <a href="#webinars"> REGISTER ME FOR THE WEBINAR </a>  <img src="' . RAD_PLUGIN_IMAGE_DIR . '/arrow-right.jpg" />
                    </div>
                    <a class="sign_up_text" href="#webinars"> Click here to sign up now </a>
                </div>
            </div>
            <div class="rad_act_thx_you_sec_1_bottom">
                <div class="bottom_arrow"></div>
            </div>
        </div>
        <div class="rad_act_thx_you_sec_2">
            <div class="rad_act_thx_you_sec_2_inner">
                <div style="text-align: center;"><h1 class="body-heading">Webinar Details</h1></div>
                <a name="webinars" id="webinars"></a>
                <div id="options">
                    <div class="option option1">
                        <div class="option-header"><p>Option #1</p></div>
                        <div class="option-text">
                            <div style="padding-top:20px; width: 390px; margin:auto;">
                                <img style ="float:left; margin-left:10px; margin-right:10px;" src="' . RAD_PLUGIN_IMAGE_DIR . '/calendar.jpg" />
                                <div style="float:right; width:240px;">
                                    <h1 style="color:black; text-transform: none;">This Wednesday</h1>
                                    <ul class="webinar-list">
                                        <li>3pm Eastern (New York)</li>
                                        <li>2pm Central (Chicago)</li>
                                        <li>12pm Pacific (San Diego)</li>
                                    </ul>
                                </div>
                                <div style="clear:both"></div>
                                <div class="option-action">
                                    <a href="javascript:;" class="rad_act_scr_webinar_button rad_act_scr_webinar_button_wed" target="blank">SAVE MY SEAT</a>
                                    <a href="javascript:;" class="rad_act_scr_webinar_link rad_act_scr_webinar_button_wed" target="blank">Click here to register for Wednesday\'s webinar now</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="option option2">
                        <div class="option-header"><p>Option #2</p></div>
                        <div class="option-text">
                            <div style="padding-top:20px; width: 390px; margin:auto;">
                                <img style ="float:left; margin-left:10px; margin-right:10px;" src="' . RAD_PLUGIN_IMAGE_DIR . '/calendar.jpg" />
                                <div style="float:right; width:240px;">
                                    <h1 style="color:black; text-transform: none;">This Thursday</h1>
                                    <ul class="webinar-list">
                                        <li>3pm Eastern (New York)</li>
                                        <li>2pm Central (Chicago)</li>
                                        <li>12pm Pacific (San Diego)</li>
                                    </ul>
                                </div>
                                <div style="clear:both"></div>
                                <div class="option-action">
                                    <a href="javascript:;" class="rad_act_scr_webinar_button rad_act_scr_webinar_button_thu">SAVE MY SEAT</a>
                                    <a href="javascript:;" class="rad_act_scr_webinar_link rad_act_scr_webinar_button_thu">Click here to register for Thursdays\'s webinar now</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div style="clear:both;"></div>
                </div>
                <div class="description">
                    <div style="text-align: center;">
                        <h1 class="body-heading">During this free live training, you will learn:</h1>
                        <ul>
                            <li><span>
                                <strong>Why only three pages on your WordPress ste should receieve the bulk of your time, energy, and focus.</strong>
                                This is about focus. Pay attention to these three pages and you\'ll boost your leads and sales. Ignore them and you\'ll struggle.
                            </span>
                        </li>
                        <li>
                            <span>
                                <strong>How to turn your WordPress site into a lead generation machine.</strong>
                                Weather you\'re just starting out or you\'ve been in business for years, we\'ll show you 4 sinple steps you can take right now
                            to transform your site into a powerful lead-gen machine.</span>
                        </li>
                        <li>
                            <span>
                                <strong>The #1 biggest mistake that even the pros make on their sites.</strong>
                                Make this mistake on your site and you\'ll continually ignore your best, hottest leads. Avoid this mistake and you\'ll
                                turn this missed opportunity into an an entirely new sales channel for your business.(We\'ll show you how to avoid this critical error in five minutes.)
                            </span>
                        </li>
                    </ul>
                    <p style="display:block; width: 700px; margin-left:auto; margin-right:auto; text-align: left;"><span style="color:black; font-weight:bold;">WARNING:</span> Space is limited and these live trainings always fill up because they contain significantly
                        more valuable information than others charge hundreds or thousands for. Click below to reserve your seat.
                    </p>
                </div>


            </div>

        </div>
        <div id="final-teaser">
            <div id="final-teaser-inner">
                <h1 class="body-heading" style="padding-top:20px; color:#fff; font-size:30px;">This Training Is a Free Gift From LeadPage<sup>&reg;</sup></h1>
                <p style="font-weight:bold; color:#fff; font-size:20px;">Click below to save your seat.</p>
                <div class="rad_act_thx_you_sec_register" style="margin-top:50px;">
                        <a href="#webinars"> REGISTER ME FOR THE WEBINAR </a>  <img src="' . RAD_PLUGIN_IMAGE_DIR . '/arrow-right.jpg" />
                    </div>
                    <a class="sign_up_text" href="#webinars"> Click here to sign up now </a>
            </div>
        </div>
    </div>
</div>
<div class="back-to-plugin">
    <a href="javascript:window.location.reload();">No thanks, take me to the Rapidology plugin!</a> | <a target="_blank" href="http://www.rapidology.com/privacy?utm_campaign=rp-rp&utm_medium=wp-thank-you-privacy">Privacy Policy</a>
</div>
</div>
			';
        } else {
            printf('<div id="rad_dashboard_header">
						<div id="rad_dashboard_logo" class="rad_dashboard_icon_%1$s rad_dashboard_icon"></div>
						<ul>', esc_attr($this->plugin_name));
            if (isset($dashboard_sections['header']['contents'])) {
                foreach ($dashboard_sections['header']['contents'] as $key => $value) {
                    printf('<li class="rad_dashboard_tab_content_header_%1$s">
						<a href="#tab_rad_dashboard_tab_content_header_%1$s" id="rad_dashboard_tab_content_header_%1$s" class="rad_dashboard_icon_header_%1$s rad_dashboard_icon">
							<span></span>
						</a>
					</li>', esc_attr($key));
                }
            }
            echo '
						</ul>
					</div>
					<div class="clearfix"></div>

					<div id="rad_dashboard_navigation">
						<ul>';
            $menu_count = 0;
            if (isset($dashboard_sections)) {
                foreach ($dashboard_sections as $key => $value) {
                    if ($key !== 'header') {
                        $current_section = $key;
                        foreach ($value as $key => $value) {
                            if ($key == 'title') {
                                printf('<li class="rad_dashboard_tab_content_side_%1$s">
									<a href="#" class="rad_dashboard_icon_%1$s rad_dashboard_icon rad_dashboard_tab_parent">
										<span>%2$s</span>
									</a>', esc_attr($current_section), esc_html($value));
                            } else {
                                printf('<ul class="rad_dashboard_%1$s_nav">', esc_attr($current_section));
                                foreach ($value as $key => $value) {
                                    printf('<li class="rad_dashboard_tab_content_side_%2$s">
										<a href="#tab_rad_dashboard_tab_content_%1$s_%2$s" id="rad_dashboard_tab_content_%1$s_%2$s" class="rad_dashboard_icon_%2$s rad_dashboard_icon">
											<span>%3$s</span>
										</a>
									</li>', esc_attr($current_section), esc_attr($key), esc_html($value));
                                }
                                echo '
							</ul>
						</li>';
                            }
                            // end else
                        }
                        // end foreach( $value as $key => $value )
                    }
                    // end if ( $key !== 'header')
                }
                //end foreach ( $dashboard_sections as $key => $value )
            }
            // end if ( isset( $dashboard_sections ) )
            echo '
					</ul>
				</div>

				<div id="rad_dashboard_content">
					<form id="rad_dashboard_options" enctype="multipart/form-data">';
            settings_fields('rad_dashboard_settings_group');
            if (isset($dashboard_sections)) {
                foreach ($dashboard_sections as $key => $value) {
                    $current_section = $key;
                    if ($key !== 'header') {
                        foreach ($value['contents'] as $key => $value) {
                            $current_location = $key;
                            $options_prefix = $current_section . '_' . $key;
                            $options_array = $dashboard_options_assigned[$current_section . '_' . $key . '_options'];
                            $sidebar_section = 'sidebar' == $key ? true : false;
                            printf('<div class="rad_dashboard_tab_content rad_dashboard_tab_content_%1$s_%2$s">', esc_attr($current_section), esc_attr($key));
                            foreach ($options_array as $option) {
                                $current_option_name = '';
                                $hint_output = '';
                                if (isset($option['name'])) {
                                    if ('' !== $sub_array) {
                                        $current_option_name = $option['name'];
                                    } else {
                                        $current_option_name = $options_prefix . '_' . $option['name'];
                                    }
                                }
                                if ('' !== $sub_array) {
                                    $current_option_value = isset($dashboard_options[$sub_array][$current_option_name]) ? $dashboard_options[$sub_array][$current_option_name] : '';
                                    if (!isset($dashboard_options[$sub_array][$current_option_name]) && isset($option['default'])) {
                                        $current_option_value = isset($option['default_' . $current_location]) ? $option['default_' . $current_location] : $option['default'];
                                    }
                                } else {
                                    $current_option_value = isset($dashboard_options[$current_option_name]) ? $dashboard_options[$current_option_name] : '';
                                    if (!isset($dashboard_options[$current_option_name]) && isset($option['default'])) {
                                        $current_option_value = isset($option['default_' . $current_location]) ? $option['default_' . $current_location] : $option['default'];
                                    }
                                }
                                if (isset($option['hint_text'])) {
                                    $escape = isset($option['hint_text_with_links']) ? (bool) true : (bool) false;
                                    $hint_output = $this->generate_hint($option['hint_text'], $escape);
                                }
                                switch ($option['type']) {
                                    case 'select_shape':
                                        printf('<div class="rad_dashboard_row rad_dashboard_selection%2$s%4$s"%3$s%5$s>
											<h2>%1$s</h2>
											<div style="clear:both;"></div>', esc_html($option['title']), isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '');
                                        foreach ($option['value'] as $shape) {
                                            printf('<div class="rad_dashboard_shape rad_dashboard_icon rad_dashboard_single_selectable %1$s">
												<div class="rad_dashboard_shape_tile rad_dashboard_icon rad_dashboard_shape_%2$s"></div>
												<input type="radio" class="rad_dashboard[%3$s]" name="rad_dashboard[%3$s]" value="%2$s" %4$s style="position: absolute; z-index: -1; visibility: hidden;">
											</div>', $shape === $current_option_value ? 'rad_dashboard_selected' : '', esc_attr($shape), esc_attr($current_option_name), checked($current_option_value, $shape, false));
                                        }
                                        echo '</div>';
                                        break;
                                    case 'select':
                                        $current_option_list = isset($option['value_' . $current_location]) ? $option['value_' . $current_location] : $option['value'];
                                        if (isset($option['filter'])) {
                                            $current_option_list = apply_filters($option['filter'], $current_option_list);
                                        }
                                        printf('<li class="select%3$s%5$s%7$s"%4$s%6$s%8$s>
											<p>%1$s</p>
											<select name="rad_dashboard[%2$s]">', isset($option['title_' . $current_location]) ? esc_html($option['title_' . $current_location]) : esc_html($option['title']), esc_attr($current_option_name), isset($option['display_if']) ? ' rad_dashboard_hidden_option rad_dashboard_triggered_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['conditional']) ? ' rad_dashboard_conditional' : '', isset($option['conditional']) ? sprintf(' data-enables="%1$s"', '' !== $sub_array ? esc_attr($option['conditional']) : esc_attr($options_prefix . '_' . $option['conditional'])) : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '');
                                        foreach ($current_option_list as $actual_value => $display_value) {
                                            printf('<option class ="%4$s" value="%1$s" %2$s>%3$s</option>', esc_attr($actual_value), selected($actual_value, $current_option_value, false), esc_html($display_value), isset($option['conditional'][$actual_value]) ? $option['conditional'][$actual_value] : '');
                                        }
                                        echo '
											</select>';
                                        echo $hint_output;
                                        echo '
										</li>';
                                        break;
                                    case 'checkbox':
                                        printf('
										<li class="rad_dashboard_checkbox clearfix%5$s%6$s%9$s"%4$s%7$s%8$s>
											<p>%1$s</p>
											<input type="checkbox" id="rad_dashboard[%2$s]" name="rad_dashboard[%2$s]" value="1" %3$s>
											<label for="rad_dashboard[%2$s]"></label>', isset($option['title_' . $current_location]) ? esc_html($option['title_' . $current_location]) : esc_html($option['title']), esc_attr($current_option_name), checked($current_option_value, 1, false), isset($option['conditional']) ? sprintf(' data-enables="%1$s"', '' !== $sub_array ? esc_attr($option['conditional']) : esc_attr($options_prefix . '_' . $option['conditional'])) : '', isset($option['conditional']) ? ' rad_dashboard_conditional' : '', isset($option['display_if']) ? ' rad_dashboard_hidden_option rad_dashboard_triggered_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '');
                                        echo $hint_output;
                                        echo '
										</li>';
                                        break;
                                    case 'checkbox_set':
                                        $checkboxes_array = isset($option['value']) ? $option['value'] : array();
                                        $current_option_value = isset($current_option_value) ? $current_option_value : array();
                                        if (!empty($checkboxes_array)) {
                                            $i = 0;
                                            foreach ($checkboxes_array as $value => $label) {
                                                printf('
												<li class="rad_dashboard_checkbox%6$s%8$s"%7$s>
													<input type="checkbox" id="rad_dashboard[%1$s][%4$s]" name="rad_dashboard[%1$s][]" value="%3$s" %2$s>
													<label for="rad_dashboard[%1$s][%4$s]"></label>
													<p>%5$s</p>
												</li>', esc_attr($current_option_name), checked(in_array($value, $current_option_value), true, false), esc_attr($value), esc_attr($i), esc_attr($label), isset($option['conditional'][$value]) ? ' rad_dashboard_conditional' : '', isset($option['conditional'][$value]) ? sprintf(' data-enables="%1$s"', esc_attr($option['conditional'][$value])) : '', isset($option['class']) ? ' ' . esc_attr($option['class']) . ' ' . esc_attr($option['class']) . '_' . esc_attr($value) : '');
                                                $i++;
                                            }
                                        }
                                        break;
                                    case 'input_field':
                                        printf('<li class="input clearfix%4$s%7$s"%5$s%10$s>
											<p>%1$s</p>
											<input type="%9$s" name="rad_dashboard[%2$s]" value="%3$s" placeholder="%6$s"%8$s>', isset($option['title_' . $current_location]) ? esc_html($option['title_' . $current_location]) : esc_html($option['title']), esc_attr($current_option_name), esc_attr($current_option_value), isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', 'number' == $option['subtype'] ? '0' : $option['placeholder'], 'text' == $option['subtype'] ? ' rad_dashboard_longinput' : '', isset($option['class']) ? sprintf(' class="%1$s"', esc_attr($option['class'])) : '', isset($option['hide_contents']) ? 'password' : 'text', isset($option['display_if']) ? ' data-triggers_count="0"' : '');
                                        echo $hint_output;
                                        echo '
										</li>';
                                        break;
                                    case 'checkbox_posts':
                                        echo '
									<li>
										<ul class="inline">';
                                        $i = 0;
                                        $current_option_value = '' == $current_option_value ? array() : $current_option_value;
                                        $checkbox_array = 'post_types' === $option['subtype'] ? $dashboard_post_types : $dashboard_categories['post'];
                                        $post_types = !empty($option['value']) ? $option['value'] : $checkbox_array;
                                        $array_of_saved_cats = isset($current_option_value['previously_saved']) ? explode(',', $current_option_value['previously_saved']) : array();
                                        foreach ($post_types as $post_type => $id) {
                                            if ('post_cats' === $option['subtype']) {
                                                if (!isset($current_option_value['previously_saved'])) {
                                                    $is_checked = true;
                                                } else {
                                                    if (isset($current_option_value['auto_select']) && '1' === $current_option_value['auto_select']) {
                                                        $is_checked = !in_array($post_type, $array_of_saved_cats) ? true : in_array($post_type, $current_option_value);
                                                    } else {
                                                        $is_checked = in_array($post_type, $current_option_value);
                                                    }
                                                }
                                            }
                                            $conditional_class = '';
                                            $conditional_data = '';
                                            if ('post_types' === $option['subtype']) {
                                                if (isset($option['conditional']['any_post']) && 'page' !== $id) {
                                                    $conditional_class = ' rad_dashboard_conditional';
                                                    $conditional_data = sprintf(' data-enables="%1$s"', esc_attr($option['conditional']['any_post']));
                                                }
                                                $conditional_class = isset($option['conditional'][$id]) ? ' rad_dashboard_conditional' : $conditional_class;
                                                $conditional_data = isset($option['conditional'][$id]) ? sprintf(' data-enables="%1$s"', esc_attr($option['conditional'][$id])) : $conditional_data;
                                            }
                                            printf('
											<li class="rad_dashboard_checkbox%6$s"%7$s>
												<input type="checkbox" id="rad_dashboard[%1$s][%4$s]" name="rad_dashboard[%1$s][]" value="%3$s" %2$s>
												<label for="rad_dashboard[%1$s][%4$s]"></label>
												<p>%5$s</p>
											</li>', esc_attr($current_option_name), 'post_types' === $option['subtype'] ? checked(in_array($id, $current_option_value), true, false) : checked($is_checked, true, false), 'post_types' === $option['subtype'] ? esc_attr($id) : esc_attr($post_type), esc_attr($i), 'post_cats' === $option['subtype'] && isset($option['include_custom']) ? esc_attr($id) . __(' ( post )', 'rapidology') : esc_attr($id), esc_attr($conditional_class), $conditional_data);
                                            $i++;
                                        }
                                        if (isset($option['include_custom']) && 'post_cats' === $option['subtype']) {
                                            foreach ($dashboard_post_types as $post_type) {
                                                if ('post' != $post_type && 'page' != $post_type) {
                                                    if (!empty($dashboard_categories[$post_type])) {
                                                        foreach ($dashboard_categories[$post_type] as $cat_id => $cat_name) {
                                                            if (!isset($current_option_value['previously_saved'])) {
                                                                $is_checked = true;
                                                            } else {
                                                                if (isset($current_option_value['auto_select']) && '1' === $current_option_value['auto_select']) {
                                                                    $is_checked = !in_array($cat_id, $array_of_saved_cats) ? true : in_array($cat_id, $current_option_value);
                                                                } else {
                                                                    $is_checked = in_array($cat_id, $current_option_value);
                                                                }
                                                            }
                                                            printf('
															<li class="rad_dashboard_checkbox%6$s"%7$s>
																<input type="checkbox" id="rad_dashboard[%1$s][%4$s]" name="rad_dashboard[%1$s][]" value="%3$s" %2$s>
																<label for="rad_dashboard[%1$s][%4$s]"></label>
																<p>%5$s</p>
															</li>', esc_attr($current_option_name), checked($is_checked, true, false), esc_attr($cat_id), esc_attr($i), esc_html($cat_name) . ' ( ' . $post_type . ' )', esc_attr($conditional_class), $conditional_data);
                                                            $i++;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        if ('post_cats' === $option['subtype']) {
                                            $current_option_value['auto_select'] = isset($current_option_value['auto_select']) ? $current_option_value['auto_select'] : 0;
                                            $current_option_value['auto_select'] = !isset($current_option_value['previously_saved']) ? 1 : $current_option_value['auto_select'];
                                            $cat_id_array = array();
                                            printf('
											<li class="rad_dashboard_checkbox rad_dashboard_auto_select">
												<input type="checkbox" id="rad_dashboard[%1$s][auto_select]" name="rad_dashboard[%1$s][auto_select]" value="1" %2$s>
												<label for="rad_dashboard[%1$s][auto_select]"></label>
												<p>%3$s</p>
											</li>', esc_attr($current_option_name), checked($current_option_value['auto_select'], 1, false), __('Automatically check categories created in future', 'rad_dashboard'));
                                            foreach ($checkbox_array as $id => $name) {
                                                $cat_id_array[] = $id;
                                            }
                                            if (isset($option['include_custom'])) {
                                                foreach ($dashboard_post_types as $post_type) {
                                                    if ('post' != $post_type && 'page' != $post_type) {
                                                        if (!empty($dashboard_categories[$post_type])) {
                                                            foreach ($dashboard_categories[$post_type] as $cat_id => $cat_name) {
                                                                $cat_id_array[] = $cat_id;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            $current_option_value['previously_saved'] = implode(',', $cat_id_array);
                                            printf('
											<li>
												<input type="hidden" id="rad_dashboard[%1$s][previously_saved]" name="rad_dashboard[%1$s][previously_saved]" value="%2$s" />
											</li>', esc_attr($current_option_name), $current_option_value['previously_saved']);
                                        }
                                        echo '
										</ul>
										<div style="clear:both;"></div>
									</li>';
                                        break;
                                    case 'section_start':
                                        printf('%5$s<div class="rad_dashboard_form rad_dashboard_row%2$s%7$s"%3$s%4$s%8$s>
											%1$s
											%6$s
											<div style="clear:both;"></div>
											<ul>', isset($option['title']) ? sprintf('<h2>%1$s</h2>', esc_html($option['title'])) : '', isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($current_option_name) && '' != $current_option_name ? sprintf(' data-name="rad_dashboard[%1$s]"', esc_attr($current_option_name)) : '', isset($option['sub_section']) && true == $option['sub_section'] ? '<li class="rad_dashboard_auto_height">' : '', isset($option['subtitle']) ? sprintf('<p class="rad_dashboard_section_subtitle">%1$s</p>', esc_html($option['subtitle'])) : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '');
                                        break;
                                    case 'section_end':
                                        printf('
												</ul>
											</div>
										%1$s', isset($option['sub_section']) && true == $option['sub_section'] ? '</li>' : '');
                                        break;
                                    case 'text':
                                        $button_class_text = !empty($option['button_text']) ? str_replace(' ', '_', $option['button_text']) : '';
                                        $button_class_text = strlen($button_class_text) > 0 ? strtolower($button_class_text) : '';
                                        $button_text = !empty($option['button_text']) ? $option['button_text'] : '';
                                        printf('<li class="rad_dashboard_auto_height%6$s%10$s"%7$s%8$s>
											%9$s
											<textarea placeholder="%1$s" rows="%2$s" id="rad_dashboard_%4$s" name="rad_dashboard[%4$s]"%5$s>%3$s</textarea>%11$s
										</li>', esc_attr($option['placeholder']), esc_attr($option['rows']), esc_html($current_option_value), esc_attr($current_option_name), isset($option['class']) ? sprintf(' class="%1$s"', esc_attr($option['class'])) : '', isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '', !empty($option['title']) ? sprintf('<p>%1$s</p>', esc_html($option['title'])) : '', !empty($option['title']) ? ' rad_dashboard_text_with_title' : '', !empty($option['button_text']) ? '<button class="rad_rapidology_textarea_button rad_rapidology_' . $button_class_text . '">' . $button_text . '</button>' : '');
                                        break;
                                    case 'main_title':
                                        printf('<div class="rad_dashboard_row rad_dashboard_selection%3$s">
											<h1>%1$s</h1>
											%2$s
										</div>', esc_html($option['title']), isset($option['subtitle']) ? sprintf('<p>%1$s</p>', esc_html($option['subtitle'])) : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '');
                                        break;
                                    case 'note':
                                        printf('<div class="rad_dashboard_row rad_dashboard_note">
											<h2>%1$s</h2>
											<p>
												<span>%2$s</span>
											</p>
										</div>', esc_html__('Note:', 'rad_dashboard'), esc_html($option['text']));
                                        break;
                                    case 'color_picker':
                                        printf('<li class="input clearfix rad_dashboard_color_picker%5$s%8$s"%6$s%7$s>
											<p>%4$s</p>
											<input class="rad-dashboard-color-picker" type="text" maxlength="7" placeholder="%1$s" name=rad_dashboard[%2$s] value="%3$s" />
										</li>', esc_attr($option['placeholder']), esc_attr($current_option_name), esc_attr($current_option_value), esc_html($option['title']), isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '');
                                        break;
                                    case 'live_search':
                                        if ('' === $current_option_value) {
                                            $current_option_value_array = array();
                                        } else {
                                            $current_option_value_array = is_array($current_option_value) ? $current_option_value : explode(',', $current_option_value);
                                        }
                                        $selected_posts_list = '';
                                        if (!empty($current_option_value_array)) {
                                            $selected_posts = get_posts(array('post__in' => $current_option_value_array, 'post_type' => 'any', 'posts_per_page' => -1));
                                            if (!empty($selected_posts)) {
                                                foreach ($selected_posts as $single_post) {
                                                    $selected_posts_list .= sprintf('
													<span data-post_id="%3$s">[%1$s] -  %2$s<span class="rad_dashboard_menu_remove"></span></span>', esc_html($single_post->post_type), esc_html($single_post->post_title), esc_attr($single_post->ID));
                                                }
                                            }
                                        }
                                        printf('
										<li class="rad_dashboard_selected">%1$s</li>
										<li class="rad_dashboard_live_fields">
											<input type="text" class="rad_dashboard_search_posts" placeholder="%4$s" data-post_type="%5$s"/><span class="spinner"></span>
											<input type="hidden" id="rad_dashboard[%2$s]" name="rad_dashboard[%2$s]" value="%3$s" />
										</li>
										<li class="rad_dashboard_live_search_res">
											<ul class="rad_dashboard_search_results"></ul>
										</li>', $selected_posts_list, esc_attr($current_option_name), is_array($current_option_value) ? esc_attr(implode(',', $current_option_value)) : esc_attr($current_option_value), esc_attr($option['placeholder']), esc_attr($option['post_type']));
                                        break;
                                    case 'image_upload':
                                        printf('
										<li class="rad_dashboard_upload_image%7$s"%8$s%9$s>
											<p>%6$s</p>
											<input name="rad_dashboard[%1$s][url]" type="text" class="rad-dashboard-upload-field" value="%2$s" />
											<input type="hidden" class="rad-dashboard-upload-id" name="rad_dashboard[%1$s][id]" value="%10$s">
											<input type="button" class="button button-upload rad-dashboard-upload-button" value="%3$s" data-choose="%4$s" data-update="%5$s" data-type="image" />
										</li>', esc_attr($current_option_name), isset($current_option_value['url']) ? esc_attr($current_option_value['url']) : '', esc_attr($option['button_text']), esc_attr($option['wp_media_title']), esc_attr($option['wp_media_button']), isset($option['title_' . $current_location]) ? esc_html($option['title_' . $current_location]) : esc_html($option['title']), isset($option['display_if']) ? ' rad_dashboard_hidden_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '', isset($current_option_value['id']) ? esc_attr($current_option_value['id']) : '');
                                        break;
                                    case 'hidden_option':
                                        if ('array' == $option['subtype']) {
                                            $current_option_value = '' == $current_option_value ? array() : $current_option_value;
                                            foreach ($current_option_value as $single_value) {
                                                printf('<input name="rad_dashboard[%1$s][]" type="hidden" value="%2$s" />', esc_attr($current_option_name), esc_attr($single_value));
                                            }
                                        } else {
                                            printf('<input name="rad_dashboard[%1$s]" id="rad_dashboard_%1$s" type="hidden" value="%2$s" />', esc_attr($current_option_name), esc_attr($current_option_value));
                                        }
                                        break;
                                    case 'button':
                                        printf('<li class="rad_dashboard_action_button">
											<a href="%1$s" class="rad_dashboard_icon %2$s">%3$s</a>
											<span class="spinner"></span>
										</li>', esc_url($option['link']), esc_html($option['class']), true == $option['authorize'] && $this->api_is_network_authorized($option['action']) ? __('Re-Authorize', 'rad_dashboard') : esc_html($option['title']));
                                        break;
                                    case 'font_select':
                                        $fonts_class = RAD_Dashboard::load_fonts_class();
                                        $current_option_list = $fonts_class->et_get_google_fonts();
                                        if (isset($option['filter'])) {
                                            $current_option_list = apply_filters($option['filter'], $current_option_list);
                                        }
                                        printf('<li class="select%3$s%5$s%7$s"%4$s%6$s%8$s>
											<p>%1$s</p>
											<select name="rad_dashboard[%2$s]">', isset($option['title_' . $current_location]) ? esc_html($option['title_' . $current_location]) : esc_html($option['title']), esc_attr($current_option_name), isset($option['display_if']) ? ' rad_dashboard_hidden_option rad_dashboard_triggered_option' : '', isset($option['display_if']) ? ' data-condition="' . esc_attr($option['display_if']) . '"' : '', isset($option['conditional']) ? ' rad_dashboard_conditional' : '', isset($option['conditional']) ? sprintf(' data-enables="%1$s"', '' !== $sub_array ? esc_attr($option['conditional']) : esc_attr($options_prefix . '_' . $option['conditional'])) : '', isset($option['class']) ? ' ' . esc_attr($option['class']) : '', isset($option['display_if']) ? ' data-triggers_count="0"' : '');
                                        foreach ($current_option_list as $font_name => $font_details) {
                                            printf('<option value="%1$s" class="rad_dashboard_font_%1$s" %2$s>%3$s</option>', esc_attr($font_name), selected($font_name, $current_option_value, false), esc_html($font_name));
                                        }
                                        echo '
											</select>';
                                        echo $hint_output;
                                        echo '</li>';
                                        break;
                                }
                                // end switch
                                do_action('rad_' . $this->plugin_name . '_after_main_options', $option, $current_option_value);
                            }
                            // end foreach( $options_array as $option)
                            echo '</div>';
                        }
                        // end foreach( $value['contents'] as $key => $value )
                    }
                    // end if ( $key !== 'header')
                }
                // end foreach ( $dashboard_sections as $key => $value )
            }
            // end if ( isset( $dashboard_sections ) )
            printf('<div class="rad_dashboard_row rad_dashboard_save_changes %3$s">
				<button class="rad_dashboard_icon"%2$s>%1$s</button>
				<span class="spinner"></span>
			</div>
			<input type="hidden" name="action" value="save_dashboard" />', esc_html__($this->save_button_text), '' !== $sub_array ? sprintf('data-subtitle="%1$s"', esc_attr($sub_array)) : '', apply_filters('rad_' . $this->plugin_name . '_save_button_class', ''));
            do_action('rad_' . $this->plugin_name . '_after_save_button');
            echo '</form>';
            if (isset($dashboard_sections['header']['contents'])) {
                do_action('rad_' . $this->plugin_name . '_header_start');
                foreach ($dashboard_sections['header']['contents'] as $key => $value) {
                    $options_array = $dashboard_options_assigned['header_' . $key . '_options'];
                    printf('<div class="rad_dashboard_tab_content rad_dashboard_tab_content_header_%1$s rad_dashboard_header_option">', esc_attr($key));
                    if (isset($options_array)) {
                        foreach ($options_array as $option) {
                            switch ($option['type']) {
                                case 'import_export':
                                    printf('<div class="rad_dashboard_form rad_dashboard_row">
										<h1>%1$s</h1>
										<p>%2$s</p>
									</div>
									<div class="rad_dashboard_import_form rad_dashboard_row">
										<h2>%3$s</h2>
										<p class="rad_dashboard_section_subtitle">%4$s</p>
										<form method="post">
											<input type="hidden" name="rad_dashboard_action" value="export_settings" />
											<p>', esc_html($option['title']), __(sprintf('You can either export your %1$s Settings or import settings from another install of %1$s below.', esc_html(ucfirst($this->plugin_name))), 'rad_dashboard'), __(sprintf('Export %1$s Settings', esc_html(ucfirst($this->plugin_name))), 'rad_dashboard'), __('Export the plugin settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'rad_dashboard'));
                                    wp_nonce_field('rad_dashboard_export_nonce', 'rad_dashboard_export_nonce');
                                    printf('			<button class="rad_dashboard_icon rad_dashboard_icon_importexport" type="submit" name="submit_export" id="submit_export">' . __('Export', 'rad_dashboard') . '</button>
											</p>
										</form>
									</div>

									<div class="rad_dashboard_form rad_dashboard_row">
										<h2>%1$s</h2>
										<div class="rad_dashboard_import_form rad_dashboard_row">
											<p class="rad_dashboard_section_subtitle">%2$s</p>
											<form method="post" enctype="multipart/form-data" action="%4$s.php?page=%3$s#tab_rad_dashboard_tab_content_header_importexport">
												<input type="file" name="import_file"/>', sprintf(__('Import %1$s Settings', 'rad_dashboard'), esc_html(ucfirst($this->plugin_name))), __('Import the plugin settings from a .json file. This file can be obtained by exporting the settings on another site using the form above.', 'rad_dashboard'), $this->_options_pagename, 'toplevel_page' == $this->top_level_page ? 'admin' : $this->top_level_page);
                                    wp_nonce_field('rad_dashboard_import_nonce', 'rad_dashboard_import_nonce');
                                    echo '
											<button class="rad_dashboard_icon rad_dashboard_icon_importexport" type="submit" name="submit_import" id="submit_import">' . __('Import', 'rad_dashboard') . '</button>
											<input type="hidden" name="rad_dashboard_action" value="import_settings" />
										</form>
									</div>
								</div>';
                                    break;
                            }
                            // end switch
                            do_action('rad_' . $this->plugin_name . '_after_header_options', $option, $dashboard_options);
                        }
                        // end foreach( $options_array as $option )
                    }
                    // end if ( isset( $options_array ) )
                    echo '</div><!-- .rad_dashboard_tab_content_header_ -->';
                }
                // end foreach ( $dashboard_sections[ 'header' ][ 'contents' ] as $key => $value )
                do_action('rad_' . $this->plugin_name . '_header_end');
            }
            // end if ( isset( $dashboard_sections[ 'header' ][ 'contents' ] ) )
            echo '</div>';
        }
        // activate screen end
        echo '</div></div>';
    }
Esempio n. 2
0
 function __construct()
 {
     // Don't allow more than one instance of the class
     if (isset(self::$_this)) {
         wp_die(sprintf(__('%s is a singleton class and you cannot create a second instance.', 'rapidology'), get_class($this)));
     }
     self::$_this = $this;
     $this->protocol = is_ssl() ? 'https' : 'http';
     add_action('admin_menu', array($this, 'add_menu_link'));
     add_action('plugins_loaded', array($this, 'add_localization'));
     add_action('admin_init', array($this, 'execute_footer_text'));
     add_filter('rad_rapidology_import_sub_array', array($this, 'import_settings'));
     add_filter('rad_rapidology_import_array', array($this, 'import_filter'));
     add_filter('rad_rapidology_export_exclude', array($this, 'filter_export_settings'));
     add_filter('rad_rapidology_save_button_class', array($this, 'save_btn_class'));
     // generate home tab in dashboard
     add_action('rad_rapidology_after_header_options', array($this, 'generate_home_tab'));
     add_action('rad_rapidology_after_main_options', array($this, 'generate_premade_templates'));
     add_action('rad_rapidology_after_save_button', array($this, 'add_next_button'));
     $plugin_file = plugin_basename(__FILE__);
     add_filter("plugin_action_links_{$plugin_file}", array($this, 'add_settings_link'));
     $dashboard_args = array('rad_dashboard_options_pagename' => $this->_options_pagename, 'rad_dashboard_plugin_name' => 'rapidology', 'rad_dashboard_save_button_text' => __('Save & Exit', 'rapidology'), 'rad_dashboard_plugin_class_name' => 'rad_rapidology', 'rad_dashboard_options_path' => RAD_RAPIDOLOGY_PLUGIN_DIR . '/dashboard/includes/options.php', 'rad_dashboard_options_page' => 'toplevel_page');
     parent::__construct($dashboard_args);
     // Register save settings function for ajax request
     add_action('wp_ajax_rad_rapidology_save_settings', array($this, 'rapidology_save_settings'));
     add_action('admin_enqueue_scripts', array($this, 'register_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'load_scripts_styles'));
     add_action('wp_ajax_rapidology_reset_options_page', array($this, 'rapidology_reset_options_page'));
     add_action('wp_ajax_rapidology_remove_optin', array($this, 'remove_optin'));
     add_action('wp_ajax_rapidology_duplicate_optin', array($this, 'duplicate_optin'));
     add_action('wp_ajax_rapidology_add_variant', array($this, 'add_variant'));
     add_action('wp_ajax_rapidology_home_tab_tables', array($this, 'home_tab_tables'));
     add_action('wp_ajax_rapidology_toggle_optin_status', array($this, 'toggle_optin_status'));
     add_action('wp_ajax_rapidology_authorize_account', array($this, 'authorize_account'));
     add_action('wp_ajax_rapidology_reset_accounts_table', array($this, 'reset_accounts_table'));
     add_action('wp_ajax_rapidology_generate_mailing_lists', array($this, 'generate_mailing_lists'));
     add_action('wp_ajax_rapidology_generate_new_account_fields', array($this, 'generate_new_account_fields'));
     add_action('wp_ajax_rapidology_generate_accounts_list', array($this, 'generate_accounts_list'));
     add_action('wp_ajax_rapidology_generate_current_lists', array($this, 'generate_current_lists'));
     add_action('wp_ajax_rapidology_generate_edit_account_page', array($this, 'generate_edit_account_page'));
     add_action('wp_ajax_rapidology_save_account_tab', array($this, 'save_account_tab'));
     add_action('wp_ajax_rapidology_ab_test_actions', array($this, 'ab_test_actions'));
     add_action('wp_ajax_rapidology_get_stats_graph_ajax', array($this, 'get_stats_graph_ajax'));
     add_action('wp_ajax_rapidology_refresh_optins_stats_table', array($this, 'refresh_optins_stats_table'));
     add_action('wp_ajax_rapidology_reset_stats', array($this, 'reset_stats'));
     add_action('wp_ajax_rapidology_pick_winner_optin', array($this, 'pick_winner_optin'));
     add_action('wp_ajax_rapidology_clear_stats', array($this, 'clear_stats'));
     add_action('wp_ajax_rapidology_get_premade_values', array($this, 'get_premade_values'));
     add_action('wp_ajax_rapidology_generate_premade_grid', array($this, 'generate_premade_grid'));
     add_action('wp_ajax_rapidology_display_preview', array($this, 'display_preview'));
     add_action('wp_ajax_rapidology_handle_stats_adding', array($this, 'handle_stats_adding'));
     add_action('wp_ajax_nopriv_rapidology_handle_stats_adding', array($this, 'handle_stats_adding'));
     add_action('wp_ajax_rapidology_subscribe', array($this, 'subscribe'));
     add_action('wp_ajax_nopriv_rapidology_subscribe', array($this, 'subscribe'));
     add_action('widgets_init', array($this, 'register_widget'));
     add_action('after_setup_theme', array($this, 'register_image_sizes'));
     add_shortcode('rad_rapidology_inline', array($this, 'display_inline_shortcode'));
     add_shortcode('rad_rapidology_locked', array($this, 'display_locked_shortcode'));
     add_filter('body_class', array($this, 'add_body_class'));
     register_activation_hook(__FILE__, array($this, 'activate_plugin'));
     register_deactivation_hook(__FILE__, array($this, 'deactivate_plugin'));
     add_action('rapidology_lists_auto_refresh', array($this, 'perform_auto_refresh'));
     add_action('rapidology_stats_auto_refresh', array($this, 'perform_stats_refresh'));
     $this->frontend_register_locations();
     foreach (array('post.php', 'post-new.php') as $hook) {
         add_action("admin_head-{$hook}", array($this, 'tiny_mce_vars'));
         add_action("admin_head-{$hook}", array($this, 'add_mce_button_filters'));
     }
 }