You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2008/06/23 13:43:53 UTC

svn commit: r670524 - /incubator/shindig/trunk/php/src/gadgets/Preload.php

Author: chabotc
Date: Mon Jun 23 04:43:53 2008
New Revision: 670524

URL: http://svn.apache.org/viewvc?rev=670524&view=rev
Log:
function ordening

Modified:
    incubator/shindig/trunk/php/src/gadgets/Preload.php

Modified: incubator/shindig/trunk/php/src/gadgets/Preload.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/Preload.php?rev=670524&r1=670523&r2=670524&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/Preload.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/Preload.php Mon Jun 23 04:43:53 2008
@@ -20,14 +20,40 @@
  */
 
 class Preload {
-	
 	public static $AUTHZ_ATTR = "authz";
-	
 	private $href;
 	private $auth;
 	private $signViewer;
 	private $signOwner;
 	private $views = array();
+	
+	/**
+	 * Creates a new Preload from an xml node.
+	 *
+	 * @param preload The Preload to create
+	 */
+	public function __construct(SimpleXMLElement $preload)
+	{
+		$attributes = $preload->attributes();
+		$this->signOwner = isset($attributes['sign_owner']) ? trim($attributes['sign_owner']) : true;
+		$this->signViewer = isset($attributes['sign_viewer']) ? trim($attributes['sign_viewer']) : true;
+		$this->href = isset($attributes['href']) ? trim($attributes['href']) : '';
+		if (empty($this->href)) {
+			throw new SpecParserException("Preload/@href is missing or invalid.");
+		}
+		// Record all the associated views
+		$viewNames = isset($attributes['views']) ? trim($attributes['views']) : '';
+		$views = array();
+		$arrViewNames = explode(",", $viewNames);
+		foreach ($arrViewNames as $view) {
+			$view = trim($view);
+			if (strlen($view) > 0) {
+				$views[] = $view;
+			}
+		}
+		$this->views = $views;
+		$this->auth = Auth::parse($attributes[Preload::$AUTHZ_ATTR]);
+	}
 
 	public function getHref()
 	{
@@ -59,34 +85,6 @@
 		return $this->fillPreload($this, $substituter);
 	}
 
-	/**
-	 * Creates a new Preload from an xml node.
-	 *
-	 * @param preload The Preload to create
-	 */
-	public function __construct(SimpleXMLElement $preload)
-	{
-		$attributes = $preload->attributes();
-		$this->signOwner = isset($attributes['sign_owner']) ? trim($attributes['sign_owner']) : true;
-		$this->signViewer = isset($attributes['sign_viewer']) ? trim($attributes['sign_viewer']) : true;
-		$this->href = isset($attributes['href']) ? trim($attributes['href']) : '';
-		if (empty($this->href)) {
-			throw new SpecParserException("Preload/@href is missing or invalid.");
-		}
-		// Record all the associated views
-		$viewNames = isset($attributes['views']) ? trim($attributes['views']) : '';
-		$views = array();
-		$arrViewNames = explode(",", $viewNames);
-		foreach ($arrViewNames as $view) {
-			$view = trim($view);
-			if (strlen($view) > 0) {
-				$views[] = $view;
-			}
-		}
-		$this->views = $views;
-		$this->auth = Auth::parse($attributes[Preload::$AUTHZ_ATTR]);
-	}
-
 	private function fillPreload(Preload $preload, $substituter)
 	{
 		$this->signOwner = $preload->signOwner;