made things a little prettier, modified the view structure
This commit is contained in:
		
							parent
							
								
									27ceeca9a8
								
							
						
					
					
						commit
						4631ff1374
					
				| @ -1,5 +1,10 @@ | ||||
| RewriteEngine On | ||||
| 
 | ||||
| RewriteCond %{REQUEST_URI} !.*index\.php$ | ||||
| RewriteCond %{REQUEST_URI} !.*/media/.* | ||||
| RewriteRule .* /panacea/src/index.php [L] | ||||
| RewriteRule ^wiki$              /panacea/src/wiki.php    [L] | ||||
| RewriteRule ^tracker$           /panacea/src/tracker.php [L] | ||||
| RewriteRule ^ci$                /panacea/src/ci.php      [L] | ||||
| RewriteRule ^repo$              /panacea/src/repo.php    [L] | ||||
| 
 | ||||
| RewriteCond %{REQUEST_FILENAME} !-f | ||||
| RewriteCond %{REQUEST_URI}      !.*/media/.* | ||||
| RewriteRule .*                  /panacea/src/index.php   [L] | ||||
| @ -29,6 +29,7 @@ | ||||
| 				$file = "$path/lib/$className.php"; | ||||
| 				break; | ||||
| 			 | ||||
| 			case 'PanaceaView': | ||||
| 			case 'PanaceaPageView': | ||||
| 			case 'PanaceaTemplateView': | ||||
| 			case 'PanaceaHeaderView': | ||||
|  | ||||
							
								
								
									
										0
									
								
								src/ci.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/ci.php
									
									
									
									
									
										Normal file
									
								
							| @ -20,7 +20,7 @@ | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-16 | ||||
| 	 */ | ||||
| 	class PanaceaHeaderView extends View { | ||||
| 	class PanaceaHeaderView extends PanaceaView { | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Creates a view for the header | ||||
|  | ||||
| @ -20,7 +20,7 @@ | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-16 | ||||
| 	 */ | ||||
| 	class PanaceaLogoView extends View { | ||||
| 	class PanaceaLogoView extends PanaceaView { | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Renders the view | ||||
|  | ||||
| @ -20,7 +20,7 @@ | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-16 | ||||
| 	 */ | ||||
| 	class PanaceaMenuView extends View { | ||||
| 	class PanaceaMenuView extends PanaceaView { | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Renders the view | ||||
| @ -32,11 +32,13 @@ | ||||
| 			 | ||||
| 				<div id="menu"> | ||||
| 					<ul> | ||||
| 						<li><a href="#">Item #1</a></li>
 | ||||
| 						<li><a href="#">Item #2</a></li>
 | ||||
| 						<li><a href="#">Item #3</a></li>
 | ||||
| 						<li><a href="#">Item #4</a></li>
 | ||||
| 						<li><a href="#">Item #5</a></li>
 | ||||
| 						<li><a href="<?php echo $this->root; ?>/">Home</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/repo">SVN Repo</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/ci">Continuous Integration</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/wiki">Wiki</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/tracker">Tracker</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/reviewer">Code Review</a></li> | ||||
| 						<li><a href="<?php echo $this->root; ?>/manager">Project Management</a></li> | ||||
| 					</ul> | ||||
| 					<div style="clear:left"></div> | ||||
| 				</div> | ||||
|  | ||||
| @ -20,7 +20,7 @@ | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-05 | ||||
| 	 */ | ||||
| 	class PanaceaPageView extends View { | ||||
| 	class PanaceaPageView extends PanaceaView { | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Renders the view | ||||
|  | ||||
| @ -20,7 +20,24 @@ | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-14 | ||||
| 	 */ | ||||
| 	class PanaceaTemplateView extends TemplateView { | ||||
| 	class PanaceaTemplateView extends PanaceaView { | ||||
| 		 | ||||
| 		/**#@+ @var string */ | ||||
| 		/**  | ||||
| 		 * The title of the web page | ||||
| 		 */ | ||||
| 		protected $title; | ||||
| 		 | ||||
| 		/** | ||||
| 		 * The default title of the web page | ||||
| 		 */ | ||||
| 		protected $defaultTitle; | ||||
| 		 | ||||
| 		/** | ||||
| 		 * The title separator | ||||
| 		 */ | ||||
| 		protected $separator; | ||||
| 		/**#@-*/ | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Creates a new {@link TemplateView} | ||||
| @ -35,50 +52,127 @@ | ||||
| 				throw new InvalidTypeException(1, 'string', $title); | ||||
| 			} | ||||
| 			 | ||||
| 			parent::__construct(); | ||||
| 			parent::__construct(0); | ||||
| 			 | ||||
| 			$this->defaultTitle = 'Panacea'; | ||||
| 			$this->title        = (!empty($title)) ? $title : 'It doesn\'t suck'; | ||||
| 			$this->separator    = ' - '; | ||||
| 			 | ||||
| 			$this->addView(new PanaceaHeaderView(1)); | ||||
| 		} | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Gets all meta data associated with this view | ||||
| 		 * The meta data for this view | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-10-14 | ||||
| 		 * @todo   Get rid of the hardcoded CSS path | ||||
| 		 * @since  2008-07-03 | ||||
| 		 * @uses   ViewMetaData::generate() | ||||
| 		 * @uses   ViewMetaData::addMeta() | ||||
| 		 * | ||||
| 		 * @return ViewMetaData | ||||
| 		 */ | ||||
| 		public function getMetaData() { | ||||
| 			return parent::getMetaData()->addCss('/panacea/src/media/css/global.css'); | ||||
| 			//latest revision time
 | ||||
| 			$revised = 0; | ||||
| 			foreach (get_included_files() as $file) { | ||||
| 				if (($mtime = filemtime($file)) > $revised) { | ||||
| 					$revised = $mtime; | ||||
| 				} | ||||
| 			} | ||||
| 			 | ||||
| 			return ViewMetaData::generate()->addMeta('revised', date('c', $revised)) | ||||
| 			                               ->addCss($this->cssPath . '/global.css'); | ||||
| 		} | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Gets the next default priority | ||||
| 		 * Allows read access to certain class properties | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-10-16 | ||||
| 		 * @since  2008-07-03 | ||||
| 		 * | ||||
| 		 * @param  string $var The property to get | ||||
| 		 * @throws {@link UnknownPropertyException} if the property is invalid or inaccessible | ||||
| 		 * @return mixed | ||||
| 		 * @ignore | ||||
| 		 */ | ||||
| 		public function getNextPriority() { | ||||
| 			$priority = 1; | ||||
| 			foreach ($this->views as $view) { | ||||
| 				$priority = max($priority, $view->priority); | ||||
| 		public function __get($var) { | ||||
| 			switch ($var) { | ||||
| 				case 'title': | ||||
| 				case 'defaultTitle': | ||||
| 				case 'separator': | ||||
| 					return $this->$var; | ||||
| 				default: | ||||
| 					return parent::__get($var); | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 			return $priority + 1; | ||||
| 		/** | ||||
| 		 * Allows write access to certain class properties | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-07-03 | ||||
| 		 * | ||||
| 		 * @param  string $var The property to set | ||||
| 		 * @param  string $val The value to set the property to | ||||
| 		 * @throws {@link InvalidTypeException} if the datatypes don't match | ||||
| 		 * @throws {@link UnknownPropertyException} if the property is invalid or inaccessible | ||||
| 		 * @ignore | ||||
| 		 */ | ||||
| 		public function __set($var, $val) { | ||||
| 			switch ($var) { | ||||
| 				case 'title': | ||||
| 				case 'defaultTitle': | ||||
| 				case 'separator': | ||||
| 					if (!is_string($val)) { | ||||
| 						throw new InvalidTypeException(2, 'string', $val); | ||||
| 					} | ||||
| 					$this->$var = $val; | ||||
| 					break; | ||||
| 				default: | ||||
| 					parent::__set($var, $val); | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Renders the view | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-10-14 | ||||
| 		 * @since  2008-07-03 | ||||
| 		 * @uses   getMetaData() | ||||
| 		 * @uses   ViewMetaData::merge() | ||||
| 		 * @uses   View::send() | ||||
| 		 */ | ||||
| 		public function send() { | ||||
| 			parent::send(); | ||||
| 			$metadata = $this->getMetaData(); | ||||
| 			foreach ($this->views as $view) { | ||||
| 				$metadata->merge($view->getMetaData()); | ||||
| 			} | ||||
| 			 | ||||
| 		?>
 | ||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  | ||||
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||||
| 
 | ||||
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> | ||||
| 	<head> | ||||
| 		<title><?php echo $this->defaultTitle . $this->separator . $this->title; ?></title>
 | ||||
| 		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | ||||
| 		<?php echo $metadata; ?>
 | ||||
| 		 | ||||
| 	</head> | ||||
| 	 | ||||
| 	<body> | ||||
| 	 | ||||
| 		<div id="wrapper"> | ||||
| 			 | ||||
| 			<?php parent::send();	?>
 | ||||
| 			 | ||||
| 		</div> | ||||
| 	 | ||||
| 	</body> | ||||
| </html> | ||||
| <?php | ||||
| 		unset($metadata); | ||||
| 		 | ||||
| 		} | ||||
| 		 | ||||
| 	} | ||||
|  | ||||
							
								
								
									
										83
									
								
								src/lib/views/PanaceaView.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								src/lib/views/PanaceaView.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,83 @@ | ||||
| <?php | ||||
| 
 | ||||
| 	/** | ||||
| 	 * PanaceaView | ||||
| 	 * | ||||
| 	 * @package    Panacea | ||||
| 	 * @subpackage Views | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-16 | ||||
| 	 */ | ||||
| 
 | ||||
| 	/** Bootstraps the NowhereConcave framework */ | ||||
| 	require_once 'NowhereConcave/bootstrap.php'; | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Base view of <i>Panacea</i> | ||||
| 	 * | ||||
| 	 * @package    Panacea | ||||
| 	 * @subpackage Views | ||||
| 	 * @author     Tommy Montgomery | ||||
| 	 * @since      2008-10-16 | ||||
| 	 * | ||||
| 	 * @property-read string $root       The relative root | ||||
| 	 * @property-read string $mediaPath  The path to the media directory | ||||
| 	 * @property-read string $cssPath    The path to the CSS directory | ||||
| 	 * @property-read string $jsPath     The path to the JavaScript directory | ||||
| 	 * @property-read string $imagesPath The path to the images directory | ||||
| 	 * @property-read string $audioPath  The path to the audio directory | ||||
| 	 * @property-read string $videoPath  The path to the video directory | ||||
| 	 */ | ||||
| 	class PanaceaView extends View { | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Configuration data for <i>Panacea</i> | ||||
| 		 * | ||||
| 		 * @var array | ||||
| 		 * @ignore | ||||
| 		 */ | ||||
| 		private $config; | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Creates a new {@link PanaceaView} | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-10-16 | ||||
| 		 * @todo   The config values should be loaded from a config file | ||||
| 		 * | ||||
| 		 * @param int $priority The priority of the view | ||||
| 		 */ | ||||
| 		public function __construct($priority = 0) { | ||||
| 			parent::__construct($priority); | ||||
| 			 | ||||
| 			$this->config = array( | ||||
| 				'root'       => '/panacea/src', | ||||
| 				'mediaPath'  => '/panacea/src/media', | ||||
| 				'cssPath'    => '/panacea/src/media/css', | ||||
| 				'jsPath'     => '/panacea/src/media/js', | ||||
| 				'imagesPath' => '/panacea/src/media/images', | ||||
| 				'audioPath'  => '/panacea/src/media/audio', | ||||
| 				'videoPath'  => '/panacea/src/media/video'); | ||||
| 		} | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Allows read access to certain class properties | ||||
| 		 * | ||||
| 		 * @author Tommy Montgomery | ||||
| 		 * @since  2008-10-16 | ||||
| 		 * | ||||
| 		 * @param  string $var The property to get | ||||
| 		 * @return mixed | ||||
| 		 * @ignore | ||||
| 		 */ | ||||
| 		public function __get($var) { | ||||
| 			if (isset($this->config[$var])) { | ||||
| 				return $this->config[$var]; | ||||
| 			} | ||||
| 			 | ||||
| 			return parent::__get($var); | ||||
| 		} | ||||
| 		 | ||||
| 	} | ||||
| 
 | ||||
| ?>
 | ||||
| @ -2,14 +2,18 @@ html { | ||||
| 	overflow: auto; | ||||
| } | ||||
| body { | ||||
| 	background-color: #999999; | ||||
| 	background-color: #363636; | ||||
| 	font-family: Verdana, Arial, sans-serif; | ||||
| 	font-size: 8pt; | ||||
| 	color: #000000; | ||||
| 	color: #FFFFFF; | ||||
| } | ||||
| 
 | ||||
| #wrapper { | ||||
| 
 | ||||
| 	width: 95%; | ||||
| 	margin: auto; | ||||
| 	background-color: #EEEEEE; | ||||
| 	color: #000000; | ||||
| 	border: 2px solid #000000; | ||||
| } | ||||
| 
 | ||||
| #head { | ||||
| @ -33,14 +37,27 @@ body { | ||||
| } | ||||
| #menu ul li { | ||||
| 	float: left; | ||||
| 	position: relative; | ||||
| } | ||||
| #menu ul li a { | ||||
| 	display: block; | ||||
| 	width: 10em; | ||||
| 	height: 2em; | ||||
| 	font-size: 1.5em; | ||||
| 	color: #000000; | ||||
| 	height: 1.5em; | ||||
| 	line-height: 1.5em; | ||||
| 	padding: .5em; | ||||
| 	font-size: 1em; | ||||
| 	font-weight: bold; | ||||
| 	margin-right: 1px; | ||||
| 	text-decoration: none; | ||||
| 	background-color: #CCCCCC; | ||||
| 	border: 1px solid transparent; | ||||
| } | ||||
| #menu ul li a:hover { | ||||
| 	display: inline; | ||||
| 	background-color: #009999; | ||||
| 	color: #FFFFFF; | ||||
| 	border: 1px solid #000000; | ||||
| 	border-top-width: 2px; | ||||
| 	padding-bottom: 14px; | ||||
| 	line-height: 1.9em; | ||||
| } | ||||
							
								
								
									
										0
									
								
								src/repo.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/repo.php
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/reviewer.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/reviewer.php
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/tracker.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/tracker.php
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/wiki.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/wiki.php
									
									
									
									
									
										Normal file
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user