[Eis-commits] SF.net SVN: eis: [212] trunk/lib/engine/engine.lib.php
Status: Pre-Alpha
Brought to you by:
baslijnse
|
From: <bas...@us...> - 2007-09-16 11:28:38
|
Revision: 212
http://eis.svn.sourceforge.net/eis/?rev=212&view=rev
Author: baslijnse
Date: 2007-09-16 04:28:25 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Added 'setContentType' method for controlling output content type and added a getPathPart method for getting a single part of the path.
Modified Paths:
--------------
trunk/lib/engine/engine.lib.php
Modified: trunk/lib/engine/engine.lib.php
===================================================================
--- trunk/lib/engine/engine.lib.php 2007-09-15 00:40:07 UTC (rev 211)
+++ trunk/lib/engine/engine.lib.php 2007-09-16 11:28:25 UTC (rev 212)
@@ -10,6 +10,7 @@
var $currentModule = null; /**< Current rendered element's module */
var $currentElement = null; /**< Current rendered element */
var $moduleConfig = array(); /**< Variable containing array of moduleconfig elements*/
+ var $contentType = 'text/html; charset=UTF-8;'; /** < content type of output */
/**< ENGINE STATUS VARIABLES */
var $version = 'svn-trunk'; /**< Engine version */
@@ -735,7 +736,7 @@
}
//Show Headers
- header('Content-Type: text/html; charset=UTF-8;');
+ header('Content-Type: '.$this->contentType);
$this->_engineHeaders();
$this->_noCache();
@@ -1000,6 +1001,14 @@
function getPath() {
return $this->request->getPath();
}
+ function getPathPart($index) {
+ $path = $this->request->getPath();
+ if($index >= 0) {
+ return $path[$index];
+ } else {
+ return $path[count($path) + $index];
+ }
+ }
function getLocale() {
//TODO: Get this from session/browser/whatever
@@ -1293,6 +1302,15 @@
}
}
/**
+ * Set output mimetype
+ *
+ * @param mimetype the content mimetype
+ */
+ function setContentType($mimetype) {
+ $this->contentType = $mimetype;
+ }
+
+ /**
* Get a reference to a service object.
*
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|