Changeset 2088
- Timestamp:
- 02/22/10 21:19:03 (13 years ago)
- Location:
- plugins/eventdata
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/eventdata/_admin.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/eventdata/_define.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 17 17 /* Description*/ "Add period to your posts", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 8',19 /* Version */ '0.9', 20 20 /* Permissions */ 'usage,contentadmin,eventdata' 21 21 ); 22 /* date */ #20 09121222 /* date */ #20100222 23 23 ?> -
plugins/eventdata/_install.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 45 45 $si = new dbStruct($core->con,$core->prefix); 46 46 $changes = $si->synchronize($s); 47 48 47 # Settings options 49 $core->blog->settings->setNameSpace('eventdata'); 50 $core->blog->settings->put('eventdata_active', 48 $s = $core->blog->settings; 49 $s->setNameSpace('eventdata'); 50 $s->put('eventdata_active', 51 51 false,'boolean','eventdata plugin enabled',false,true); 52 $ core->blog->settings->put('eventdata_blog_menu',52 $s->put('eventdata_blog_menu', 53 53 false,'boolean','eventdata icon on blog menu',false,true); 54 $ core->blog->settings->put('eventdata_public_active',54 $s->put('eventdata_public_active', 55 55 false,'boolean','eventdata public page enabled',false,true); 56 $ core->blog->settings->put('eventdata_importexport_active',56 $s->put('eventdata_importexport_active', 57 57 true,'boolean','Enabled import/export behaviors',false,true); 58 58 # Settings templates 59 $ core->blog->settings->put('eventdata_tpl_title',59 $s->put('eventdata_tpl_title', 60 60 'Events','string','Public page title',false,true); 61 $ core->blog->settings->put('eventdata_tpl_desc',61 $s->put('eventdata_tpl_desc', 62 62 '','string','Public page description',false,true); 63 $ core->blog->settings->put('eventdata_tpl_dis_bhv',63 $s->put('eventdata_tpl_dis_bhv', 64 64 false,'boolean','Disable public entry behavior',false,true); 65 $ core->blog->settings->put('eventdata_tpl_theme',65 $s->put('eventdata_tpl_theme', 66 66 'default','string','Public page template',false,true); 67 $ core->blog->settings->put('eventdata_tpl_cats',67 $s->put('eventdata_tpl_cats', 68 68 '','string','Redirected categories',false,true); 69 $ core->blog->settings->put('eventdata_no_cats',69 $s->put('eventdata_no_cats', 70 70 '','string','Unlisted categories',false,true); 71 71 $s->setNameSpace('system'); 72 72 # Set version 73 $core->setVersion('eventdata',$ core->plugins->moduleInfo('eventdata','version'));73 $core->setVersion('eventdata',$new_version); 74 74 return true; 75 75 } -
plugins/eventdata/_prepend.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 34 34 'eventstheme','^eventstheme/(.+)$',array('eventdataPublic','eventdatastheme')); 35 35 # Add eventdata report on plugin activityReport 36 if (defined('ACTIVITY_REPORT')) 37 { 36 if (defined('ACTIVITY_REPORT')) { 38 37 require_once dirname(__FILE__).'/inc/lib.rateit.activityreport.php'; 39 38 } -
plugins/eventdata/_public.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 627 627 628 628 # Period 629 if (preg_match('%(^|/)(started|notstarted|scheduled|ongoing|outgoing|finished|notfinished|all)( .*?)$%',$args,$m)) {629 if (preg_match('%(^|/)(started|notstarted|scheduled|ongoing|outgoing|finished|notfinished|all)(/|^)(.*?)$%',$args,$m)) { 630 630 $post_params['period'] = $m[2]; 631 631 632 if ('' != $m[3]) { 633 $exp = explode('/',$m[3]); 634 635 if (isset($exp[1]) && preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/',urldecode($exp[1]))) 636 $post_params['eventdata_start'] = urldecode($exp[1]); 637 638 if (isset($exp[2]) && preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/',urldecode($exp[2]))) 639 $post_params['eventdata_end'] = urldecode($exp[2]); 632 if (strlen($m[4]) > 1) { 633 $exp = explode('/',$m[4]); 634 635 if (isset($exp[0]) && preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/',urldecode($exp[0]),$m)) 636 $post_params['eventdata_start'] = urldecode($exp[0]); 637 638 if (isset($exp[1]) && preg_match('/^([0-9]{4})-([0-9]{2})-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/',urldecode($exp[1]),$m)) { 639 $post_params['eventdata_end'] = urldecode($exp[1]); 640 $_ctx->evdt = array('year'=>$m[1],'month'=>$m[2]); 641 } 640 642 } 641 643 -
plugins/eventdata/_uninstall.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 19 19 /* description */ __('delete all settings') 20 20 ); 21 22 21 $this->addUserAction( 23 22 /* type */ 'tables', … … 26 25 /* description */ __('delete table') 27 26 ); 28 29 27 $this->addUserAction( 30 28 /* type */ 'plugins', … … 33 31 /* description */ __('delete plugin files') 34 32 ); 35 36 33 $this->addUserAction( 37 34 /* type */ 'versions', … … 41 38 ); 42 39 43 44 # Keep table on delete from pluginsBeforeDelete45 46 40 $this->addDirectAction( 47 41 /* type */ 'settings', … … 50 44 /* description */ sprintf(__('delete all %s settings'),'eventdata') 51 45 ); 52 46 $this->addDirectAction( 47 /* type */ 'tables', 48 /* action */ 'delete', 49 /* ns */ 'eventdata', 50 /* description */ sprintf(__('delete %s table'),'eventdata') 51 ); 53 52 $this->addDirectAction( 54 53 /* type */ 'plugins', … … 57 56 /* description */ sprintf(__('delete %s plugin files'),'eventdata') 58 57 ); 59 60 58 $this->addDirectAction( 61 59 /* type */ 'versions', … … 64 62 /* description */ sprintf(__('delete %s version number'),'eventdata') 65 63 ); 66 67 64 ?> -
plugins/eventdata/_widgets.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 140 140 __('Title:'), 141 141 __('Events calendar'),'text'); 142 $w->eventdatacalendar->setting('weekstart', 143 __('First day of week:'),'0','combo', 144 array(__('Sunday')=>0,__('Monday')=>1)); 142 145 # Home only 143 146 $w->eventdatacalendar->setting('homeonly', … … 210 213 $end_day = dt::dt2str('%Y%m%d',$rs->eventdata_end); 211 214 212 $over_format = ($start_day == $end_day && $w->over_day_format ) ?215 $over_format = ($start_day == $end_day && $w->over_day_format != '') ? 213 216 $w->over_day_format : $w->over_format; 214 217 215 $item_format = ($start_day == $end_day && $w->item_day_format ) ?218 $item_format = ($start_day == $end_day && $w->item_day_format != '') ? 216 219 $w->item_day_format : $w->item_format; 217 220 … … 273 276 $end_day = dt::dt2str('%Y%m%d',$rs->eventdata_end); 274 277 275 $item_format = ($start_day == $end_day && $w->item_day_format ) ?278 $item_format = ($start_day == $end_day && $w->item_day_format != '') ? 276 279 $w->item_day_format : $w->item_format; 277 280 … … 302 305 public static function calendar($w) 303 306 { 304 global $core; 307 global $core, $_ctx; 308 309 $weekstart = $w->weekstart == 1 ? 1 : 0; 310 311 $year = $_ctx->exists('evdt') ? $_ctx->evdt['year'] : null; 312 $month = $_ctx->exists('evdt') ? $_ctx->evdt['month'] : null; 305 313 306 314 # Generic calendar Object 307 $res = eventdata::arrayCalendar($core );315 $res = eventdata::arrayCalendar($core,$year,$month,$weekstart); 308 316 309 317 return -
plugins/eventdata/inc/class.dc.eventdata.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 22 22 { 23 23 $this->core =& $core; 24 $this->con = &$this->core->con;24 $this->con = $this->core->con; 25 25 $this->table = $this->core->prefix.'eventdata'; 26 26 } … … 195 195 public function countEventOfDay($y,$m,$d) 196 196 { 197 $ts_start = sprintf('%4d-%02d-%02d 00:00:00',$y,$m,$d);198 $ts_end = sprintf('%4d-%02d-%02d 23:59:59',$y,$m,$d);197 $ts_start = date('Y-m-d H:i:s',mktime(0,0,0,$m,$d+1,$y)); 198 $ts_end = date('Y-m-d H:i:s',mktime(0,0,0,$m,$d,$y)); 199 199 200 200 $rs = $this->getEventdata('eventdata',null,$ts_start,$ts_end,null,'ongoing'); -
plugins/eventdata/inc/class.dc.eventdata.rest.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/eventdata/inc/class.eventdata.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 125 125 126 126 # ts 127 $ts = strtotime(date('Y-m-01 00:00:00',strtotime($year.'-'.$month.'-01 00:00:00'))); 128 129 $prev_ts = strtotime(date('Y-m-01 00:00:00',strtotime($year.'-'.($month - 1).'-01 00:00:00'))); 130 $next_ts = strtotime(date('Y-m-01 00:00:00',strtotime($year.'-'.($month + 1).'-01 00:00:00'))); 127 $dt = date('Y-m-01 00:00:00',mktime(0,0,0,$month,1,$year)); 128 $ts = strtotime($dt); 129 $prev_dt = date('Y-m-01 00:00:00',mktime(0,0,0,$month - 1,1,$year)); 130 $prev_ts = strtotime($prev_dt); 131 $next_dt = date('Y-m-01 00:00:00',mktime(0,0,0,$month + 1,1,$year)); 132 $nurl_dt = date('Y-m-01 00:00:00',mktime(0,0,0,$month + 2,1,$year)); 133 $next_ts = strtotime($next_dt); 131 134 132 135 $res->year = $year; … … 136 139 # caption 137 140 $res->caption = array( 141 'prev_url' => urlencode($dt).'/'.urlencode($prev_dt), 138 142 'prev_txt' => dt::str('%B %Y',$prev_ts), 139 143 'current' => dt::str('%B %Y',$ts), 140 'prev_txt' => dt::str('%B %Y',$next_ts) 144 'next_url' => urlencode($nurl_dt).'/'.urlencode($next_dt), 145 'next_txt' => dt::str('%B %Y',$next_ts) 141 146 ); 142 147 … … 190 195 # Caption 191 196 if ($rs->caption) { 197 $base = $core->blog->url.$core->url->getBase('eventdatapage').'/ongoing/'; 198 192 199 $res .= " <caption>\n"; 193 200 if (!empty($rs->caption['prev_url'])) 194 $res .= " <a href=\"".$ rs->caption['prev_url']."\">".$rs->caption['prev_txt']."</a> \n";201 $res .= " <a href=\"".$base.$rs->caption['prev_url']."\" title=\"".$rs->caption['prev_txt']."\">«</a> \n"; 195 202 196 203 $res .= " ".$rs->caption['current']."\n"; 197 204 198 205 if (!empty($rs->caption['next_url'])) 199 $res .= " <a href=\"".$ rs->caption['next_url']."\">".$rs->caption['next_txt']."</a> \n";206 $res .= " <a href=\"".$base.$rs->caption['next_url']."\" title=\"".$rs->caption['next_txt']."\">»</a> \n"; 200 207 201 208 $res .= " </caption>\n"; … … 215 222 $res .= " <tbody>\n"; 216 223 217 foreach($rs->rows as $r => $ fields) {224 foreach($rs->rows as $r => $days) { 218 225 $res .= " <tr>\n"; 219 foreach($ fields as $f => $field) {220 if (' ' != $ field) {221 $count = $eventdata->countEventOfDay($rs->year,$rs->month,$ field);226 foreach($days as $f => $day) { 227 if (' ' != $day) { 228 $count = $eventdata->countEventOfDay($rs->year,$rs->month,$day); 222 229 223 230 if ($count != 0) { 224 $ field=231 $day = 225 232 '<a href="'. 226 233 $core->blog->url.$core->url->getBase('eventdatapage').'/ongoing/'. 227 urlencode( sprintf('%4d-%02d-%02d 00:00:00',$rs->year,$rs->month,$field)).'/'.228 urlencode( sprintf('%4d-%02d-%02d 00:00:00',$rs->year,$rs->month,$field)).234 urlencode(date('Y-m-d H:i:s',mktime(0,0,0,$rs->month,$day+1,$rs->year))).'/'. 235 urlencode(date('Y-m-d H:i:s',mktime(0,0,0,$rs->month,$day,$rs->year))). 229 236 '" title="'. 230 237 ($count == 1 ? __('one event') : sprintf(__('%s events'),$count)). 231 '">'.$ field.'</a>';238 '">'.$day.'</a>'; 232 239 } 233 240 } 234 $res .= " <td".(2 < strlen($ field) ? ' class="eventsday"' : '').">".$field."</td>\n";241 $res .= " <td".(2 < strlen($day) ? ' class="eventsday"' : '').">".$day."</td>\n"; 235 242 } 236 243 $res .= " </tr>\n"; -
plugins/eventdata/inc/lib.eventdata.list.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/eventdata/inc/lib.rateit.activityreport.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 57 57 $cur->post_id 58 58 ); 59 60 59 $GLOBALS['core']->activityReport->addLog('eventdata','set',$logs); 61 60 } … … 65 64 $post_id 66 65 ); 67 68 66 $GLOBALS['core']->activityReport->addLog('eventdata','delete',$logs); 69 67 } 70 public static function eventdata update($type,$post_id,$start,$end,$location,$new_start,$new_end,$new_location)68 public static function eventdataUpdate($type,$post_id,$start,$end,$location,$new_start,$new_end,$new_location) 71 69 { 72 70 $logs = array( … … 76 74 $location 77 75 ); 78 79 76 $GLOBALS['core']->activityReport->addLog('eventdata','update',$logs); 80 77 } -
plugins/eventdata/index.php
r1977 r2088 3 3 # This file is part of eventdata, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/eventdata/js/admin.js
r1977 r2088 2 2 * This file is part of eventdata, a plugin for Dotclear 2. 3 3 * 4 * Copyright (c) 2009 JC Denis and contributors4 * Copyright (c) 2009-2010 JC Denis and contributors 5 5 * jcdenis@gdwd.com 6 6 * -
plugins/eventdata/js/post.js
r1977 r2088 2 2 * This file is part of eventdata, a plugin for Dotclear 2. 3 3 * 4 * Copyright (c) 2009 JC Denis and contributors4 * Copyright (c) 2009-2010 JC Denis and contributors 5 5 * jcdenis@gdwd.com 6 6 * -
plugins/eventdata/locales/fr/main.lang.php
r1977 r2088 1 1 <?php 2 2 // Language: français 3 // Module: eventdata - 0. 84 // Date: 20 09-12-12 20:52:273 // Module: eventdata - 0.9 4 // Date: 2010-02-22 20:05:51 5 5 // Translated with dcTranslater - 1.3 6 6 … … 189 189 $GLOBALS['__l10n']['Events calendar'] = 'Calendrier des événements'; 190 190 191 #_widgets.php:143 192 $GLOBALS['__l10n']['First day of week:'] = 'Premier jour de la semaine :'; 193 191 194 #default-templates/eventdata-default/eventdataentryaftercontent.html:7 192 195 #default-templates/eventdata-noviny/eventdataentrybeforecontent.html:7 … … 203 206 $GLOBALS['__l10n']['to'] = 'à'; 204 207 208 #default-templates/eventdata-noviny/eventdatas.html:71 209 $GLOBALS['__l10n']['This event\'s entries Rss feed'] = 'Flux des événements des billets'; 210 211 #default-templates/eventdata-noviny/eventdatas.html:71 212 $GLOBALS['__l10n']['This event\'s entries feed'] = 'Flux des événements des billets'; 213 205 214 #default-templates/eventdata-noviny/eventdatas.html:85 206 215 $GLOBALS['__l10n']['Comments:'] = 'Commentaires :'; … … 227 236 $GLOBALS['__l10n']['instantaneous'] = 'instantané'; 228 237 229 #inc/class.eventdata.php:1 88238 #inc/class.eventdata.php:193 230 239 $GLOBALS['__l10n']['Calendar'] = 'Calendrier'; 231 240 232 #inc/class.eventdata.php:23 0241 #inc/class.eventdata.php:237 233 242 $GLOBALS['__l10n']['one event'] = 'Un événement'; 234 243 235 #inc/class.eventdata.php:23 0244 #inc/class.eventdata.php:237 236 245 $GLOBALS['__l10n']['%s events'] = '% événements'; 237 246 -
plugins/eventdata/locales/fr/main.po
r1977 r2088 1 1 # Language: français 2 # Module: eventdata - 0. 83 # Date: 20 09-12-12 20:52:272 # Module: eventdata - 0.9 3 # Date: 2010-02-22 20:05:51 4 4 # Translated with translater 1.3 5 5 … … 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: eventdata 0. 8\n"9 "Project-Id-Version: eventdata 0.9\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 20 09-12-12T20:52:27+00:00\n"11 "PO-Revision-Date: 2010-02-22T20:05:51+00:00\n" 12 12 "Last-Translator: JC Denis\n" 13 13 "Language-Team: \n" … … 246 246 msgstr "Calendrier des événements" 247 247 248 #: _widgets.php:143 249 msgid "First day of week:" 250 msgstr "Premier jour de la semaine :" 251 248 252 #: default-templates/eventdata-default/eventdataentryaftercontent.html:7 249 253 #: default-templates/eventdata-noviny/eventdataentrybeforecontent.html:7 … … 263 267 msgstr "à" 264 268 269 #: default-templates/eventdata-noviny/eventdatas.html:71 270 msgid "This event's entries Rss feed" 271 msgstr "Flux des événements des billets" 272 273 #: default-templates/eventdata-noviny/eventdatas.html:71 274 msgid "This event's entries feed" 275 msgstr "Flux des événements des billets" 276 265 277 #: default-templates/eventdata-noviny/eventdatas.html:85 266 278 msgid "Comments:" … … 295 307 msgstr "instantané" 296 308 297 #: inc/class.eventdata.php:1 88309 #: inc/class.eventdata.php:193 298 310 msgid "Calendar" 299 311 msgstr "Calendrier" 300 312 301 #: inc/class.eventdata.php:23 0313 #: inc/class.eventdata.php:237 302 314 msgid "one event" 303 315 msgstr "Un événement" 304 316 305 #: inc/class.eventdata.php:23 0317 #: inc/class.eventdata.php:237 306 318 msgid "%s events" 307 319 msgstr "% événements" -
plugins/eventdata/release.txt
r1977 r2088 1 1 x.x.x xxxxxxxx 2 2 - Not added rate for event (plugin rateIt) 3 - Missing Next/Previous in calendar widget 3 4 0.9 20100222 5 - Fixed bug of first day on widget 6 - Fixed bug of one day event on widget 7 - Added Next/Previous in calendar widget 4 8 5 9 0.8 20091212
Note: See TracChangeset
for help on using the changeset viewer.