forked from nikrou/eventHandler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_prepend.php
More file actions
64 lines (54 loc) · 3.09 KB
/
Copy path_prepend.php
File metadata and controls
64 lines (54 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of eventHandler, a plugin for Dotclear 2.
#
# Copyright(c) 2014-2015 Nicolas Roudaire <nikrou77@gmail.com> http://www.nikrou.net
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')){return;}
global $__autoload, $core;
# Main class
$__autoload['eventHandler'] = dirname(__FILE__).'/inc/class.eventhandler.php';
$__autoload['eventHandlerAdminWidgets'] = dirname(__FILE__).'/inc/class.eventhandler.admin.widgets.php';
$__autoload['eventHandlerPublicWidgets'] = dirname(__FILE__).'/inc/class.eventhandler.public.widgets.php';
$__autoload['adminEventHandlerMiniList'] = dirname(__FILE__).'/inc/class.admin.eventhandler.minilist.php';
$__autoload['adminEventHandlertList'] = dirname(__FILE__).'/inc/class.admin.eventhandler.list.php';
$__autoload['adminEventHandlertPostsList'] = dirname(__FILE__).'/inc/class.admin.eventhandler.posts.list.php';
$__autoload['adminEventHandler'] = dirname(__FILE__).'/inc/class.admin.eventhandler.php';
$__autoload['publicEventHandler'] = dirname(__FILE__).'/inc/class.public.eventhandler.php';
$__autoload['tplEventHandler'] = dirname(__FILE__).'/inc/class.tpl.eventhandler.php';
$__autoload['urlEventHandler'] = dirname(__FILE__).'/inc/class.url.eventhandler.php';
$__autoload['rsExtEventHandlerPublic'] = dirname(__FILE__).'/inc/lib.eventhandler.rs.extension.php';
$__autoload['eventHandlerCalendar'] = dirname(__FILE__).'/inc/lib.eventhandler.calendar.php';
$__autoload['eventHandlerRestMethods'] = dirname(__FILE__).'/_services.php';
$__autoload['eventHandlerPublicRest'] = dirname(__FILE__).'/inc/lib.eventhandler.pubrest.php';
# Public page for an event
$core->url->register('eventhandler_single','day','^day/(.+)$',array('urlEventHandler','eventSingle'));
# Preview page
$core->url->register('eventhandler_preview','daypreview','^daypreview/(.+)$',array('urlEventHandler','eventPreview'));
# Public page for list of events
$core->url->register('eventhandler_list','days','^days(|/.+)$',array('urlEventHandler','eventList'));
# Feed of events
$core->url->register('eventhandler_feed','daysfeed','^daysfeed/(.+)$',array('urlEventHandler','eventFeed'));
# Public rest service
$core->url->register('eventhandler_pubrest','daysservice','^daysservice/$',array('urlEventHandler','eventService'));
# Add new post type for event
$core->setPostType('eventhandler','plugin.php?p=eventHandler&part=event&id=%d',$core->url->getBase('eventhandler_single').'/%s');
# Add sort ability on template
$core->addBehavior('templateCustomSortByAlias','eventHandlerCustomSortByAlias');
function eventHandlerCustomSortByAlias($alias) {
$alias['eventhandler'] = array(
'startdt' => 'event_startdt',
'enddt' => 'event_enddt'
);
}
# Admin rest method
$core->rest->addFunction('unbindEventOfPost',array('eventHandlerRestMethods','unbindEventOfPost'));