/
bmlt.module
160 lines (136 loc) · 4.78 KB
/
bmlt.module
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
// $Id$
\file bmlt.module
\brief The implementation of the Drupal BMLT satellite server module.
\version 3.10.0
This file is part of the Basic Meeting List Toolbox (BMLT).
Find out more at: http://magshare.org/bmlt
BMLT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BMLT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this code. If not, see <http://www.gnu.org/licenses/>.
*/
require_once( dirname( __FILE__ ) . '/bmlt-drupal-satellite-plugin.php' );
/***********************************************/
/**
\brief This displays the actual BMLT content if the
text contains the BMLT shortcodes or HTML comments.
*/
function bmlt_filter( $op = 'list',
$delta = 0,
$format = -1,
$text = '',
$cache_id = 0
)
{
global $BMLTPluginOp;
switch( $op )
{
case 'list':
$text = array( $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['add_instance'] ) );
break;
case 'no cache':
return true;
break;
case 'description':
$text = $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['add_instance'] );
break;
case 'prepare':
$text = _bmlt_prepare( $text );
break;
case 'process':
$text = _bmlt_process( $text );
break;
}
return $text;
}
/***********************************************/
/**
\brief Sets up the menu for the BMLT
*/
function bmlt_menu( )
{
global $BMLTPluginOp;
$items = array('admin/settings/bmlt' => array(
'title' => $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['bmlt_settings'] ),
'description' => $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['describe_admin'] ),
'page callback' => 'bmlt_admin_form',
'access arguments' => array( $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['access_admin'] ) )
)
);
return $items;
}
/***********************************************/
/**
\brief This function returns the HTML for the BMLT admin.
*/
function bmlt_admin_form( )
{
global $BMLTPluginOp;
$BMLTPluginOp->admin_ajax_handler();
$BMLTPluginOp->admin_head();
return $BMLTPluginOp->return_admin_page();
}
/***********************************************/
/**
\brief This function sets up the header for the module.
*/
function bmlt_boot( )
{
global $BMLTPluginOp;
$BMLTPluginOp->ajax_router();
}
/***********************************************/
/**
\brief This tells Drupal 7 about our filter.
*/
function bmlt_filter_info()
{
global $BMLTPluginOp;
return array( 'bmlt' => array( 'title' => $BMLTPluginOp->process_text( $BMLTPluginOp->local_strings['en']['add_instance'] ),
'prepare callback' => '_bmlt_prepare',
'process callback' => '_bmlt_process',
'cache' => false
)
);
}
/***********************************************/
/**
\brief
*/
function _bmlt_prepare($in_text,
$in_filter = null
)
{
global $BMLTPluginOp;
if ( $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'simple_search_list' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt_map' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt_simple' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt_mobile' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt_table' )
|| $BMLTPluginOp->get_shortcode ( $in_text, 'bmlt_quicksearch' )
)
{
$BMLTPluginOp->standard_head( $in_text );
}
return $in_text;
}
/***********************************************/
/**
\brief
*/
function _bmlt_process($in_text,
$in_filter = null
)
{
global $BMLTPluginOp;
return $BMLTPluginOp->content_filter( $in_text );
}