------------------------------------------------------------
revno: 1087
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Sun 2012-02-12 00:22:55 +0100
message:
  Output adapted for multi-engine
modified:
  index.php
  libs/Output.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'index.php'
--- index.php	2012-02-11 21:06:20 +0000
+++ index.php	2012-02-11 23:22:55 +0000
@@ -70,7 +70,7 @@
 	if ($noheaders) {
 		$html_output = $layout->html_output;
 	} else {   
-		$html_output = $aiki->Output->headers();
+		$html_output = $aiki->Output->headers($layout->widgets_css, $layout->head_output);
 		
 		$layout->html_output = str_replace(
 				'[page_title]', 

=== modified file 'libs/Output.php'
--- libs/Output.php	2012-02-09 20:35:59 +0000
+++ libs/Output.php	2012-02-11 23:22:55 +0000
@@ -172,6 +172,22 @@
 	}
 
 	/**
+	 * Returns the favicon
+	 *
+	 * @return  string
+	 */
+
+	public function favicon() {
+		global $config, $aiki;
+		$favicon =
+			'<link rel="icon" href="' . $config['url'] .
+			'assets/images/favicon.ico" type="image/x-icon" />';
+		$aiki->Plugins->doAction("output_favicon", $favicon);
+		return 	$favicon;
+	}
+
+
+	/**
 	 * Returns the doctype
 	 *
 	 * @global  $aiki
@@ -206,9 +222,10 @@
 	 *
 	 * @global      aiki            $aiki   main obj manipulating configs + urls
 	 * @global      array           $db     global db instance
-	 * @global      CreateLayout	$layout global layout object
-	 * @global      bool            $nogui  global yes or no about gui
 	 * @global      array           $config global config options instance
+	 *
+	 * @param  $css array   
+	 
 	 * @return string
 	 *
 	 * @see bootstrap.php
@@ -216,8 +233,8 @@
 	 * @todo the html hardcoded in here needs abstraction and shouldn't make
 	 * assumptions about setup
 	 */
-	public function headers() {
-		global $aiki, $db, $layout, $nogui, $config;
+	public function headers( $css, $aditionalHeader) {
+		global $aiki, $db, $config;
 		
         $header = '';
 		$aiki->Plugins->doAction("output_begin", $header);
@@ -227,34 +244,22 @@
         $header .= $head_tag;
 		$header .= $this->title_and_metas();
 						
-		if (!$nogui) {
-			if (count($layout->widgets_css)) {
-
-				// handle language settings
-				if(isset($_GET['language'])) {
-					$language=$_GET['language'];
-				} else {
-					$language = $config['default_language'];
-				}
-				$view = $aiki->site->view();// comodity
-				$header .= sprintf(
-					'<link rel="stylesheet" type="text/css" ' .
-					' href="%sstyle.php?site=%s&amp;%swidgets=%s&amp;language=%s" />' . "\n",
-					config("url"),
-					$aiki->site->get_site(),
-					( $view ? "view={$view}&amp;" : ""),
-					implode("_", $layout->widgets_css),
-					$language);
-			}
-			$favicon =
-				'<link rel="icon" href="' . $config['url'] .
-				'assets/images/favicon.ico" type="image/x-icon" />';
-		    $aiki->Plugins->doAction("output_head_favicon", $favicon);
-            $header .= $favicon;
-		}
+		if (is_array($css) && count($css)) {			
+			$view = $aiki->site->view();// comodity
+			$header .= sprintf(
+				'<link rel="stylesheet" type="text/css" ' .
+				' href="%sstyle.php?site=%s&amp;%swidgets=%s&amp;language=%s" />' . "\n",
+				config("url"),
+				$aiki->site->get_site(),
+				( $view ? "view={$view}&amp;" : ""),
+				implode("_", $css),
+				$aiki->site->language() );
+		}			
+        $header .= $this->favicon();
+		
 	
-		if (isset($layout->head_output)){
-			$header .= $layout->head_output;
+		if ( !is_null($aditionalHeader) ){
+			$header .= $aditionalHeader;
 		}
 
 		$header .= $this->headers;

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to