示例#1
0
    function content()
    {
        global $eventon, $eventon_au;
        // Settings Tabs array
        $evcal_tabs = array('evoau_1' => __('General'), 'evoau_2' => __('User Capabilities'));
        $focus_tab = isset($_GET['tab']) ? sanitize_text_field(urldecode($_GET['tab'])) : 'evoau_1';
        $settings_page_role = isset($_POST['current_role']) ? $_POST['current_role'] : 'administrator';
        // Update or add options
        if (isset($_POST['evoau_noncename']) && isset($_POST)) {
            if (wp_verify_nonce($_POST['evoau_noncename'], AJDE_EVCAL_BASENAME)) {
                // update role caps
                if ($focus_tab == 'evoau_2') {
                    // User cap edit
                    if (isset($_GET['object']) && isset($_GET['user_id'])) {
                        $current_edit_user = $_GET['user_id'];
                        if (isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'evo_user_' . $current_edit_user)) {
                            $eventon_au->admin->update_role_caps($current_edit_user, 'user', 'post');
                            $_POST['settings-updated'] = 'Capabilities updated successfully.';
                        } else {
                            $_POST['settings-updated'] = 'Could not verify required information.';
                        }
                        // role cap edit
                    } else {
                        if ($settings_page_role != 'administrator') {
                            //echo $role;
                            $eventon_au->admin->update_role_caps($settings_page_role, 'role', 'post');
                            $_POST['settings-updated'] = $settings_page_role . ' capabilities have been updated.';
                        } else {
                            $_POST['settings-updated'] = 'You can not change Administrator capabilities.';
                        }
                    }
                } else {
                    foreach ($_POST as $pf => $pv) {
                        $pv = is_array($pv) ? $pv : htmlspecialchars($pv);
                        $evcal_options[$pf] = $pv;
                    }
                    update_option('evcal_options_' . $focus_tab, $evcal_options);
                    $_POST['settings-updated'] = 'Successfully updated values.';
                }
            } else {
                die(__('Action failed. Please refresh the page and retry.', 'eventon'));
            }
        }
        ?>
<div class="wrap" id='evcal_settings'>
	<div id='eventon'><div id="icon-themes" class="icon32"></div></div>
	<h2><?php 
        _e('Action User Settings', 'eventon');
        ?>
</h2>
	<h2 class='nav-tab-wrapper' id='meta_tabs'>
		<?php 
        foreach ($evcal_tabs as $nt => $ntv) {
            if ($nt == 'evoau_2' && current_user_can('administrator') || $nt != 'evoau_2') {
                $evo_notification = '';
                echo "<a href='?page=action_user&tab=" . $nt . "' class='nav-tab " . ($focus_tab == $nt ? 'nav-tab-active' : null) . "' evcal_meta='evcal_1'>" . $ntv . $evo_notification . "</a>";
            }
        }
        ?>
		
	</h2>	
<div class='evo_settings_box'>		
<?php 
        $updated_code = isset($_POST['settings-updated']) ? '<div class="updated fade"><p>' . $_POST['settings-updated'] . '</p></div>' : null;
        echo $updated_code;
        switch ($focus_tab) {
            case "evoau_1":
                $eventon->load_ajde_backender();
                ?>
		<form method="post" action=""><?php 
                settings_fields('evoau_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evoau_noncename');
                ?>
		<div id="evoau_1" class="evcal_admin_meta evcal_focus">		
			<div class="inside">
				<?php 
                // GET form fields
                foreach ($eventon_au->frontend->au_form_fields('additional') as $field => $fn) {
                    $fieldar[$field] = $fn[0];
                }
                // Default select tax #1 and #2
                $default_tax_fields = array();
                $_tax_names_array = $eventon_au->frontend->tax_names;
                for ($t = 1; $t < 3; $t++) {
                    $ab = $t == 1 ? '' : '_' . $t;
                    $ett = get_terms('event_type' . $ab);
                    $au_ett = '';
                    // show option only if there are tax terms
                    if (!empty($ett) && !is_wp_error($ett)) {
                        foreach ($ett as $term) {
                            $au_ett[$term->term_id] = $term->name;
                        }
                        $default_tax_fields[$t][1] = array('id' => 'evoau_set_def_ett' . $ab, 'type' => 'yesno', 'name' => 'Set default ' . $_tax_names_array[$t] . ' category tag for event submissions', 'afterstatement' => 'evoau_set_def_ett' . $ab, 'legend' => 'This will assign a selected ' . $_tax_names_array[$t] . ' category tag to the submitted event by default.');
                        $default_tax_fields[$t][2] = array('id' => 'evoau_set_def_ett' . $ab, 'type' => 'begin_afterstatement');
                        $default_tax_fields[$t][3] = array('id' => 'evoau_def_ett_v' . $ab, 'type' => 'dropdown', 'name' => 'Select default ' . $_tax_names_array[$t] . ' tag for submitted events', 'width' => 'full', 'options' => $au_ett);
                        $default_tax_fields[$t][4] = array('id' => 'evoau_set_def_ett' . $ab, 'type' => 'end_afterstatement');
                    }
                }
                // intergration with RSVP addon
                // check if rsvp addon exists
                if (is_plugin_active('eventon-rsvp/eventon-rsvp.php')) {
                    $evors_setting = array('id' => 'evoar_rsvp_addon', 'type' => 'yesno', 'name' => 'Enable RSVP-ing for submitted events by default', 'legend' => 'This will automatically set RSVP capability for events submitted.');
                }
                // ARRAY
                $cutomization_pg_array = array(array('id' => 'evoAU1', 'name' => 'Front-end Event Submission form', 'tab_name' => 'Event Submission Form', 'display' => 'show', 'icon' => 'inbox', 'fields' => array(array('id' => 'evoau_access', 'type' => 'yesno', 'name' => 'Allow only logged-in users to submit events', 'legend' => 'This will allow you to only give event submission form access to loggedin users.'), array('id' => 'evoau_limit_submissions', 'type' => 'yesno', 'name' => 'Restrict only one event submission per user', 'legend' => 'This will restrict any user submit events only once. No more submissions message can be editted from EventON > Language > Action User'), array('id' => 'evoau_post_status', 'type' => 'dropdown', 'name' => 'Submitted event\'s default post status', 'width' => 'full', 'options' => array('draft' => 'Draft', 'publish' => 'Publish', 'private' => 'Private')), array('id' => 'evoau_assignu', 'type' => 'yesno', 'name' => 'Assign logged-in user to event after successful event submission'), array('id' => 'evoau_ux', 'type' => 'yesno', 'name' => 'Set default user-interaction for event', 'afterstatement' => 'evoau_ux'), array('id' => 'evoau_ux', 'type' => 'begin_afterstatement'), array('id' => 'evoau_ux_val', 'type' => 'dropdown', 'name' => 'Select default event user-interaction', 'width' => 'full', 'options' => array('1' => 'Slide Down', '3' => 'Lightbox', '4' => 'Single Event page (if single events addon installed)')), array('id' => 'evoau_ux', 'type' => 'end_afterstatement'), array('id' => 'evoau001', 'type' => 'subheader', 'name' => 'Event Type Category Settings'), !empty($default_tax_fields[1]) ? $default_tax_fields[1][1] : null, !empty($default_tax_fields[1]) ? $default_tax_fields[1][2] : null, !empty($default_tax_fields[1]) ? $default_tax_fields[1][3] : null, !empty($default_tax_fields[1]) ? $default_tax_fields[1][4] : null, !empty($default_tax_fields[2]) ? $default_tax_fields[2][1] : null, !empty($default_tax_fields[2]) ? $default_tax_fields[2][2] : null, !empty($default_tax_fields[2]) ? $default_tax_fields[2][3] : null, !empty($default_tax_fields[2]) ? $default_tax_fields[2][4] : null, array('id' => 'evoau_add_cats', 'type' => 'yesno', 'name' => 'Allow users to create new categories for event type tax', 'legend' => 'Users will be able to create their own custom categories for all event type taxonomies (categories) from the event submission form'), !empty($evors_setting) ? $evors_setting : null)), array('id' => 'evoAU1a', 'name' => 'Submission form fields', 'tab_name' => 'Form Fields', 'icon' => 'briefcase', 'fields' => array(array('id' => 'evo_au_title', 'type' => 'text', 'name' => 'Default Form Header Text'), array('id' => 'evo_au_stitle', 'type' => 'text', 'name' => 'Default Form Subheader Text'), array('id' => 'evoau_fields', 'type' => 'note', 'name' => 'Additional 
								fields for the event submission form: <i>(NOTE: Event Name, Start and End date/time are default fields)</i><br/><a href="' . get_admin_url() . 'admin.php?page=eventon&tab=evcal_2">Customize text for form field names</a>'), array('id' => 'evoau_fields', 'type' => 'rearrange', 'fields_array' => $this->fields_array(), 'order_var' => 'evoau_fieldorder', 'selected_var' => 'evoau_fields', 'title' => __('Fields for the Event Submission form', 'eventon')), array('id' => 'evoau_html_content', 'type' => 'textarea', 'name' => 'Additional HTML field content', 'legend' => 'Type the HTML content to be used in the above HTML field inside the event submission form.'), array('id' => 'evoau_notif', 'type' => 'note', 'name' => '** Name and email fields will not be visible in the form if user is loggedin already, but those fields will be populated with registered information.<br/><br/>** Category selection fields will not show on form if they do not have category tags.'))), array('id' => 'evoAU2', 'name' => 'Form Emailing Settings', 'tab_name' => 'Emailing', 'icon' => 'envelope', 'fields' => array(array('id' => 'evoau_001', 'type' => 'note', 'name' => 'Supported email tags that can be used within email message: <code>{event-edit-link}</code>,<code>{event-name}</code>,<code>{event-link}</code>,<code>{event-start-date}</code><br/>
									IF available only tags: <code>{submitter-name}</code>,<code>{submitter-email}</code>
									<br/>HTML codes can be used inside email message body.'), array('id' => 'evoau_notif', 'type' => 'yesno', 'name' => 'Notify admin upon new event submission', 'afterstatement' => 'evoau_notif'), array('id' => 'evoau_notif', 'type' => 'begin_afterstatement'), array('id' => 'evoau_ntf_admin_to', 'type' => 'text', 'name' => 'Email address to send notification. (eg. you@domain.com)', 'legend' => 'You can add multiple email addresses seperated by commas to receive notifications of event submissions.', 'default' => $this->adminEmail), array('id' => 'evoau_ntf_admin_from', 'type' => 'text', 'name' => 'From eg. My Name &lt;myname@domain.com&gt; - Default will use admin email from this website'), array('id' => 'evoau_ntf_admin_subject', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'New Event Submission'), array('id' => 'evoau_ntf_admin_msg', 'type' => 'textarea', 'name' => 'Message body', 'default' => 'You have a new event submission!'), array('id' => 'evoau_notif', 'type' => 'end_afterstatement'), array('id' => 'evoau_notsubmitter', 'type' => 'yesno', 'name' => 'Notify submitter when they submit an event (if submitter email present)', 'afterstatement' => 'evoau_notsubmitter'), array('id' => 'evoau_notsubmitter', 'type' => 'begin_afterstatement'), array('id' => 'evoau_ntf_user_from', 'type' => 'text', 'name' => 'From eg. My Name &lt;myname@domain.com&gt; - Default will use admin email from this website', 'default' => $this->adminEmail), array('id' => 'evoau_ntf_drf_subject', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'We have received your event!'), array('id' => 'evoau_ntf_drf_msg', 'type' => 'textarea', 'name' => 'Message body', 'default' => 'Thank you for submitting your event!', 'default' => 'Thank you for submitting your event!'), array('id' => 'evoau_notsubmitterAP', 'type' => 'end_afterstatement'), array('id' => 'evoau_notsubmitterAP', 'type' => 'yesno', 'name' => 'Notify submitter when their event is approved (if submitter email present)', 'afterstatement' => 'evoau_notsubmitterAP', 'legend' => 'If you set the submitted events to be saved as drafts, you can use this message notifications to let them know when their event is approved'), array('id' => 'evoau_notsubmitterAP', 'type' => 'begin_afterstatement'), array('id' => 'evoau_ntf_pub_from', 'type' => 'text', 'name' => 'From eg. My Name &lt;myname@domain.com&gt; - Default will use admin email from this website', 'default' => $this->adminEmail), array('id' => 'evoau_ntf_pub_subject', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'We have approved your event!'), array('id' => 'evoau_ntf_pub_msg', 'type' => 'textarea', 'name' => 'Message body', 'default' => 'Thank you for submitting your event and we have approved it!'), array('id' => 'evoau_notsubmitterAP', 'type' => 'end_afterstatement'), array('id' => 'evoau_link', 'type' => 'dropdown', 'name' => 'Select notification email link type', 'width' => 'full', 'options' => array('event' => 'Link to event', 'learnmore' => 'Link to learn more link inside event', 'other' => 'Other link, type below')), array('id' => 'evoaun_link_other', 'type' => 'text', 'name' => ' Type other custom link you want to use in notification email', 'legend' => "For this link to be included in the notification email, make sure to select Other Link as an option in above setting."))), array('id' => 'evoAU3', 'name' => 'Front-end form notification Messages', 'tab_name' => 'Front-end Messages', 'icon' => 'comments', 'fields' => array(array('id' => 'evoaun_msg_f', 'type' => 'note', 'name' => 'Form success message and error message text can be editted from <u>EventON Settings > Language > Addon: Action User</u>'))));
                // load new settings values
                $this->opt = get_option('evcal_options_evoau_1');
                $updated_code = isset($_POST['settings-updated']) && $_POST['settings-updated'] == 'true' ? '<div class="updated fade"><p>Settings Saved</p></div>' : null;
                echo $updated_code;
                $eventon->load_ajde_backender();
                print_ajde_customization_form($cutomization_pg_array, $this->opt);
                ?>
				
			</div>				
		</div>	
		<div class='evo_diag'>
			<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
                _e('Save Changes');
                ?>
" /><br/><br/>
			<a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php 
                echo AJDE_EVCAL_URL;
                ?>
/assets/images/myeventon_resources.png'/></a>
		</div>		
		</form>
		
<?php 
                break;
                // PERMISSIONS TAB
            // PERMISSIONS TAB
            case "evoau_2":
                if (current_user_can('administrator')) {
                    $eventon->load_ajde_backender();
                    ?>
		<form method="post" action=""><?php 
                    settings_fields('evoau_field_group');
                    wp_nonce_field(AJDE_EVCAL_BASENAME, 'evoau_noncename');
                    ?>
		<div id="evoau_2" class="evcal_admin_meta evcal_focus">		
			<div class='postbox'>
			<div class="inside">
				<?php 
                    // Capabilities for Individual user
                    if (isset($_GET['object']) && isset($_GET['user_id']) && $_GET['object'] == 'user') {
                        $this_user_id = $_GET['user_id'];
                        $cur_edit_user = new WP_User($_GET['user_id']);
                        if (!is_multisite() || current_user_can('manage_network_users')) {
                            $anchor_start = '<a href="' . wp_nonce_url("user-edit.php?user_id={$this_user_id}", "evo_user_{$this_user_id}") . '" >';
                            $anchor_end = '</a>';
                        } else {
                            $anchor_start = '';
                            $anchor_end = '';
                        }
                        $user_info = ' <span style="font-weight: bold;">' . $anchor_start . $cur_edit_user->user_login;
                        if ($cur_edit_user->display_name !== $cur_edit_user->user_login) {
                            $user_info .= ' (' . $cur_edit_user->display_name . ')';
                        }
                        $user_info .= $anchor_end . '</span>';
                        if (is_multisite() && is_super_admin($this_user_id)) {
                            $user_info .= '  <span style="font-weight: bold; color:red;">' . esc_html__('Network Super Admin', 'eventon') . '</span>';
                        }
                        ?>
					<h3><?php 
                        _e('Capabilities for user', 'eventon');
                        ?>
 <?php 
                        echo $user_info;
                        ?>
</h3>
					<p><?php 
                        _e('Primary Role', 'eventon');
                        ?>
: <b><?php 
                        echo $cur_edit_user->roles[0];
                        ?>
</b></p>				
					<h4><?php 
                        _e('EventON Capabilities', 'eventon');
                        ?>
</h4>					
					<em class="hr_line noexpand"></em>
					<div class='capabilities_list evo_backender_uix'>
						<?php 
                        echo $eventon_au->admin->get_cap_list_admin($this_user_id, 'user');
                        ?>
					</div>				
				<?php 
                    } else {
                        ?>
				
					<h3><?php 
                        _e('Select Role and set Capabilities for eventON', 'eventon');
                        ?>
</h3>
					<p><?php 
                        _e('Select Role', 'eventon');
                        ?>
 <select id='evoau_role_selector' name='current_role'>
					<?php 
                        global $wp_roles;
                        $roles = $wp_roles->get_names();
                        //print_r($roles);
                        foreach ($roles as $role => $rolev) {
                            $selected = $settings_page_role == $role ? 'selected' : null;
                            echo "<option value='{$role}' {$selected}>{$rolev}</option>";
                        }
                        ?>
					</select></p>				
					<em class="hr_line noexpand"></em>
					<p class="evoau_msg" style='display:none; padding-bottom:20px'><?php 
                        _e('Loading..', 'eventon');
                        ?>
</p>
					<div class='capabilities_list evo_backender_uix'>
						<?php 
                        $caps = $eventon_au->admin->get_cap_list_admin($settings_page_role);
                        echo $caps;
                        ?>
					</div>
					</p><i><?php 
                        _e('NOTE: Administrator capabilities can not be changed.', 'eventon');
                        ?>
</i></p>					
				<?php 
                    }
                    ?>
				
				<br/>
				<h4><?php 
                    _e('Guide to Capabilities:', 'eventon');
                    ?>
</h4>
				<p><b><?php 
                    _e('publish events', 'eventon');
                    ?>
</b> - <?php 
                    _e('Allow user to publish a event', 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('edit events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Allow editing of the user's own events but does not grant publishing permission.", 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('edit others events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Allows the user to edit everyone else's events but not publish.", 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('edit published events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Allows the user to edit his own events that are published.", 'eventon');
                    ?>
</p>
				
				<p><b><?php 
                    _e('delete events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Grants the ability to delete events written by that user but not other.", 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('delete others events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Capability to edit events written by other users.", 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('read private events', 'eventon');
                    ?>
</b> - <?php 
                    _e("Allow user to read private events.", 'eventon');
                    ?>
</p>
				<p><b><?php 
                    _e('assign event terms', 'eventon');
                    ?>
</b> - <?php 
                    _e("Allows the user to assign event terms to allowed events.", 'eventon');
                    ?>
</p>
			</div>
			</div>
		</div>
		<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
                    _e('Save Changes');
                    ?>
" /></form>
<?php 
                }
                break;
        }
        echo "</div>";
    }
    /**
     * Settings page.
     *
     * Handles the display of the main EventON settings page in admin.
     *
     * @access public
     * @return void
     */
    function eventon_settings()
    {
        global $eventon, $ajde;
        do_action('eventon_settings_start');
        // Settings Tabs array
        $evcal_tabs = apply_filters('eventon_settings_tabs', array('evcal_1' => __('Settings', 'eventon'), 'evcal_2' => __('Language', 'eventon'), 'evcal_3' => __('Styles', 'eventon'), 'evcal_4' => __('Addons & Licenses', 'eventon'), 'evcal_5' => __('Support', 'eventon')));
        // Get current tab/section
        $focus_tab = isset($_GET['tab']) ? sanitize_text_field(urldecode($_GET['tab'])) : 'evcal_1';
        $current_section = isset($_GET['section']) ? sanitize_text_field(urldecode($_GET['section'])) : '';
        // Update or add options
        if (isset($_POST['evcal_noncename']) && isset($_POST)) {
            if (wp_verify_nonce($_POST['evcal_noncename'], AJDE_EVCAL_BASENAME)) {
                foreach ($_POST as $pf => $pv) {
                    if ($pf != 'evcal_styles' && $focus_tab != 'evcal_4' || $pf != 'evcal_sort_options') {
                        $pv = is_array($pv) ? $pv : addslashes(esc_html(stripslashes($pv)));
                        $evcal_options[$pf] = $pv;
                    }
                    if ($pf == 'evcal_sort_options') {
                        $evcal_options[$pf] = $pv;
                    }
                }
                // General settings page - write styles to head option
                if ($focus_tab == 'evcal_1' && isset($_POST['evcal_css_head']) && $_POST['evcal_css_head'] == 'yes') {
                    ob_start();
                    include AJDE_EVCAL_PATH . '/assets/css/dynamic_styles.php';
                    $evo_dyn_css = ob_get_clean();
                    update_option('evo_dyn_css', $evo_dyn_css);
                }
                //language tab
                if ($focus_tab == 'evcal_2') {
                    $new_lang_opt = '';
                    $_lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1';
                    $lang_opt = get_option('evcal_options_evcal_2');
                    if (!empty($lang_opt)) {
                        $new_lang_opt[$_lang_version] = $evcal_options;
                        $new_lang_opt = array_merge($lang_opt, $new_lang_opt);
                    } else {
                        $new_lang_opt[$_lang_version] = $evcal_options;
                    }
                    update_option('evcal_options_evcal_2', $new_lang_opt);
                } elseif ($focus_tab == 'evcal_1' || empty($focus_tab)) {
                    // store custom meta box count
                    $cmd_count = evo_calculate_cmd_count();
                    $evcal_options['cmd_count'] = $cmd_count;
                    update_option('evcal_options_' . $focus_tab, $evcal_options);
                    // all other settings tabs
                } else {
                    update_option('evcal_options_' . $focus_tab, $evcal_options);
                }
                // STYLES
                if (isset($_POST['evcal_styles'])) {
                    update_option('evcal_styles', strip_tags(stripslashes($_POST['evcal_styles'])));
                }
                $_POST['settings-updated'] = 'true';
                eventon_generate_options_css();
                // nonce check
            } else {
                die(__('Action failed. Please refresh the page and retry.', 'eventon'));
            }
        }
        // Load eventon settings values for current tab
        $current_tab_number = substr($focus_tab, -1);
        if (!is_numeric($current_tab_number)) {
            // if the tab last character is not numeric then get the whole tab name as the variable name for the options
            $current_tab_number = $focus_tab;
        }
        $evcal_opt[$current_tab_number] = get_option('evcal_options_' . $focus_tab);
        // activation notification
        if (!$eventon->evo_updater->is_activated('eventon')) {
            echo '<div class="update-nag">' . __('Your eventON license is not saved. eventON should still work fine. <a href="' . get_admin_url() . 'admin.php?page=eventon&tab=evcal_4">Enter License Now</a>', 'eventon') . '</div>';
        }
        // TABBBED HEADER
        ?>
<div class="wrap" id='evcal_settings'>
	<h2><?php 
        _e('EventON Settings', 'eventon');
        ?>
 (ver <?php 
        echo get_option('eventon_plugin_version');
        ?>
) <?php 
        do_action('eventon_updates_in_settings');
        ?>
</h2>
	<h2 class='nav-tab-wrapper' id='meta_tabs'>
		<?php 
        foreach ($evcal_tabs as $nt => $ntv) {
            $evo_notification = '';
            echo "<a href='?page=eventon&tab=" . $nt . "' class='nav-tab " . ($focus_tab == $nt ? 'nav-tab-active' : null) . " {$nt}' evcal_meta='evcal_{$nt}'>" . $ntv . $evo_notification . "</a>";
        }
        ?>
		
	</h2>	
<div class='evo_settings_box'>	
<?php 
        // SETTINGS SAVED MESSAGE
        $updated_code = isset($_POST['settings-updated']) && $_POST['settings-updated'] == 'true' ? '<div class="updated fade"><p>' . __('Settings Saved', 'eventon') . '</p></div>' : null;
        echo $updated_code;
        // TABS
        switch ($focus_tab) {
            case "evcal_1":
                // Event type custom taxonomy NAMES
                $event_type_names = evo_get_ettNames($evcal_opt[1]);
                $evt_name = $event_type_names[1];
                $evt_name2 = $event_type_names[2];
                ?>
		<form method="post" action=""><?php 
                settings_fields('evcal_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
                ?>
		<div id="evcal_1" class=" evcal_admin_meta evcal_focus">		
			
			<div class="evo_inside">
				<?php 
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/class-settings-settings.php';
                $settings = new evo_settings_settings($evcal_opt);
                $ajde->load_ajde_backender();
                print_ajde_customization_form($settings->content(), $evcal_opt[1]);
                ?>
			</div>	
		</div>
		<div class='evo_diag'>
			<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
                _e('Save Changes');
                ?>
" /> <a id='resetColor' style='display:none' class='evo_admin_btn btn_secondary'><?php 
                _e('Reset to default colors', 'eventon');
                ?>
</a><br/><br/>
			<a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php 
                echo AJDE_EVCAL_URL;
                ?>
/assets/images/myeventon_resources.png'/></a>
		</div>
		
		</form>
	
<?php 
                break;
                // LANGUAGE TAB
            // LANGUAGE TAB
            case "evcal_2":
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_language_tab.php';
                $settings_lang = new evo_settings_lang($evcal_opt);
                $settings_lang->get_content();
                break;
                // STYLES TAB
            // STYLES TAB
            case "evcal_3":
                echo '<form method="post" action="">';
                //settings_fields('evcal_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
                // styles settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_styles_tab.php';
                break;
                // ADDON TAB
            // ADDON TAB
            case "evcal_4":
                // Addons settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_addons_tab.php';
                break;
                // support TAB
            // support TAB
            case "evcal_5":
                // Addons settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_support_tab.php';
                break;
                // ADVANDED extra field
            // ADVANDED extra field
            case "extra":
                // advanced tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_advanced_tab.php';
                break;
            default:
                do_action('eventon_settings_tabs_' . $focus_tab);
                break;
        }
        echo "</div>";
    }
示例#3
0
    function evotx_tab_content()
    {
        global $eventon;
        $eventon->load_ajde_backender();
        ?>
				<form method="post" action=""><?php 
        settings_fields('evoau_field_group');
        wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
        ?>
				<div id="evcal_tx" class="evcal_admin_meta">	
					<div class="evo_inside">
					<?php 
        $site_name = get_bloginfo('name');
        $site_email = get_bloginfo('admin_email');
        $cutomization_pg_array = array(array('id' => 'evotx', 'display' => 'show', 'name' => 'General Ticket Settings', 'tab_name' => 'General', 'fields' => array(array('id' => 'evotx_loggedinuser', 'type' => 'yesno', 'name' => 'Show ticket purchase only for loggedin users'), array('id' => 'evotx_tix_email', 'type' => 'yesno', 'name' => 'Stop sending ticket emails to buyers'), array('id' => 'evotx_tix_inquiries', 'type' => 'subheader', 'name' => 'Ticket Inquiries Settings'), array('id' => 'evotx_tix_inquiries_def_email', 'type' => 'text', 'name' => 'Default Email Address to <b>Receive</b> Ticket Inquiries. eg. YourName &#60;you@mail.com&#62;', 'default' => get_option('admin_email')), array('id' => 'evotx_tix_inquiries_def_subject', 'type' => 'text', 'name' => 'Default Subject for Ticket Inquiries Email', 'default' => 'New Ticket Sale Inquery'))), array('id' => 'evotx2', 'name' => 'Email Templates', 'tab_name' => 'Emails', 'icon' => 'envelope', 'fields' => array(array('type' => 'subheader', 'name' => 'Event Ticket Email'), array('id' => 'evotx_notfiemailfromN', 'type' => 'text', 'name' => '"From" Name', 'default' => $site_name), array('id' => 'evotx_notfiemailfrom', 'type' => 'text', 'name' => '"From" Email Address', 'default' => $site_email), array('id' => 'evotx_notfiesubjest', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'Event Ticket'), array('id' => 'evcal_fcx', 'type' => 'subheader', 'name' => 'HTML Template'), array('id' => 'evcal_fcx', 'type' => 'note', 'name' => 'To override and edit the email template copy "eventon-tickets/templates/ticket_confirmation_email.php" to  "yourtheme/eventon/templates/email/ticket_confirmation_email.php.'))));
        $eventon->load_ajde_backender();
        $evcal_opt = get_option('evcal_options_evcal_tx');
        print_ajde_customization_form($cutomization_pg_array, $evcal_opt);
        ?>
				</div>
				</div>
				<div class='evo_diag'>
					<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
        _e('Save Changes');
        ?>
" /><br/><br/>
					<a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php 
        echo AJDE_EVCAL_URL;
        ?>
/assets/images/myeventon_resources.png'/></a>
				</div>
				
				</form>	
			<?php 
    }
示例#4
0
    function evoRS_tab_content()
    {
        global $eventon;
        $eventon->load_ajde_backender();
        ?>
			<form method="post" action=""><?php 
        settings_fields('evoau_field_group');
        wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
        ?>
			<div id="evcal_csv" class="evcal_admin_meta">	
				<div class="evo_inside">
				<?php 
        $site_name = get_bloginfo('name');
        $site_email = get_bloginfo('admin_email');
        $cutomization_pg_array = array(array('id' => 'evoRS1', 'display' => 'show', 'name' => 'General RSVP Settings', 'tab_name' => 'General', 'fields' => array(array('id' => 'evors_onlylogu', 'type' => 'yesno', 'name' => 'Allow only logged-in in users to submit RSVP'), array('id' => 'evors_onlylog_chg', 'type' => 'yesno', 'name' => 'Allow only logged in users to change RSVP'), array('id' => 'evors_prefil', 'type' => 'yesno', 'name' => 'Pre-fill fields  if user is already logged-in (eg. first name, last name, email)', 'legend' => 'If this option is activated, form will pre-fill fields (name & email) for logged-in users.'), array('id' => 'evors_prefil_block', 'type' => 'yesno', 'name' => 'Disable pre-filled fields editing', 'legend' => 'This will disable editing pre-filled data fields, when fields are pre-filled with loggedin user data eg. first name, last name, email.'), array('id' => 'evors_eventop_rsvp', 'type' => 'yesno', 'name' => 'Allow RSVPing with one-click from eventTop to logged-in users', 'legend' => 'This will show the normal RSVP option buttons for a logged-in user to RSVP to the event straight from the eventtop. This method will only capture user name, email and rsvp status only'))), array('id' => 'evoRS2', 'display' => '', 'name' => 'Email Templates', 'tab_name' => 'Emails', 'icon' => 'envelope', 'fields' => array(array('id' => 'evors_notif', 'type' => 'yesno', 'name' => 'Receive email notifications upon new RSVP receipt', 'afterstatement' => 'evors_notif'), array('id' => 'evors_notif', 'type' => 'begin_afterstatement'), array('id' => 'evcal_fcx', 'type' => 'note', 'name' => 'You can also set additional email addresses to receive notifications on each event edit page'), array('id' => 'evors_notfiemailfromN', 'type' => 'text', 'name' => '"From" Name', 'default' => $site_name), array('id' => 'evors_notfiemailfrom', 'type' => 'text', 'name' => '"From" Email Address', 'default' => $site_email), array('id' => 'evors_notfiemailto', 'type' => 'text', 'name' => '"To" Email Address', 'default' => $site_email), array('id' => 'evors_notfiesubjest', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'New RSVP Notification'), array('id' => 'evcal_fcx', 'type' => 'subheader', 'name' => 'HTML Template'), array('id' => 'evcal_fcx', 'type' => 'note', 'name' => 'To override and edit the email template copy "eventon-rsvp/templates/notification_email.php" to  "yourtheme/eventon/templates/email/notification_email.php.'), array('id' => 'evors_notif', 'type' => 'end_afterstatement'), array('id' => 'evors_notif_e', 'type' => 'subheader', 'name' => 'Send out RSVP email confirmations to attendees'), array('id' => 'evors_notfiemailfromN_e', 'type' => 'text', 'name' => '"From" Name', 'default' => $site_name), array('id' => 'evors_notfiemailfrom_e', 'type' => 'text', 'name' => '"From" Email Address', 'default' => $site_email), array('id' => 'evors_notfiesubjest_e', 'type' => 'text', 'name' => 'Email Subject line', 'default' => 'RSVP Confirmation'), array('id' => 'evors_contact_link', 'type' => 'text', 'name' => 'Contact for help link', 'default' => site_url(), 'legend' => 'This will be added to the bottom of RSVP confirmation email sent to attendee'), array('id' => 'evcal_fcx', 'type' => 'subheader', 'name' => 'HTML Template'), array('id' => 'evcal_fcx', 'type' => 'note', 'name' => 'To override and edit the email template copy "eventon-rsvp/templates/confirmation_email.php" to  "yourtheme/eventon/templates/email/confirmation_email.php.'))), array('id' => 'evoRS3', 'display' => '', 'name' => 'RSVP form fields', 'tab_name' => 'RSVP Form', 'icon' => 'inbox', 'fields' => array(array('id' => 'evors_selection', 'type' => 'checkboxes', 'name' => 'Select RSVP status options for selection. <i>(Yes value is required)</i>', 'options' => array('m' => 'Maybe', 'n' => 'No')), array('id' => 'evors_hide_change', 'type' => 'yesno', 'name' => 'Hide \'Change RSVP\' button', 'legend' => 'This will hide the change rsvp button from eventcard.'), array('id' => 'evors_ffields', 'type' => 'checkboxes', 'name' => 'Select RSVP form fields to show in the form. <i>(** First , Last names, and Email are required)</i>', 'options' => array('phone' => 'Phone Number', 'count' => 'RSVP Count (If unckecked system will count as 1 RSVP)', 'updates' => 'Receive updates about event', 'captcha' => 'Verification code')), array('id' => 'evors_terms', 'type' => 'yesno', 'name' => 'Activate Terms & Conditions for form', 'afterstatement' => 'evors_terms'), array('id' => 'evors_terms', 'type' => 'begin_afterstatement'), array('id' => 'evors_terms_link', 'type' => 'text', 'name' => 'Link to Terms & Conditions'), array('id' => 'evors_terms_text', 'type' => 'note', 'name' => 'Text Caption for Terms & Conditions can be edited from EventON > Language > EventON RSVP'), array('id' => 'evors_terms', 'type' => 'end_afterstatement'), array('id' => 'evors_addf1', 'type' => 'yesno', 'name' => 'Additional Field #1', 'afterstatement' => 'evors_addf1'), array('id' => 'evors_addf1', 'type' => 'begin_afterstatement'), array('id' => 'evors_addf1_1', 'type' => 'text', 'name' => 'Field Name'), array('id' => 'evors_addf1_2', 'type' => 'dropdown', 'name' => 'Field Type', 'options' => $this->_custom_field_types()), array('id' => 'evors_addf1_4', 'type' => 'text', 'name' => 'Option Values (only for Drop Down field)', 'default' => 'eg. cats,dogs', 'legend' => 'Only set these values for field type = drop down. If these values are not provided for drop down field type it will revert as text field.'), array('id' => 'evors_addf1_3', 'type' => 'yesno', 'name' => 'Required Field'), array('id' => 'evors_addf1', 'type' => 'end_afterstatement'), array('id' => 'evors_addf2', 'type' => 'yesno', 'name' => 'Additional Field #2', 'afterstatement' => 'evors_addf2'), array('id' => 'evors_addf2', 'type' => 'begin_afterstatement'), array('id' => 'evors_addf2_1', 'type' => 'text', 'name' => 'Field Name'), array('id' => 'evors_addf2_2', 'type' => 'dropdown', 'name' => 'Field Type', 'options' => $this->_custom_field_types()), array('id' => 'evors_addf2_4', 'type' => 'text', 'name' => 'Option Values (only for Drop Down field)', 'default' => 'eg. cats,dogs', 'legend' => 'Only set these values for field type = drop down. If these values are not provided for drop down field type it will revert as text field.'), array('id' => 'evors_addf2_3', 'type' => 'yesno', 'name' => 'Required Field'), array('id' => 'evors_addf2', 'type' => 'end_afterstatement'), array('id' => 'evors_addf3', 'type' => 'yesno', 'name' => 'Additional Field #3', 'afterstatement' => 'evors_addf3'), array('id' => 'evors_addf3', 'type' => 'begin_afterstatement'), array('id' => 'evors_addf3_1', 'type' => 'text', 'name' => 'Field Name'), array('id' => 'evors_addf3_2', 'type' => 'dropdown', 'name' => 'Field Type', 'options' => $this->_custom_field_types()), array('id' => 'evors_addf3_4', 'type' => 'text', 'name' => 'Option Values (only for Drop Down field)', 'default' => 'eg. cats,dogs', 'legend' => 'Only set these values for field type = drop down. If these values are not provided for drop down field type it will revert as text field.'), array('id' => 'evors_addf3_3', 'type' => 'yesno', 'name' => 'Required Field'), array('id' => 'evors_addf3', 'type' => 'end_afterstatement'))));
        $eventon->load_ajde_backender();
        $evcal_opt = get_option('evcal_options_evcal_rs');
        print_ajde_customization_form($cutomization_pg_array, $evcal_opt);
        ?>
			</div>
			</div>
			<div class='evo_diag'>
				<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
        _e('Save Changes');
        ?>
" /><br/><br/>
				<a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php 
        echo AJDE_EVCAL_URL;
        ?>
/assets/images/myeventon_resources.png'/></a>
			</div>			
			</form>	
		<?php 
    }
    /**
     * Settings page.
     *
     * Handles the display of the main EventON settings page in admin.
     *
     * @access public
     * @return void
     */
    function eventon_settings()
    {
        global $eventon;
        do_action('eventon_settings_start');
        // Settings Tabs array
        $evcal_tabs = apply_filters('eventon_settings_tabs', array('evcal_1' => __('Settings', 'eventon'), 'evcal_2' => __('Language', 'eventon'), 'evcal_3' => __('Styles', 'eventon'), 'evcal_4' => __('Addons & Licenses', 'eventon'), 'evcal_5' => __('Support', 'eventon')));
        // Get current tab/section
        $focus_tab = isset($_GET['tab']) ? sanitize_text_field(urldecode($_GET['tab'])) : 'evcal_1';
        $current_section = isset($_GET['section']) ? sanitize_text_field(urldecode($_GET['section'])) : '';
        $evcal_skins[] = 'slick';
        // Update or add options
        if (isset($_POST['evcal_noncename']) && isset($_POST)) {
            if (wp_verify_nonce($_POST['evcal_noncename'], AJDE_EVCAL_BASENAME)) {
                foreach ($_POST as $pf => $pv) {
                    if ($pf != 'evcal_styles' && $focus_tab != 'evcal_4' || $pf != 'evcal_sort_options') {
                        $pv = is_array($pv) ? $pv : $pv;
                        $evcal_options[$pf] = $pv;
                    }
                    if ($pf == 'evcal_sort_options') {
                        $evcal_options[$pf] = $pv;
                    }
                }
                // General settings page - write styles to head option
                if ($focus_tab == 'evcal_1' && isset($_POST['evcal_css_head']) && $_POST['evcal_css_head'] == 'yes') {
                    ob_start();
                    include AJDE_EVCAL_PATH . '/assets/css/dynamic_styles.php';
                    $evo_dyn_css = ob_get_clean();
                    update_option('evo_dyn_css', $evo_dyn_css);
                }
                //language tab
                if ($focus_tab == 'evcal_2') {
                    $new_lang_opt = '';
                    $_lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1';
                    $lang_opt = get_option('evcal_options_evcal_2');
                    if (!empty($lang_opt)) {
                        $new_lang_opt[$_lang_version] = $evcal_options;
                        $new_lang_opt = array_merge($lang_opt, $new_lang_opt);
                    } else {
                        $new_lang_opt[$_lang_version] = $evcal_options;
                    }
                    update_option('evcal_options_evcal_2', $new_lang_opt);
                } elseif ($focus_tab == 'evcal_1' || empty($focus_tab)) {
                    // store custom meta box count
                    $cmd_count = evo_calculate_cmd_count();
                    $evcal_options['cmd_count'] = $cmd_count;
                    update_option('evcal_options_' . $focus_tab, $evcal_options);
                    // all other settings tabs
                } else {
                    update_option('evcal_options_' . $focus_tab, $evcal_options);
                }
                // STYLES
                if (isset($_POST['evcal_styles'])) {
                    update_option('evcal_styles', strip_tags(stripslashes($_POST['evcal_styles'])));
                }
                $_POST['settings-updated'] = 'true';
                eventon_generate_options_css();
                // nonce check
            } else {
                die(__('Action failed. Please refresh the page and retry.', 'eventon'));
            }
        }
        // Load eventon settings values for current tab
        $current_tab_number = substr($focus_tab, -1);
        if (!is_numeric($current_tab_number)) {
            // if the tab last character is not numeric then get the whole tab name as the variable name for the options
            $current_tab_number = $focus_tab;
        }
        $evcal_opt[$current_tab_number] = get_option('evcal_options_' . $focus_tab);
        //print_r(get_option('_evo_licenses'));
        //print_r($evcal_opt[1]);
        // activation notification
        if (!$eventon->evo_updater->is_activated('eventon')) {
            echo '<div class="update-nag">' . __('Your copy of EventOn is not activated yet some features may be restricted. <a href="' . get_admin_url() . 'admin.php?page=eventon&tab=evcal_4">Activate License Now</a>', 'eventon') . '</div>';
        }
        // TABBBED HEADER
        ?>
<div class="wrap" id='evcal_settings'>
	<div id='eventon'><div id="icon-themes" class="icon32"></div></div>
	<h2>EventON Settings (ver <?php 
        echo get_option('eventon_plugin_version');
        ?>
) <?php 
        do_action('eventon_updates_in_settings');
        ?>
</h2>
	<h2 class='nav-tab-wrapper' id='meta_tabs'>
		<?php 
        foreach ($evcal_tabs as $nt => $ntv) {
            $evo_notification = '';
            echo "<a href='?page=eventon&tab=" . $nt . "' class='nav-tab " . ($focus_tab == $nt ? 'nav-tab-active' : null) . " {$nt}' evcal_meta='evcal_{$nt}'>" . $ntv . $evo_notification . "</a>";
        }
        ?>
		
	</h2>	
<div class='evo_settings_box'>	
<?php 
        // SETTINGS SAVED MESSAGE
        $updated_code = isset($_POST['settings-updated']) && $_POST['settings-updated'] == 'true' ? '<div class="updated fade"><p>' . __('Settings Saved', 'eventon') . '</p></div>' : null;
        echo $updated_code;
        // TABS
        switch ($focus_tab) {
            case "evcal_1":
                // Event type custom taxonomy NAMES
                $event_type_names = evo_get_ettNames($evcal_opt[1]);
                $evt_name = $event_type_names[1];
                $evt_name2 = $event_type_names[2];
                ?>
	<form method="post" action=""><?php 
                settings_fields('evcal_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
                ?>
	<div id="evcal_1" class=" evcal_admin_meta evcal_focus">		
		
		<div class="evo_inside">
			<?php 
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/class-settings-settings.php';
                $settings = new evo_settings_settings($evcal_opt);
                $eventon->load_ajde_backender();
                print_ajde_customization_form($settings->content(), $evcal_opt[1]);
                ?>
		</div>	
	</div>
	<div class='evo_diag'>
		<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
                _e('Save Changes');
                ?>
" /> <a id='resetColor' style='display:none' class='evo_admin_btn btn_secondary'><?php 
                _e('Reset to default colors', 'eventon');
                ?>
</a><br/><br/>
		<a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php 
                echo AJDE_EVCAL_URL;
                ?>
/assets/images/myeventon_resources.png'/></a>
	</div>
	
	</form>
	
	
<?php 
                break;
                // LANGUAGE TAB
            // LANGUAGE TAB
            case "evcal_2":
                //print_r($evcal_opt[1]);
                $__lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1';
                $lang_options = !empty($evcal_opt[2][$__lang_version]) ? $evcal_opt[2][$__lang_version] : null;
                //$lang_options =eventon_process_lang_options($lang_options);
                $eventon_months = array(1 => 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december');
                $eventon_days = array(1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
                // Language variations
                $lang_variations = apply_filters('eventon_lang_variation', array('L1', 'L2', 'L3'));
                $uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2);
                ?>
<form method="post" action=""><?php 
                settings_fields('evcal_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
                ?>
<div id="evcal_2" class="postbox evcal_admin_meta">	
	<div class="inside">
		<h2><?php 
                _e('Type in custom language text for front-end calendar', 'eventon');
                ?>
</h2>
		<h4><?php 
                _e('Select your language', 'eventon');
                ?>
 <select id='evo_lang_selection' url=<?php 
                echo 'http://' . $_SERVER['HTTP_HOST'] . $uri_parts[0];
                ?>
>		
		<?php 
                foreach ($lang_variations as $lang) {
                    echo "<option value='{$lang}' " . ($__lang_version == $lang ? 'selected="select"' : null) . ">{$lang}</option>";
                }
                ?>
</select><span class='evoGuideCall'>?<em><?php 
                _e("You can use this to save upto 2 different languages for customized text. Once saved use the shortcode to show calendar text in that customized language. eg. [add_eventon lang='L2']", 'eventon');
                ?>
</em></span></h4>
		<p><i><?php 
                _e('Please use the below fields to type in custom language text that will be used to replace the default language text on the front-end of the calendar.', 'eventon');
                ?>
</i></p>
		
		<div class='evoLANG_section_header evo_settings_toghead'><?php 
                _e('Months and Dates', 'eventon');
                ?>
</div>
		<div class='evo_settings_togbox'>
			<div class='evcal_lang_box '>
				
				<?php 
                // full month names
                for ($x = 1; $x < 13; $x++) {
                    $pre_var_name = 'evcal_lang_';
                    echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='";
                    echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $eventon_months[$x];
                    echo "'/></p>";
                }
                echo "<p class='clear' style='padding-top:5px'></p>";
                // 3 letter month names
                for ($x = 1; $x < 13; $x++) {
                    $pre_var_name = 'evo_lang_3Lm_';
                    $month_3l = substr($eventon_months[$x], 0, 3);
                    echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='";
                    echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $month_3l;
                    echo "'/></p>";
                }
                echo "<p class='clear' style='padding-top:5px'></p>";
                // 1 letter month names
                for ($x = 1; $x < 13; $x++) {
                    $pre_var_name = 'evo_lang_1Lm_';
                    $month_3l = substr($eventon_months[$x], 0, 1);
                    echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='";
                    echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $month_3l;
                    echo "'/></p>";
                }
                echo "<p class='clear' style='padding-top:5px'></p>";
                ?>
<p style='clear:both'></p>			
			</div>
		
			<div class='evcal_lang_box'>
				<?php 
                // full day names
                for ($x = 1; $x < 8; $x++) {
                    $num = $x;
                    $pre_var_name = 'evcal_lang_day';
                    echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $num . "' class='evcal_lang' value='";
                    echo !empty($lang_options[$pre_var_name . $num]) ? $lang_options[$pre_var_name . $num] : $eventon_days[$x];
                    echo "'/></p>";
                }
                echo "<p class='clear' style='padding-top:5px'></p>";
                // 3 letter day names
                for ($x = 1; $x < 8; $x++) {
                    $num = $x;
                    $pre_var_name = 'evo_lang_3Ld_';
                    $day_3l = substr($eventon_days[$x], 0, 3);
                    echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $num . "' class='evcal_lang' value='";
                    echo !empty($lang_options[$pre_var_name . $num]) ? $lang_options[$pre_var_name . $num] : $day_3l;
                    echo "'/></p>";
                }
                if (has_action('eventon_lang_after_daynames')) {
                    do_action('eventon_lang_after_daynames');
                }
                ?>
				
				
				<p style='clear:both'></p>
			</div>
			
		</div>
		
		
		<?php 
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_language_tab.php';
                // hook into addons
                //eventon_settings_lang_tab_content
                $eventon_custom_language_array_updated = apply_filters('eventon_settings_lang_tab_content', array_filter($eventon_custom_language_array));
                foreach ($eventon_custom_language_array_updated as $cl) {
                    if (!empty($cl['type']) && $cl['type'] == 'togheader') {
                        echo "<div class='evoLANG_section_header evo_settings_toghead'>{$cl['name']}</div>\n\t\t\t\t\t\t<div class='evo_settings_togbox'>";
                    } else {
                        if (!empty($cl['type']) && $cl['type'] == 'togend') {
                            echo '</div>';
                        } else {
                            if (!empty($cl['type']) && $cl['type'] == 'subheader') {
                                echo '<div class="evoLANG_subheader">' . $cl['label'] . '</div><div class="evoLANG_subsec">';
                            } else {
                                $val = !empty($lang_options[$cl['name']]) ? $lang_options[$cl['name']] : '';
                                $placeholder = !empty($cl['placeholder']) ? $cl['placeholder'] : '';
                                echo "\n\t\t\t\t\t\t<div class='eventon_custom_lang_line'>\n\t\t\t\t\t\t\t<div class='eventon_cl_label_out'>\n\t\t\t\t\t\t\t\t<p class='eventon_cl_label'>{$cl['label']}</p>\n\t\t\t\t\t\t\t</div>";
                                echo '<input class="eventon_cl_input" type="text" name="' . $cl['name'] . '" placeholder="' . $placeholder . '" value="' . stripslashes($val) . '"/>';
                                echo "<div class='clear'></div>\n\t\t\t\t\t\t</div>";
                                echo !empty($cl['legend']) ? "<p class='eventon_cl_legend'>{$cl['legend']}</p>" : null;
                            }
                        }
                    }
                }
                ?>
		
		
		
		
		
				
	</div>
	
</div>
<input type="submit" class="evo_admin_btn btn_prime" value="<?php 
                _e('Save Changes', 'eventon');
                ?>
" style='margin-top:15px'/>	
</form>
<?php 
                break;
                // STYLES TAB
            // STYLES TAB
            case "evcal_3":
                echo '<form method="post" action="">';
                //settings_fields('evcal_field_group');
                wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename');
                // styles settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_styles_tab.php';
                break;
                // ADDON TAB
            // ADDON TAB
            case "evcal_4":
                // Addons settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_addons_tab.php';
                break;
                // support TAB
            // support TAB
            case "evcal_5":
                // Addons settings tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_support_tab.php';
                break;
                // ADVANDED extra field
            // ADVANDED extra field
            case "extra":
                // advanced tab content
                require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_advanced_tab.php';
                break;
            default:
                do_action('eventon_settings_tabs_' . $focus_tab);
                break;
        }
        echo "</div>";
    }