1
|
|
|
<?php |
|
|
|
|
2
|
|
|
require_once('class.SecurePage.php'); |
3
|
|
|
class ThemePage extends SecurePage |
|
|
|
|
4
|
|
|
{ |
5
|
|
|
public $theme_root; |
6
|
|
|
|
7
|
|
|
function __construct($title) |
|
|
|
|
8
|
|
|
{ |
9
|
|
|
parent::__construct($title, true); |
|
|
|
|
10
|
|
|
$root = $_SERVER['DOCUMENT_ROOT']; |
11
|
|
|
$script_dir = dirname(__FILE__); |
12
|
|
|
$this->theme_root = substr($script_dir, strlen($root)); |
13
|
|
|
$this->add_links(); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
function add_links() |
|
|
|
|
17
|
|
|
{ |
18
|
|
|
$dir = $this->theme_root; |
19
|
|
|
if(!FlipSession::isLoggedIn()) |
20
|
|
|
{ |
21
|
|
|
$this->add_link('Login', 'http://profiles.burningflipside.com/login.php?return='.$this->current_url()); |
|
|
|
|
22
|
|
|
} |
23
|
|
|
else |
24
|
|
|
{ |
25
|
|
|
if($this->user->isInGroupNamed('ThemeAdmins')) |
26
|
|
|
{ |
27
|
|
|
$this->add_link('Admin', $dir.'/_admin/'); |
|
|
|
|
28
|
|
|
} |
29
|
|
|
$secure_menu = array( |
30
|
|
|
'Tickets'=>'/tickets/index.php', |
31
|
|
|
'View Registrations'=>'/register/view.php', |
32
|
|
|
//'Theme Camp Registration'=>$dir.'/tc_reg.php', |
|
|
|
|
33
|
|
|
'Art Project Registration'=>'/register/art_reg.php', |
34
|
|
|
'Art Car Registration'=>'/register/artCar_reg.php', |
35
|
|
|
'Event Registration'=>'/register/event_reg.php' |
36
|
|
|
); |
37
|
|
|
$this->add_link('Secure', 'https://secure.burningflipside.com/', $secure_menu); |
|
|
|
|
38
|
|
|
$this->add_link('Logout', 'http://profiles.burningflipside.com/logout.php'); |
|
|
|
|
39
|
|
|
} |
40
|
|
|
$about_menu = array( |
41
|
|
|
'Burning Flipside'=>'http://www.burningflipside.com/about/event', |
42
|
|
|
'AAR, LLC'=>'http://www.burningflipside.com/LLC', |
43
|
|
|
'Privacy Policy'=>'http://www.burningflipside.com/about/privacy' |
44
|
|
|
); |
45
|
|
|
$this->add_link('About', 'http://www.burningflipside.com/about', $about_menu); |
|
|
|
|
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
?> |
|
|
|
|
49
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.