40 require_once(dirname(__FILE__) .
'/../config-bmlt-basic.inc.php');
42 define(
'ROOTPATH', __DIR__);
43 require_once(ROOTPATH .
'/vendor/bmlt/bmlt-satellite-base-class/bmlt-cms-satellite-plugin.php');
70 $this->my_shortcode = $in_shortcode;
81 echo $this->content_filter($this->my_shortcode);
100 $from_proxy = array_key_exists(
"HTTP_X_FORWARDED_PROTO", $_SERVER);
105 $https = $_SERVER[
'HTTP_X_FORWARDED_PROTO'] ==
'https';
106 if (array_key_exists(
"HTTP_X_FORWARDED_PORT", $_SERVER)) {
107 $port = intval($_SERVER[
'HTTP_X_FORWARDED_PORT']);
114 $port = $_SERVER[
'SERVER_PORT'];
116 $https = (!empty($_SERVER[
'HTTPS']) && (($_SERVER[
'HTTPS'] !==
'off') || ($port == 443)));
118 $server_path = $_SERVER[
'SERVER_NAME'];
119 $my_path = $_SERVER[
'PHP_SELF'];
120 $server_path .= trim((($https && ($port != 443)) || (!$https && ($port != 80))) ?
':' . $port :
'',
'/');
121 $server_path =
'http' . ($https ?
's' :
'') .
'://' . $server_path . $my_path;
134 $ret = isset($this->my_http_vars[
'base_url']) ? $this->my_http_vars[
'base_url'] : dirname($this->
get_ajax_base_uri()) .
'/bmlt-basic/vendor/bmlt/bmlt-satellite-base-class/';
151 $in_string = htmlspecialchars($in_string);
180 global $bmlt_basic_configuration_index;
184 if ($in_option_key != self::$admin2OptionsName) {
185 $index = intval(max($bmlt_basic_configuration_index - 1, intval(str_replace(self::$adminOptionsName .
'_',
'', $in_option_key))));
189 $ret = array (
'num_servers' => $bmlt_basic_configuration_index );
206 $in_check_mobile =
false
211 if (!$in_check_mobile && isset($this->my_http_vars[
'bmlt_settings_id']) && is_array($this->getBMLTOptions($this->my_http_vars[
'bmlt_settings_id']))) {
212 $my_option_id = $this->my_http_vars[
'bmlt_settings_id'];
214 $support_mobile = self::get_shortcode($in_text,
'bmlt_mobile');
216 if ($support_mobile ===
true) {
217 $options = $this->getBMLTOptions(1);
218 $support_mobile = strval($options[
'id']);
221 if ($in_check_mobile && $support_mobile && !isset($this->my_http_vars[
'BMLTPlugin_mobile']) && (self::mobile_sniff_ua($this->my_http_vars) !=
'xhtml')) {
222 $my_option_id = $support_mobile;
223 } elseif (!$in_check_mobile) {
224 if (isset($this->my_http_vars[
'bmlt_settings_id']) && intval($this->my_http_vars[
'bmlt_settings_id'])) {
225 $my_option_id = intval($this->my_http_vars[
'bmlt_settings_id']);
226 } elseif ($in_text) {
227 $my_option_id_content = parent::cms_get_page_settings_id($in_text, $in_check_mobile);
229 $my_option_id = $my_option_id_content ? $my_option_id_content : $my_option_id;
232 if (!$my_option_id) {
233 $options = $this->getBMLTOptions(1);
234 $my_option_id = $options[
'id'];
239 return $my_option_id;
250 $this->ajax_router();
252 $head_content =
"<!-- Added by the BMLT plugin 3.X. -->\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" /><meta http-equiv=\"Content-Style-Type\" content=\"text/css\" /><meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />";
256 if ($support_mobile) {
257 $mobile_options = $this->getBMLTOptions_by_id($support_mobile);
259 $support_mobile =
null;
264 if ($support_mobile && is_array($mobile_options) && count($mobile_options)) {
265 $mobile_url = $_SERVER[
'PHP_SELF'] .
'?BMLTPlugin_mobile&bmlt_settings_id=' . $support_mobile;
267 if (isset($this->my_http_vars[
'WML'])) {
268 $mobile_url .=
'&WML=' . intval($this->my_http_vars[
'WML']);
270 if (isset($this->my_http_vars[
'simulate_smartphone'])) {
271 $mobile_url .=
'&simulate_smartphone';
274 if (ob_get_contents()) {
278 header(
"location: $mobile_url");
282 $load_server_header = $this->get_shortcode($in_text,
'bmlt');
284 $this->my_http_vars[
'start_view'] = $options[
'bmlt_initial_view'];
286 $this->load_params();
288 $root_server_root = $options[
'root_server'];
290 $head_content .=
'<meta name="BMLT-Root-URI" content="' . htmlspecialchars($root_server_root) .
'" />';
292 $head_content .=
"\n" .
'<style type="text/css">' .
"\n";
293 $temp = self::stripFile(
"styles.css", $options[
'theme']);
295 $image_dir_path = $this->
get_plugin_path() .
'/themes/' . $options[
'theme'] .
'/images/';
296 $temp = str_replace(
'##-IMAGEDIR-##', $image_dir_path, $temp);
297 $head_content .=
"\t$temp\n";
299 $temp = self::stripFile(
"nouveau_map_styles.css", $options[
'theme']);
301 $image_dir_path = $this->
get_plugin_path() .
'/themes/' . $options[
'theme'] .
'/images/';
302 $temp = str_replace(
'##-IMAGEDIR-##', $image_dir_path, $temp);
303 $head_content .=
"\t$temp\n";
306 $head_content .= self::stripFile(
'table_styles.css') .
"\n";
307 $head_content .= self::stripFile(
'quicksearch.css') .
"\n";
309 $dirname = ROOTPATH .
'/vendor/bmlt/bmlt-satellite-base-class/themes';
310 $dir =
new DirectoryIterator($dirname);
312 foreach ($dir as $fileinfo) {
313 if (!$fileinfo->isDot()) {
314 $fName = $fileinfo->getFilename();
315 $temp = self::stripFile(
"table_styles.css", $fName);
317 $image_dir_path = $this->
get_plugin_path() .
'/themes/' . $fName .
'/images/';
318 $temp = str_replace(
'##-IMAGEDIR-##', $image_dir_path, $temp);
319 $head_content .=
"\t$temp\n";
321 $temp = self::stripFile(
"quicksearch.css", $fName);
323 $head_content .=
"\t$temp\n";
327 $head_content .= self::stripFile(
'responsiveness.css') .
"\n";
328 $head_content .=
"\n</style>\n";
329 $head_content .=
'<script type="text/javascript">';
331 $head_content .= self::stripFile(
'javascript.js');
333 if ($this->get_shortcode($in_text,
'bmlt_quicksearch')) {
334 $head_content .= self::stripFile(
'quicksearch.js') . (defined(
'_DEBUG_MODE_') ?
"\n" :
'');
337 if ($this->get_shortcode($in_text,
'bmlt_map')) {
338 $head_content .= self::stripFile(
'map_search.js');
341 if ($this->get_shortcode($in_text,
'bmlt_mobile')) {
342 $head_content .= self::stripFile(
'fast_mobile_lookup.js');
345 $head_content .=
'</script>';
347 return $head_content;
443 static $basic_bmlt_object;
445 if (!isset($basic_bmlt_object) && class_exists(
"bmlt_basic")) {
449 if ($basic_bmlt_object) {
450 $basic_bmlt_object->ajax_router();
452 echo
'UNABLE TO INITIALIZE THE BMLT SUBSYSTEM';
get_ajax_base_uri()
Return an HTTP path to the AJAX callback target. * *.
$my_shortcode
This will hold the given shortcode.
output_head($in_shortcode='[[bmlt]]')
Outputs the head HTML, CSS and JavaScript. *.
get_plugin_path()
Return an HTTP path to the plugin directory. * *.
cms_get_post_meta( $in_page_id, $in_settings_id)
This is declared to make it clear that we don't do post meta. * *.
cms_set_option( $in_option_key, $in_option_value)
You cannot set options in this implementation. * *.
cms_get_option($in_option_key)
This gets the admin options from the config file. * *.
admin_head()
No admin in this implementation. * *.
cms_delete_option($in_option_key)
You cannot delete options in this implementation. * *.
process_text($in_string)
This uses the CMS text processor (t) to process the given string. *This allows easier translation of ...
admin_page()
Prevents the admin page from being shown. *.
get_admin_form_uri()
We don't do admin in this variant, so this makes that clear. * *.
get_admin_ajax_base_uri()
We don't do admin in this variant, so this makes that clear. * *.
output_body()
Outputs the body HTML and JavaScript. *.
geDefaultBMLTOptions()
This gets the default admin options from the object (not the DB). * *.
cms_get_page_settings_id( $in_text, $in_check_mobile=false)
This function fetches the settings ID for a page (if there is one). *If $in_check_mobile is set to tr...
standard_head($in_text=null)
returns any necessary head content. *
global $bmlt_basic_configuration
These are used by the bmlt_basic class. Don't mess with them.