phpDocumentor GloryLands
System
[ class tree: GloryLands ] [ index: GloryLands ] [ all elements ]

Source for file view.php

Documentation is available at view.php

  1. <?php
  2. /**
  3.   * View streamline
  4.   *
  5.   * <pre>
  6.   * GloryLands, a Web-Based, Massive Multiplayer Online RPG/Strategy Game
  7.   * Copyright (C) 2008-09  John Haralampidis <jïhnys2[at]gmail.cïm>
  8.   *
  9.   * This program is free software: you can redistribute it and/or modify
  10.   * it under the terms of the GNU General Public License as published by
  11.   * the Free Software Foundation, either version 3 of the License, or
  12.   * (at your option) any later version.
  13.   *
  14.   * This program is distributed in the hope that it will be useful,
  15.   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.   * GNU General Public License for more details.
  18.   *
  19.   * You should have received a copy of the GNU General Public License
  20.   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21.   *
  22.   * For any help/suggestions or troubleshooting you can see the
  23.   * project community website at <http://www.glorylands.gr>
  24.   * </pre>
  25.   *
  26.   * @license GNU/GPLv3 GNU General Public License version 3
  27.   * @package GloryLands
  28.   * @subpackage System
  29.   * @author John Haralampidis <jïhnys2[at]gmail.cïm>
  30.   * @copyright Copyright (C) 2007-2009, John Haralampidis
  31.   * @version 1.0
  32.   */
  33.  
  34. /**
  35.   *
  36.   * @subpackage System
  37.   * @version 1.0
  38.   */
  39. class srm_view extends GLStream {
  40.  
  41.     /**
  42.       * Check if this stream is valid for handling this action
  43.       *
  44.       */
  45.     public function is_valid({
  46.         return true;
  47.     }
  48.     
  49.     public function initialize({
  50.         // Initialize stream
  51.         GL::$stream new GLTemplate(GLConfig::$resources->file('engine/page.php'));
  52.     
  53.         // Initialize stream variables
  54.         GL::$stream->headers array(
  55.             'js' => array(
  56.                 GLConfig::$resources->url('runtime/mootools-1.2.2-core-yc.js'),
  57.                 GLConfig::$resources->url('runtime/mootools-1.2.2.2-more.js'),
  58.                 GLConfig::$resources->url('runtime/trace.js'),                
  59.             ),
  60.             'css' => array(),
  61.             'meta' => array(
  62.                 array(
  63.                     'http-equiv' => '',
  64.                     'content' => 'text/html; charset=utf-8'
  65.                 )
  66.             ),
  67.         );
  68.         GL::$stream->inline array(
  69.             'js' => array(),
  70.             'css' => array()
  71.         );        
  72.         GL::$stream->title 'GLOO Test';    
  73.         
  74.         // Append the GLAPI javascript
  75.         $glapi include(GLConfig::$resources->file('engine/glapi/get.php'));
  76.         foreach ($glapi as $r{
  77.             GL::$stream->headers['js'][$r;
  78.         }        
  79.     }
  80.  
  81.     public function post_initialize({
  82.         GLOOLink::initialize(true);
  83.     }
  84.     
  85.     public function process({
  86.  
  87.         //******** REMOVE THEESE:
  88.             
  89.         // That's all :)
  90.         $ui GLOOLink::get_object(0);
  91.         if (!$ui$ui new GLUICore();
  92.         $ui->test 'hello!';
  93.         
  94.         $panel new GLUIPanel('player_panel_1');
  95.         $panel->title 'Welcome to GloryLands Object Oriented API';
  96.         $panel->text 'The GLOO is a set of functions that allow real-time PHP and Javascript interaction, letting you concern ornly about the PHP-side of the script. The javascript DOM will automatically follow the PHP object hierectary and every PHP object can directly communicate with the Javascript itnerface.';
  97.         $ui->welcome $panel;
  98.         
  99.         $panel new GLUIPanel();
  100.         $panel->title 'Another panel';
  101.         //$panel->text = '<a href="javascript:var v=new GLUIPanel({\'text\': \'This is a test\', \'title\':\'Static testing\'});">Click me!</a>';
  102.         $_SESSION['req'0;
  103.         $panel->text '<b>Request:</b> 0';
  104.         $panel->right 20;
  105.         $ui->second $panel;
  106.             
  107.         $map new GLMap();
  108.         
  109.         $e new GLMapBackground();
  110.         $map->background $e;
  111.     
  112.     }
  113.     
  114.     public function render({
  115.  
  116.         // Render the PHP-JS linking script into an in-line javscript
  117.         GL::$stream->inline['js'][GLOOLink::compile_js();
  118.     
  119.         // Render the final output
  120.         return GL::$stream->fetch();
  121.     }
  122.     
  123. }
  124.  
  125. ?>

Documentation generated on Tue, 13 Oct 2009 23:49:15 +0300 by phpDocumentor 1.4.1