psf
bootstrap.php
1 <?php
2 
3 // Part of php simple framework (psf)
4 
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // Copyright (c) Petr Bena <petr@bena.rocks> 2015 - 2018
16 
17 if (!defined("PSF_ENTRY_POINT"))
18  die("Not a valid psf entry point");
19 
20 require_once (dirname(__FILE__) . "/bootstrap/alert.php");
21 require_once (dirname(__FILE__) . "/bootstrap/button.php");
22 require_once (dirname(__FILE__) . "/bootstrap/containerfluid.php");
23 require_once (dirname(__FILE__) . "/bootstrap/checkbox.php");
24 require_once (dirname(__FILE__) . "/bootstrap/form.php");
25 require_once (dirname(__FILE__) . "/bootstrap/table.php");
26 require_once (dirname(__FILE__) . "/bootstrap/tabs.php");
27 require_once (dirname(__FILE__) . "/bootstrap/textbox.php");
28 require_once (dirname(__FILE__) . "/bootstrap/well.php");
29 
30 function bootstrap_init($page)
31 {
32  global $psf_bootstrap_css_url, $psf_bootstrap_js_url;
33  $bs = $psf_bootstrap_css_url;
34  if (!in_array($bs, $page->ExternalCss))
35  $page->ExternalCss[] = $bs;
36  $bs_j = $psf_bootstrap_js_url;
37  if (!in_array($bs_j, $page->ExternalJs))
38  $page->ExternalJs[] = $bs_j;
39  $page->Header_Meta["viewport"] = "width=device-width, initial-scale=1";
40 }