PageRenderTime 18ms CodeModel.GetById 2ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/halogy/application/views/includes/admin/header.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 244 lines | 226 code | 17 blank | 1 comment | 45 complexity | 13f2f5ad3118e4832ef6425249c73388 MD5 | raw file
  1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  4<head>
  5	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6	<link rel="icon" href="<?php echo $this->config->item('staticPath'); ?>/images/favicon.ico" type="image/x-icon" />
  7	<link rel="stylesheet" type="text/css" href="<?php echo $this->config->item('staticPath'); ?>/css/admin.css" media="all" />
  8	<link rel="stylesheet" type="text/css" href="<?php echo $this->config->item('staticPath'); ?>/css/lightbox.css" media="screen" />
  9	<link rel="stylesheet" type="text/css" href="<?php echo $this->config->item('staticPath'); ?>/css/datepicker.css" media="screen" />
 10	<script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.js"></script>
 11	<script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.lightbox.js"></script>
 12	<script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/default.js"></script>
 13	<script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/admin.js"></script>
 14
 15	<script language="JavaScript">			
 16		$(function(){
 17			$('ul#menubar li').hover(
 18				function() { $('ul', this).css('display', 'block').parent().addClass('hover'); },
 19				function() { $('ul', this).css('display', 'none').parent().removeClass('hover'); }
 20			);			
 21		});		
 22	</script>		
 23	
 24	<title><?php echo (isset($this->site->config['siteName'])) ? $this->site->config['siteName'] : 'Login to'; ?> Admin - Halogy</title>
 25	
 26</head>
 27<body>
 28
 29<div class="bg">
 30	
 31	<div class="container">
 32	
 33		<div id="header">
 34
 35			<div id="logo">
 36			
 37				<?php
 38					// set logo
 39					if ($this->config->item('logoPath')) $logo = $this->config->item('logoPath');
 40					elseif ($image = $this->uploads->load_image('admin-logo')) $logo = $image['src'];
 41					else $logo = $this->config->item('staticPath').'/images/halogy_logo.jpg';
 42				?>
 43
 44				<h1><a href="/admin"><?php echo (isset($this->site->config['siteName'])) ? $this->site->config['siteName'] : 'Login to'; ?> Admin</a></h1>
 45				<a href="/admin"><img src="<?php echo $logo; ?>" alt="Logo" /></a>
 46
 47			</div>
 48
 49			<div id="siteinfo">
 50				<ul id="toolbar">
 51					<li><a href="/">View Site</a></li>				
 52					<?php if ($this->session->userdata('session_admin')): ?>				
 53						<li><a href="/admin/dashboard">Dashboard</a></li>
 54						<li><a href="/admin/users/edit/<?php echo $this->session->userdata('userID'); ?>">My Account</a></li>
 55						<?php if ($this->session->userdata('groupID') == $this->site->config['groupID'] || $this->session->userdata('groupID') < 0): ?>
 56							<li><a href="/admin/site/">My Site</a></li>
 57						<?php endif; ?>
 58						<?php if ($this->session->userdata('groupID') < 0 && @file_exists(APPPATH.'modules/halogy/controllers/halogy.php')): ?>
 59							<li class="noborder"><a href="/admin/logout">Logout</a></li>
 60							<li class="superuser"><a href="/halogy/sites">Sites</a></li>
 61						<?php else: ?>
 62							<li class="last"><a href="/admin/logout">Logout</a></li>
 63						<?php endif; ?>						
 64					<?php else: ?>
 65						<li class="last"><a href="/admin">Login</a></li>
 66					<?php endif; ?>
 67				</ul>
 68
 69				<?php if ($this->session->userdata('session_admin')): ?>	
 70					<h2 class="clear"><strong><?php echo $this->site->config['siteName']; ?> Admin</strong></h2>
 71					<h3>Logged in as: <strong><?php echo $this->session->userdata('username'); ?></strong></h3>
 72				<?php endif; ?>	
 73			</div>
 74
 75		</div>
 76		
 77		<div id="navigation">
 78			<ul id="menubar">
 79			<?php if($this->session->userdata('session_admin')): ?>
 80				<?php if (in_array('pages', $this->permission->permissions)): ?>
 81					<li><a href="/admin/pages/">Pages</a>
 82						<ul class="subnav">
 83							<li><a href="/admin/pages/viewall">All Pages</a></li>
 84							<?php if (in_array('pages_edit', $this->permission->permissions)): ?>
 85								<li><a href="/admin/pages/add">Add Page</a></li>
 86							<?php endif; ?>
 87						</ul>
 88					</li>
 89				<?php endif; ?>
 90				<?php if (in_array('pages_templates', $this->permission->permissions)): ?>
 91					<li><a href="/admin/pages/templates">Templates</a>
 92						<ul class="subnav">
 93							<li><a href="/admin/pages/templates">All Templates</a></li>
 94							<li><a href="/admin/pages/includes">Includes</a></li>
 95							<li><a href="/admin/pages/includes/css">CSS</a></li>
 96							<li><a href="/admin/pages/includes/js">Javascript</a></li>
 97						</ul>
 98					</li>
 99				<?php endif; ?>	
100				<?php if (in_array('images', $this->permission->permissions)): ?>
101					<li><a href="/admin/images/viewall">Uploads</a>
102						<ul class="subnav">				
103							<li><a href="/admin/images/viewall">Images</a></li>
104							<?php if (in_array('images_all', $this->permission->permissions)): ?>
105								<li><a href="/admin/images/folders">Image Folders</a></li>
106							<?php endif; ?>
107							<?php if (in_array('files', $this->permission->permissions)): ?>
108								<li><a href="/admin/files/viewall">Files</a></li>
109								<?php if (in_array('files_all', $this->permission->permissions)): ?>								
110									<li><a href="/admin/files/folders">File Folders</a></li>						
111								<?php endif; ?>
112							<?php endif; ?>								
113						</ul>
114					</li>
115				<?php endif; ?>
116				<?php if (in_array('webforms', $this->permission->permissions)): ?>
117					<li><a href="/admin/webforms/tickets">Web Forms</a>
118						<ul class="subnav">
119							<li><a href="/admin/webforms/tickets">Tickets</a></li>
120							<?php if (in_array('webforms_edit', $this->permission->permissions)): ?>							
121								<li><a href="/admin/webforms/viewall">All Web Forms</a></li>
122								<li><a href="/admin/webforms/add_form">Add Web Form</a></li>
123							<?php endif; ?>
124						</ul>
125					</li>
126				<?php endif; ?>
127				<?php if (in_array('blog', $this->permission->permissions)): ?>
128					<li><a href="/admin/blog/viewall">Blog</a>
129						<ul class="subnav">
130							<?php if (in_array('blog', $this->permission->permissions)): ?>
131								<li><a href="/admin/blog/viewall">All Posts</a></li>
132							<?php endif; ?>
133							<?php if (in_array('blog_edit', $this->permission->permissions)): ?>
134								<li><a href="/admin/blog/add_post">Add Post</a></li>
135							<?php endif; ?>
136							<?php if (in_array('blog_cats', $this->permission->permissions)): ?>
137								<li><a href="/admin/blog/categories">Categories</a></li>
138							<?php endif; ?>							
139							<li><a href="/admin/blog/comments">Comments</a></li>
140						</ul>
141					</li>
142				<?php endif; ?>
143				<?php if (in_array('shop', $this->permission->permissions)): ?>
144					<li><a href="/admin/shop/products">Shop</a>
145						<ul class="subnav">
146							<li><a href="/admin/shop/products">All Products</a></li>
147							<?php if (in_array('shop_edit', $this->permission->permissions)): ?>
148								<li><a href="/admin/shop/add_product">Add Product</a></li>
149							<?php endif; ?>
150							<?php if (in_array('shop_cats', $this->permission->permissions)): ?>
151								<li><a href="/admin/shop/categories">Categories</a></li>
152							<?php endif; ?>
153							<?php if (in_array('shop_orders', $this->permission->permissions)): ?>
154								<li><a href="/admin/shop/orders">View Orders</a></li>
155							<?php endif; ?>
156							<?php if (in_array('shop_subscriptions', $this->permission->permissions)): ?>
157								<li><a href="/admin/shop/subscriptions">Subscriptions</a></li>
158							<?php endif; ?>
159							<?php if (in_array('shop_shipping', $this->permission->permissions)): ?>
160								<li><a href="/admin/shop/bands">Shipping Bands</a></li>
161								<li><a href="/admin/shop/postages">Shipping Costs</a></li>
162								<li><a href="/admin/shop/modifiers">Shipping Modifiers</a></li>								
163							<?php endif; ?>
164							<?php if (in_array('shop_discounts', $this->permission->permissions)): ?>
165								<li><a href="/admin/shop/discounts">Discount Codes</a></li>
166							<?php endif; ?>
167							<?php if (in_array('shop_reviews', $this->permission->permissions)): ?>
168								<li><a href="/admin/shop/reviews">Reviews</a></li>
169							<?php endif; ?>
170							<?php if (in_array('shop_upsells', $this->permission->permissions)): ?>
171								<li><a href="/admin/shop/upsells">Upsells</a></li>
172							<?php endif; ?>			
173						</ul>
174					</li>
175				<?php endif ?>				
176				<?php if (in_array('events', $this->permission->permissions)): ?>
177					<li><a href="/admin/events/viewall">Events</a>
178						<ul class="subnav">
179							<li><a href="/admin/events/viewall">All Events</a></li>
180						<?php if (in_array('events_edit', $this->permission->permissions)): ?>
181							<li><a href="/admin/events/add_event">Add Event</a></li>
182						<?php endif; ?>	
183						</ul>
184					</li>
185				<?php endif; ?>
186				<?php if (in_array('emailer', $this->permission->permissions)): ?>					
187					<li><a href="/admin/emailer/campaigns">Email Campaigns</a>
188						<ul class="subnav">
189							<li><a href="/admin/emailer/campaigns/">Campaigns</a></li>
190							<li><a href="/admin/emailer/add_email/">Add Email</a></li>
191							<?php if (in_array('emailer_lists', $this->permission->permissions)): ?>
192								<li><a href="/admin/emailer/lists">Mailing Lists</a></li>
193							<?php endif; ?>
194							<?php if (in_array('emailer_templates', $this->permission->permissions)): ?>
195								<li><a href="/admin/emailer/templates">Templates</a></li>
196							<?php endif; ?>
197							<li><a href="/admin/emailer/viewsend/">Send Progress</a></li>
198						</ul>
199					</li>
200				<?php endif; ?>	
201				<?php if (in_array('forums', $this->permission->permissions)): ?>
202					<li><a href="/admin/forums/forums">Forums</a>
203						<ul class="subnav">
204							<?php if (in_array('forums', $this->permission->permissions)): ?>
205								<li><a href="/admin/forums/forums">Forums</a></li>
206							<?php endif; ?>
207							<?php if (in_array('forums_cats', $this->permission->permissions)): ?>
208								<li><a href="/admin/forums/categories">Forum Categories</a></li>
209							<?php endif; ?>
210						</ul>
211					</li>
212				<?php endif; ?>
213				<?php if (in_array('wiki', $this->permission->permissions)): ?>
214					<li><a href="/admin/wiki/">Wiki</a>
215						<ul class="subnav">
216							<?php if (in_array('wiki_edit', $this->permission->permissions)): ?>
217								<li><a href="/admin/wiki/viewall">All Wiki Pages</a></li>
218							<?php endif; ?>
219							<?php if (in_array('wiki_cats', $this->permission->permissions)): ?>
220								<li><a href="/admin/wiki/categories">Wiki Categories</a></li>
221							<?php endif; ?>
222							<li><a href="/admin/wiki/changes">Recent Changes</a></li>							
223						</ul>
224					</li>
225				<?php endif; ?>			
226				<?php if (in_array('users', $this->permission->permissions)): ?>
227					<li><a href="/admin/users/viewall">Users</a>
228					<?php if (in_array('users_groups', $this->permission->permissions)): ?>
229						<ul class="subnav">				
230							<li><a href="/admin/users/viewall">All Users</a></li>
231							<li><a href="/admin/users/groups">User Groups</a></li>
232						</ul>
233					<?php endif; ?>						
234					</li>
235				<?php endif; ?>
236				<?php else: ?>
237					<li><a href="/admin">Login</a></li>
238				<?php endif; ?>					
239			</ul>
240			
241		</div>
242		
243		<div id="content" class="content">
244