コード例 #1
0
function timetable_vc_init()
{
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (!is_plugin_active("js_composer/js_composer.php") || !function_exists('vc_map')) {
        return;
    }
    //add support for multiple select field
    vc_add_shortcode_param('dropdownmulti', 'timetable_vc_dropdownmultiple_settings_field');
    global $wpdb;
    $timetable_events_settings = timetable_events_settings();
    //get saved shortcodes
    $timetable_shortcodes_list = get_option("timetable_shortcodes_list");
    $timetable_shortcodes_array = array(__("choose...", "timetable") => "-1");
    if (!empty($timetable_shortcodes_list)) {
        foreach ($timetable_shortcodes_list as $key => $val) {
            $timetable_shortcodes_array[$key] = $key;
        }
    }
    //get events list
    $events_list = get_posts(array('posts_per_page' => -1, 'nopaging' => true, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => $timetable_events_settings['slug']));
    $events_array = array();
    $events_array["All"] = "";
    foreach ($events_list as $event) {
        $events_array[$event->post_title . " (id:" . $event->ID . ")"] = urldecode($event->post_name);
    }
    //get events categories list
    $events_categories = get_terms("events_category");
    $events_categories_array = array();
    $events_categories_array["All"] = "";
    foreach ($events_categories as $events_category) {
        $events_categories_array[$events_category->name] = urldecode($events_category->slug);
    }
    //get hour categories
    $query = "SELECT distinct(category) AS category FROM " . $wpdb->prefix . "event_hours AS t1\r\n\t\t\tLEFT JOIN {$wpdb->posts} AS t2 ON t1.event_id=t2.ID \r\n\t\t\tWHERE \r\n\t\t\tt2.post_type='" . $timetable_events_settings['slug'] . "'\r\n\t\t\tAND t2.post_status='publish'\r\n\t\t\tAND category<>''";
    $hour_categories = $wpdb->get_results($query);
    $hour_categories_array = array();
    $hour_categories_array["All"] = "";
    foreach ($hour_categories as $hour_category) {
        $hour_categories_array[$hour_category->category] = $hour_category->category;
    }
    //get columns
    $weekdays_list = get_posts(array('posts_per_page' => -1, 'nopaging' => true, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'timetable_weekdays'));
    $weekdays_array = array();
    $weekdays_array["All"] = "";
    foreach ($weekdays_list as $weekday) {
        $weekdays_array[$weekday->post_title . " (id:" . $weekday->ID . ")"] = urldecode($weekday->post_name);
    }
    //get google fonts
    $fontsArray = timetable_get_google_fonts();
    $google_fonts_array = array();
    $google_fonts_array["Default"] = "";
    if (isset($fontsArray)) {
        $fontsCount = count($fontsArray->items);
        for ($i = 0; $i < $fontsCount; $i++) {
            $variantsCount = count($fontsArray->items[$i]->variants);
            if ($variantsCount > 1) {
                for ($j = 0; $j < $variantsCount; $j++) {
                    $google_fonts_array[$fontsArray->items[$i]->family . ":" . $fontsArray->items[$i]->variants[$j]] = $fontsArray->items[$i]->family . ":" . $fontsArray->items[$i]->variants[$j];
                }
            } else {
                $google_fonts_array[$fontsArray->items[$i]->family] = $fontsArray->items[$i]->family;
            }
        }
    }
    vc_map(array("name" => __("Timetable", 'timetable'), "base" => "tt_timetable", "class" => "", "controls" => "full", "show_settings_on_create" => true, "icon" => "icon-wpb-layer-timetable", "admin_enqueue_js" => array(plugin_dir_url(__FILE__) . '/admin/js/timetable_vc.js'), "front_enqueue_js" => array(plugin_dir_url(__FILE__) . '/admin/js/timetable_vc.js'), "params" => array(array("type" => "dropdown", "class" => "", "heading" => __("Choose shortcode id:", "timetable"), "param_name" => "shortcode_id", "value" => $timetable_shortcodes_array), array("type" => "dropdownmulti", "class" => "", "heading" => __("Events", "timetable"), "param_name" => "event", "value" => $events_array), array("type" => "dropdownmulti", "class" => "", "heading" => __("Event categories", "timetable"), "param_name" => "event_category", "value" => $events_categories_array), array("type" => "dropdownmulti", "class" => "", "heading" => __("Hour categories", "timetable"), "param_name" => "hour_category", "value" => $hour_categories_array), array("type" => "dropdownmulti", "class" => "", "heading" => __("Columns", "timetable"), "param_name" => "columns", "value" => $weekdays_array), array("type" => "dropdown", "class" => "", "heading" => __("Hour measure", "timetable"), "param_name" => "measure", "value" => array(__("Hour (1h)", "timetable") => "1", __("Half hour (30min)", "timetable") => "0.5", __("Quarter hour (15min)", "timetable") => "0.25")), array("type" => "dropdown", "class" => "", "heading" => __("Filter style", "timetable"), "param_name" => "filter_style", "value" => array(__("Dropdown list", "timetable") => "dropdown_list", __("Tabs", "timetable") => "tabs")), array("type" => "dropdown", "class" => "", "heading" => __("Filter kind", "timetable"), "param_name" => "filter_kind", "value" => array(__("By event", "timetable") => "event", __("By event category", "timetable") => "event_category", __("By event and event category", "timetable") => "event_and_event_category")), array("type" => "textfield", "class" => "", "heading" => __("Filter label", "timetable"), "param_name" => "filter_label", "value" => __("All Events", "timetable")), array("type" => "textfield", "class" => "", "heading" => __("Filter label 2", "timetable"), "param_name" => "filter_label_2", "value" => __("All Events Categories", "timetable"), "dependency" => array("element" => "filter_kind", "value" => array("event_and_event_category"))), array("type" => "dropdown", "class" => "", "heading" => __("Select time format", "timetable"), "param_name" => "select_time", "value" => array(__("09.03 (H.i)", "timetable") => "H.i", __("09:03 (H:i)", "timetable") => "H:i", __("9:03 am (g:i a)", "timetable") => "g:i a", __("9:03 AM (g:i A)", "timetable") => "g:i A")), array("type" => "textfield", "class" => "", "heading" => __("Time format", "timetable"), "param_name" => "time_format", "value" => "H.i"), array("type" => "dropdown", "class" => "", "heading" => __("Hide 'All Events' view", "timetable"), "param_name" => "hide_all_events_view", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "dropdown", "class" => "", "heading" => __("Hide first (hours) column", "timetable"), "param_name" => "hide_hours_column", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "dropdown", "class" => "", "heading" => __("Show end hour in first (hours) column", "timetable"), "param_name" => "show_end_hour", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "dropdown", "class" => "", "heading" => __("Event block layout", "timetable"), "param_name" => "event_layout", "value" => array(__("Type 1", "timetable") => "1", __("Type 2", "timetable") => "2", __("Type 3", "timetable") => "3", __("Type 4", "timetable") => "4", __("Type 5", "timetable") => "5")), array("type" => "dropdown", "class" => "", "heading" => __("Hide empty rows", "timetable"), "param_name" => "hide_empty", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "dropdown", "class" => "", "heading" => __("Disable event url", "timetable"), "param_name" => "disable_event_url", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "dropdown", "class" => "", "heading" => __("Text align", "timetable"), "param_name" => "text_align", "value" => array(__("center", "timetable") => "center", __("left", "timetable") => "left", __("right", "timetable") => "right")), array("type" => "textfield", "class" => "", "heading" => __("Id", "timetable"), "param_name" => "id", "value" => ""), array("type" => "textfield", "class" => "", "heading" => __("Row height (in px)", "timetable"), "param_name" => "row_height", "value" => "31"), array("type" => "dropdown", "class" => "", "heading" => __("Responsive", "timetable"), "param_name" => "responsive", "value" => array(__("Yes", "timetable") => "1", __("No", "timetable") => "0")), array("type" => "dropdown", "class" => "", "heading" => __("Event Description in responsive mode", "timetable"), "param_name" => "event_description_responsive", "value" => array(__("None", "timetable") => "none", __("Only Description 1", "timetable") => "description-1", __("Only Description 2", "timetable") => "description-2", __("Description 1 and Description 2", "timetable") => "description-1-and-description-2")), array("type" => "dropdown", "class" => "", "heading" => __("Collapse event hours in responsive mode", "timetable"), "param_name" => "collapse_event_hours_responsive", "value" => array(__("No", "timetable") => "0", __("Yes", "timetable") => "1")), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box background color", "timetable"), "param_name" => "box_bg_color", "value" => "00A27C"), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box hover background color", "timetable"), "param_name" => "box_hover_bg_color", "value" => "1F736A"), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box text color", "timetable"), "param_name" => "box_txt_color", "value" => "FFFFFF"), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box hover text color", "timetable"), "param_name" => "box_hover_txt_color", "value" => "FFFFFF"), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box hours text color", "timetable"), "param_name" => "box_hours_txt_color", "value" => "FFFFFF"), array("type" => "colorpicker", "class" => "", "heading" => __("Timetable box hours hover text color", "timetable"), "param_name" => "box_hours_hover_txt_color", "value" => "FFFFFF"), array("type" => "colorpicker", "class" => "", "heading" => __("Filter control background color", "timetable"), "param_name" => "filter_color", "value" => "00A27C"), array("type" => "colorpicker", "class" => "", "heading" => __("Row 1 style background color", "timetable"), "param_name" => "row1_color", "value" => "F0F0F0"), array("type" => "colorpicker", "class" => "", "heading" => __("Row 2 style background color", "timetable"), "param_name" => "row2_color", "value" => ""), array("type" => "textfield", "class" => "", "heading" => __("Table header font", "timetable"), "param_name" => "font_custom", "value" => ""), array("type" => "dropdown", "class" => "", "heading" => __("or choose Google font", "timetable"), "param_name" => "font", "value" => $google_fonts_array), array("type" => "dropdownmulti", "class" => "", "heading" => __("Google font subset", "timetable"), "param_name" => "font_subset", "value" => array("", "arabic", "hebrew", "telugu", "cyrillic-ext", "cyrillic", "devanagari", "greek-ext", "greek", "vietnamese", "latin-ext", "latin", "khmer"), "dependency" => array("element" => "font", "not_empty" => true, "callback" => "timetable_font_subset_init")), array("type" => "textfield", "class" => "", "heading" => __("Font size (in px)", "timetable"), "param_name" => "font_size", "value" => ""), array("type" => "textarea", "class" => "", "heading" => __("Custom CSS", "timetable"), "param_name" => "custom_css", "value" => ""))));
}
コード例 #2
0
    function timetable_admin_page()
    {
        //get events list
        $events_list = get_posts(array('posts_per_page' => -1, 'nopaging' => true, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'events'));
        //get weekdays list
        $weekdays_list = get_posts(array('posts_per_page' => -1, 'nopaging' => true, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'timetable_weekdays'));
        //get all hour categories
        global $wpdb;
        $query = "SELECT distinct(category) AS category FROM " . $wpdb->prefix . "event_hours AS t1\n\t\t\t\tLEFT JOIN {$wpdb->posts} AS t2 ON t1.event_id=t2.ID \n\t\t\t\tWHERE \n\t\t\t\tt2.post_type='events'\n\t\t\t\tAND t2.post_status='publish'\n\t\t\t\tAND category<>''";
        $hour_categories = $wpdb->get_results($query);
        //events string
        $events_string = "";
        $events_select_list = "";
        foreach ($events_list as $event) {
            $events_select_list .= '<option value="' . urldecode($event->post_name) . '">' . $event->post_title . ' (id: ' . $event->ID . ')' . '</option>';
            $events_string .= $event->post_name . (end($events_list) != $event ? "," : "");
        }
        //events categories string
        $events_categories_list = "";
        $events_categories = get_terms("events_category");
        foreach ($events_categories as $events_category) {
            $events_categories_list .= '<option value="' . urldecode(esc_attr($events_category->slug)) . '">' . $events_category->name . '</option>';
        }
        //weekdays string
        $weekdays_string = "";
        $weekdays_select_list = "";
        foreach ($weekdays_list as $weekday) {
            $weekdays_select_list .= '<option value="' . urldecode($weekday->post_name) . '">' . $weekday->post_title . ' (id: ' . $weekday->ID . ')' . '</option>';
            $weekdays_string .= $weekday->post_name . (end($weekdays_list) != $weekday ? "," : "");
        }
        //get google fonts
        $fontsArray = timetable_get_google_fonts();
        $fontsHtml = "";
        if (isset($fontsArray)) {
            $fontsCount = count($fontsArray->items);
            for ($i = 0; $i < $fontsCount; $i++) {
                $variantsCount = count($fontsArray->items[$i]->variants);
                if ($variantsCount > 1) {
                    for ($j = 0; $j < $variantsCount; $j++) {
                        $fontsHtml .= '<option value="' . $fontsArray->items[$i]->family . ":" . $fontsArray->items[$i]->variants[$j] . '">' . $fontsArray->items[$i]->family . ":" . $fontsArray->items[$i]->variants[$j] . '</option>';
                    }
                } else {
                    $fontsHtml .= '<option value="' . $fontsArray->items[$i]->family . '">' . $fontsArray->items[$i]->family . '</option>';
                }
            }
        }
        ?>
		<div class="wrap">
			<h2><?php 
        _e("Timetable Dummy Content", "timetable");
        ?>
</h2>
		</div>
		<div>
			<input type="button" class="button" name="timetable_import_dummy" id="import_dummy" value="<?php 
        _e('Import dummy content', 'timetable');
        ?>
" />
			<span class="spinner" style="float: none; margin-top: 4px;"></span>
			<img id="dummy_content_tick" src="<?php 
        echo WP_PLUGIN_URL;
        ?>
/timetable/admin/images/tick.png" />
			<div id="dummy_content_info"></div>
		</div>
		<div class="wrap">
			<h2><?php 
        _e("Timetable Shortcode Generator", "timetable");
        ?>
</h2>
		</div>
		<div class="timetable_shortcode_container">
			<input style="width: 630px;" type="text" class="regular-text tt_shortcode" value="[tt_timetable]" data-default="[tt_timetable]" name="shortcode">
			<a href="#" id="copy_to_clipboard1" class="button-primary"><?php 
        _e("Copy to Clipboard", "timetable");
        ?>
</a>
			<span class="copy_info"><?php 
        _e("Shortcode has been copied to clipboard!", 'timetable');
        ?>
</span>
		</div>
		<form action="<?php 
        echo $_SERVER['REQUEST_URI'];
        ?>
" method="post" id="timetable_settings">
			<div id="timetable_configuration_tabs">
				<ul class="nav-tabs">
					<li class="nav-tab">
						<a href="#tab-main">
							<?php 
        _e('Main configuration', 'timetable');
        ?>
						</a>
					</li>
					<li class="nav-tab">
						<a href="#tab-colors">
							<?php 
        _e('Colors', 'timetable');
        ?>
						</a>
					</li>
					<li class="nav-tab">
						<a href="#tab-fonts">
							<?php 
        _e('Fonts', 'timetable');
        ?>
						</a>
					</li>
					<li class="nav-tab">
						<a href="#tab-custom-css">
							<?php 
        _e('Custom CSS', 'timetable');
        ?>
						</a>
					</li>
				</ul>
				<div id="tab-main">
					<table class="form-table">
						<tbody>
							<tr valign="top">
								<th scope="row">
									<label for="event">
										<?php 
        _e("Events", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="event" id="event" multiple="multiple">
										<?php 
        echo $events_select_list;
        ?>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Select the events that are to be displayed in timetable. Hold the CTRL key to select multiple items.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="event">
										<?php 
        _e("Event categories", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="event_category" id="event_category" multiple="multiple">
										<?php 
        echo $events_categories_list;
        ?>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Select the events categories that are to be displayed in timetable. Hold the CTRL key to select multiple items.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="hour_category">
										<?php 
        _e("Hour categories", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="hour_category" id="hour_category" multiple="multiple">
										<?php 
        foreach ($hour_categories as $hour_category) {
            echo '<option value="' . $hour_category->category . '">' . $hour_category->category . '</option>';
        }
        ?>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Select the hour categories (if defined for existing event hours) for events that are to be displayed in timetable. Hold the CTRL key to select multiple items.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="weekdays">
										<?php 
        _e("Columns", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="weekday" id="weekday" multiple="multiple">
										<?php 
        echo $weekdays_select_list;
        ?>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Select the columns that are to be displayed in timetable. Hold the CTRL key to select multiple items.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="measure">
										<?php 
        _e("Hour measure", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="measure" id="measure">
										<option value="1"><?php 
        _e("Hour (1h)", "timetable");
        ?>
</option>
										<option value="0.5"><?php 
        _e("Half hour (30min)", "timetable");
        ?>
</option>
										<option value="0.25"><?php 
        _e("Quarter hour (15min)", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Choose hour measure for event hours.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="filter_style">
										<?php 
        _e("Filter style", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="filter_style" id="filter_style">
										<option value="dropdown_list"><?php 
        _e("Dropdown list", "timetable");
        ?>
</option>
										<option value="tabs"><?php 
        _e("Tabs", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Choose between dropdown menu and tabs for event filtering.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="filter_kind">
										<?php 
        _e("Filter kind", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="filter_kind" id="filter_kind">
										<option value="event"><?php 
        _e("By event", "timetable");
        ?>
</option>
										<option value="event_category"><?php 
        _e("By event category", "timetable");
        ?>
</option>
										<option value="event_and_event_category"><?php 
        _e("By event and event category", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Choose between filtering by events or events categories.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="filter_label">
										<?php 
        _e("Filter label", "timetable");
        ?>
									</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="All Events" id="filter_label" name="filter_label">
								</td>
								<td>
									<span class="description"><?php 
        _e("Specify text label for all events.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top" class="filter_label_2 tt_hide">
								<th scope="row">
									<label for="filter_label_2">
										<?php 
        _e("Filter label 2", "timetable");
        ?>
									</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="All Events Categories" id="filter_label_2" name="filter_label_2">
								</td>
								<td>
									<span class="description"><?php 
        _e("Specify text label for all events categories.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="time_format">
										<?php 
        _e("Time format", "timetable");
        ?>
									</label>
								</th>
								<td>
									<fieldset>
										<legend class="screen-reader-text"><span><?php 
        _e("Time format", "timetable");
        ?>
</span></legend>
										<label title="H.i">
											<input type="radio" checked="checked" value="H.i" name="time_format"> 
											<span>09.03</span>
										</label>
										<br>
										<label title="H:i">
											<input type="radio" value="H:i" name="time_format"> 
											<span>09:03</span>
										</label>
										<br>
										<label title="g:i a">
											<input type="radio" value="g:i a" name="time_format"> 
											<span>9:03 am</span>
										</label>
										<br>
										<label title="g:i A">
											<input type="radio" value="g:i A" name="time_format"> 
											<span>9:03 AM</span>
										</label>
										<br>
										<label>
											<input type="radio" value="custom" id="time_format_custom_radio" name="time_format"> 
											<?php 
        _e("Custom: ", "timetable");
        ?>
										</label>
										<input type="text" class="small-text" value="H.i" name="time_format_custom" id="time_format"> 
										<span class="example"> 9:03 am</span> 
										<span class="spinner"></span>
									</fieldset>
								</td>
								<td></td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="hide_all_events_view">
										<?php 
        _e("Hide 'All Events' view", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="hide_all_events_view" id="hide_all_events_view">
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes to hide All Events view.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="hide_hours_column">
										<?php 
        _e("Hide first (hours) column", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="hide_hours_column" id="hide_hours_column">
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes to hide timetable column with hours.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="show_end_hour">
										<?php 
        _e("Show end hour in first (hours) column", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="show_end_hour" id="show_end_hour">
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes to show both start and end hour in timetable column with hours.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="event_layout">
										<?php 
        _e("Event block layout", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="event_layout" id="event_layout">
										<option value="1"><?php 
        _e("Type 1", "timetable");
        ?>
</option>
										<option value="2"><?php 
        _e("Type 2", "timetable");
        ?>
</option>
										<option value="3"><?php 
        _e("Type 3", "timetable");
        ?>
</option>
										<option value="4"><?php 
        _e("Type 4", "timetable");
        ?>
</option>
										<option value="5"><?php 
        _e("Type 5", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Select one of the available event block layouts.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="hide_empty">
										<?php 
        _e("Hide empty rows", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="hide_empty" id="hide_empty">
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes to hide timetable rows without events.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="disable_event_url">
										<?php 
        _e("Disable event url", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="disable_event_url" id="disable_event_url">
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes for nonclickable event blocks.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="text_align">
										<?php 
        _e("Text align", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="text_align" id="text_align">
										<option value="center"><?php 
        _e("center", "timetable");
        ?>
</option>
										<option value="left"><?php 
        _e("left", "timetable");
        ?>
</option>
										<option value="right"><?php 
        _e("right", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Specify text align in timetable event block.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="row_height">
										<?php 
        _e("Id", "timetable");
        ?>
									</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="" id="id" name="id">
								</td>
								<td>
									<span class="description"><?php 
        _e("Assign a unique identifier to a timetable if you use more than one table on a single page. Otherwise, leave this field blank.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="row_height">
										<?php 
        _e("Row height (in px)", "timetable");
        ?>
									</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="31" id="row_height" name="row_height">
								</td>
								<td>
									<span class="description"><?php 
        _e("Specify timetable row height in pixels.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="responsive">
										<?php 
        _e("Responsive", "timetable");
        ?>
									</label>
								</th>
								<td>
									<select name="responsive" id="responsive">
										<option value="1"><?php 
        _e("Yes", "timetable");
        ?>
</option>
										<option value="0"><?php 
        _e("No", "timetable");
        ?>
</option>
									</select>
								</td>
								<td>
									<span class="description"><?php 
        _e("Set to Yes to adjust timetable to mobile devices.", 'timetable');
        ?>
</span>
								</td>
							</tr>
							<?php 
        /*
        <tr valign="top">
        	<th scope="row">
        		<label for="direction">
        			<?php _e("Direction", "timetable"); ?>
        		</label>
        	</th>
        	<td>
        		<select name="direction" id="direction">
        			<option value="ltr"><?php _e("LTR (Left to Right)", "timetable"); ?></option>
        			<option value="rtl"><?php _e("RTL (Right to Left)", "timetable"); ?></option>
        		</select>
        	</td>
        	<td>
        		<span class="description"><?php _e("Change timetable mode between LTR and RTL", 'timetable'); ?></span>
        	</td>
        </tr>
        */
        ?>
						</tbody>
					</table>
				</div>
				<div id="tab-colors">
					<table class="form-table">
						<tbody>
							<tr>
								<th scope="row">
									<label for="box_bg_color">
										<?php 
        _e('Timetable box background color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #00A27C"></span>
									<input class="regular-text color" type="text" id="box_bg_color" name="box_bg_color" value="00A27C" data-default-color="00A27C" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="box_hover_bg_color">
										<?php 
        _e('Timetable box hover background color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #1F736A"></span>
									<input class="regular-text color" type="text" id="box_hover_bg_color" name="box_hover_bg_color" value="1F736A" data-default-color="1F736A" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="box_txt_color">
										<?php 
        _e('Timetable box text color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #FFFFFF"></span>
									<input class="regular-text color" type="text" id="box_txt_color" name="box_txt_color" value="FFFFFF" data-default-color="FFFFFF" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="box_hover_txt_color">
										<?php 
        _e('Timetable box hover text color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #FFFFFF"></span>
									<input class="regular-text color" type="text" id="box_hover_txt_color" name="box_hover_txt_color" value="FFFFFF" data-default-color="FFFFFF" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="box_hours_txt_color">
										<?php 
        _e('Timetable box hours text color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #FFFFFF"></span>
									<input class="regular-text color" type="text" id="box_hours_txt_color" name="box_hours_txt_color" value="FFFFFF" data-default-color="FFFFFF" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="box_hours_hover_txt_color">
										<?php 
        _e('Timetable box hours hover text color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #FFFFFF"></span>
									<input class="regular-text color" type="text" id="box_hours_hover_txt_color" name="box_hours_hover_txt_color" value="FFFFFF" data-default-color="FFFFFF" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="filter_color">
										<?php 
        _e('Filter control background color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #00A27C"></span>
									<input class="regular-text color" type="text" id="filter_color" name="filter_color" value="00A27C" data-default-color="00A27C" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="row1_color">
										<?php 
        _e('Row 1 style background color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: #F0F0F0"></span>
									<input class="regular-text color" type="text" id="row1_color" name="row1_color" value="F0F0F0" data-default-color="F0F0F0" />
								</td>
							</tr>
							<tr>
								<th scope="row">
									<label for="row2_color">
										<?php 
        _e('Row 2 style background color', 'timetable');
        ?>
									</label>
								</th>
								<td>
									<span class="color_preview" style="background-color: transparent"></span>
									<input class="regular-text color" type="text" id="row2_color" name="row2_color" value="" data-default-color="transparent" />
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div id="tab-fonts">
					<table class="form-table">
						<tbody>
							<!--<tr valign="top">
								<th scope="row" class="header_row" colspan="2">
									<label>
										<?php 
        _e("Table header font", 'timetable');
        ?>
									</label>
								</th>
							</tr>-->
							<tr valign="top">
								<th scope="row">
									<label for="timetable_font_custom"><?php 
        _e("Enter font name", 'timetable');
        ?>
</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="" id="timetable_font_custom" name="timetable_font_custom">
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="timetable_font"><?php 
        _e("or choose Google font", 'timetable');
        ?>
</label>
								</th>
								<td>
									<select name="timetable_font" id="timetable_font" class="google_font_chooser">
										<option value=""><?php 
        _e("Default", 'timetable');
        ?>
</option>
										<?php 
        echo $fontsHtml;
        ?>
									</select>
									<span class="spinner"></span>
								</td>
							</tr>
							<tr valign="top" class="fontSubsetRow">
								<th scope="row">
									<label for="timetable_font_subset"><?php 
        _e("Google font subset", 'timetable');
        ?>
</label>
								</th>
								<td>
									<select name="timetable_font_subset[]" id="timetable_font_subset" class="fontSubset" multiple="multiple"></select>
								</td>
							</tr>
							<tr valign="top">
								<th scope="row">
									<label for="timetable_font_size"><?php 
        _e("Font size (in px)", 'timetable');
        ?>
</label>
								</th>
								<td>
									<input type="text" class="regular-text" value="" id="timetable_font_size" name="timetable_font_size">
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div id="tab-custom-css">
					<table class="form-table">
						<tbody>
							<tr valign="top">
								<th scope="row">
									<label for="timetable_custom_css"><?php 
        _e("Custom CSS", 'timetable');
        ?>
</label>
								</th>
								<td>
									<textarea id="timetable_custom_css" name="timetable_custom_css" style="width: 540px; height: 200px;"></textarea>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</form>
		<div class="timetable_shortcode_container">
			<input style="width: 630px;" type="text" class="regular-text tt_shortcode" value="[tt_timetable]" data-default="[tt_timetable]" name="shortcode">
			<a href="#" id="copy_to_clipboard2" class="button-primary"><?php 
        _e("Copy to Clipboard", "timetable");
        ?>
</a>
			<span class="copy_info"><?php 
        _e("Shortcode has been copied to clipboard!", 'timetable');
        ?>
</span>
		</div>
		<?php 
    }