__construct();
}
/**
* Init all variables when WP is ready
*
* @action evenpost_init
* @filter eventpost_default_list_shema
* @filter eventpost_list_shema
*/
public function init(){
$this->META_START = 'event_begin';
$this->META_END = 'event_end';
$this->META_COLOR = 'event_color';
// http://codex.wordpress.org/Geodata
$this->META_ADD = 'geo_address';
$this->META_LAT = 'geo_latitude';
$this->META_LONG = 'geo_longitude';
$this->list_id = 0;
$this->NomDuMois = array('', __('Jan', 'event-post'), __('Feb', 'event-post'), __('Mar', 'event-post'), __('Apr', 'event-post'), __('May', 'event-post'), __('Jun', 'event-post'), __('Jul', 'event-post'), __('Aug', 'event-post'), __('Sept', 'event-post'), __('Oct', 'event-post'), __('Nov', 'event-post'), __('Dec', 'event-post'));
$this->Week = array(__('Sunday', 'event-post'), __('Monday', 'event-post'), __('Tuesday', 'event-post'), __('Wednesday', 'event-post'), __('Thursday', 'event-post'), __('Friday', 'event-post'), __('Saturday', 'event-post'));
$this->maps = $this->get_maps();
$this->settings = $this->get_settings();
do_action('evenpost_init', $this);
$this->Shortcodes = new EventPost_Shortcodes();
// Edit
add_action('add_meta_boxes', array(&$this, 'add_custom_box'));
foreach($this->settings['posttypes'] as $posttype){
add_filter('manage_'.$posttype.'_posts_columns', array(&$this, 'columns_head'), 2);
add_action('manage_'.$posttype.'_posts_custom_column', array(&$this, 'columns_content'), 10, 2);
}
if (!empty($this->settings['markpath']) && !empty($this->settings['markurl'])) {
$this->markpath = ABSPATH.'/'.$this->settings['markpath'];
$this->markurl = $this->settings['markurl'];
} else {
$this->markpath = plugin_dir_path(__FILE__) . 'markers/';
$this->markurl = plugins_url('/markers/', __FILE__);
}
$this->dateformat = str_replace(array('yy', 'mm', 'dd'), array('Y', 'm', 'd'), __('yy-mm-dd', 'event-post'));
$this->default_list_shema = apply_filters('eventpost_default_list_shema', array(
'container' => '
<%type% class="event_loop %id% %class%" id="%listid%" style="%style%" %attributes%>%list%
%type%>',
'item' => '
<%child% class="event_item %class%" data-color="%color%">
%event_thumbnail%
%event_title%
%event_date%
%event_cat%
%event_location%
%event_excerpt%
%child%>'
));
$this->list_shema = apply_filters('eventpost_list_shema',$this->default_list_shema);
$this->map_interactions=array(
'DragRotate'=>__('Drag Rotate', 'event-post'),
'DoubleClickZoom'=>__('Double Click Zoom', 'event-post'),
'DragPan'=>__('Drag Pan', 'event-post'),
'PinchRotate'=>__('Pinch Rotate', 'event-post'),
'PinchZoom'=>__('Pinch Zoom', 'event-post'),
'KeyboardPan'=>__('Keyboard Pan', 'event-post'),
'KeyboardZoom'=>__('Keyboard Zoom', 'event-post'),
'MouseWheelZoom'=>__('Mouse Wheel Zoom', 'event-post'),
'DragZoom'=>__('Drag Zoom', 'event-post'),
);
}
public function register_widgets(){
register_widget('EventPost_List');
register_widget('EventPost_Map');
register_widget('EventPost_Cal');
}
/**
* Usefull hexadecimal to decimal converter. Returns an array of RGB from a given hexadecimal color.
* @param string $color
* @return array $color($R, $G, $B)
*/
public function hex2dec($color = '000000') {
$tbl_color = array();
if (!strstr('#', $color)){
$color = '#' . $color;
}
$tbl_color['R'] = hexdec(substr($color, 1, 2));
$tbl_color['G'] = hexdec(substr($color, 3, 2));
$tbl_color['B'] = hexdec(substr($color, 5, 2));
return $tbl_color;
}
/**
* Fetch all registered image sizes
* @global array $_wp_additional_image_sizes
* @return array
*/
function get_thumbnail_sizes(){
global $_wp_additional_image_sizes;
$sizes = array('thumbnail', 'medium', 'large', 'full');
foreach(array_keys($_wp_additional_image_sizes) as $size){
$sizes[]=$size;
}
return $sizes;
}
/**
* Just for localization
*/
private function no_use() {
__('Add calendar and/or geolocation metadata on posts', 'event-post');
__('Event Post', 'event-post');
}
/**
* Get blog settings, load and saves default settings if needed. Can be filterred using
*
* ``
*
* @action eventpost_getsettings_action
* @filter eventpost_getsettings
* @return array
*/
public function get_settings() {
$ep_settings = get_option('ep_settings');
$reg_settings=false;
if(!is_array($ep_settings)){
$ep_settings = array();
}
if (!isset($ep_settings['dateformat']) || empty($ep_settings['dateformat'])) {
$ep_settings['dateformat'] = get_option('date_format');
$reg_settings=true;
}
if (!isset($ep_settings['timeformat']) || empty($ep_settings['timeformat'])) {
$ep_settings['timeformat'] = get_option('time_format');
$reg_settings=true;
}
if (!isset($ep_settings['tile']) || empty($ep_settings['tile']) || !isset($this->maps[$ep_settings['tile']])) {
$maps = array_keys($this->maps);
$ep_settings['tile'] = $this->maps[$maps[0]]['id'];
$reg_settings=true;
}
if (!isset($ep_settings['cache']) || !is_numeric($ep_settings['cache'])) {
$ep_settings['cache'] = 0;
$reg_settings=true;
}
if (!isset($ep_settings['export']) || empty($ep_settings['export'])) {
$ep_settings['export'] = 'both';
$reg_settings=true;
}
if (!isset($ep_settings['dateforhumans'])) {
$ep_settings['dateforhumans'] = 1;
$reg_settings=true;
}
if (!isset($ep_settings['emptylink'])) {
$ep_settings['emptylink'] = 1;
$reg_settings=true;
}
if (!isset($ep_settings['markpath'])) {
$ep_settings['markpath'] = '';
$reg_settings=true;
}
if (!isset($ep_settings['singlepos']) || empty($ep_settings['singlepos'])) {
$ep_settings['singlepos'] = 'after';
$reg_settings=true;
}
if (!isset($ep_settings['loopicons'])) {
$ep_settings['loopicons'] = 1;
$reg_settings=true;
}
if (!isset($ep_settings['adminpos']) || empty($ep_settings['adminpos'])) {
$ep_settings['adminpos'] = 'side';
$reg_settings=true;
}
if (!isset($ep_settings['container_shema']) ) {
$ep_settings['container_shema'] = '';
$reg_settings=true;
}
if (!isset($ep_settings['item_shema']) ) {
$ep_settings['item_shema'] = '';
$reg_settings=true;
}
if(!isset($ep_settings['datepicker']) || !in_array($ep_settings['datepicker'], array('simple', 'native'))){
$ep_settings['datepicker']='simple';
$reg_settings=true;
}
if(!isset($ep_settings['posttypes']) || !is_array($ep_settings['posttypes'])){
$ep_settings['posttypes']=array('post');
$reg_settings=true;
}
do_action_ref_array('eventpost_getsettings_action', array(&$ep_settings, &$reg_settings));
//Save settings not changed
if($reg_settings===true){
update_option('ep_settings', $ep_settings);
}
return apply_filters('eventpost_getsettings', $ep_settings);
}
/**
* Checks if HTML schemas are not empty
* @param array $shema
* @return array
*/
public function custom_shema($shema){
if(!empty($this->settings['container_shema'])){
$shema['container']=$this->settings['container_shema'];
}
if(!empty($this->settings['item_shema'])){
$shema['item']=$this->settings['item_shema'];
}
return $shema;
}
/**
* Parse the maps.json file. Custom maps can be added by using the `eventpost_getsettings` filter like the following example:
*
* ```
* 'Myt custom map',
* 'id'=>'custom_map',
* 'urls'=>array(
* 'http://a.customurl.org/{z}/{x}/{y}.png',
* 'http://b.customurl.org/{z}/{x}/{y}.png',
* 'http://c.customurl.org/{z}/{x}/{y}.png',
* )
* ));
* return $maps;
* }
* ?>
* ```
*
* @filter eventpost_maps
* @return array of map arrays ['name', 'id', 'urls']
*/
public function get_maps() {
$maps = array();
$filename = plugin_dir_path(__FILE__) . 'maps.json';
if (is_file($filename) && (false !== $json = json_decode(file_get_contents($filename)))) {
// Convert objects to array to ensure retrocompatibility
$arrays = array();
foreach($json as $map){
$arrays[$map->id] = (array) $map;
}
$maps = apply_filters('eventpost_maps', $arrays);
}
return $maps;
}
/**
*
* @return array
*/
public function get_colors() {
$colors = array();
if (is_dir($this->markpath)) {
$files = scandir($this->markpath);
foreach ($files as $file) {
if (substr($file, -4) == '.png') {
$colors[substr($file, 0, -4)] = $this->markurl . $file;
}
}
}
return $colors;
}
/**
*
* @param string $color
* @return sring
*/
public function get_marker($color) {
if (is_file($this->markpath . $color . '.png')) {
return $this->markurl . $color . '.png';
}
return plugins_url('/markers/ffffff.png', __FILE__);
}
/**
* Enqueue CSS files
*/
public function load_styles() {
//CSS
wp_register_style('event-post', plugins_url('/css/eventpost.min.css', __FILE__), false, $this->version);
wp_enqueue_style('event-post', plugins_url('/css/eventpost.min.css', __FILE__), false, $this->version);
wp_enqueue_style('openlayers', plugins_url('/css/openlayers.css', __FILE__), false, $this->version);
wp_enqueue_style('dashicons', includes_url('/css/dashicons.min.css'));
}
/**
* Enqueue Editor style
*/
public function editor_styles() {
add_editor_style( plugins_url('/css/eventpost.min.css', __FILE__) );
}
/**
* Enqueue JS files
*/
public function load_scripts($deps = array('jquery')) {
// JS
wp_enqueue_script('jquery', false, false, false, true);
wp_enqueue_script('event-post', plugins_url('/js/eventpost.min.js', __FILE__), $deps, $this->version, true);
wp_localize_script('event-post', 'eventpost_params', array(
'imgpath' => plugins_url('/img/', __FILE__),
'maptiles' => $this->maps,
'defaulttile' => $this->settings['tile'],
'ajaxurl' => admin_url() . 'admin-ajax.php',
'map_interactions'=>$this->map_interactions,
));
}
/**
* Enqueue JS files for maps
*/
public function load_map_scripts() {
// JS
wp_enqueue_script('openlayers', plugins_url('/js/OpenLayers.js', __FILE__), false, $this->version, true);
$this->load_scripts(array('jquery', 'openlayers'));
if(is_admin()){
$this->admin_scripts(array('jquery', 'openlayers'));
}
}
/**
* Enqueue CSS files in admin
*/
public function admin_head() {
$page = basename($_SERVER['SCRIPT_NAME']);
if( $page!='post-new.php' && !($page=='post.php' && filter_input(INPUT_GET, 'action')=='edit') && !($page=='options-general.php' && filter_input(INPUT_GET, 'page')=='event-settings') ){
return;
}
wp_enqueue_style('openlayers', plugins_url('/css/openlayers.css', __FILE__), false, $this->version);
wp_enqueue_style('jquery-ui', plugins_url('/css/jquery-ui.css', __FILE__), false, $this->version);
wp_enqueue_style('event-post-admin', plugins_url('/css/eventpost-admin.css', __FILE__), false, $this->version);
}
/**
* Enqueue JS files in admin
*/
public function admin_scripts($deps = array('jquery')) {
$page = basename($_SERVER['SCRIPT_NAME']);
if( $page!='post-new.php' && !($page=='post.php' && filter_input(INPUT_GET, 'action')=='edit') && !($page=='options-general.php' && filter_input(INPUT_GET, 'page')=='event-settings') ){
return;
}
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-effects-core');
wp_enqueue_script('jquery-effects-shake');
if($this->settings['datepicker']=='simple' || (isset($_GET['page']) && $_GET['page']=='event-settings')){
wp_enqueue_script('jquery-ui-datepicker');
$deps[] = 'jquery-ui-datepicker';
}
wp_enqueue_script('event-post-admin', plugins_url('/js/eventpost-admin.min.js', __FILE__), $deps, $this->version, true);
$language = get_bloginfo('language');
if (strpos($language, '-') > -1) {
$language = strtolower(substr($language, 0, 2));
}
wp_localize_script('event-post-admin', 'eventpost', array(
'imgpath' => plugins_url('/img/', __FILE__),
'date_choose' => ''.__('Choose', 'event-post').'',
'date_format' => __('yy-mm-dd', 'event-post'),
'more_icons' => __('More icons', 'event-post'),
'pick_a_date'=>__('Pick a date','event-post'),
'use_current_location'=>__('Use my current location','event-post'),
'start_drag'=>__('Click to
drag the map
and change location','event-post'),
'empty_address'=>__('Be kind to fill a non empty address :)', 'event-post'),
'search'=>__('Type an address', 'event-post'),
'stop_drag'=>_x('Done','Stop allowing to drag the map', 'event-post'),
'datepickeri18n'=>array(
'order'=>__( '%1$s %2$s, %3$s @ %4$s:%5$s', 'event-post'),
'day'=>__('Day', 'event-post'),
'month'=>__('Month', 'event-post'),
'year'=>__('Day', 'event-post'),
'hour'=>__('Hour', 'event-post'),
'minute'=>__('Minute', 'event-post'),
'ok'=>__('OK', 'event-post'),
'cancel'=>__('Cancel', 'event-post'),
'edit'=>__('Edit', 'event-post'),
'months'=>$this->NomDuMois,
),
'META_START' => $this->META_START,
'META_END' => $this->META_END,
'META_ADD' => $this->META_ADD,
'META_LAT' => $this->META_LAT,
'META_LONG' => $this->META_LONG,
'lang'=>$language,
'maptiles' => $this->maps,
'defaulttile' => $this->settings['tile']
));
}
/**
* Add custom header meta for single events
*/
public function single_header() {
if (is_single()) {
$event = $this->retreive();
if ($event->address != '' || ($event->lat != '' && $event->long != '')) {
?>
start != '' && $event->end != '') {
?>
settings['dateforhumans']){
if (is_numeric($date) && date('d/m/Y', $date) == date('d/m/Y')) {
return __('today', 'event-post');
} elseif (is_numeric($date) && date('d/m/Y', $date) == date('d/m/Y', strtotime('+1 day'))) {
return __('tomorrow', 'event-post');
} elseif (is_numeric($date) && date('d/m/Y', $date) == date('d/m/Y', strtotime('-1 day'))) {
return __('yesterday', 'event-post');
}
}
return date_i18n($format, $date);
}
/**
*
* @param timestamp $time_start
* @param timestamp $time_end
* @return string
*/
public function delta_date($time_start, $time_end){
if(!$time_start || !$time_end){
return;
}
//Display dates
$dates="\t\t\t\t".'
'.__('An events map', 'event-post').'
%1$s>', $type); } foreach ($events as $event) { $class_item = ($event->time_end >= current_time('timestamp')) ? 'event_future' : 'event_past'; if ($ep_settings['emptylink'] == 0 && empty($event->post_content)) { $event->permalink = '#' . $id . $this->list_id; } elseif(empty($ob->permalink)){ $event->permalink=$event->guid; } $list.=str_replace( apply_filters('eventpost_item_scheme_entities', array( '%child%', '%class%', '%color%', '%event_link%', '%event_thumbnail%', '%event_title%', '%event_date%', '%event_cat%', '%event_location%', '%event_excerpt%' )), apply_filters('eventpost_item_scheme_values', array( $child, $class_item, $event->color, $event->permalink, $thumbnail == true ? '' . get_the_post_thumbnail($event->root_ID, !empty($thumbnail_size) ? $thumbnail_size : 'thumbnail', array('class' => 'attachment-thumbnail wp-post-image event_thumbnail')) . '' : '', $event->post_title, $this->get_singledate($event, '', $context), $this->get_singlecat($event, '', $context), $this->get_singleloc($event, '', $context), $excerpt == true && $event->post_excerpt!='' ? ''.$event->post_excerpt.'' : '', ), $event), $item_schema ); } $attributes = ''; if($id == 'event_geolist'){ $attributes = 'data-tile="'.$tile.'" data-width="'.$width.'" data-height="'.$height.'" data-disabled-interactions="'; foreach($this->map_interactions as $int_key=>$int_name){ $attributes.=$atts[$int_key]==false ? $int_key.', ' : ''; } $attributes.='"'; } $ret.=str_replace( array( '%type%', '%id%', '%class%', '%listid%', '%style%', '%attributes%', '%list%' ), array( $type, $id, $class, $id . $this->list_id, (!empty($width) ? 'width:' . $width . ';' : '') . (!empty($height) ? 'height:' . $height . ';' : '') . $style, $attributes, $list ), $container_schema ); } return apply_filters('eventpost_listevents', $ret, $id.$this->list_id, $atts, $events, $context); } /** * get_events * @param array $atts * @filter eventpost_params * @filter eventpost_get_items * @return array of post_ids wich are events */ public function get_events($atts) { $requete = (shortcode_atts(apply_filters('eventpost_params', array( 'nb' => 5, 'future' => true, 'past' => false, 'geo' => 0, 'cat' => '', 'tag' => '', 'date' => '', 'orderby' => 'meta_value', 'orderbykey' => $this->META_START, 'order' => 'ASC', 'tax_name' => '', 'tax_term' => '', 'post_type'=> $this->settings['posttypes'] ), 'get_events'), $atts)); extract($requete); wp_reset_query(); $arg = array( 'post_type' => $post_type, 'posts_per_page' => $nb, 'meta_key' => $orderbykey, 'orderby' => $orderby, 'order' => $order ); if($tax_name=='category'){ $tax_name=''; $cat=$tax_term; } elseif($tax_name=='post-tag'){ $tax_name=''; $tag=$tax_term; } // CUSTOM TAXONOMY if ($tax_name != '' && $tax_term != '') { $arg[$tax_name] = $tax_term; } // CAT if ($cat != '') { if (preg_match('/[a-zA-Z]/i', $cat)) { $arg['category_name'] = $cat; } else { $arg['cat'] = $cat; } } // TAG if ($tag != '') { $arg['tag'] = $tag; } // DATES $meta_query = array( array( 'key' => $this->META_END, 'value' => '', 'compare' => '!=' ), array( 'key' => $this->META_END, 'value' => '0:0:00 0:', 'compare' => '!=' ), array( 'key' => $this->META_END, 'value' => ':00', 'compare' => '!=' ), array( 'key' => $this->META_START, 'value' => '', 'compare' => '!=' ), array( 'key' => $this->META_START, 'value' => '0:0:00 0:', 'compare' => '!=' ) ); if ($future == 0 && $past == 0) { $meta_query = array(); $arg['meta_key'] = null; $arg['orderby'] = null; $arg['order'] = null; } elseif ($future == 1 && $past == 0) { $meta_query[] = array( 'key' => $this->META_END, 'value' => current_time('mysql'), 'compare' => '>=', //'type'=>'DATETIME' ); } elseif ($future == 0 && $past == 1) { $meta_query[] = array( 'key' => $this->META_END, 'value' => current_time('mysql'), 'compare' => '<=', //'type'=>'DATETIME' ); } if ($date != '') { $date = date('Y-m-d', $date); $meta_query = array( array( 'key' => $this->META_END, 'value' => $date . ' 00:00:00', 'compare' => '>=', 'type' => 'DATETIME' ), array( 'key' => $this->META_START, 'value' => $date . ' 23:59:59', 'compare' => '<=', 'type' => 'DATETIME' ) ); } // GEO if ($geo == 1) { $meta_query[] = array( 'key' => $this->META_LAT, 'value' => '', 'compare' => '!=' ); $meta_query[] = array( 'key' => $this->META_LONG, 'value' => '', 'compare' => '!=' ); $arg['meta_key'] = $this->META_LAT; $arg['orderby'] = 'meta_value'; $arg['order'] = 'DESC'; } $arg['meta_query'] = $meta_query; $query_md5 = 'eventpost_' . md5(var_export($requete, true)); // Check if cache is activated if ($this->settings['cache'] == 1 && false !== ( $cached_events = get_transient($query_md5) )) { return apply_filters('eventpost_get_items', is_array($cached_events) ? $cached_events : array(), $requete, $arg); } $events = apply_filters('eventpost_get', '', $requete, $arg); if ('' === $events) { global $wpdb; $query = new WP_Query($arg); $events = $wpdb->get_col($query->request); foreach ($events as $k => $post) { $event = $this->retreive($post); $events[$k] = $event; } } if ($this->settings['cache'] == 1){ set_transient($query_md5, $events, 5 * MINUTE_IN_SECONDS); } return apply_filters('eventpost_get_items', $events, $requete, $arg); } /** * * @param object $event * @return object */ public function retreive($event = null) { global $EventPost_cache; $ob = get_post($event); if($ob->start){ return $ob; } if(isset($EventPost_cache[$ob->ID])){ return $EventPost_cache[$ob->ID]; } $ob->start = get_post_meta($ob->ID, $this->META_START, true); $ob->end = get_post_meta($ob->ID, $this->META_END, true); if (!$this->dateisvalid($ob->start)){ $ob->start = ''; } if (!$this->dateisvalid($ob->end)){ $ob->end = ''; } $ob->root_ID = $ob->ID; $ob->time_start = !empty($ob->start) ? strtotime($ob->start) : ''; $ob->time_end = !empty($ob->end) ? strtotime($ob->end) : ''; $ob->address = get_post_meta($ob->ID, $this->META_ADD, true); $ob->lat = get_post_meta($ob->ID, $this->META_LAT, true); $ob->long = get_post_meta($ob->ID, $this->META_LONG, true); $ob->color = get_post_meta($ob->ID, $this->META_COLOR, true); $ob->categories = get_the_category($ob->ID); $ob->permalink = get_permalink($ob->ID); $ob->blog_id = get_current_blog_id(); if ($ob->color == ''){ $ob->color = '000000'; } $EventPost_cache[$ob->ID] = apply_filters('eventpost_retreive', $ob); return $EventPost_cache[$ob->ID]; } /** * * @param mixte $_term * @param string $taxonomy * @param string $post_type */ public function retreive_term($_term=null, $taxonomy='category', $post_type='post') { $term = get_term($_term, $taxonomy); if(!$term){ return $term; } $term->start = $term->end = $term->time_start = $term->time_end = Null; $request = array( 'post_type'=>$post_type, 'tax_name'=>$term->taxonomy, 'tax_term'=>$term->slug, 'future'=>true, 'past'=>true, 'nb'=>-1, 'order'=>'ASC' ); $events = $this->get_events($request); $term->events_count = count($events); if($term->events_count){ $term->start = $events[0]->start; $term->time_start = $events[0]->time_start; $term->end = $events[$term->events_count-1]->end; $term->time_end = $events[$term->events_count-1]->time_end; } $request['order']='DESC'; $request['nb']=1; $request['orderbykey']=$this->META_END; $events = $this->get_events($request); if(count($events)){ $term->end = $events[0]->end; $term->time_end = $events[0]->time_end; } return $term; } /** ADMIN ISSUES * */ /** * add custom boxes in posts edit page */ public function add_custom_box() { foreach($this->settings['posttypes'] as $posttype){ add_meta_box('event_post_date', __('Event date', 'event-post'), array(&$this, 'inner_custom_box_date'), $posttype, apply_filters('eventpost_add_custom_box_position', $this->settings['adminpos'], $posttype), 'core'); add_meta_box('event_post_loc', __('Location', 'event-post'), array(&$this, 'inner_custom_box_loc'), $posttype, apply_filters('eventpost_add_custom_box_position', $this->settings['adminpos'], $posttype), 'core'); do_action('eventpost_add_custom_box', $posttype); } if(!function_exists('shortcode_ui_register_for_shortcode')){ add_meta_box('event_post_sc_edit', __('Events Shortcode editor', 'event-post'), array(&$this, 'inner_custom_box_edit'), 'page'); } } /** * display the date custom box */ public function inner_custom_box_date() { wp_nonce_field(plugin_basename(__FILE__), 'eventpost_nonce'); $post_id = get_the_ID(); $event = $this->retreive($post_id); $start_date = $event->start; $end_date = $event->end; $eventcolor = $event->color; $language = get_bloginfo('language'); if (strpos($language, '-') > -1) { $language = strtolower(substr($language, 0, 2)); } $colors = $this->get_colors(); ?>
$file): ?>
| ';
if ($datepicker == 1) {
$ret.=' ';
$ret.=' ';
$ret.=$annee;
$ret.=' ';
$ret.=' ';
$ret.=$this->NomDuMois[$mois];
$ret.=' ';
$ret.='';
$ret.=' ';
}
$ret.=' | ||||||
|---|---|---|---|---|---|---|
| ' . strtoupper(substr($this->Week[$w], 0, 1)) . ' | '; } $ret.='||||||
| '; if ($sqldate . '-' . ($NoJour<10?'0':'').$NoJour == $cejour) { $td = ' | '; } $ret.=$td; $ret.= $this->display_caldate(mktime(0, 0, 0, $mois, $NoJour, $annee), $cat, false, $colored, $thumbnail); $ret.=' | '; } else { $ret.=''; } $NoJour ++; } $ret.=' | ||||