mango r180 - in trunk: . lib
- From: ovitters svn gnome org
- To: svn-commits-list gnome org,gnome-sysadmin gnome org
- Subject: mango r180 - in trunk: . lib
- Date: Sun, 1 Jun 2008 09:26:39 +0000 (UTC)
Author: ovitters
Date: Sun Jun 1 09:26:39 2008
New Revision: 180
URL: http://svn.gnome.org/viewvc/mango?rev=180&view=rev
Log:
* lib/page.php: Convert to PHP5 style object.
Modified:
trunk/ChangeLog
trunk/lib/page.php
Modified: trunk/lib/page.php
==============================================================================
--- trunk/lib/page.php (original)
+++ trunk/lib/page.php Sun Jun 1 09:26:39 2008
@@ -13,18 +13,18 @@
* @package Mango
*/
class Page {
- var $result;
+ public $result;
- var $stylesheet;
+ private $stylesheet;
- function Page($stylesheet) {
+ function __construct($stylesheet) {
$this->stylesheet = $stylesheet;
$this->result = new DOMDocument();
$node = $this->result->createProcessingInstruction("xml-stylesheet", "href=\"".$this->stylesheet."\" type=\"text/xsl\"");
$this->result->appendChild($node);
}
- function validate_post() {
+ public function validate_post() {
// SECURITY: Protect against CSRF (POST only)
// Based upon the method used by Michal Cihar (michal cihar com), phpMyAdmin (GPL)
if($_SERVER['REQUEST_METHOD'] == 'POST') {
@@ -44,7 +44,7 @@
/**
* Process the given input file using the given stylesheet
*/
- function process($filename) {
+ public function process($filename) {
$this->result->loadXML(file_get_contents($filename));
$this->send();
}
@@ -52,7 +52,7 @@
/**
* Parse the content with the stylesheet
*/
- function send() {
+ public function send() {
/* Grab root node */
$dom = $this->result;
$xpath = new DOMXPath($dom);
@@ -104,7 +104,7 @@
* @access public
* @since 1.0
*/
- function _add_dynamic_data(&$dom, &$pagenode) {
+ public function _add_dynamic_data(&$dom, &$pagenode) {
global $config;
/* Add runtime mode and useful URLs */
@@ -147,7 +147,7 @@
* @access public
* @since 1.0
*/
- function sendError($response_code) {
+ public function sendError($response_code) {
header($_SERVER['SERVER_PROTOCOL']." ".$response_code);
}
@@ -159,7 +159,7 @@
* @access public
* @since 1.0
*/
- function sendRedirect($url) {
+ public function sendRedirect($url) {
header("Location: $url");
}
@@ -169,7 +169,7 @@
* @access public
* @since 1.0
*/
- function generate_token() {
+ public function generate_token() {
if (!isset($_SESSION[' token_bits '])) {
$_SESSION[' token_bits '] = sha1(uniqid(rand(), true));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]