function custom_param_yesno($settings, $value)
 {
     $out = "<div class='evovc_dropdown_cont'><p class='yesno_leg_line' style='padding-top:0px'>";
     $out .= eventon_html_yesnobtn(array('id' => esc_attr($settings['param_name']), 'var' => esc_attr($value), 'input' => true, 'inputAttr' => array('class' => 'wpb_vc_param_value wpb-textinput'), 'label' => esc_attr($settings['label']), 'guide' => !empty($settings['guide']) ? esc_attr($settings['guide']) : ''));
     $out .= '</p></div>';
     return $out;
 }
/** Main meta box. */
function ajde_evcal_show_box()
{
    global $eventon;
    $evcal_opt1 = get_option('evcal_options_evcal_1');
    $evcal_opt2 = get_option('evcal_options_evcal_2');
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'evo_noncename');
    // The actual fields for data entry
    $p_id = get_the_ID();
    $ev_vals = get_post_custom($p_id);
    $evcal_allday = !empty($ev_vals["evcal_allday"]) ? $ev_vals["evcal_allday"][0] : null;
    $show_style_code = $evcal_allday == 'yes' ? "style='display:none'" : null;
    $select_a_arr = array('AM', 'PM');
    // --- TIME variations
    $evcal_date_format = eventon_get_timeNdate_format($evcal_opt1);
    $time_hour_span = $evcal_date_format[2] ? 25 : 13;
    // GET DATE and TIME values
    $_START = !empty($ev_vals['evcal_srow'][0]) ? eventon_get_editevent_kaalaya($ev_vals['evcal_srow'][0], $evcal_date_format[1], $evcal_date_format[2]) : false;
    $_END = !empty($ev_vals['evcal_erow'][0]) ? eventon_get_editevent_kaalaya($ev_vals['evcal_erow'][0], $evcal_date_format[1], $evcal_date_format[2]) : false;
    //print_r($_START);
    //print_r($ev_vals);
    ?>

<?php 
    // --------------------------
    // HTML - Subtitle
    ob_start();
    ?>
			<div class='evcal_data_block_style1'>
				<div class='evcal_db_data'>
					<input type='text' id='evcal_subtitle' name='evcal_subtitle' value="<?php 
    echo evo_meta($ev_vals, 'evcal_subtitle', true);
    ?>
" style='width:100%'/>
				</div>
			</div>
		<?php 
    $_html_ST = ob_get_clean();
    $__hiddenVAL_ST = '';
    // --------------------------
    // HTML - date
    ob_start();
    ?>
		<!-- date and time formats to use -->
		<input type='hidden' name='_evo_date_format' value='<?php 
    echo $evcal_date_format[1];
    ?>
'/>
		<input type='hidden' name='_evo_time_format' value='<?php 
    echo $evcal_date_format[2] ? '24h' : '12h';
    ?>
'/>	
		<div id='evcal_dates' date_format='<?php 
    echo $evcal_date_format[0];
    ?>
'>
			
			
			<p class='yesno_leg_line fcw'>
				<?php 
    echo eventon_html_yesnobtn(array('id' => 'evcal_allday_yn_btn', 'var' => $evcal_allday, 'attr' => array('allday_switch' => '1')));
    ?>
			
				<input type='hidden' name='evcal_allday' value="<?php 
    echo $evcal_allday == 'yes' ? 'yes' : 'no';
    ?>
"/>
				<label for='evcal_allday_yn_btn'><?php 
    _e('All Day Event', 'eventon');
    ?>
</label>
			</p>
			<p style='clear:both'></p>
			
			<!-- START TIME-->
			<div class='evo_start_event evo_datetimes'>
				<div class='evo_date'>
					<p id='evcal_start_date_label'><?php 
    _e('Event Start Date', 'eventon');
    ?>
</p>
					<input id='evo_dp_from' class='evcal_data_picker datapicker_on' type='text' id='evcal_start_date' name='evcal_start_date' value='<?php 
    echo $_START ? $_START[0] : null;
    ?>
' placeholder='<?php 
    echo $evcal_date_format[1];
    ?>
'/>					
					<span><?php 
    _e('Select a Date', 'eventon');
    ?>
</span>
				</div>					
				<div class='evcal_date_time switch_for_evsdate evcal_time_selector' <?php 
    echo $show_style_code;
    ?>
>
					<div class='evcal_select'>
						<select id='evcal_start_time_hour' class='evcal_date_select' name='evcal_start_time_hour'>
							<?php 
    //echo "<option value=''>--</option>";
    $start_time_h = $_START ? $_START[1] : null;
    for ($x = 1; $x < $time_hour_span; $x++) {
        echo "<option value='{$x}'" . ($start_time_h == $x ? 'selected="selected"' : '') . ">{$x}</option>";
    }
    ?>
						</select>
					</div><p style='display:inline; font-size:24px;padding:4px 2px'>:</p>
					<div class='evcal_select'>
						
						<select id='evcal_start_time_min' class='evcal_date_select' name='evcal_start_time_min'>
							<?php 
    //echo "<option value=''>--</option>";
    $start_time_m = $_START ? $_START[2] : null;
    for ($x = 0; $x < 12; $x++) {
        $min = $x < 2 ? '0' . $x * 5 : $x * 5;
        echo "<option value='{$min}'" . ($start_time_m == $min ? 'selected="selected"' : '') . ">{$min}</option>";
    }
    ?>
						</select>
					</div>
					
					<?php 
    if (!$evcal_date_format[2]) {
        ?>
					<div class='evcal_select evcal_ampm_sel'>
						<select name='evcal_st_ampm' id='evcal_st_ampm' >
							<?php 
        $evcal_st_ampm = $_START ? $_START[3] : null;
        foreach ($select_a_arr as $sar) {
            echo "<option value='" . $sar . "' " . ($evcal_st_ampm == $sar ? 'selected="selected"' : '') . ">" . $sar . "</option>";
        }
        ?>
								
						</select>
					</div>	
					<?php 
    }
    ?>
					<br/>
					<span><?php 
    _e('Select a Time', 'eventon');
    ?>
</span>
				</div><div class='clear'></div>
			</div>
			
			
			
			<!-- END TIME -->
			<?php 
    $evo_hide_endtime = !empty($ev_vals["evo_hide_endtime"]) ? $ev_vals["evo_hide_endtime"][0] : null;
    ?>
			<div class='evo_end_event evo_datetimes switch_for_evsdate'>
				<div class='evo_enddate_selection' style='<?php 
    echo $evo_hide_endtime == 'yes' ? 'opacity:0.5' : null;
    ?>
'>
				<div class='evo_date'>
					<p><?php 
    _e('Event End Date', 'eventon');
    ?>
</p>
					<input id='evo_dp_to' class='evcal_data_picker datapicker_on' type='text' id='evcal_end_date' name='evcal_end_date' value='<?php 
    echo $_END ? $_END[0] : null;
    ?>
'/>					
					<span><?php 
    _e('Select a Date', 'eventon');
    ?>
</span>
					
				</div>
				<div class='evcal_date_time evcal_time_selector' <?php 
    echo $show_style_code;
    ?>
>
					<div class='evcal_select'>
						<select class='evcal_date_select' name='evcal_end_time_hour'>
							<?php 
    //echo "<option value=''>--</option>";
    $end_time_h = $_END ? $_END[1] : null;
    for ($x = 1; $x < $time_hour_span; $x++) {
        echo "<option value='{$x}'" . ($end_time_h == $x ? 'selected="selected"' : '') . ">{$x}</option>";
    }
    ?>
						</select>
					</div><p style='display:inline; font-size:24px;padding:4px'>:</p>
					<div class='evcal_select'>
						<select class='evcal_date_select' name='evcal_end_time_min'>
							<?php 
    //echo "<option value=''>--</option>";
    $end_time_m = $_END[2] ? $_END[2] : null;
    for ($x = 0; $x < 12; $x++) {
        $min = $x < 2 ? '0' . $x * 5 : $x * 5;
        echo "<option value='{$min}'" . ($end_time_m == $min ? 'selected="selected"' : '') . ">{$min}</option>";
    }
    ?>
						</select>
					</div>
					
					<?php 
    if (!$evcal_date_format[2]) {
        ?>
					<div class='evcal_select evcal_ampm_sel'>
						<select name='evcal_et_ampm'>
							<?php 
        $evcal_et_ampm = $_END ? $_END[3] : null;
        foreach ($select_a_arr as $sar) {
            echo "<option value='" . $sar . "' " . ($evcal_et_ampm == $sar ? 'selected="selected"' : '') . ">" . $sar . "</option>";
        }
        ?>
								
						</select>
					</div>
					<?php 
    }
    ?>
					<br/>
					<span><?php 
    _e('Select the Time', 'eventon');
    ?>
</span>
				</div><div class='clear'></div>
				</div>
				
				
				<!-- end time yes/no option -->					
				<p class='yesno_leg_line '>
					<?php 
    echo eventon_html_yesnobtn(array('id' => 'evo_endtime', 'var' => $evo_hide_endtime, 'attr' => array('afterstatement' => 'evo_span_hidden_end')));
    ?>
					
					<input type='hidden' name='evo_hide_endtime' value="<?php 
    echo $evo_hide_endtime == 'yes' ? 'yes' : 'no';
    ?>
"/>
					<label for='evo_hide_endtime'><?php 
    _e('Hide End Time from calendar', 'eventon');
    ?>
</label>
				</p>
				<?php 
    // span event to hidden end time
    $evo_span_hidden_end = !empty($ev_vals["evo_span_hidden_end"]) ? $ev_vals["evo_span_hidden_end"][0] : null;
    $evo_span_hidd_display = $evo_hide_endtime && $evo_hide_endtime == 'yes' ? 'block' : 'none';
    ?>
				<p class='yesno_leg_line ' id='evo_span_hidden_end' style='display:<?php 
    echo $evo_span_hidd_display;
    ?>
'>
					<?php 
    echo eventon_html_yesnobtn(array('id' => 'evo_span_hidden_end', 'var' => $evo_span_hidden_end));
    ?>
					
					<input type='hidden' name='evo_span_hidden_end' value="<?php 
    echo $evo_span_hidden_end == 'yes' ? 'yes' : 'no';
    ?>
"/>
					<label for='evo_span_hidden_end'><?php 
    _e('Span the event until hidden end time', 'eventon');
    $eventon->throw_guide(__('If event end time goes beyond start time +  and you want the event to show in the calendar until end time expire, select this.', 'eventon'));
    ?>
</label>
				</p>

				<?php 
    // Year long event
    $evo_year_long = !empty($ev_vals["evo_year_long"]) ? $ev_vals["evo_year_long"][0] : null;
    $event_year = !empty($ev_vals["event_year"]) ? $ev_vals["event_year"][0] : null;
    ?>
				<p class='yesno_leg_line ' id='evo_year_long' >
					<?php 
    echo eventon_html_yesnobtn(array('id' => 'evo_year_long', 'var' => $evo_year_long));
    ?>
					
					<input type='hidden' name='evo_year_long' value="<?php 
    echo $evo_year_long == 'yes' ? 'yes' : 'no';
    ?>
"/>
					<input id='evo_event_year' type='hidden' name='event_year' value="<?php 
    echo $event_year;
    ?>
"/>
					<label for='evo_year_long'><?php 
    _e('Show this event for the entire year', 'eventon');
    $eventon->throw_guide(__('This will show this event on every month of the year. The year will be based off the start date you choose above', 'eventon'));
    ?>
</label>
				</p>

				<p style='clear:both'></p>
			</div>
			<div style='clear:both'></div>
			
			<?php 
    // Recurring events
    $evcal_repeat = !empty($ev_vals["evcal_repeat"]) ? $ev_vals["evcal_repeat"][0] : null;
    ?>
			<div id='evcal_rep' class='evd'>



				<div class='evcalr_1'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('id' => 'evd_repeat', 'var' => $evcal_repeat));
    ?>
						
						<input type='hidden' name='evcal_repeat' value="<?php 
    echo $evcal_repeat == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evcal_repeat'><?php 
    _e('Repeating event', 'eventon');
    ?>
</label>
					</p>
					<p style='clear:both'></p>
				</div>
				<p class='eventon_ev_post_set_line'></p>
				<?php 
    $display = !empty($ev_vals["evcal_repeat"]) && $evcal_repeat == 'yes' ? '' : 'none';
    ?>
				<div class='evcalr_2' style='display:<?php 
    echo $display;
    ?>
'>
					
					<?php 
    // repeat frequency array
    $repeat_freq = apply_filters('evo_repeat_intervals', array('weekly' => 'weeks', 'monthly' => 'months', 'yearly' => 'years'));
    ?>

					<p class='evcalr_2_freq evcalr_2_p'><span class='evo_form_label'><?php 
    _e('Frequency', 'eventon');
    ?>
:</span> <select id='evcal_rep_freq' name='evcal_rep_freq'>
					<?php 
    $evcal_rep_freq = !empty($ev_vals['evcal_rep_freq']) ? $ev_vals['evcal_rep_freq'][0] : null;
    foreach ($repeat_freq as $refv => $ref) {
        echo "<option field='" . $ref . "' value='" . $refv . "' " . ($evcal_rep_freq == $refv ? 'selected="selected"' : '') . ">" . $refv . "</option>";
    }
    ?>
</select></p>
					
					<?php 
    $evcal_rep_gap = !empty($ev_vals['evcal_rep_gap']) ? $ev_vals['evcal_rep_gap'][0] : 1;
    $freq = !empty($ev_vals["evcal_rep_freq"]) ? $repeat_freq[$ev_vals["evcal_rep_freq"][0]] : null;
    if (!empty($ev_vals['repeat_intervals'])) {
        //print_r(unserialize($ev_vals['repeat_intervals'][0]));
    }
    ?>
						
					<p class='evcalr_2_rep evcalr_2_p'><span class='evo_form_label'><?php 
    _e('Gap between repeats', 'eventon');
    ?>
:</span>
						<input type='number' name='evcal_rep_gap' min='1' max='100' value='<?php 
    echo $evcal_rep_gap;
    ?>
' placeholder='1'/>	 <span id='evcal_re'><?php 
    echo $freq;
    ?>
</span></p>
					
					
					
					<?php 
    // repeat number
    $evcal_rep_num = !empty($ev_vals['evcal_rep_num']) ? $ev_vals['evcal_rep_num'][0] : 1;
    // repeat by
    $evp_repeat_rb = !empty($ev_vals['evp_repeat_rb']) ? $ev_vals['evp_repeat_rb'][0] : null;
    $evo_rep_WK = !empty($ev_vals['evo_rep_WK']) ? unserialize($ev_vals['evo_rep_WK'][0]) : array();
    $evo_repeat_wom = !empty($ev_vals['evo_repeat_wom']) ? $ev_vals['evo_repeat_wom'][0] : null;
    // display none section
    $__display_none_1 = !empty($ev_vals['evcal_rep_freq']) && $ev_vals['evcal_rep_freq'][0] == 'monthly' ? 'block' : 'none';
    $__display_none_2 = $__display_none_1 == 'block' && !empty($ev_vals['evp_repeat_rb']) && $ev_vals['evp_repeat_rb'][0] == 'dow' ? 'block' : 'none';
    ?>
						
					<?php 
    // monthly only
    ?>
						<p class='evcalr_2_p evo_rep_month' style='display:<?php 
    echo $__display_none_1;
    ?>
'>
							<span class='evo_form_label'><?php 
    _e('Repeat by', 'eventon');
    ?>
:</span>
							<select id='evo_rep_by' name='evp_repeat_rb'>
								<option value='dom' <?php 
    echo 'dom' == $evp_repeat_rb ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Day of the month', 'eventon');
    ?>
</option>
								<option value='dow' <?php 
    echo 'dow' == $evp_repeat_rb ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Day of the week', 'eventon');
    ?>
</option>
							</select>
						</p>
						<p class='evo_days_list evo_rep_month_2'  style='display:<?php 
    echo $__display_none_2;
    ?>
'>
							<span class='evo_form_label'><?php 
    _e('Repeat on selected days', 'eventon');
    ?>
: </span>
							<em><input type='checkbox' name='evo_rep_WK[]' value='0' <?php 
    echo in_array('0', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>S</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='1' <?php 
    echo in_array('1', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>M</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='2' <?php 
    echo in_array('2', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>T</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='3' <?php 
    echo in_array('3', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>W</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='4' <?php 
    echo in_array('4', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>T</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='5' <?php 
    echo in_array('5', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>F</label></em>
							<em><input type='checkbox' name='evo_rep_WK[]' value='6' <?php 
    echo in_array('6', $evo_rep_WK) ? 'checked="checked"' : null;
    ?>
><label>S</label></em>
						</p>
						<p class='evcalr_2_p evo_rep_month_2'  style='display:<?php 
    echo $__display_none_2;
    ?>
'>
							<span class='evo_form_label'><?php 
    _e('Week of month to repeat', 'eventon');
    ?>
: </span>
							<select id='evo_wom' name='evo_repeat_wom'>
								<option value='none' <?php 
    echo 'none' == $evo_repeat_wom ? 'checked="checked"' : null;
    ?>
>None</option>
								<option value='1' <?php 
    echo '1' == $evo_repeat_wom ? 'selected="selected"' : null;
    ?>
><?php 
    _e('First', 'eventon');
    ?>
</option>
								<option value='2' <?php 
    echo '2' == $evo_repeat_wom ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Second', 'eventon');
    ?>
</option>
								<option value='3' <?php 
    echo '3' == $evo_repeat_wom ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Third', 'eventon');
    ?>
</option>
								<option value='4' <?php 
    echo '4' == $evo_repeat_wom ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Fourth', 'eventon');
    ?>
</option>
								<option value='-1' <?php 
    echo '-1' == $evo_repeat_wom ? 'selected="selected"' : null;
    ?>
><?php 
    _e('Last', 'eventon');
    ?>
</option>
							</select>
						</p>
					
						<p class='evo_month_rep_value evo_rep_month_2' style='display:none'></p>
						
						<p class='evcalr_2_numr evcalr_2_p'><span class='evo_form_label'><?php 
    _e('Number of repeats', 'eventon');
    ?>
:</span>
							<input type='number' name='evcal_rep_num' min='1' max='100' value='<?php 
    echo $evcal_rep_num;
    ?>
' placeholder='1'/>						
						</p>

					<div class='repeat_information'>
						<?php 
    /* 
    						<p>Repeat Times:</p>
    						<?php
    
    date_default_timezone_set('UTC');
    $repeat_times = (unserialize($ev_vals['repeat_intervals'][0]));
    if(!empty($repeat_times)){
    	foreach($repeat_times as $rt){
    		echo 'start '.date('d-m-y',$rt[0]).' End '.date('d-m-y',$rt[1]).'</br>';
    	}
    }
    */
    ?>
					</div>	
				</div>
			</div>	
			
		</div>
		
		<?php 
    $_html_TD = ob_get_clean();
    $__hiddenVAL_TD = '';
    // --------------------------
    // HTML - location
    ob_start();
    ?>
			<div class='evcal_data_block_style1'>
				<p class='edb_icon evcal_edb_map'></p>
				<div class='evcal_db_data'>			
					<p>
					<?php 
    // location terms for event post
    $loc_term_id = $termMeta = '';
    $location_terms = get_the_terms($p_id, 'event_location');
    if ($location_terms && !is_wp_error($location_terms)) {
        foreach ($location_terms as $location_term) {
            $loc_term_id = $location_term->term_id;
            $termMeta = get_option("taxonomy_{$loc_term_id}");
        }
    }
    //print_r($location_terms);
    // GET all available location terms
    $terms = get_terms('event_location', array('hide_empty' => false));
    if (count($terms) > 0) {
        echo "<select id='evcal_location_field' name='evcal_location_name_select' class='evo_select_field'>\n\t\t\t\t\t\t\t\t<option value=''>" . __('Select a saved location', 'eventon') . "</option>";
        foreach ($terms as $term) {
            $loc_img_src = $loc_img_id = '';
            $t_id = $term->term_id;
            $term_meta = get_option("taxonomy_{$t_id}");
            $__selected = $loc_term_id == $t_id ? "selected='selected'" : null;
            // location image
            $loc_img_id = !empty($term_meta['evo_loc_img']) ? $term_meta['evo_loc_img'] : null;
            $img_src = !empty($loc_img_id) ? wp_get_attachment_image_src($loc_img_id, 'medium') : false;
            $loc_img_src = $img_src ? $img_src[0] : '';
            echo "<option value='" . $term->name . "' data-tid='{$t_id}' data-address='" . (!empty($term_meta['location_address']) ? esc_attr($term_meta['location_address']) : '') . "' data-lat='" . (!empty($term_meta['location_lat']) ? esc_attr($term_meta['location_lat']) : '') . "' data-lon='" . (!empty($term_meta['location_lon']) ? esc_attr($term_meta['location_lon']) : '') . "' {$__selected} data-loc_img_id='" . $loc_img_id . "' data-loc_img_src='{$loc_img_src}'>" . $term->name . "</option>";
        }
        echo "</select> <label for='evcal_location_field'>" . __('Choose already saved location or type new one below', 'eventon') . "</label>";
    }
    ?>
					<input id='evo_location_tax' type='hidden' name='evo_location_tax_id' value='<?php 
    echo $loc_term_id;
    ?>
'/>
					<input type='text' id='evcal_location_name' name='evcal_location_name' value="<?php 
    echo evo_meta($ev_vals, 'evcal_location_name', true);
    ?>
" style='width:100%' placeholder='eg. Irving City Park'/><label for='evcal_location_name'><?php 
    _e('Event Location Name', 'eventon');
    ?>
</label></p>
					<p><input type='text' id='evcal_location' name='evcal_location' value="<?php 
    echo evo_meta($ev_vals, 'evcal_location', true);
    ?>
" style='width:100%' placeholder='eg. 12 Rue de Rivoli, Paris'/><label for='evcal_location'><?php 
    _e('Event Location Address', 'eventon');
    ?>
</label></p>
					
					
					<p><input type='text' id='evcal_lat' class='evcal_latlon' name='evcal_lat' value='<?php 
    echo evo_meta($ev_vals, 'evcal_lat');
    ?>
' placeholder='<?php 
    _e('Latitude', 'eventon');
    ?>
'/>
					<input type='text' id='evcal_lon' class='evcal_latlon' name='evcal_lon' value='<?php 
    echo evo_meta($ev_vals, 'evcal_lon');
    ?>
' placeholder='<?php 
    _e('Longitude', 'eventon');
    ?>
'/></p>
					<p><i>(NOTE: If Latlon provided, Latlon will be used for generating google maps while location address will be shown as text address. Location address field is required for this to work. <a href='http://itouchmap.com/latlong.html' target='_blank'>Find LanLat for address</a>)</i></p>

					<!-- image -->
					<?php 
    $loc_img_id = !empty($ev_vals['evo_loc_img']) ? $ev_vals['evo_loc_img'][0] : false;
    // image soruce array
    $img_src = $loc_img_id ? wp_get_attachment_image_src($loc_img_id, 'medium') : null;
    $loc_img_src = !empty($img_src) ? $img_src[0] : null;
    $__button_text = !empty($loc_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
    $__button_text_not = empty($loc_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
    $__button_class = !empty($loc_img_id) ? 'removeimg' : 'chooseimg';
    // /echo $loc_img_id.' '.$img_src.'66';
    ?>
					<div class='evo_metafield_image' style='padding-top:10px'>
						
						<p >
							<input id='evo_loc_img_id' class='evo_loc_img' name="evo_loc_img" type="hidden" class="custom_upload_image" value="<?php 
    echo $loc_img_id ? $loc_img_id : null;
    ?>
" /> 
                    		<input class="custom_upload_image_button button <?php 
    echo $__button_class;
    ?>
" data-txt='<?php 
    echo $__button_text_not;
    ?>
' type="button" value="<?php 
    echo $__button_text;
    ?>
" /><br/>
                    		<span class='evo_loc_image_src'>
                    			<img src='<?php 
    echo $loc_img_src;
    ?>
' style='<?php 
    echo !empty($loc_img_id) ? '' : 'display:none';
    ?>
'/>
                    		</span>
                    		<label><?php 
    _e('Event Location Image', 'eventon');
    ?>
</label>
                    	</p>

                    </div>
					
					<!-- HIDE google map option -->
					<p class='yesno_leg_line'>
						<?php 
    $location_val = !empty($ev_vals["evcal_gmap_gen"]) ? $ev_vals["evcal_gmap_gen"][0] : 'yes';
    echo eventon_html_yesnobtn(array('id' => 'evo_genGmap', 'var' => $location_val));
    ?>
						
						<input type='hidden' name='evcal_gmap_gen' value="<?php 
    echo !empty($ev_vals["evcal_gmap_gen"]) && $ev_vals["evcal_gmap_gen"][0] == 'yes' ? 'yes' : (empty($ev_vals["evcal_gmap_gen"]) ? 'yes' : 'no');
    ?>
"/>
						<label for='evcal_gmap_gen'><?php 
    _e('Generate Google Map from the address', 'eventon');
    ?>
</label>
					</p>
					<p style='clear:both'></p>

					<!-- Show location name over image -->
					<p class='yesno_leg_line'>
						<?php 
    $evcal_name_over_img = !empty($ev_vals["evcal_name_over_img"]) ? $ev_vals["evcal_name_over_img"][0] : 'no';
    echo eventon_html_yesnobtn(array('id' => 'evcal_name_over_img', 'var' => $evcal_name_over_img));
    ?>
						
						<input type='hidden' name='evcal_name_over_img' value="<?php 
    echo !empty($ev_vals["evcal_name_over_img"]) && $ev_vals["evcal_name_over_img"][0] == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evcal_name_over_img'><?php 
    _e('Show location name & address over location image (If location image exist)', 'eventon');
    ?>
</label>
					</p>
					<p style='clear:both'></p>
				</div>
			</div>
		<?php 
    $_html_LOC = ob_get_clean();
    $__hiddenVAL_LOC = '';
    // --------------------------
    // HTML - Organizer
    ob_start();
    ?>

			<div class='evcal_data_block_style1'>
				<p class='edb_icon evcal_edb_map'></p>
				<div class='evcal_db_data'>			
					<p>
					<?php 
    // organier terms for event post
    $organizer_terms = get_the_terms($p_id, 'event_organizer');
    $termMeta = $org_term_id = '';
    if ($organizer_terms && !is_wp_error($organizer_terms)) {
        foreach ($organizer_terms as $org_term) {
            $org_term_id = $org_term->term_id;
            $termMeta = get_option("taxonomy_{$org_term_id}");
        }
    }
    // Get all available organizer terms
    $terms = get_terms('event_organizer', array('hide_empty' => false));
    if (count($terms) > 0) {
        echo "<select id='evcal_organizer_field' name='evcal_organizer_name_select' class='evo_select_field'>\n\t\t\t\t\t\t\t\t<option value=''>" . __('Select a saved organizer', 'eventon') . "</option>";
        foreach ($terms as $term) {
            $t_id = $term->term_id;
            $term_meta = get_option("taxonomy_{$t_id}");
            $__selected = $org_term_id == $t_id ? "selected='selected'" : null;
            echo "<option value='" . $term->name . "' data-tid='{$t_id}' data-contact='" . (!empty($term_meta['evcal_org_contact']) ? esc_attr($term_meta['evcal_org_contact']) : '') . "' data-img='" . (!empty($term_meta['evcal_org_img']) ? esc_attr($term_meta['evcal_org_img']) : '') . "' {$__selected}>" . $term->name . "</option>";
        }
        echo "</select> <label for='evcal_organizer_field'>" . __('Choose already saved organier or type new one below', 'eventon') . "</label>";
    }
    ?>
					<input id='evo_organizer_tax_id' type='hidden' name='evo_organizer_tax_id' value='<?php 
    echo $org_term_id;
    ?>
'/>
					<input type='text' id='evcal_organizer_name' name='evcal_organizer' value="<?php 
    echo !empty($ev_vals["evcal_organizer"]) ? $ev_vals["evcal_organizer"][0] : null;
    ?>
" style='width:100%' placeholder='eg. Blue Light Band'/><label for='evcal_organizer'><?php 
    _e('Event Organizer Name', 'eventon');
    ?>
</label></p>
					<p><input type='text' id='evcal_org_contact' name='evcal_org_contact' value="<?php 
    echo !empty($termMeta["evcal_org_contact"]) ? $termMeta["evcal_org_contact"] : null;
    ?>
" style='width:100%' placeholder='eg. noone[at] thismail.com'/><label for='evcal_org_contact'><?php 
    _e('(Optional) Organizer Contact Information', 'eventon');
    ?>
</label></p>
					
					<?php 
    /*<p><input type='text' id='evcal_org_img' name='evcal_org_img' value="<?php echo (!empty($termMeta["evcal_org_img"]) )? $termMeta["evcal_org_img"]:null?>" style='width:100%' placeholder='eg. URL to image'/><label for='evcal_evo_evcrd_field_org'><?php _e('(Optional) Organizer Image URL','eventon')?></label></p>*/
    ?>
					
					
					
					<!-- yea no field - hide organizer field from eventcard -->
					<p class='yesno_leg_line'>
						<?php 
    $evo_evcrd_field_org = !empty($ev_vals["evo_evcrd_field_org"]) ? $ev_vals["evo_evcrd_field_org"][0] : null;
    echo eventon_html_yesnobtn(array('id' => 'evo_org_field_ec', 'var' => $evo_evcrd_field_org));
    ?>
						
						<input type='hidden' name='evo_evcrd_field_org' value="<?php 
    echo !empty($ev_vals["evo_evcrd_field_org"]) && $ev_vals["evo_evcrd_field_org"][0] == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evo_evcrd_field_org'><?php 
    _e('Hide Organizer field from EventCard', 'eventon');
    ?>
</label>
					</p>
					<p style='clear:both'></p>
				</div>
			</div>

		<?php 
    $_html_OR = ob_get_clean();
    $__hiddenVAL_OR = '';
    // --------------------------
    // HTML - User Interaction
    ob_start();
    ?>
			<div class='evcal_data_block_style1'>
				<div class='evcal_db_data'>
					
					<?php 
    $exlink_option = !empty($ev_vals["_evcal_exlink_option"]) ? $ev_vals["_evcal_exlink_option"][0] : 1;
    $exlink_target = !empty($ev_vals["_evcal_exlink_target"]) && $ev_vals["_evcal_exlink_target"][0] == 'yes' ? $ev_vals["_evcal_exlink_target"][0] : null;
    //echo $ev_vals["_evcal_exlink_target"][0].'tt';
    ?>
					
					<input id='evcal_exlink_option' type='hidden' name='_evcal_exlink_option' value='<?php 
    echo $exlink_option;
    ?>
'/>
					
					<input id='evcal_exlink_target' type='hidden' name='_evcal_exlink_target' value='<?php 
    echo $exlink_target;
    ?>
'/>
					
					<?php 
    $display_link_input = !empty($ev_vals["_evcal_exlink_option"]) && $ev_vals["_evcal_exlink_option"][0] != '1' ? 'display:block' : 'display:none';
    ?>
					<p <?php 
    echo $exlink_option == '1' || $exlink_option == '3' ? "style='display:none'" : null;
    ?>
 id='evo_new_window_io' class='<?php 
    echo $exlink_target == 'yes' ? 'selected' : null;
    ?>
'><span></span> <?php 
    _e('Open in new window', 'eventon');
    ?>
</p>
					
					<!-- external link field-->
					<input id='evcal_exlink' placeholder='<?php 
    _e('Type the URL address', 'eventon');
    ?>
' type='text' name='evcal_exlink' value='<?php 
    echo !empty($ev_vals["evcal_exlink"]) ? $ev_vals["evcal_exlink"][0] : null;
    ?>
' style='width:100%; <?php 
    echo $display_link_input;
    ?>
'/>
					
					<div class='evcal_db_uis'>
						<a link='no'  class='evcal_db_ui evcal_db_ui_1 <?php 
    echo $exlink_option == '1' ? 'selected' : null;
    ?>
' title='<?php 
    _e('Slide Down Event Card', 'eventon');
    ?>
' value='1'></a>
						
						<!-- open as link-->
						<a link='yes' class='evcal_db_ui evcal_db_ui_2 <?php 
    echo $exlink_option == '2' ? 'selected' : null;
    ?>
' title='<?php 
    _e('External Link', 'eventon');
    ?>
' value='2'></a>	
						
						<!-- open as popup -->
						<a link='yes' class='evcal_db_ui evcal_db_ui_3 <?php 
    echo $exlink_option == '3' ? ' selected' : null;
    ?>
' title='<?php 
    _e('Popup Window', 'eventon');
    ?>
' value='3'></a>
						
						<?php 
    // (-- addon --)
    if (has_action('evcal_ui_click_additions')) {
        do_action('evcal_ui_click_additions');
    }
    ?>
							
						<div class='clear'></div>
					</div>
				</div>
			</div>
		<?php 
    $_html_UIN = ob_get_clean();
    $__hiddenVAL_UIN = '';
    // --------------------------
    // HTML - Learn More
    ob_start();
    ?>
			<div class='evcal_data_block_style1'>
				<div class='evcal_db_data'>
					<input type='text' id='evcal_lmlink' name='evcal_lmlink' value='<?php 
    echo !empty($ev_vals["evcal_lmlink"]) ? $ev_vals["evcal_lmlink"][0] : null;
    ?>
' style='width:100%'/><br/>
					<input type='checkbox' name='evcal_lmlink_target' value='yes' <?php 
    echo !empty($ev_vals["evcal_lmlink_target"]) && $ev_vals["evcal_lmlink_target"][0] == 'yes' ? 'checked="checked"' : null;
    ?>
/> <?php 
    _e('Open in New window', 'eventon');
    ?>
				</div>
			</div>
		<?php 
    $_html_LM = ob_get_clean();
    $__hiddenVAL_LM = '';
    /** custom fields **/
    $evMB_custom = array();
    $num = evo_calculate_cmd_count($evcal_opt1);
    for ($x = 1; $x <= $num; $x++) {
        if (eventon_is_custom_meta_field_good($x)) {
            $fa_icon_class = $evcal_opt1['evcal__fai_00c' . $x];
            ob_start();
            echo "<div class='evcal_data_block_style1'>\n\t\t\t\t\t\t<div class='evcal_db_data'>";
            // FIELD
            $__saved_field_value = !empty($ev_vals["_evcal_ec_f" . $x . "a1_cus"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cus"][0] : null;
            $__field_id = '_evcal_ec_f' . $x . 'a1_cus';
            // wysiwyg editor
            if (!empty($evcal_opt1['evcal_ec_f' . $x . 'a2']) && $evcal_opt1['evcal_ec_f' . $x . 'a2'] == 'textarea') {
                wp_editor($__saved_field_value, $__field_id);
                // button
            } elseif (!empty($evcal_opt1['evcal_ec_f' . $x . 'a2']) && $evcal_opt1['evcal_ec_f' . $x . 'a2'] == 'button') {
                $__saved_field_link = !empty($ev_vals["_evcal_ec_f" . $x . "a1_cusL"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cusL"][0] : null;
                echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cus' ";
                echo 'value="' . $__saved_field_value . '"';
                echo "style='width:100%' placeholder='Button Text' title='Button Text'/>";
                echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cusL' ";
                echo 'value="' . $__saved_field_link . '"';
                echo "style='width:100%' placeholder='Button Link' title='Button Link'/>";
                $onw = !empty($ev_vals["_evcal_ec_f" . $x . "_onw"]) ? $ev_vals["_evcal_ec_f" . $x . "_onw"][0] : null;
                ?>
						<input type='checkbox' name='_evcal_ec_f<?php 
                echo $x;
                ?>
_onw' value='yes' <?php 
                echo !empty($onw) && $onw == 'yes' ? 'checked="checked"' : null;
                ?>
/> <?php 
                _e('Open in New window', 'eventon');
                ?>
						<?php 
                // text
            } else {
                echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cus' ";
                echo 'value="' . $__saved_field_value . '"';
                echo "style='width:100%'/>";
            }
            echo "</div></div>";
            $__html = ob_get_clean();
            $evMB_custom[] = array('id' => 'evcal_ec_f' . $x . 'a1', 'variation' => 'customfield', 'name' => $evcal_opt1['evcal_ec_f' . $x . 'a1'], 'iconURL' => $fa_icon_class, 'iconPOS' => '', 'type' => 'code', 'content' => $__html, 'slug' => 'evcal_ec_f' . $x . 'a1');
        }
    }
    // array of all meta boxes
    $metabox_array = apply_filters('eventon_event_metaboxs', array(array('id' => 'ev_subtitle', 'name' => __('Event SubTitle', 'eventon'), 'variation' => 'customfield', 'hiddenVal' => $__hiddenVAL_ST, 'iconURL' => 'fa-pencil', 'iconPOS' => '', 'type' => 'code', 'content' => $_html_ST, 'slug' => 'ev_subtitle'), array('id' => 'ev_timedate', 'name' => __('Time and Date', 'eventon'), 'hiddenVal' => $__hiddenVAL_TD, 'iconURL' => '', 'iconPOS' => '0 -190px', 'type' => 'code', 'content' => $_html_TD, 'slug' => 'ev_timedate'), array('id' => 'ev_location', 'name' => __('Location and Venue', 'eventon'), 'hiddenVal' => $__hiddenVAL_LOC, 'iconURL' => '', 'iconPOS' => '0 -225px', 'type' => 'code', 'content' => $_html_LOC, 'slug' => 'ev_location', 'guide' => ''), array('id' => 'ev_organizer', 'name' => __('Organizer', 'eventon'), 'hiddenVal' => $__hiddenVAL_OR, 'iconURL' => '', 'iconPOS' => '0 -31px', 'type' => 'code', 'content' => $_html_OR, 'slug' => 'ev_organizer'), array('id' => 'ev_uint', 'name' => __('User Interaction for event click', 'eventon'), 'hiddenVal' => $__hiddenVAL_UIN, 'iconURL' => '', 'iconPOS' => '0 -262px', 'type' => 'code', 'content' => $_html_UIN, 'slug' => 'ev_uint', 'guide' => 'This define how you want the events to expand following a click on the eventTop by a user'), array('id' => 'ev_learnmore', 'name' => __('Learn more about event link', 'eventon'), 'hiddenVal' => $__hiddenVAL_LM, 'iconURL' => '', 'iconPOS' => '0 -96px', 'type' => 'code', 'content' => $_html_LM, 'slug' => 'ev_learnmore', 'guide' => 'This will create a learn more link in the event card. Make sure your links start with http://')));
    // combine array with custom fields
    $metabox_array = !empty($evMB_custom) && count($evMB_custom) > 0 ? array_merge($metabox_array, $evMB_custom) : $metabox_array;
    $closedmeta = eventon_get_collapse_metaboxes($p_id);
    //print_r($closedmeta);
    ?>
	
	
	<div id='evo_mb' class='eventon_mb'>
		<input type='hidden' id='evo_collapse_meta_boxes' name='evo_collapse_meta_boxes' value=''/>
	<?php 
    foreach ($metabox_array as $mBOX) {
        // ICONS
        $icon_style = !empty($mBOX['iconURL']) ? 'background-image:url(' . $mBOX['iconURL'] . ')' : 'background-position:' . $mBOX['iconPOS'];
        $icon_class = !empty($mBOX['iconPOS']) ? 'evIcons' : 'evII';
        $guide = !empty($mBOX['guide']) ? $eventon->throw_guide($mBOX['guide'], '', false) : null;
        $hiddenVal = !empty($mBOX['hiddenVal']) ? '<span class="hiddenVal">' . $mBOX['hiddenVal'] . '</span>' : null;
        $closed = !empty($closedmeta) && in_array($mBOX['id'], $closedmeta) ? 'closed' : null;
        ?>
	
	
		<div class='evomb_section' id='<?php 
        echo $mBOX['id'];
        ?>
'>			
			<div class='evomb_header'>
				<?php 
        // custom field with icons
        if (!empty($mBOX['variation']) && $mBOX['variation'] == 'customfield') {
            ?>
	
					<span class='evomb_icon <?php 
            echo $icon_class;
            ?>
'><i class='fa <?php 
            echo $mBOX['iconURL'];
            ?>
'></i></span>
					
				<?php 
        } else {
            ?>
					<span class='evomb_icon <?php 
            echo $icon_class;
            ?>
' style='<?php 
            echo $icon_style;
            ?>
'></span>
				<?php 
        }
        ?>
				<p><?php 
        echo $mBOX['name'];
        echo $hiddenVal;
        echo $guide;
        ?>
</p>
			</div>
			<div class='evomb_body <?php 
        echo $closed;
        ?>
' box_id='<?php 
        echo $mBOX['id'];
        ?>
'>
				<?php 
        echo $mBOX['content'];
        ?>
			</div>
		</div>
	<?php 
    }
    ?>
		<div class='evMB_end'></div>
	</div>

	
	
	
	

<?php 
}
Example #3
0
    function print_ajde_customization_form($cutomization_pg_array, $evOPT, $extra_tabs = '')
    {
        global $eventon;
        $font_sizes = array('10px', '11px', '12px', '13px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '30px', '36px', '42px', '48px', '54px', '60px');
        $font_styles = array('normal', 'bold', 'italic', 'bold-italic');
        $__no_hr_types = array('begin_afterstatement', 'end_afterstatement', 'hiddensection_open', 'hiddensection_close');
        //define variables
        $leftside = $rightside = '';
        $count = 1;
        // different types of content
        /*
        	notice, image, icon, subheader, note, checkbox, text. textarea, font_size, font_style, border_radius, color, fontation, multicolor, radio, dropdown, checkboxes, yesno, begin_afterstatement, end_afterstatement, hiddensection_open, hiddensection_close, customcode
        */
        foreach ($cutomization_pg_array as $cpa => $cpav) {
            // left side tabs with different level colors
            $ls_level_code = isset($cpav['level']) ? 'class="' . $cpav['level'] . '"' : null;
            $leftside .= "<li " . $ls_level_code . "><a class='" . ($count == 1 ? 'focused' : null) . "' data-c_id='" . $cpav['id'] . "' title='" . $cpav['tab_name'] . "'>" . __($cpav['tab_name'], 'eventon') . "</a></li>";
            $tab_type = isset($cpav['tab_type']) ? $cpav['tab_type'] : '';
            if ($tab_type != 'empty') {
                // to not show the right side
                // RIGHT SIDE
                $display_default = !empty($cpav['display']) && $cpav['display'] == 'show' ? '' : 'display:none';
                $rightside .= "<div id='" . $cpav['id'] . "' style='" . $display_default . "' class='nfer'>\n\t\t\t\t<h3 style='margin-bottom:10px' >" . __($cpav['name'], 'eventon') . "</h3>\n\t\t\t\t<em class='hr_line'></em>";
                if ($cpav['id'] == 'evcal_002') {
                    // color selector guide box
                    $rightside .= "<div style='display:none' id='evo_color_guide'>Testing</div>";
                } else {
                    // font awesome
                    require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_fa_fonts.php';
                    $rightside .= "<div style='display:none' class='fa_icons_selection'><div class='fai_in'><ul class='faicon_ul'>";
                    foreach ($font_ as $fa) {
                        $rightside .= "<li><i data-name='" . $fa . "' class='fa " . $fa . "' title='{$fa}'></i></li>";
                    }
                    $rightside .= "</ul>";
                    $rightside .= "</div></div>";
                }
                // EACH field
                foreach ($cpav['fields'] as $field) {
                    // LEGEND
                    $legend_code = !empty($field['legend']) ? $eventon->throw_guide($field['legend'], 'L', false) : null;
                    switch ($field['type']) {
                        // notices
                        case 'notice':
                            $rightside .= "<div class='evos_notice'>" . __($field['name'], 'eventon') . "</div>";
                            break;
                            //IMAGE
                        //IMAGE
                        case 'image':
                            $image = '';
                            $meta = $evOPT[$field['id']];
                            $preview_img_size = empty($field['preview_img_size']) ? 'medium' : $field['preview_img_size'];
                            $rightside .= "<div id='pa_" . $field['id'] . "'><p class='nylon_img'>" . $field['name'] . "</p>";
                            $rightside .= '<span class="custom_default_image" style="display:none">' . $image . '</span>';
                            if ($meta) {
                                $image = wp_get_attachment_image_src($meta, $preview_img_size);
                                $image = $image[0];
                            }
                            $img_code = empty($image) ? "<p class='custom_no_preview_img'><i>No Image Selected</i></p><img id='ev_" . $field['id'] . "' src='' style='display:none' class='custom_preview_image' />" : '<p class="custom_no_preview_img" style="display:none"><i>No Image Selected</i></p><img src="' . $image . '" class="custom_preview_image" alt="" />';
                            $rightside .= '<input name="' . $field['id'] . '" type="hidden" class="custom_upload_image" value="' . $meta . '" />' . $img_code . '<br />';
                            $display_choose = empty($image) ? 'block' : 'none';
                            $display_remove = empty($image) ? 'none' : 'block';
                            $rightside .= '<input style="display:' . $display_choose . '" parent="pa_' . $field['id'] . '" class="custom_upload_image_button button" type="button" value="Choose Image" />
							<small > <a href="#" style="display:' . $display_remove . '" class="custom_clear_image_button">Remove Image</a></small> 
							<br clear="all" /></div>';
                            break;
                        case 'icon':
                            $field_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : $field['default'];
                            $rightside .= "<div class='row_faicons'><p class='fieldname'>" . __($field['name'], 'foodpress') . "</p>";
                            // code
                            $rightside .= "<p class='acus_line faicon'>\n\t\t\t\t\t\t\t<i class='fa " . $field_value . "'></i>\n\t\t\t\t\t\t\t<input name='" . $field['id'] . "' class='backender_colorpicker' type='hidden' value='" . $field_value . "' /></p>";
                            $rightside .= "<div class='clear'></div></div>";
                            break;
                        case 'subheader':
                            $rightside .= "<h4 class='acus_subheader'>" . __($field['name'], 'eventon') . "</h4>";
                            break;
                        case 'note':
                            $rightside .= "<p class='nylon_note'><i>" . __($field['name'], 'eventon') . "</i></p>";
                            break;
                        case 'hr':
                            $rightside .= "<em class='hr_line'></em>";
                            break;
                        case 'checkbox':
                            $this_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                            $rightside .= "<p><input type='checkbox' name='" . $field['id'] . "' value='yes' " . ($this_value == 'yes' ? 'checked="/checked"/' : '') . "/> " . $field['name'] . "</p>";
                            break;
                        case 'text':
                            $this_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                            $default_value = !empty($field['default']) ? 'placeholder="' . $field['default'] . '"' : null;
                            $rightside .= "<p>" . __($field['name'], 'eventon') . $legend_code . "</p><p><span class='nfe_f_width'><input type='text' name='" . $field['id'] . "'";
                            $rightside .= 'value="' . $this_value . '"';
                            $rightside .= $default_value . "/></span></p>";
                            break;
                        case 'textarea':
                            $textarea_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                            $rightside .= "<p>" . __($field['name'], 'eventon') . $legend_code . "</p><p><span class='nfe_f_width'><textarea name='" . $field['id'] . "'>" . $textarea_value . "</textarea></span></p>";
                            break;
                        case 'font_size':
                            $rightside .= "<p>" . __($field['name'], 'eventon') . " <select name='" . $field['id'] . "'>";
                            $evo_fval = $evOPT[$field['id']];
                            foreach ($font_sizes as $fs) {
                                $selected = $evo_fval == $fs ? "selected='selected'" : null;
                                $rightside .= "<option value='{$fs}' " . $selected . ">{$fs}</option>";
                            }
                            $rightside .= "</select></p>";
                            break;
                        case 'font_style':
                            $rightside .= "<p>" . __($field['name'], 'eventon') . " <select name='" . $field['id'] . "'>";
                            $evo_fval = $evOPT[$field['id']];
                            foreach ($font_styles as $fs) {
                                $selected = $evo_fval == $fs ? "selected='selected'" : null;
                                $rightside .= "<option value='{$fs}' " . $selected . ">{$fs}</option>";
                            }
                            $rightside .= "</select></p>";
                            break;
                        case 'border_radius':
                            $rightside .= "<p>" . __($field['name'], 'eventon') . " <select name='" . $field['id'] . "'>";
                            $evo_fval = $evOPT[$field['id']];
                            $border_radius = array('0px', '2px', '3px', '4px', '5px', '6px', '8px', '10px');
                            foreach ($border_radius as $br) {
                                $selected = $evo_fval == $br ? "selected='selected'" : null;
                                $rightside .= "<option value='{$br}' " . $selected . ">{$br}</option>";
                            }
                            $rightside .= "</select></p>";
                            break;
                        case 'color':
                            // default hex color
                            $hex_color = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : $field['default'];
                            $hex_color_val = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                            // RGB Color for the color box
                            $rgb_color_val = !empty($field['rgbid']) && !empty($evOPT[$field['rgbid']]) ? $evOPT[$field['rgbid']] : null;
                            $__em_class = !empty($field['rgbid']) ? ' rgb' : null;
                            $rightside .= "<p class='acus_line color'>\n\t\t\t\t\t\t\t<em><span class='colorselector{$__em_class}' style='background-color:#" . $hex_color . "' hex='" . $hex_color . "' title='" . $hex_color . "'></span>\n\t\t\t\t\t\t\t<input name='" . $field['id'] . "' class='backender_colorpicker' type='hidden' value='" . $hex_color_val . "' default='" . $field['default'] . "'/>";
                            if (!empty($field['rgbid'])) {
                                $rightside .= "<input name='" . $field['rgbid'] . "' class='rgb' type='hidden' value='" . $rgb_color_val . "' />";
                            }
                            $rightside .= "</em>" . __($field['name'], 'foodpress') . " </p>";
                            break;
                        case 'fontation':
                            $variations = $field['variations'];
                            $rightside .= "<div class='row_fontation'><p class='fieldname'>" . __($field['name'], 'foodpress') . "</p>";
                            foreach ($variations as $variation) {
                                switch ($variation['type']) {
                                    case 'color':
                                        // default hex color
                                        $hex_color = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : $variation['default'];
                                        $hex_color_val = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : null;
                                        $title = !empty($variation['name']) ? $variation['name'] : $hex_color;
                                        $_has_title = !empty($variation['name']) ? true : false;
                                        // code
                                        $rightside .= "<p class='acus_line color'>\n\t\t\t\t\t\t\t\t\t\t<em><span class='colorselector " . ($_has_title ? 'hastitle' : '') . "' style='background-color:#" . $hex_color . "' hex='" . $hex_color . "' title='" . $hex_color . "' alt='" . $title . "'></span>\n\t\t\t\t\t\t\t\t\t\t<input name='" . $variation['id'] . "' class='backender_colorpicker' type='hidden' value='" . $hex_color_val . "' default='" . $variation['default'] . "'/></em></p>";
                                        break;
                                    case 'font_style':
                                        $rightside .= "<p><select title='" . __('Font Style', 'foodpress') . "' name='" . $variation['id'] . "'>";
                                        $f1_fs = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : $variation['default'];
                                        foreach ($font_styles as $fs) {
                                            $selected = $f1_fs == $fs ? "selected='selected'" : null;
                                            $rightside .= "<option value='{$fs}' " . $selected . ">{$fs}</option>";
                                        }
                                        $rightside .= "</select></p>";
                                        break;
                                    case 'font_size':
                                        $rightside .= "<p><select title='" . __('Font Size', 'foodpress') . "' name='" . $variation['id'] . "'>";
                                        $f1_fs = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : $variation['default'];
                                        foreach ($font_sizes as $fs) {
                                            $selected = $f1_fs == $fs ? "selected='selected'" : null;
                                            $rightside .= "<option value='{$fs}' " . $selected . ">{$fs}</option>";
                                        }
                                        $rightside .= "</select></p>";
                                        break;
                                }
                            }
                            $rightside .= "<div class='clear'></div></div>";
                            break;
                        case 'multicolor':
                            $variations = $field['variations'];
                            $rightside .= "<div class='row_multicolor'>";
                            foreach ($variations as $variation) {
                                // default hex color
                                $hex_color = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : $variation['default'];
                                $hex_color_val = !empty($evOPT[$variation['id']]) ? $evOPT[$variation['id']] : null;
                                $rightside .= "<p class='acus_line color'>\n\t\t\t\t\t\t\t<em data-name='" . __($variation['name'], 'foodpress') . "'><span class='colorselector' style='background-color:#" . $hex_color . "' hex='" . $hex_color . "' title='" . $hex_color . "'></span>\n\t\t\t\t\t\t\t<input name='" . $variation['id'] . "' class='backender_colorpicker' type='hidden' value='" . $hex_color_val . "' default='" . $variation['default'] . "'/></em></p>";
                            }
                            $rightside .= "<div class='clear'></div><p class='multicolor_alt'></p></div>";
                            break;
                        case 'radio':
                            $rightside .= "<p class='acus_line acus_radio'>" . __($field['name'], 'eventon') . "</br></br>";
                            $cnt = 0;
                            foreach ($field['options'] as $option => $option_val) {
                                $this_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                                $checked_or_not = !empty($this_value) && $option == $this_value || empty($this_value) && $cnt == 0 ? 'checked=\\"checked\\"' : null;
                                $rightside .= "<em><input id='" . $field['id'] . $option_val . "' type='radio' name='" . $field['id'] . "' value='" . $option . "' " . $checked_or_not . "/><label for='" . $field['id'] . $option_val . "'><span></span>" . __($option_val, 'eventon') . "</label></em>";
                                $cnt++;
                            }
                            $rightside .= "</p>";
                            break;
                        case 'dropdown':
                            $dropdown_opt = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : (!empty($field['default']) ? $field['default'] : null);
                            $rightside .= "<p class='acus_line {$field['id']}'>" . __($field['name'], 'eventon') . " <select name='" . $field['id'] . "'>";
                            foreach ($field['options'] as $option => $option_val) {
                                $rightside .= "<option type='radio' name='" . $field['id'] . "' value='" . $option . "' " . ($option == $dropdown_opt ? 'selected=\\"selected\\"' : null) . "/> " . $option_val . "</option>";
                            }
                            $rightside .= "</select>";
                            // description text for this field
                            if (!empty($field['desc'])) {
                                $rightside .= "<br/><i style='opacity:0.6'>" . $field['desc'] . "</i>";
                            }
                            $rightside .= "</p>";
                            break;
                        case 'checkboxes':
                            $meta_arr = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : null;
                            $default_arr = !empty($field['default']) ? $field['default'] : null;
                            ob_start();
                            echo "<p class='acus_line acus_checks'><span style='padding-bottom:10px;'>" . __($field['name'], 'eventon') . "</span>";
                            // foreach checkbox
                            foreach ($field['options'] as $option => $option_val) {
                                $checked = '';
                                if (!empty($meta_arr) && is_array($meta_arr)) {
                                    $checked = in_array($option, $meta_arr) ? 'checked' : '';
                                } elseif (!empty($default_arr)) {
                                    $checked = in_array($option, $default_arr) ? 'checked' : '';
                                }
                                echo "<span><input id='" . $field['id'] . $option_val . "' type='checkbox' \n\t\t\t\t\t\t\tname='" . $field['id'] . "[]' value='" . $option . "' " . $checked . "/>\n\t\t\t\t\t\t\t<label for='" . $field['id'] . $option_val . "'><span></span>" . $option_val . "</label></span>";
                            }
                            echo "</p>";
                            $rightside .= ob_get_clean();
                            break;
                        case 'yesno':
                            $yesno_value = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : 'no';
                            $after_statement = isset($field['afterstatement']) ? $field['afterstatement'] : '';
                            $__default = !empty($field['default']) && $evOPT[$field['id']] != 'yes' ? $field['default'] : $yesno_value;
                            $rightside .= "<p class='yesno_row'>" . eventon_html_yesnobtn(array('var' => $__default, 'attr' => array('afterstatement' => $after_statement))) . "<input type='hidden' name='" . $field['id'] . "' value='" . ($__default == 'yes' ? 'yes' : 'no') . "'/><span class='field_name'>" . __($field['name'], 'eventon') . "{$legend_code}</span>";
                            // description text for this field
                            if (!empty($field['desc'])) {
                                $rightside .= "<i style='opacity:0.6; padding-top:8px; display:block'>" . $field['desc'] . "</i>";
                            }
                            $rightside .= '</p>';
                            break;
                        case 'begin_afterstatement':
                            $yesno_val = !empty($evOPT[$field['id']]) ? $evOPT[$field['id']] : 'no';
                            $rightside .= "<div class='backender_yn_sec' id='" . $field['id'] . "' style='display:" . ($yesno_val == 'yes' ? 'block' : 'none') . "'>";
                            break;
                        case 'end_afterstatement':
                            $rightside .= "</div>";
                            break;
                            // hidden section open
                        // hidden section open
                        case 'hiddensection_open':
                            $__display = !empty($field['display']) && $field['display'] == 'none' ? 'style="display:none"' : null;
                            $__diclass = !empty($field['display']) && $field['display'] == 'none' ? '' : 'open';
                            $rightside .= "<div class='evoSET_hidden_open {$__diclass}'><h4>{$field['name']}{$legend_code}</h4></div>\n\t\t\t\t\t\t<div class='evoSET_hidden_body' {$__display}>";
                            break;
                        case 'hiddensection_close':
                            $rightside .= "</div>";
                            break;
                            // custom code
                        // custom code
                        case 'customcode':
                            $rightside .= $field['code'];
                            break;
                    }
                    if (!empty($field['type']) && !in_array($field['type'], $__no_hr_types)) {
                        $rightside .= "<em class='hr_line'></em>";
                    }
                }
                $rightside .= "</div>";
            }
            $count++;
        }
        //built out the backender section
        ob_start();
        ?>
	<table id='ajde_customization'>
			<tr><td class='backender_left' valign='top'>
				<div id='acus_left'>
					<ul><?php 
        echo $leftside;
        ?>
</ul>								
				</div>
				<div class="evo-collapse-menu"><div id="collapse-button" class='evo_collpase_btn'><div></div></div><span>Collpase Menu</span></div>
				</td><td width='100%'  valign='top'>
					<div id='acus_right' class='evo_backender_uix'>
						<p id='acus_arrow' style='top:4px'></p>
						<div class='customization_right_in'><?php 
        echo $rightside . $extra_tabs;
        ?>
</div>
					</div>
				</td></tr>
			</table>
	
	<?php 
        echo ob_get_clean();
    }
function evors_metabox_content()
{
    global $post, $eventon_rs, $eventon;
    $optRS = $eventon_rs->evors_opt;
    $pmv = get_post_meta($post->ID);
    wp_nonce_field(plugin_basename(__FILE__), 'evors_nonce');
    ob_start();
    $evors_rsvp = !empty($pmv['evors_rsvp']) ? $pmv['evors_rsvp'][0] : null;
    $evors_show_rsvp = !empty($pmv['evors_show_rsvp']) ? $pmv['evors_show_rsvp'][0] : null;
    $evors_show_whos_coming = !empty($pmv['evors_show_whos_coming']) ? $pmv['evors_show_whos_coming'][0] : null;
    $evors_add_emails = !empty($pmv['evors_add_emails']) ? $pmv['evors_add_emails'][0] : null;
    ?>
	<div class='eventon_mb'>
	<div class="evors">
		<p class='yesno_leg_line ' style='padding:10px'>
			<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_rsvp, 'attr' => array('afterstatement' => 'evors_details')));
    ?>
			<input type='hidden' name='evors_rsvp' value="<?php 
    echo $evors_rsvp == 'yes' ? 'yes' : 'no';
    ?>
"/>
			<label for='evors_rsvp'><?php 
    _e('Allow visitors to RSVP to this event');
    ?>
</label>
		</p>
		<div id='evors_details' class='evors_details evomb_body ' <?php 
    echo $evors_rsvp == 'yes' ? null : 'style="display:none"';
    ?>
>		
			<div class="evors_stats" style='padding-top:5px'>			
			<?php 
    $yes_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'yes', $pmv);
    $maybe_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'maybe', $pmv);
    $no_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'no', $pmv);
    ?>
				<p><b><?php 
    echo $yes_count;
    ?>
</b><span><?php 
    _e('YES', 'eventon');
    ?>
</span></p>
				<p><b><?php 
    echo $maybe_count;
    ?>
</b><span><?php 
    _e('Maybe', 'eventon');
    ?>
</span></p>
				<p><b><?php 
    echo $no_count;
    ?>
</b><span><?php 
    _e('No', 'eventon');
    ?>
</span></p>
				<div class='clear'></div>
			</div>
			<div class='evo_negative_25'>
			<table width='100%' class='eventon_settings_table'>
				<tr><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_show_rsvp));
    ?>
					
						<input type='hidden' name='evors_show_rsvp' value="<?php 
    echo $evors_show_rsvp == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_show_rsvp'><?php 
    _e('Show current RSVP count for event');
    ?>
</label>
					</p>
				</td></tr>
				<tr><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_show_whos_coming));
    ?>
						<input type='hidden' name='evors_show_whos_coming' value="<?php 
    echo $evors_show_whos_coming == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_show_whos_coming'><?php 
    _e("Show who's coming to event");
    ?>
</label>
					</p>
				</td></tr>
				
				<?php 
    // if notifications enabled show additional emails field
    if (!empty($optRS['evors_notif']) && $optRS['evors_notif'] == 'yes') {
        ?>
						<tr><td colspan='2'>
						<p style='padding:5px 0'>
							<label for='evors_add_emails'><i><?php 
        _e('Additional email addresses to receive email notifications', 'eventon');
        echo $eventon->throw_guide("Set additional email addresses seperated by commas to receive email notifications upon new RSVP reciept", '', false);
        ?>
</i></label>
							<input type='text' name='evors_add_emails' value="<?php 
        echo $evors_add_emails;
        ?>
" style='width:100%' placeholder='eg. you@domain.com'/>			
						</p>
						</td></tr>
					<?php 
    }
    ?>

				<tr><td colspan='2'>			
					<?php 
    $evors_max_active = !empty($pmv['evors_max_active']) ? $pmv['evors_max_active'][0] : null;
    $evors_max_count = !empty($pmv['evors_max_count']) ? $pmv['evors_max_count'][0] : null;
    ?>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_max_active, 'attr' => array('afterstatement' => 'evors_max_count_row', 'as_type' => 'class')));
    ?>
						<input type='hidden' name='evors_max_active' value="<?php 
    echo $evors_max_active == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_max_active'><?php 
    _e('Limit maximum capacity count per RSVP', 'eventon');
    echo $eventon->throw_guide('This will allow you to limit each RSVP reservation count to a set max number, then the guests can not book more spaces than this limit.');
    ?>
</label>
					</p>
				</td></tr>
					<tr class='evors_max_count_row yesnosub' style='display:<?php 
    echo $evors_max_active == 'yes' ? '' : 'none';
    ?>
'>
						<td><?php 
    _e('Maximum count number', 'eventon');
    ?>
</td>
						<td><input type='text' id='evors_max_count' name='evors_max_count' value="<?php 
    echo $evors_max_count;
    ?>
"/></td>
					</tr>


				<tr><td colspan='2'>			
					<?php 
    $evors_capacity = !empty($pmv['evors_capacity']) ? $pmv['evors_capacity'][0] : null;
    ?>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_capacity, 'attr' => array('afterstatement' => 'evors_capacity_row', 'as_type' => 'class')));
    ?>
						<input type='hidden' name='evors_capacity' value="<?php 
    echo $evors_capacity == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_capacity'><?php 
    _e('Set capacity limit for RSVP', 'eventon');
    echo $eventon->throw_guide('Activating this will allow you to add a limit to how many RSVPs you can receive. When the limit is reached RSVP will close.');
    ?>
</label>
					</p>
				</td></tr>
				<?php 
    $evors_capacity_count = !empty($pmv['evors_capacity_count']) ? $pmv['evors_capacity_count'][0] : null;
    $evors_capacity_show = !empty($pmv['evors_capacity_show']) ? $pmv['evors_capacity_show'][0] : null;
    ?>
				<tr class='evors_capacity_row yesnosub' style='display:<?php 
    echo $evors_capacity == 'yes' ? '' : 'none';
    ?>
'>
					<td><?php 
    _e('Total available RSVP capacity', 'eventon');
    ?>
</td>
					<td><input type='text' id='evors_capacity_count' name='evors_capacity_count' value="<?php 
    echo $evors_capacity_count;
    ?>
"/></td>
				</tr>

				<?php 
    // manange RSVP capacity separate for repeating events
    if (!empty($pmv['evcal_repeat']) && $pmv['evcal_repeat'][0] == 'yes') {
        $manage_repeat_cap = evo_meta_yesno($pmv, '_manage_repeat_cap_rs', 'yes', 'yes', 'no');
        ?>
				<tr class='evors_capacity_row yesnosub' style='display:<?php 
        echo $evors_capacity == 'yes' ? '' : 'none';
        ?>
'><td colspan='2'>
					<p class='yesno_leg_line ' >
						<?php 
        echo eventon_html_yesnobtn(array('id' => 'evors_mcap', 'var' => $manage_repeat_cap, 'attr' => array('afterstatement' => 'evors_ri_cap')));
        ?>
						<input type='hidden' name='_manage_repeat_cap_rs' value="<?php 
        echo $manage_repeat_cap;
        ?>
"/>

						<label for='_manage_repeat_cap_rs'><?php 
        _e('Manage available capacity separate for each repeating interval of this event');
        echo $eventon->throw_guide('Once repeating event capacities are set the total capacity for event will be overridden. If you just made event repeat, this event need to be updated for repeat options to show up.', '', false);
        ?>
</label>
					</p>
				<?php 
        $repeat_intervals = !empty($pmv['repeat_intervals']) ? unserialize($pmv['repeat_intervals'][0]) : false;
        ?>
					<div id='evors_ri_cap' class='evotx_repeat_capacity' style='padding-top:15px; padding-bottom:20px;display:<?php 
        echo evo_meta_yesno($pmv, '_manage_repeat_cap_rs', 'yes', '', 'none');
        ?>
'>
						<p><em style='opacity:0.6'><?php 
        _e('NOTE: The capacity above should match the total number of capacity for each repeat occurance below for this event.', 'eventon');
        ?>
</em></p>
						<?php 
        // if repeat intervals set
        if ($repeat_intervals && count($repeat_intervals) > 0) {
            $count = 0;
            // get saved capacities for repeats
            $ri_capacity_rs = !empty($pmv['ri_capacity_rs']) ? unserialize($pmv['ri_capacity_rs'][0]) : false;
            echo "<div class='evotx_ri_cap_inputs'>";
            // for each repeat interval
            $evcal_opt1 = get_option('evcal_options_evcal_1');
            foreach ($repeat_intervals as $interval) {
                $date_format = eventon_get_timeNdate_format($evcal_opt1);
                $TIME = eventon_get_editevent_kaalaya($interval[0], $date_format[1], $date_format[2]);
                $ri_open_count = $ri_capacity_rs && !empty($ri_capacity_rs[$count]) ? $ri_capacity_rs[$count] : '0';
                echo "<p class='" . ($count > 10 ? 'hidden' : '') . "'><input type='text' name='ri_capacity_rs[]' value='" . $ri_open_count . "'/><span>" . $TIME[0] . "<br/><em>Remaining: " . $eventon_rs->frontend->functions->get_ri_remaining_count('y', $count, $ri_open_count, $pmv) . "</em></span></p>";
                $count++;
            }
            echo "<div class='clear'></div>";
            echo $count > 10 ? "<p class='evors_repeats_showrest'>" . __('Show Rest', 'eventon') . "</p>" : '';
            echo "</div>";
            echo count($repeat_intervals) > 5 ? "<p class='evotx_ri_view_more'><a class='button_evo'>Click here</a> to view the rest of repeat occurances.</p>" : null;
        }
        ?>
					</div>
				</td></tr>
				<?php 
    }
    ?>

				<tr class='evors_capacity_row yesnosub' style='display:<?php 
    echo $evors_capacity == 'yes' ? '' : 'none';
    ?>
'><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_capacity_show));
    ?>
						<input type='hidden' name='evors_capacity_show' value="<?php 
    echo $evors_capacity_show == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_capacity_show'><?php 
    _e('Show available spaces count on front-end');
    ?>
</label>
					</p>
				</td></tr>
				<?php 
    $evors_close_time = !empty($pmv['evors_close_time']) ? $pmv['evors_close_time'][0] : null;
    ?>
				<tr>
					<td><?php 
    _e('Close RSVP before time (in minutes)', 'eventon');
    echo $eventon->throw_guide('Set how many minutes before the event end time to close RSVP form. Time must be in minutes. Leave blank to not close RSVP before event time.');
    ?>
</td>
					<td><input type='text' id='evors_close_time' name='evors_close_time' value="<?php 
    echo $evors_close_time;
    ?>
" placeholder='eg. 45'/></td>
				</tr>
				<tr>
					<td colspan='2'><?php 
    _e('Additional Information only visible to loggedin RSVPed guests & in Confirmation Email', 'eventon');
    echo $eventon->throw_guide('Information entered in here will only be visible on front-end once user has RSVPed to the event.');
    ?>
					<br/><textarea style='width:100%; margin-top:10px' name='evors_additional_data'><?php 
    echo !empty($pmv['evors_additional_data']) ? $pmv['evors_additional_data'][0] : null;
    ?>
</textarea>
					</td>
				</tr>
			</table>
			</div>
			<?php 
    // INITIAL information for lightbox data section
    // @version 0.2
    // DOWNLOAD CSV link
    $exportURL = add_query_arg(array('action' => 'the_ajax_evors_a3', 'e_id' => $post->ID), admin_url('admin-ajax.php'));
    // repeat event interval data
    $ri_count_active = $eventon_rs->frontend->functions->is_ri_count_active($pmv);
    $repeatIntervals = !empty($pmv['repeat_intervals']) ? unserialize($pmv['repeat_intervals'][0]) : false;
    $datetime = new evo_datetime();
    $wp_date_format = get_option('date_format');
    ?>
			<div class='evcal_rep evors_info_actions'>				
				<div class='evcalr_1'>
				<p class='actions'>
					<a id='evors_VA' data-e_id='<?php 
    echo $post->ID;
    ?>
' data-riactive='<?php 
    echo $ri_count_active && $repeatIntervals ? 'yes' : 'no';
    ?>
' data-popc='evors_lightbox' class='button_evo attendees ajde_popup_trig' ><?php 
    _e('View Attendees', 'eventon');
    ?>
</a> 
					<a class='button_evo download' href="<?php 
    echo $exportURL;
    ?>
"><?php 
    _e('Download (CSV)', 'eventon');
    ?>
</a> 
					<a id='evors_SY' data-e_id='<?php 
    echo $post->ID;
    ?>
' class='button_evo sync' ><?php 
    _e('Sync Count', 'eventon');
    ?>
</a> 
					<a id='evors_EMAIL' data-e_id='<?php 
    echo $post->ID;
    ?>
' data-popc='evors_email_attendee' class='button_evo email ajde_popup_trig' ><?php 
    _e('Emailing', 'eventon');
    ?>
</a> 
				</p>
				
				<?php 
    // lightbox content for emailing section
    ob_start();
    ?>
				<div id='evors_emailing' style=''>
					<p><label><?php 
    _e('Select emailing option', 'eventon');
    ?>
</label>
						<select name="" id="evors_emailing_options">
							<option value="someone"><?php 
    _e('Email Attendees List to someone', 'eventon');
    ?>
</option>
							<option value="coming"><?php 
    _e('Email only attending guests', 'eventon');
    ?>
</option>
							<option value="notcoming"><?php 
    _e('Email guests not coming to event', 'eventon');
    ?>
</option>
							<option value="all"><?php 
    _e('Email all rsvped guests', 'eventon');
    ?>
</option>
						</select>
					</p>
					<?php 
    // if repeat interval count separatly
    if ($ri_count_active && $repeatIntervals) {
        if (count($repeatIntervals) > 0) {
            echo "<p><label>" . __('Select Event Repeat Instance', 'eventon') . "</label> ";
            echo "<select name='repeat_interval' id='evors_emailing_repeat_interval'>\r\n\t\t\t\t\t\t\t\t\t<option value='all'>" . __('All', 'eventon') . "</option>";
            $x = 0;
            foreach ($repeatIntervals as $interval) {
                $time = $datetime->get_correct_formatted_event_repeat_time($pmv, $x, $wp_date_format);
                echo "<option value='" . $x . "'>" . $time['start'] . "</option>";
                $x++;
            }
            echo "</select>";
            echo $eventon->throw_guide("Select which instance of repeating events of this event you want to use for this emailing action.", '', false);
            echo "</p>";
        }
    }
    ?>
					<p style='' class='text'><label for=""><?php 
    _e('Email Addresses (separated by commas)', 'eventon');
    ?>
</label><br/><input style='width:100%' type="text"></p>
					<p style='' class='subject'><label for=""><?php 
    _e('Subject for email', 'eventon');
    ?>
 *</label><br/><input style='width:100%' type="text"></p>
					<p style='' class='textarea'><label for=""><?php 
    _e('Message for the email', 'eventon');
    ?>
</label><br/>
						<textarea cols="30" rows="5" style='width:100%'></textarea></p>
					<p><a data-eid='<?php 
    echo $post->ID;
    ?>
' id="evors_email_submit" class='evo_admin_btn btn_prime'><?php 
    _e('Send Email', 'eventon');
    ?>
</a></p>
				</div>
				<?php 
    $emailing_content = ob_get_clean();
    ?>

				<?php 
    // lightbox content for view attendees
    if ($repeatIntervals && $ri_count_active && count($repeatIntervals) > 0) {
        ob_start();
        ?>
					<div id='evors_view_attendees'>
						<p style='text-align:center'><label><?php 
        _e('Select Repeating Instance of Event', 'eventon');
        ?>
</label> 
							<select name="" id="evors_event_repeatInstance">
								<option value="all"><?php 
        _e('All Repeating Instances', 'eventon');
        ?>
</option>
								<?php 
        $x = 0;
        foreach ($repeatIntervals as $interval) {
            $time = $datetime->get_correct_formatted_event_repeat_time($pmv, $x, $wp_date_format);
            echo "<option value='" . $x . "'>" . $time['start'] . "</option>";
            $x++;
        }
        ?>
							</select>
						</p>
						<p style='text-align:center'><a id='evors_VA_submit' data-e_id='<?php 
        echo $post->ID;
        ?>
' class='evo_admin_btn btn_prime' ><?php 
        _e('Submit', 'eventon');
        ?>
</a> </p>
					</div>
					<div id='evors_view_attendees_list'></div>
					<?php 
        $viewattendee_content = ob_get_clean();
    } else {
        $viewattendee_content = "<div id='evors_view_attendees'>LOADING...</div>";
    }
    ?>

				<p id='evors_message' style='display:none'></p>
				<?php 
    echo $eventon->output_eventon_pop_window(array('class' => 'evors_lightbox', 'content' => $viewattendee_content, 'title' => __('View Attendee List', 'eventon'), 'type' => 'padded', 'max_height' => 450));
    echo $eventon->output_eventon_pop_window(array('class' => 'evors_email_attendee', 'content' => $emailing_content, 'title' => __('Email Attendee List', 'eventon'), 'type' => 'padded', 'max_height' => 450));
    ?>
				</div>
			</div>
		</div>
	</div>
	</div>
	<?php 
    echo ob_get_clean();
}
Example #5
0
/**  Event META BOX for ajde_events CPT */
function evotx_metabox_content()
{
    global $post, $evotx, $eventon, $evotx_admin;
    $woometa = '';
    $fmeta = get_post_meta($post->ID);
    $woo_product = !empty($fmeta['tx_woocommerce_product_id']) ? $fmeta['tx_woocommerce_product_id'][0] : null;
    // get options
    $evoOpt = get_evoOPT_array(1);
    // if woocommerce ticket has been created
    if ($woo_product) {
        $woometa = get_post_custom($woo_product);
    }
    $__woo_currencySYM = get_woocommerce_currency_symbol();
    //print_r($woometa);
    ob_start();
    $evotx_tix = !empty($fmeta['evotx_tix']) ? $fmeta['evotx_tix'][0] : null;
    ?>
		<div class='eventon_mb'>
		<div class="evotx">
			<input type='hidden' name='tx_woocommerce_product_id' value="<?php 
    echo evo_meta($fmeta, 'tx_woocommerce_product_id');
    ?>
"/>

			<p class='yesno_leg_line ' style='padding:10px'>
				<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_activate', 'var' => $evotx_tix, 'attr' => array('afterstatement' => 'evotx_details')));
    ?>
				
				<input type='hidden' name='evotx_tix' value="<?php 
    echo $evotx_tix == 'yes' ? 'yes' : 'no';
    ?>
"/>
				<label for='evotx_tix'><?php 
    _e('Activate tickets for this Event', 'eventon');
    echo $eventon->throw_guide('You can allow ticket selling via Woocommerce for this event in here.', '', false);
    ?>
</label>
			</p>
			<div id='evotx_details' class='evotx_details evomb_body ' <?php 
    echo $evotx_tix == 'yes' ? null : 'style="display:none"';
    ?>
>
				
				
				<div class="evotx_tickets" >
				
					<h4><?php 
    _e('Ticket Info for this event', 'eventon');
    ?>
</h4>
					<table width='100%' border='0' cellspacing='0'>
						<?php 
    $product_type = 'simple';
    // product type
    if ($woo_product && function_exists('get_product')) {
        $product = new WC_Product($woo_product);
        $product_type = $evotx_admin->get_product_type($woo_product);
        $product_type = !empty($product_type) ? $product_type : 'simple';
        ?>
							<tr><td><?php 
        _e('Ticket Pricing Type', 'eventon');
        ?>
</td><td><?php 
        echo $product_type;
        ?>
</td></tr>
						<?php 
    }
    ?>

						<input type='hidden' name='tx_product_type' value='<?php 
    echo $product_type;
    ?>
'/>

						<!-- Price-->
						<?php 
    if (!empty($product_type) && $product_type == 'variable') {
        ?>
							<tr><td><?php 
        printf(__('Ticket price (%s)', 'eventon'), $__woo_currencySYM);
        ?>
</td><td><p><?php 
        echo $__woo_currencySYM . ' ' . evo_meta($woometa, '_min_variation_price') . ' - ' . evo_meta($woometa, '_max_variation_price');
        ?>
</p>
							<p class='marb20'><a href='<?php 
        echo get_edit_post_link($woo_product);
        ?>
' style='color:#fff'><?php 
        _e('Edit Price Variations');
        ?>
</a></p></td></tr>				
							
						<?php 
    } else {
        ?>
							<!-- Regular Price-->
							<tr><td><?php 
        printf(__('Ticket price (%s)', 'eventon'), $__woo_currencySYM);
        ?>
</td><td><input type='text' id='_regular_price' name='_regular_price' value="<?php 
        echo evo_meta($woometa, '_regular_price');
        ?>
"/></td></tr>

							<!-- Sale Price-->
							<tr><td><?php 
        printf(__('Sale price (%s)', 'eventon'), $__woo_currencySYM);
        ?>
</td><td><input type='text' id='_sale_price' name='_sale_price' value="<?php 
        echo evo_meta($woometa, '_sale_price');
        ?>
"/></td></tr>
						<?php 
    }
    ?>

						<?php 
    do_action('evotx_edit_event_ticket_tablerow', $post->ID, $woo_product);
    ?>
								


						<!-- SKU-->
						<tr><td><?php 
    _e('Ticket SKU', 'eventon');
    echo $eventon->throw_guide('SKU refers to a Stock-keeping unit, a unique identifier for each distinct menu item that can be ordered.', '', false);
    ?>
</td><td><input type='text' name='_sku' value='<?php 
    echo evo_meta($woometa, '_sku');
    ?>
'/></td></tr>

						<!-- Desc-->
						<tr><td><?php 
    _e('Short Ticket Detail', 'eventon');
    ?>
</td><td><input type='text' name='_tx_desc' value='<?php 
    echo evo_meta($woometa, '_tx_desc');
    ?>
'/></td></tr>
						
						<!-- manage capacity -->
							<?php 
    $_manage_cap = evo_meta_yesno($woometa, '_manage_stock', 'yes', 'yes', 'no');
    ?>
							<tr><td colspan='2'>
								<p class='yesno_leg_line ' >
									<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_mcap', 'var' => $_manage_cap, 'attr' => array('afterstatement' => 'exotc_cap')));
    ?>
									<input type='hidden' name='_manage_stock' value="<?php 
    echo $_manage_cap;
    ?>
"/>
									<label for='_manage_stock'><?php 
    _e('Manage Capacity');
    ?>
</label>
								</p>
							</td></tr>
							
							<tbody id='exotc_cap' style='display:<?php 
    echo evo_meta_yesno($woometa, '_manage_stock', 'yes', '', 'none');
    ?>
'>
							<tr ><td><?php 
    _e('CAPACITY', 'eventon');
    ?>
</td><td><input type='text' id="_stock" name="_stock" value="<?php 
    echo evo_meta($woometa, '_stock');
    ?>
"/></td></tr>
						
						<!-- stock status -->
							<?php 
    $_stock_status = !empty($woometa['_stock_status']) && $woometa['_stock_status'][0] == 'outofstock' ? 'outofstock' : 'instock';
    $_stock_status_yesno = !empty($woometa['_stock_status']) && $woometa['_stock_status'][0] == 'outofstock' ? 'yes' : 'no';
    ?>
							<tr><td colspan='2'>
								<p class='yesno_leg_line '>
									<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_mcap', 'var' => $_stock_status_yesno, 'no' => 'no'));
    ?>
									<input type='hidden' name='_stock_status' value="<?php 
    echo $_stock_status;
    ?>
"/>
									<label for='_stock_status'><?php 
    _e('Make ticket out of stock', 'eventon');
    echo $eventon->throw_guide('Set stock status of tickets. Setting this to yes would make tickets not available for sale anymore', '', false);
    ?>
</label>
								</p>
							</td></tr>
			
						<!-- Manage Capcity seperate for repeating events -->
							<?php 
    if (!empty($fmeta['evcal_repeat']) && $fmeta['evcal_repeat'][0] == 'yes' && $product_type == 'simple') {
        $manage_repeat_cap = evo_meta_yesno($fmeta, '_manage_repeat_cap', 'yes', 'yes', 'no');
        ?>
							<tr><td colspan='2'>
								<p class='yesno_leg_line ' >
									<?php 
        echo eventon_html_yesnobtn(array('id' => 'evotx_mcap', 'var' => $manage_repeat_cap, 'attr' => array('afterstatement' => 'evotx_ri_cap')));
        ?>
									<input type='hidden' name='_manage_repeat_cap' value="<?php 
        echo $manage_repeat_cap;
        ?>
"/>

									<label for='_manage_repeat_cap'><?php 
        _e('Manage capacity seperate for each repeating event');
        echo $eventon->throw_guide('This will show remaining tickets for this event on front-end', '', false);
        ?>
</label>
								</p>
							<?php 
        $repeat_intervals = !empty($fmeta['repeat_intervals']) ? unserialize($fmeta['repeat_intervals'][0]) : false;
        ?>
								<div id='evotx_ri_cap' class='evotx_repeat_capacity' style='padding-top:15px; padding-bottom:20px;display:<?php 
        echo evo_meta_yesno($fmeta, '_manage_repeat_cap', 'yes', '', 'none');
        ?>
'>
									<p><em style='opacity:0.6'><?php 
        _e('NOTE: The capacity above should match the total number of capacity for each repeat occurance below for this event.', 'eventon');
        ?>
</em></p>
									<?php 
        // if repeat intervals set
        if ($repeat_intervals && count($repeat_intervals) > 0) {
            $count = 0;
            // get saved capacities for repeats
            $ri_capacity = !empty($fmeta['ri_capacity']) ? unserialize($fmeta['ri_capacity'][0]) : false;
            //print_r($ri_capacity);
            //print_r($repeat_intervals);
            echo "<div class='evotx_ri_cap_inputs'>";
            // for each repeat interval
            foreach ($repeat_intervals as $interval) {
                $TIME = $evotx_admin->get_format_time($interval[0]);
                echo "<p style='display:" . ($count > 4 ? 'none' : 'block') . "'><input type='text' name='ri_capacity[]' value='" . ($ri_capacity && !empty($ri_capacity[$count]) ? $ri_capacity[$count] : '0') . "'/> " . $TIME[0] . "</p>";
                $count++;
            }
            echo "</div>";
            echo count($repeat_intervals) > 5 ? "<p class='evotx_ri_view_more'><a class='button_evo'>Click here</a> to view the rest of repeat occurances.</p>" : null;
        }
        ?>
								</div>
							</td></tr>
							<?php 
    }
    ?>

						<!-- show remaining -->
							<?php 
    $remain_tix = evo_meta_yesno($fmeta, '_show_remain_tix', 'yes', 'yes', 'no');
    ?>
							<tr><td colspan='2'>
								<p class='yesno_leg_line ' >
									<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_mcap', 'var' => $remain_tix, 'attr' => array('afterstatement' => 'evotx_showre_count')));
    ?>
									<input type='hidden' name='_show_remain_tix' value="<?php 
    echo $remain_tix;
    ?>
"/>
									<label for='_show_remain_tix'><?php 
    _e('Show remaining tickets');
    echo $eventon->throw_guide('This will show remaining tickets for this event on front-end', '', false);
    ?>
</label>
								</p>
							</td></tr>
							<tr id='evotx_showre_count' style='display:<?php 
    echo evo_meta_yesno($fmeta, '_show_remain_tix', 'yes', '', 'none');
    ?>
'><td><?php 
    _e('Show remaining count at', 'eventon');
    echo $eventon->throw_guide('Show remaining count when remaining count go below this number.', '', false);
    ?>
</td><td><input type='text' id="remaining_count" name="remaining_count" placeholder='20' value="<?php 
    echo evo_meta($fmeta, 'remaining_count');
    ?>
"/></td></tr>	
							</tbody>
							
						<!-- sold individually -->
							<?php 
    $_sold_ind = evo_meta_yesno($woometa, '_sold_individually', 'yes', 'yes', 'no');
    ?>
							<tr><td colspan='2'>
								<p class='yesno_leg_line ' >
									<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_mcap', 'var' => $_sold_ind));
    ?>
				
									<input type='hidden' name="_sold_individually" value="<?php 
    echo $_sold_ind;
    ?>
"/>
									<label for='_sold_individually'><?php 
    _e('Sold Individually', 'eventon');
    echo $eventon->throw_guide('Enable this to only allow one ticket per person', '', false);
    ?>
</label>
								</p>
							</td></tr>	

						<!-- Field details-->
							<tr><td style='padding:5px 25px;' colspan='2'><?php 
    _e('Ticket Field description', 'eventon');
    echo $eventon->throw_guide('Use this to type instruction text that will appear above add to cart section on calendar.', '', false);
    ?>
<br/><input style='width:100%; margin-top:5px'type='text' name='_tx_text' value='<?php 
    echo evo_meta($woometa, '_tx_text');
    ?>
'/></td></tr>

						<!-- ticket image -->
							<?php 
    // tix_image_id
    $_tix_image_id = !empty($fmeta['_tix_image_id']) ? $fmeta['_tix_image_id'][0] : false;
    // image soruce array
    $img_src = $_tix_image_id ? wp_get_attachment_image_src($_tix_image_id, 'medium') : null;
    $tix_img_src = !empty($img_src) ? $img_src[0] : null;
    // button texts & Class names
    $__button_text = !empty($_tix_image_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
    $__button_text_not = empty($_tix_image_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
    $__button_class = !empty($_tix_image_id) ? 'removeimg' : 'chooseimg';
    ?>
							<tr><td style='padding:5px 25px;' colspan='2'>
								<div class='evo_metafield_image' style='padding-top:10px'>
									<p >
										<label style='padding-bottom:5px; display:inline-block'><?php 
    _e('Ticket Image', 'eventon');
    ?>
</label><br/>
										<span style=''></span>
										<input id='_tix_image_id' class='custom_upload_image evo_meta_img' name="_tix_image_id" type="hidden" value="<?php 
    echo $_tix_image_id ? $_tix_image_id : null;
    ?>
" /> 
			                    		<input class="custom_upload_image_button button <?php 
    echo $__button_class;
    ?>
" data-txt='<?php 
    echo $__button_text_not;
    ?>
' type="button" value="<?php 
    echo $__button_text;
    ?>
" /><br/>
			                    		<span class='evo_loc_image_src image_src'>
			                    			<img src='<?php 
    echo $tix_img_src;
    ?>
' style='<?php 
    echo !empty($_tix_image_id) ? '' : 'display:none';
    ?>
'/>
			                    		</span>		                    		
			                    	</p>
			                    	<?php 
    _e('Ticket Image Caption', 'eventon');
    echo $eventon->throw_guide('Caption text that will appear under ticket image.', '', false);
    ?>
<br/><input style='width:100%; margin-top:5px'type='text' name='_tx_img_text' value='<?php 
    echo evo_meta($fmeta, '_tx_img_text');
    ?>
'/>
			                    </div>
							</td></tr>

						<?php 
    // inquire before buying
    $_allow_inquire = evo_meta_yesno($fmeta, '_allow_inquire', 'yes', 'yes', 'no');
    $_tx_inq_subject = !empty($fmeta['_tx_inq_subject']) ? $fmeta['_tx_inq_subject'][0] : (!empty($evoOpt['evotx_tix_inquiries_def_subject']) ? $evoOpt['evotx_tix_inquiries_def_subject'] : 'New Ticket Sale Inquery');
    $_tx_inq_email = !empty($fmeta['_tx_inq_email']) ? $fmeta['_tx_inq_email'][0] : (!empty($evoOpt['evotx_tix_inquiries_def_email']) ? $evoOpt['evotx_tix_inquiries_def_email'] : get_option('admin_email'));
    ?>
						<tr><td colspan='2'>
							<p class='yesno_leg_line ' >
								<?php 
    echo eventon_html_yesnobtn(array('id' => 'evotx_showinq', 'var' => $_allow_inquire, 'attr' => array('afterstatement' => 'evotx_show_inq')));
    ?>
								<input type='hidden' name='_allow_inquire' value="<?php 
    echo $_allow_inquire;
    ?>
"/>
								<label for='_allow_inquire'><?php 
    _e('Allow customers to submit inquiries.');
    echo $eventon->throw_guide('With this customers can submit inquiries via this form before buying tickets on front-end.', '', false);
    ?>
</label>
							</p>
						</td></tr>
						<tr id='evotx_show_inq' style='display:<?php 
    echo evo_meta_yesno($fmeta, '_allow_inquire', 'yes', '', 'none');
    ?>
'><td colspan='2'><?php 
    _e('Override Default Email Address to receive Inquiries', 'eventon');
    ?>
<br/>
							<input style='width:100%; margin-top:5px'type='text' name='_tx_inq_email' placeholder='<?php 
    echo $_tx_inq_email;
    ?>
' value='<?php 
    echo $_tx_inq_email;
    ?>
'/>
							<?php 
    _e('Override Default Subject for Inquiries Email', 'eventon');
    ?>
<br/>
							<input style='width:100%; margin-top:5px'type='text' name='_tx_inq_subject' placeholder='<?php 
    echo $_tx_inq_subject;
    ?>
' value='<?php 
    echo evo_meta($fmeta, '_tx_inq_subject');
    ?>
'/>
							<p style='padding-top:5px;opacity:0.6'><i><?php 
    _e('NOTE: Front-end fields for Inquiries form can be customized from', 'eventon');
    ?>
 <a style='color:#B3DDEC' href='<?php 
    echo admin_url();
    ?>
admin.php?page=eventon&tab=evcal_2'>EventON Languages</a></i></p>
						</td></tr>	
					</table>
					<?php 
    // DOWNLOAD CSV link
    $exportURL = add_query_arg(array('action' => 'the_ajax_evotx_a3', 'e_id' => $post->ID, 'pid' => $woo_product), admin_url('admin-ajax.php'));
    ?>

					<?php 
    if ($woo_product) {
        ?>
						<p class='actions'><a class='button_evo edit' href='<?php 
        echo get_edit_post_link($woo_product);
        ?>
'  title='<?php 
        _e('Further Edit', 'eventon');
        ?>
'></a></p>
					<?php 
    }
    ?>
					<div class='clear'></div>		
				</div>	

				<?php 
    echo $eventon->output_eventon_pop_window(array('class' => 'evotx_lightbox', 'content' => 'Loading...', 'title' => 'Event Attendees', 'type' => 'padded', 'max_height' => '500'));
    ?>

				<!-- Attendee section -->
					<?php 
    if (!empty($woometa['total_sales']) && $woometa['total_sales'] > 0) {
        ?>
					<div class='evoTX_metabox_attendee_other'>
						<p><?php 
        _e('Attendees for event', 'eventon');
        ?>
</p>
						<p class="actions">
							<a id='evotx_attendees' data-eid='<?php 
        echo $post->ID;
        ?>
' data-wcid='<?php 
        echo evo_meta($fmeta, 'tx_woocommerce_product_id');
        ?>
' data-popc='evotx_lightbox' class='button_evo attendees ajde_popup_trig' title='<?php 
        _e('View Attendees', 'eventon');
        ?>
'><?php 
        _e('View Attendees', 'eventon');
        ?>
</a><a class='button_evo download' href="<?php 
        echo $exportURL;
        ?>
"><?php 
        _e('Download (CSV)', 'eventon');
        ?>
</a>
						</p>

					</div>
					<?php 
    }
    ?>
			</div>			
		</div>
		</div>

		<?php 
    echo ob_get_clean();
}
Example #6
0
 function get_cap_list_admin($ID, $type = 'role')
 {
     $content = $content_l = $content_r = '';
     $count = 1;
     if ($type == 'role') {
         global $wp_roles;
         $wp_roles = new WP_Roles();
         $current_role_caps = $wp_roles->get_role($ID);
         //print_r($current_role_caps);
         $cur_role_caps = $current_role_caps->capabilities;
     } else {
         if ($type == 'user') {
             $currentuser = new WP_User($ID);
             $cur_role_caps = $currentuser->allcaps;
         }
     }
     $caps = eventon_get_core_capabilities();
     foreach ($caps as $capgroupf => $capgroup) {
         foreach ($capgroup as $cap) {
             $rowcap = $cap;
             if ($capgroupf == 'core') {
                 $cap = str_replace('eventon', 'eventon Settings', $cap);
             } else {
                 $cap = str_replace('eventon', 'event', $cap);
             }
             $human_nam = ucwords(str_replace('_', ' ', $cap));
             $yesno_val = $ID == 'administrator' ? 'yes' : (isset($cur_role_caps[$rowcap]) ? 'yes' : 'no');
             $disabled = $ID == 'administrator' ? 'disable' : null;
             $yesno_btn = eventon_html_yesnobtn(array('var' => $yesno_val));
             $content = '<p class="yesno_row">' . $yesno_btn . '<input type="hidden" name="' . $rowcap . '" value="' . $yesno_val . '"><span class="field_name">' . $human_nam . '</span></p>';
             if ($count > 10) {
                 $content_r .= $content;
             } else {
                 $content_l .= $content;
             }
             $count++;
         }
     }
     $content = "<table width='100%' ><tr><td valign='top'>" . $content_l . "</td><td valign='top'>" . $content_r . "</td></tr></table>";
     return $content;
 }