Commit dc4ede0c authored by lucha's avatar lucha

new plugin: event-list

parent deb997c8
<?php
if(!defined('WPINC')) {
exit;
}
require_once( EL_PATH.'includes/options.php' );
// This class handles all available admin pages
class EL_Admin {
private static $instance;
private $options;
private function __construct() {
$this->options = &EL_Options::get_instance();
}
public static function &get_instance() {
// Create class instance if required
if(!isset(self::$instance)) {
self::$instance = new self();
}
// Return class instance
return self::$instance;
}
public function init_admin_page() {
// Register actions
add_action('admin_menu', array(&$this, 'register_pages'));
add_action('plugins_loaded', array(&$this, 'db_upgrade_check'));
add_action('right_now_content_table_end', array(&$this, 'add_events_to_right_now'));
// Register syncing if required
if(1 == $this->options->get('el_sync_cats')) {
add_action('create_category', array(&$this, 'action_add_category'));
add_action('edit_category', array(&$this, 'action_edit_category'));
add_action('delete_category', array(&$this, 'action_delete_category'));
}
}
/**
* Add and register all admin pages in the admin menu
*/
public function register_pages() {
// Main Menu page
add_menu_page(__('Event List','event-list'), __('Event List','event-list'), 'edit_posts', 'el_admin_main', array(&$this, 'show_main_page'), 'dashicons-calendar-alt', '22.2');
// All Events subpage
$page = add_submenu_page('el_admin_main', __('Events','event-list'), __('All Events','event-list'), 'edit_posts', 'el_admin_main', array(&$this, 'show_main_page'));
add_action('admin_print_scripts-'.$page, array(&$this, 'embed_main_scripts'));
// New Event subpage
$page = add_submenu_page('el_admin_main', __('Add New Event','event-list'), __('Add New','event-list'), 'edit_posts', 'el_admin_new', array(&$this, 'show_new_page'));
add_action('admin_print_scripts-'.$page, array(&$this, 'embed_new_scripts'));
// Categories subpage
$page = add_submenu_page('el_admin_main', __('Event List Categories','event-list'), __('Categories','event-list'), 'manage_categories', 'el_admin_categories', array(&$this, 'show_categories_page'));
add_action('admin_print_scripts-'.$page, array(&$this, 'embed_categories_scripts'));
// Settings subpage
$page = add_submenu_page('el_admin_main', __('Event List Settings','event-list'), __('Settings','event-list'), 'manage_options', 'el_admin_settings', array(&$this, 'show_settings_page'));
add_action('admin_print_scripts-'.$page, array(&$this, 'embed_settings_scripts'));
// About subpage
$page = add_submenu_page('el_admin_main', __('About Event List','event-list'), __('About','event-list'), 'edit_posts', 'el_admin_about', array(&$this, 'show_about_page'));
add_action('admin_print_scripts-'.$page, array(&$this, 'embed_about_scripts'));
}
public function db_upgrade_check() {
require_once(EL_PATH.'includes/db.php');
EL_Db::get_instance()->upgrade_check();
}
public function add_events_to_right_now() {
require_once(EL_PATH.'includes/db.php');
$num_events = EL_Db::get_instance()->get_num_events();
$event_link = 'admin.php?page=el_admin_main';
$out = '
<tr>
<td class="first b b-events"><a href="'.$event_link.'">'.$num_events.'</a></td>
<td class="t events"><a href="'.$event_link.'">'.__('Events','event-list').'</a></td>
</tr>';
echo $out;
}
public function show_main_page() {
require_once(EL_PATH.'admin/includes/admin-main.php');
EL_Admin_Main::get_instance()->show_main();
}
public function embed_main_scripts() {
require_once(EL_PATH.'admin/includes/admin-main.php');
EL_Admin_Main::get_instance()->embed_main_scripts();
}
public function show_new_page() {
require_once(EL_PATH.'admin/includes/admin-new.php');
EL_Admin_New::get_instance()->show_new();
}
public function embed_new_scripts() {
require_once(EL_PATH.'admin/includes/admin-new.php');
EL_Admin_New::get_instance()->embed_new_scripts();
}
public function show_categories_page() {
require_once(EL_PATH.'admin/includes/admin-categories.php');
EL_Admin_Categories::get_instance()->show_categories();
}
public function embed_categories_scripts() {
require_once(EL_PATH.'admin/includes/admin-categories.php');
EL_Admin_Categories::get_instance()->embed_categories_scripts();
}
public function show_settings_page() {
require_once(EL_PATH.'admin/includes/admin-settings.php');
EL_Admin_Settings::get_instance()->show_settings();
}
public function embed_settings_scripts() {
require_once(EL_PATH.'admin/includes/admin-settings.php');
EL_Admin_Settings::get_instance()->embed_settings_scripts();
}
public function show_about_page() {
require_once(EL_PATH.'admin/includes/admin-about.php');
EL_Admin_About::get_instance()->show_about();
}
public function embed_about_scripts() {
require_once(EL_PATH.'admin/includes/admin-about.php');
EL_Admin_About::get_instance()->embed_about_scripts();
}
public function action_add_category($cat_id) {
require_once(EL_PATH.'includes/categories.php');
EL_Categories::get_instance()->add_post_category($cat_id);
}
public function action_edit_category($cat_id) {
require_once(EL_PATH.'includes/categories.php');
EL_Categories::get_instance()->edit_post_category($cat_id);
}
public function action_delete_category($cat_id) {
require_once(EL_PATH.'includes/categories.php');
EL_Categories::get_instance()->delete_post_category($cat_id);
}
}
?>
.el-show-event-options {
list-style: circle inside;
}
.el-headline {
margin-top: 1.5em;
margin-bottom: 0.5em;
clear: both;
}
.el-atts-table {
border: 1px solid #aaa;
border-collapse: collapse;
width: 98%;
}
.el-atts-table th {
border: 1px solid #aaa;
padding: 3px 4px !important;
background: #eeeeee;
}
.el-atts-table td {
border: 1px solid #aaa;
padding: 2px 5px !important;
vertical-align: top;
}
.el-atts-table-name, .el-atts-table-options, .el-atts-table-default {
width: 110px;
}
.el-filterbar-table {
border: 1px solid #aaa;
border-collapse: collapse;
width: 100%;
margin: 0.2em 0 1.2em 0;
line-height: 1.6em;
}
.el-filterbar-table th {
border: 1px solid #aaa;
padding: 1px 3px !important;
background: #eeeeee;
}
.el-filterbar-table td {
border: 1px solid #aaa;
padding: 1px 4px !important;
vertical-align: top;
}
.el-filterbar-item, .el-filterbar-doption {
width: 85px;
}
.el-filterbar-options, .el-filterbar-values {
width: 90px;
}
.el-filterbar-default {
width: 70px;
}
.el-filterbar-desc2, .el-filterbar-for {
width: 270px;
}
ul.el-formats {
list-style: none;
}
.el-format-entry {
overflow: hidden;
clear: both;
padding-bottom: 0.5em;
}
div.el-format-name {
float: left;
width: 120px;
font-weight: bold;
}
div.el-format-desc {
float: left;
}
div.el-format-desc em {
font-weight: bold;
}
a.donate img {
margin: 3px;
}
.el-warning {
background: #fff;
border-left: 4px solid #dc3232;
margin: 5px 0 15px;
padding: 1px 12px;
}
ul.el-categories {
list-style: circle inside;
margin: 8px 0;
}
.el-event-header {
font-weight: bold;
}
.el-event-data {
font-style: italic;
}
.wp-list-table .column-date {
width: 105px;
}
.wp-list-table .column-title {
width: 35%;
}
.wp-list-table .column-location {
width: 25%
}
.wp-list-table .column-details {
width: 40%;
}
.wp-list-table .column-pub_user {
width: 105px;
}
.wp-list-table .column-pub_date {
width: 115px;
}
span.time {
font-style: italic;
}
\ No newline at end of file
#title, #location {
width: 400px;
}
span.date-wrapper, #start_date, #end_date, #time {
width: 130px;
}
p.note {
margin: 2px;
font-style: italic;
}
div#postbox-container-1 {
width: 260px !important;
}
span.date-wrapper {
position: relative;
display: inline-table;
}
span.date-wrapper i.dashicons {
display: inline-block;
position: absolute;
padding-top: 3px;
padding-right: 4px;
pointer-events: none;
right: 0px;
z-index: 1;
}
span.date-wrapper input {
padding-right: 24px;
position: relative;
}
.el-settings {
padding: 0 10px;
}
.form-table th, .form-table td {
vertical-align: top;
padding: 15px 10px 15px 0;
};
This diff is collapsed.
/*! jQuery UI - v1.11.4 - 2017-02-25
* http://jqueryui.com
* Includes: core.css, datepicker.css, theme.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
* Copyright jQuery Foundation and other contributors; Licensed MIT */
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
\ No newline at end of file
<?php
if(!defined('WPINC')) {
exit;
}
require_once(EL_PATH.'includes/options.php');
require_once(EL_PATH.'includes/daterange.php');
// This class handles all data for the admin about page
class EL_Admin_About {
private static $instance;
private $options;
private $daterange;
public static function &get_instance() {
// Create class instance if required
if(!isset(self::$instance)) {
self::$instance = new self();
}
// Return class instance
return self::$instance;
}
private function __construct() {
$this->options = EL_Options::get_instance();
$this->daterange = EL_Daterange::get_instance();
}
public function show_about() {
if(!current_user_can('edit_posts')) {
wp_die(__('You do not have sufficient permissions to access this page.'));
}
if(!isset($_GET['tab'])) {
$_GET['tab'] = 'general';
}
echo '<div class="wrap">
<div id="icon-edit-pages" class="icon32"><br /></div><h2>'.__('About Event List','event-list').'</h2>';
echo $this->show_tabs($_GET['tab']);
if('atts' == $_GET['tab']) {
$this->show_atts();
$this->show_filter_syntax();
$this->show_date_syntax();
$this->show_daterange_syntax();
}
else {
$this->show_help();
$this->show_author();
}
echo '
</div>';
}
public function embed_about_scripts() {
wp_enqueue_style('eventlist_admin_about', EL_URL.'admin/css/admin_about.css');
}
private function show_tabs($current = 'about') {
$tabs = array('general' => __('General','event-list'),
'atts' => __('Shortcode Attributes','event-list'));
$out = '<h3 class="nav-tab-wrapper">';
foreach($tabs as $tab => $name){
$class = ($tab == $current) ? ' nav-tab-active' : '';
$out .= '<a class="nav-tab'.$class.'" href="?page=el_admin_about&amp;tab='.$tab.'">'.$name.'</a>';
}
$out .= '</h3>';
return $out;
}
private function show_help() {
echo '
<h3 class="el-headline">'.__('Help and Instructions','event-list').'</h3>
<p>'.sprintf(__('You can manage the events %1$shere%2$s','event-list'), '<a href="admin.php?page=el_admin_main">', '</a>').'.</p>
<p>'.__('To show the events on your site you have 2 possibilities','event-list').':</p>
<ul class="el-show-event-options"><li>'.sprintf(__('you can place the <strong>shortcode</strong> %1$s on any page or post','event-list'), '<code>[event-list]</code>').'</li>
<li>'.sprintf(__('you can add the <strong>widget</strong> %1$s in your sidebars','event-list'), '"Event List"').'</li></ul>
<p>'.__('The displayed events and their style can be modified with the available widget settings and the available attributes for the shortcode.','event-list').'<br />
'.sprintf(__('A list of all available shortcode attributes with their descriptions is available in the %1$s tab.','event-list'), '<a href="admin.php?page=el_admin_about&tab=atts">'.__('Shortcode Attributes','event-list').'</a>').'<br />
'.__('The available widget options are described in their tooltip text.','event-list').'<br />
'.sprintf(__('If you enable one of the links options (%1$s or %2$s) in the widget you have to insert an URL to the linked event-list page.','event-list'), '"'.__('Add links to the single events','event-list').'"', '"'.__('Add a link to the Event List page','event-list').'"')
.__('This is required because the widget does not know in which page or post the shortcode was included.','event-list').'<br />
'.__('Additionally you have to insert the correct Shortcode id on the linked page. This id describes which shortcode should be used on the given page or post if you have more than one.','event-list')
.sprintf(__('The default value %1$s is normally o.k. (for pages with 1 shortcode only), but if required you can check the id by looking into the URL of an event link on your linked page or post.','event-list'), '[1]')
.sprintf(__('The id is available at the end of the URL parameters (e.g. %1$s).','event-list'), '<i>https://www.your-homepage.com/?page_id=99&amp;event_id<strong>1</strong>=11</i>').'
</p>
<p>'.sprintf(__('Be sure to also check the %1$s to get the plugin behaving just the way you want.','event-list'), '<a href="admin.php?page=el_admin_settings">'.__('Settings page','event-list').'</a>').'</p>';
}
private function show_author() {
echo '
<br />
<h3>'.__('About the plugin author','event-list').'</h3>
<div class="help-content">
<p>'.sprintf(__('This plugin is developed by %1$s, you can find more information about the plugin on the %2$s.','event-list'), 'mibuthu', '<a href="http://wordpress.org/plugins/event-list" target="_blank" rel="noopener">'.__('wordpress plugin site','event-list').'</a>').'</p>
<p>'.sprintf(__('If you like the plugin please rate it on the %1$s.','event-list'), '<a href="http://wordpress.org/support/view/plugin-reviews/event-list" target="_blank" rel="noopener">'.__('wordpress plugin review site','event-list').'</a>').'<br />
<p>'.__('If you want to support the plugin I would be happy to get a small donation','event-list').':<br />
<a class="donate" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W54LNZMWF9KW2" target="_blank" rel="noopener"><img src="'.EL_URL.'admin/images/paypal_btn_donate.gif" alt="PayPal Donation" title="Donate with PayPal" border="0"></a>
<a class="donate" href="https://flattr.com/submit/auto?user_id=mibuthu&url=https%3A%2F%2Fwordpress.org%2Fplugins%2Fevent-list" target="_blank" rel="noopener"><img src="'.EL_URL.'admin/images/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0"></a></p>
</div>';
}
private function show_atts() {
echo '
<h3 class="el-headline">'.__('Shortcode Attributes', 'event-list').'</h3>
<div>
'.__('You have the possibility to modify the output if you add some of the following attributes to the shortcode.','event-list').'<br />
'.sprintf(__('You can combine and add as much attributes as you want. E.g. the shortcode including the attributes %1$s and %2$s would looks like this:','event-list'), '"num_events"', '"show_filterbar"').'
<p><code>[event-list num_events=10 show_filterbar=false]</code></p>
<p>'.__('Below you can find a list of all supported attributes with their descriptions and available options:','event-list').'</p>';
echo $this->show_atts_table();
echo '
</div>';
}
private function show_atts_table() {
require_once(EL_PATH.'includes/sc_event-list.php');
$shortcode = &SC_Event_List::get_instance();
$shortcode->load_sc_eventlist_helptexts();
$atts = $shortcode->get_atts();
$out = '
<table class="el-atts-table">
<tr>
<th class="el-atts-table-name">'.__('Attribute name','event-list').'</th>
<th class="el-atts-table-options">'.__('Value options','event-list').'</th>
<th class="el-atts-table-default">'.__('Default value','event-list').'</th>
<th class="el-atts-table-desc">'.__('Description','event-list').'</th>
</tr>';
foreach($atts as $aname => $a) {
$out .= '
<tr>
<td>'.$aname.'</td>
<td>'.$a['val'].'</td>
<td>'.$a['std_val'].'</td>
<td>'.$a['desc'].'</td>
</tr>';
}
$out .= '
</table>';
return $out;
}
private function show_filter_syntax() {
echo '
<h3 class="el-headline">'.__('Filter Syntax','event-list').'</h3>
<p>'.__('For date and cat filters you can specify complex filters with the following syntax:','event-list').'</p>
<p>'.sprintf(__('You can use %1$s and %2$s connections to define complex filters. Additionally you can set brackets %3$s for nested queries.','event-list'), __('AND','event-list').' ( "<strong>&amp;</strong>" )', __('OR','event-list').' ( "<strong>&verbar;</strong>" '.__('or','event-list').' "<strong>&comma;</strong>" )', '( "<strong>(</strong>" '.__('and','event-list').' "<strong>)</strong>" )').'</p>
'.__('Examples for cat filters:','event-list').'
<p><code>tennis</code>&hellip; '.sprintf(__('Show all events with category %1$s.','event-list'), '"tennis"').'<br />
<code>tennis&comma;hockey</code>&hellip; '.sprintf(__('Show all events with category %1$s or %2$s.','event-list'), '"tennis"', '"hockey"').'<br />
<code>tennis&verbar;(hockey&amp;winter)</code>&hellip; '.sprintf(__('Show all events with category %1$s and all events where category %2$s as well as %3$s is selected.','event-list'), '"tennis"', '"hockey"', '"winter"').'</p>';
}
private function show_date_syntax() {
echo '
<h3 class="el-headline">'.__('Available Date Formats','event-list').'</h3>
<p>'.__('For date filters you can use the following date formats:','event-list').'</p>
<ul class="el-formats">
'.$this->show_formats($this->daterange->date_formats).'
</ul>';
}
private function show_daterange_syntax() {
echo '
<h3 class="el-headline">'.__('Available Date Range Formats','event-list').'</h3>
<p>'.__('For date filters you can use the following daterange formats:','event-list').'</p>
<ul class="el-formats">
'.$this->show_formats($this->daterange->daterange_formats).'
</ul>';
}
private function show_formats(&$formats_array) {
$out = '';
foreach($formats_array as $format) {
$out .= '
<li><div class="el-format-entry"><div class="el-format-name">'.$format['name'].':</div><div class="el-format-desc">';
if(isset($format['value'])) {
$out .= __('Value','event-list').': <em>'.$format['value'].'</em><br />';
}
$out .= $format['desc'].'<br />';
if(isset($format['examp'])) {
$out .= __('Example','event-list').': <em>'.$format['examp'].'</em>';
}
$out .= '</div></div></li>';
}
return $out;
}
}
?>
<?php
if(!defined('ABSPATH')) {
exit;
}
require_once(EL_PATH.'includes/db.php');
require_once(EL_PATH.'includes/categories.php');