Modified:
trunk/Classes/Base/WHDate.php
trunk/Classes/Base/WHDateAndTime.php
trunk/Classes/Base/WHMultipleInheritance.php
trunk/Classes/Base/WHTime.php
trunk/Classes/Phaux-base/WHComponent.php
trunk/Classes/Phaux-base/WHConfiguration.php
trunk/Classes/Phaux-base/WHHalo.php
trunk/Classes/Phaux-base/WHHtmlRoot.php
trunk/Classes/Phaux-base/WHInspector.php
trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php
trunk/Classes/Phaux-base/WHSession.php
trunk/Classes/Phaux-render/WHCheckBoxTag.php
trunk/Classes/Phaux-render/WHFormInputTag.php
trunk/Classes/Phaux-render/WHHtmlCanvas.php
trunk/Classes/Phaux-render/WHRadioButtonTag.php
trunk/Classes/Phaux-render/WHSelectTag.php
trunk/Classes/Phaux-render/WHTag.php
trunk/Classes/Phaux-render/phaux-render.php
trunk/Classes/Phaux-test/WHCounter.php
trunk/Classes/REServe/REDate.php
trunk/Configuration/base.ini
trunk/Configuration/counter.ini
trunk/HtmlRoot/phaux.php
trunk/HtmlRoot/phpInfo.php
trunk/HtmlRoot/resource.php
trunk/HtmlRoot/scripts-standard/standardScript.js
Log:
Metavera changes made over the course of the last few months
Modified: trunk/Classes/Base/WHDate.php
==============================================================================
--- trunk/Classes/Base/WHDate.php (original)
+++ trunk/Classes/Base/WHDate.php Thu Dec 18 07:46:39 2008
@@ -200,13 +200,13 @@
}
public function asNiceString(){
- if($this == Object::construct('WHDate')){
+ if(self::equal($this, Object::construct('WHDate'))){
return 'Today';
}
- if($this == Object::construct('WHDate')->yesterday()){
+ if(self::equal($this, Object::construct('WHDate')->yesterday())){
return 'Yesterday';
}
- if($this == Object::construct('WHDate')->tomorrow()){
+ if(self::equal($this, Object::construct('WHDate')->tomorrow())){
return 'Tomorrow';
}
@@ -216,4 +216,9 @@
public function __toString(){
return $this->asAmericanString();
}
+
+ public static function equal($date1, $date2) {
+ return $date1 && $date2 && $date1->month() == $date2->month() &&
$date1->day() == $date2->day() && $date1->year() == $date2->year();
+ }
+
}
Modified: trunk/Classes/Base/WHDateAndTime.php
==============================================================================
--- trunk/Classes/Base/WHDateAndTime.php (original)
+++ trunk/Classes/Base/WHDateAndTime.php Thu Dec 18 07:46:39 2008
@@ -37,12 +37,16 @@
if(strtotime($aString) === FALSE){
return FALSE;
}
- $this->thisForClass("WHDate")->fromUnixTimestamp(strtotime($aString));
- $this->thisForClass("WHTime")->fromUnixTimestamp(strtotime($aString));
+ $this->fromUnixTimestamp(strtotime($aString));
return $this;
}
-
+ public function fromUnixTimestamp($aTimeStamp) {
+ $this->thisForClass("WHDate")->fromUnixTimestamp($aTimeStamp);
+ $this->thisForClass("WHTime")->fromUnixTimestamp($aTimeStamp);
+ return $this;
+ }
+
protected function asSqlValueString(){
$val = $this->thisForClass("WHDate")->asSqlValueString()
." ".
Modified: trunk/Classes/Base/WHMultipleInheritance.php
==============================================================================
--- trunk/Classes/Base/WHMultipleInheritance.php (original)
+++ trunk/Classes/Base/WHMultipleInheritance.php Thu Dec 18 07:46:39 2008
@@ -27,6 +27,7 @@
}
public function __call($methodName,$args){
+ echo $methodName."<br>";
if($this->hasMethod($methodName)){
return call_user_func_array(
array($this->whoHasMethod($methodName),
@@ -130,7 +131,7 @@
*/
public function thisForClass($className){
foreach($this->objects as $instance){
- if($instance->getClass() == $className){
+ if(is_a($instance, $className)){ //$instance->getClass() == $className){
return $instance;
}
}
Modified: trunk/Classes/Base/WHTime.php
==============================================================================
--- trunk/Classes/Base/WHTime.php (original)
+++ trunk/Classes/Base/WHTime.php Thu Dec 18 07:46:39 2008
@@ -77,4 +77,8 @@
return $this->asSqlValueString();
}
+ public function equal($time1, $time2) {
+ return $time1->second() == $time2->second() && $time1->minute() ==
$time2->minute() && $time1->hour() == $time2->hour();
+ }
+
}
Modified: trunk/Classes/Phaux-base/WHComponent.php
==============================================================================
--- trunk/Classes/Phaux-base/WHComponent.php (original)
+++ trunk/Classes/Phaux-base/WHComponent.php Thu Dec 18 07:46:39 2008
@@ -82,6 +82,10 @@
return $this;
}
+ public function isDialog(){
+ return is_object($this->parentComponent);
+ }
+
public function inform($aString){
$this->callDialog(Object::Construct('WHInformDialog')->setMessage($aString));
return $this;
@@ -135,6 +139,12 @@
return $this;
}
+ public function shiftDecoration($aWHDecoration){
+ $aWHDecoration->setDecoratedComponent($this);
+ array_unshift($this->decorations,$aWHDecoration);
+ return $this;
+ }
+
public function removeDecoration($aWHDecoration){
foreach($this->decorations as $position => &$decoration){
@@ -232,7 +242,7 @@
}
public function parentComponent(){
- return $this->parentComponet;
+ return $this->parentComponent;
}
public function setParentComponent($aComponent){
Modified: trunk/Classes/Phaux-base/WHConfiguration.php
==============================================================================
--- trunk/Classes/Phaux-base/WHConfiguration.php (original)
+++ trunk/Classes/Phaux-base/WHConfiguration.php Thu Dec 18 07:46:39 2008
@@ -35,10 +35,26 @@
return $_SERVER['SCRIPT_NAME'];
}
+
+ public function prettyUrl() {
+ return $this->configValueBySubjectAndKey('server','pretty_url');
+ }
+
+ public function prettyOrBaseUrl() {
+ if ($this->prettyUrl()) {
+ return $this->prettyUrl();
+ } else {
+ return $this->baseUrl();
+ }
+ }
+
public function basePath(){
return
substr($this->baseUrl(),0,strpos($this->baseUrl(),$this->scriptName()));
}
+ public function resourceUrl(){
+ return $this->basePath()."/resource.php/".$this->applicationName();
+ }
public function debugMode(){
return $this->configValueBySubjectAndKey('general','debug');
@@ -104,20 +120,31 @@
**Supplying the path would be a good idea as well
*/
static function parseConfigurationFileForApp($appName){
- $base_configuration = parse_ini_file("../Configuration/base.ini",TRUE);
+
if(eregi('^[A-Z_0-9_.]*$', $appName) &&
file_exists('../Configuration/'.$appName.'.ini')){
$new_conf = parse_ini_file('../Configuration/'.$appName.'.ini',TRUE);
+
+ if(isset($new_conf['general']['parent'])){
+ $parent_configuration =
self::parseConfigurationFileForApp($new_conf['general']['parent']);
+ }
+
+
foreach($new_conf as $section => $values){
- if(isset($base_configuration[$section]) &&
is_array($base_configuration[$section])){
- $new_conf[$section] =
array_merge($base_configuration[$section],$values);
+ if(isset($parent_configuration[$section]) &&
is_array($parent_configuration[$section])){
+ $new_conf[$section] =
array_merge($parent_configuration[$section],$values);
}
}
- foreach($base_configuration as $section =>$values){
- if(!isset($new_conf[$section])){
- $new_conf[$section] = $values;
- }
+
+ if(isset($parent_configuration)){
+ foreach($parent_configuration as $section =>$values){
+ if(!isset($new_conf[$section])){
+ $new_conf[$section] = $values;
+ }
+ }
}
return $new_conf;
+ }else{
+ throw new WHException("Configuration for $appName not found");
}
return NULL;
}
Modified: trunk/Classes/Phaux-base/WHHalo.php
==============================================================================
--- trunk/Classes/Phaux-base/WHHalo.php (original)
+++ trunk/Classes/Phaux-base/WHHalo.php Thu Dec 18 07:46:39 2008
@@ -77,7 +77,7 @@
$this->renderSourceButtonOn($html)
)
).
- $this->decoratedComponent->__toString()
+ get_class($this->decoratedComponent)
);
}
public function renderDecorationOn($html,$parentHTML){
Modified: trunk/Classes/Phaux-base/WHHtmlRoot.php
==============================================================================
--- trunk/Classes/Phaux-base/WHHtmlRoot.php (original)
+++ trunk/Classes/Phaux-base/WHHtmlRoot.php Thu Dec 18 07:46:39 2008
@@ -8,7 +8,7 @@
protected $scripts = array();
protected $pathExtra = "";
protected $urlArgs = array();
-
+ protected $headTags = array();
public function title(){
return $this->title;
@@ -21,6 +21,11 @@
$this->title .= $aString;
}
+ public function addHeadTag($anHtmlTag){
+ $this->headTags[] = $anHtmlTag;
+ return $this;
+ }
+
/**
* Pass a style sheet name like stannardPlacement.css
*/
@@ -57,6 +62,7 @@
$title = $html->title()->with($this->title());
$baseUrl = $_SESSION[$app]['session']->configuration()->basePath();
$styles = "";
+ $headExtra = '';
foreach($this->styles as $style => $t){
if($t){
$styles .=
$html->link()->type("text/css")->href($baseUrl.$style)->rel("stylesheet");
@@ -68,8 +74,14 @@
$styles .=
$html->script()->type("text/javascript")->src($baseUrl.$script)->with("");
}
}
+
+ foreach($this->headTags as $tag){
+ $headExtra .= $tag->__toString();
+ }
+
+
return '<meta content="text/html; charset=utf-8"
http-equiv="Content-Type" />'.
- $title.$styles;
+ $title.$styles.$headExtra;
}
Modified: trunk/Classes/Phaux-base/WHInspector.php
==============================================================================
--- trunk/Classes/Phaux-base/WHInspector.php (original)
+++ trunk/Classes/Phaux-base/WHInspector.php Thu Dec 18 07:46:39 2008
@@ -86,9 +86,17 @@
public function renderContentOn($html){
return $html->render($this->path).
-
$html->headingLevel(1)->with($this->path->currentSegment()->__toString()).
+ $html->headingLevel(1)->with(get_class($this->path->currentSegment())).
$this->renderMembersOn($html).
$this->renderWorkspaceOn($html);
+ }
+
+ public function updateRoot($anHtmlRoot){
+ $anHtmlRoot->needsStyle('styles-standard/standardStyle.css');
+ $anHtmlRoot->needsStyle('styles-standard/standardPlacement.css');
+ $anHtmlRoot->needsStyle('styles-standard/kalseyTabs.css');
+ $anHtmlRoot->needsScript('scripts-standard/standardScript.js');
+ return $this;
}
}
Modified: trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php
==============================================================================
--- trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php (original)
+++ trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php Thu Dec 18
07:46:39 2008
@@ -9,8 +9,11 @@
protected $showToolbar = true;
public function renderDecorationOn($html,$parentHtml){
- return $this->renderDecoratedComponentOn($html,$parentHtml).
- $this->renderToolbarOn($html);
+ $return = $this->renderDecoratedComponentOn($html,$parentHtml);
+
if($this->session()->configuration()->configValueBySubjectAndKey('general','showtoolbar')){
+ $return .= $this->renderToolbarOn($html);
+ }
+ return $return;
}
public function sessionMemoryUsage(){
@@ -82,7 +85,7 @@
}
return
- $html->div()->id('toolbar-console')->with(
+ $html->div()->id('phuax-toolbar-console')->with(
$html->anchor()->liveUpdateWithCallbackOn('onClick',
$this,'renderErrorConsoleOn',array(),
$this->session(),'clearDebugErrors',array())->
@@ -126,7 +129,7 @@
}
public function renderInactiveToolbarOn($html){
- return $html->div()->id('toolbar')->class('toolbar-inactive')->with(
+ return $html->div()->id('phaux-toolbar')->class('toolbar
toolbar-inactive')->with(
$html->anchor()->
callback($this,'toggleToolbar')->
// liveUpdateOn('onClick',$this,'renderToolbarOn')->
@@ -134,7 +137,7 @@
}
public function renderActiveToolbarOn($html){
- return $html->div()->id('toolbar')->with(
+ return $html->div()->id('phaux-toolbar')->class('toolbar')->with(
$html->anchor()->
callback($this,'toggleToolbar')->
//liveUpdateOn('onClick',$this,'renderToolbarOn')->
@@ -171,10 +174,11 @@
public function style(){
return '
- #toolbar {
+ #phaux-toolbar {
position: fixed;
- bottom: 0;
- left: 0; right: 0;
+ bottom: 0 ! important;
+ left: 0 ! important ;
+ right: 0 ! important;
margin-top: 40px;
padding: 3px;
padding-top:5px;
@@ -183,12 +187,15 @@
font-size: 8pt;
z-index: 20;
height:15px;
+ min-height: 0px;
+ -webkit-box-sizing: content-box;
+
}
.toolbar-inactive{
width:13px;
right:15px;
}
- #toolbar a{
+ #phaux-toolbar a{
border:1px outset;
padding:2px;
text-decoration:none;
@@ -196,16 +203,16 @@
margin-right:2px;
}
- #toolbar a:active{
+ #phaux-toolbar a:active{
border:1px inset;
background: #d0d0d0;
}
- #toolbar a.active{
+ #phaux-toolbar a.active{
border:1px inset;
background: #d0d0d0;
}
- #toolbar-console {
+ #phaux-toolbar-console {
position: fixed;
bottom: 23px;
right: 0;
@@ -218,7 +225,7 @@
overflow:hidden;
background: #d3d3d3;
}
- #toolbar-console #console-output{
+ #phaux-toolbar-console #console-output{
position: fixed;
background:white;
overflow:auto;
@@ -229,5 +236,13 @@
}
';
}
-
+
+ public function updateRoot($anHtmlRoot){
+ //$anHtmlRoot->needsStyle('styles-standard/standardStyle.css');
+ $anHtmlRoot->needsStyle('styles-standard/standardPlacement.css');
+ $anHtmlRoot->needsStyle('styles-standard/kalseyTabs.css');
+ $anHtmlRoot->needsScript('scripts-standard/standardScript.js');
+ return $this;
+ }
+
}
Modified: trunk/Classes/Phaux-base/WHSession.php
==============================================================================
--- trunk/Classes/Phaux-base/WHSession.php (original)
+++ trunk/Classes/Phaux-base/WHSession.php Thu Dec 18 07:46:39 2008
@@ -237,14 +237,14 @@
global $app;
global $errorHandler;
session_destroy();
- header("Location: ".$_SESSION[$app]['configuration']->baseUrl()."/$app");
+
header("Location: ".$_SESSION[$app]['configuration']->prettyOrBaseUrl()."/$app");
$errorHandler->end();
exit;
}
public function url(){
global $app;
- $url = $this->configuration()->baseUrl().
+ $url = $this->configuration()->prettyOrBaseUrl().
"/".
$this->appName.
"?_r=".$this->currentRegistryKey();
Modified: trunk/Classes/Phaux-render/WHCheckBoxTag.php
==============================================================================
--- trunk/Classes/Phaux-render/WHCheckBoxTag.php (original)
+++ trunk/Classes/Phaux-render/WHCheckBoxTag.php Thu Dec 18 07:46:39 2008
@@ -2,8 +2,22 @@
/**
* @package Phaux-render
*/
-class WHCheckBoxTag extends WHRadioButtonTag {
+class WHCheckBoxTag extends WHFormInputTag {
+
public function type(){
return "checkbox";
}
-}
\ No newline at end of file
+
+ public function checked(){
+ $this->setAttribute("checked","true");
+ return $this;
+ }
+
+ public function setChecked($aBool) {
+ if ($aBool) {
+ $this->checked();
+ }
+ return $this;
+ }
+
+}
Modified: trunk/Classes/Phaux-render/WHFormInputTag.php
==============================================================================
--- trunk/Classes/Phaux-render/WHFormInputTag.php (original)
+++ trunk/Classes/Phaux-render/WHFormInputTag.php Thu Dec 18 07:46:39 2008
@@ -3,7 +3,7 @@
* @package Phaux-render
*/
class WHFormInputTag extends WHTag {
-
+
function __construct(){
parent::__construct();
$this->setAttribute("type",$this->type());
Modified: trunk/Classes/Phaux-render/WHHtmlCanvas.php
==============================================================================
--- trunk/Classes/Phaux-render/WHHtmlCanvas.php (original)
+++ trunk/Classes/Phaux-render/WHHtmlCanvas.php Thu Dec 18 07:46:39 2008
@@ -136,6 +136,10 @@
return $this->constructTagWithClass("WHRadioButtonTag");
}
+ public function checkBox() {
+ return $this->constructTagWithClass("WHCheckBoxTag");
+ }
+
public function option(){
return $this->constructTagWithClass("WHOptionTag");
}
@@ -181,7 +185,15 @@
public function style(){
return $this->constructTagWithClass("WHStyleTag");
}
-
+
+ public function label($aString) {
+ return $this->constructTagWithClass("WHFormLabelTag")->with($aString);
+ }
+
+ public function button() {
+ return $this->constructTagWithClass("WHButtonTag");
+ }
+
public function render($component){
$return = $this->constructTagWithClass("WHHtmlText")
->with($component->renderOn($this));
Modified: trunk/Classes/Phaux-render/WHRadioButtonTag.php
==============================================================================
--- trunk/Classes/Phaux-render/WHRadioButtonTag.php (original)
+++ trunk/Classes/Phaux-render/WHRadioButtonTag.php Thu Dec 18 07:46:39 2008
@@ -2,7 +2,7 @@
/**
* @package Phaux-render
*/
-class WHRadioButtonTag extends WHFormInputTag {
+class WHRadioButtonTag extends WHCheckBoxTag {
protected $group;
public function type(){
@@ -22,12 +22,6 @@
public function callback($object,$function,$args = ""){
$this->error(__CLASS__.' can not have a callback associated with it.'.
__CLASS__.' Must be part of a WHRadioButtonGroup');
- return $this;
- }
-
-
- public function checked(){
- $this->setAttribute("checked","true");
return $this;
}
Modified: trunk/Classes/Phaux-render/WHSelectTag.php
==============================================================================
--- trunk/Classes/Phaux-render/WHSelectTag.php (original)
+++ trunk/Classes/Phaux-render/WHSelectTag.php Thu Dec 18 07:46:39 2008
@@ -127,7 +127,7 @@
public function setLabels($anArray){
$this->labels = $anArray;
- return this;
+ return $this;
}
public function submitFormOnChange(){
@@ -154,8 +154,8 @@
option()->
value($position)->
with($this->labelForItem($value));
-
- if($value === $this->selectedItem()){
+
+ if($value === $this->selectedItem()){
$option->selected();
}
$return .= $option->__toString();
Modified: trunk/Classes/Phaux-render/WHTag.php
==============================================================================
--- trunk/Classes/Phaux-render/WHTag.php (original)
+++ trunk/Classes/Phaux-render/WHTag.php Thu Dec 18 07:46:39 2008
@@ -8,7 +8,10 @@
protected $htmlCanvas;
protected $callbackKey;/*the key of the callback to exec when clicked */
protected $doesNotNeedClose = FALSE;
-
+
+ protected $ensure_id;
+ protected static $ensure_id_counter = 0;
+
public function tag (){
/*
** the subclass should define this tag
@@ -137,13 +140,18 @@
}else{
$return .= ">";
- $return .= sprintf("%s",$contents);
+ $return .= $contents;//sprintf("%s",$contents);
$return .= "</".$this->tag().">";
}
return $return;
}
-
+ public function ensure_id() {
+ if (!$this->ensure_id && !$this->attributeAt('id')) {
+ $this->ensure_id = ++self::$ensure_id_counter;
+ $this->setAttribute('id', 'id' . $this->ensure_id);
+ }
+ }
}
Modified: trunk/Classes/Phaux-render/phaux-render.php
==============================================================================
--- trunk/Classes/Phaux-render/phaux-render.php (original)
+++ trunk/Classes/Phaux-render/phaux-render.php Thu Dec 18 07:46:39 2008
@@ -23,9 +23,9 @@
include("WHOptionTag.php");
include("WHListItemTag.php");
include("WHSelectTag.php");
+include("WHCheckBoxTag.php");
include("WHRadioButtonGroup.php");
include("WHRadioButtonTag.php");
-include("WHCheckBoxTag.php");
include("WHDivTag.php");
include("WHLinkTag.php");
include("WHScriptTag.php");
@@ -33,3 +33,5 @@
include('WHTextAreaTag.php');
include('WHStyleTag.php');
include('WHFileInputTag.php');
+include('WHLabelTag.php');
+include('WHButtonTag.php');
Modified: trunk/Classes/Phaux-test/WHCounter.php
==============================================================================
--- trunk/Classes/Phaux-test/WHCounter.php (original)
+++ trunk/Classes/Phaux-test/WHCounter.php Thu Dec 18 07:46:39 2008
@@ -22,7 +22,11 @@
}
public function subtract(){
- $this->counter--;
+ if ($this->counter == 0) {
+
$this->callDialog(Object::construct('WHInformDialog')->setMessage('Negative :('));
+ } else {
+ $this->counter--;
+ }
}
public function renderContentOn($html){
Modified: trunk/Classes/REServe/REDate.php
==============================================================================
--- trunk/Classes/REServe/REDate.php (original)
+++ trunk/Classes/REServe/REDate.php Thu Dec 18 07:46:39 2008
@@ -40,4 +40,4 @@
return "date";
}
-}
\ No newline at end of file
+}
Modified: trunk/Configuration/base.ini
==============================================================================
--- trunk/Configuration/base.ini (original)
+++ trunk/Configuration/base.ini Thu Dec 18 07:46:39 2008
@@ -3,8 +3,8 @@
main_class="WHComponent"
configuration_class="WHConfiguration"
render_class="WHHtmlCanvas"
-use_cookie="0"
-
+use_cookie=0
+showtoolbar = 1
#If set to 0 the website users will not see tracebacks
debug="1"
@@ -15,7 +15,7 @@
admin_email='f...@bar.com'
#prevents the user hitting reload and doing the same thing twice
-redirect_after_callback="1" #State registry does not work when set to 0
+redirect_after_callback="0" #State registry does not work when set to 0
[server]
@@ -29,12 +29,12 @@
Render="../Classes/Phaux-render/phaux-render.php"
[styles]
-standard="styles-standard/standardStyle.css"
-placement="styles-standard/standardPlacement.css"
-kalseyTabs="styles-standard/kalseyTabs.css"
+;standard="styles-standard/standardStyle.css"
+;placement="styles-standard/standardPlacement.css"
+;kalseyTabs="styles-standard/kalseyTabs.css"
[scripts]
-standard="scripts-standard/standardScript.js"
+;standard="scripts-standard/standardScript.js"
#Dicectories were you keep css/js/images should be listed here
[resources]
Modified: trunk/Configuration/counter.ini
==============================================================================
--- trunk/Configuration/counter.ini (original)
+++ trunk/Configuration/counter.ini Thu Dec 18 07:46:39 2008
@@ -1,5 +1,6 @@
[general]
main_class="WHCounter"
+parent=base
[includes]
Phaux-test="../Classes/Phaux-test/phaux-test.php"
Modified: trunk/HtmlRoot/phaux.php
==============================================================================
--- trunk/HtmlRoot/phaux.php (original)
+++ trunk/HtmlRoot/phaux.php Thu Dec 18 07:46:39 2008
@@ -50,7 +50,7 @@
foreach($app_configurations[$app]['includes'] as $var => $value){
include($value);
}
-
+
$configuration_class =
$app_configurations[$app]['general']['configuration_class'];
$configuration = Object::construct($configuration_class);
$configuration->setApplicationName($app)->
@@ -184,20 +184,16 @@
$html = WHHtmlCanvas::construct($configuration->renderClass());
if(!isset($_REQUEST['_lu']) || $_REQUEST['_lu'] == ""){
-
+
+ $styles = trim($_SESSION[$app]['mainComponent']->styles());
+ $scripts = trim($_SESSION[$app]['mainComponent']->scripts());
+
$html->html()->with(
$html->head()->with(
$htmlRoot->renderHeadContentsOn($html).
-
- $html->style()->with(
- $_SESSION[$app]['mainComponent']->styles()
- ).
- $html->script()->type("text/javascript")->with(
- $_SESSION[$app]['mainComponent']->scripts()
- )
- ).
-
-
+ ($styles ? $html->style()->with($styles) : '').
+ ($scripts ?
$html->script()->type("text/javascript")->with($scripts) : '')
+ ).
$html->body()->id('main-body')->with(
$_SESSION[$app]['mainComponent']->renderOn($html)
)
Modified: trunk/HtmlRoot/phpInfo.php
==============================================================================
--- trunk/HtmlRoot/phpInfo.php (original)
+++ trunk/HtmlRoot/phpInfo.php Thu Dec 18 07:46:39 2008
@@ -1,2 +1,2 @@
<?php
-//phpinfo();
\ No newline at end of file
+phpinfo();
\ No newline at end of file
Modified: trunk/HtmlRoot/resource.php
==============================================================================
--- trunk/HtmlRoot/resource.php (original)
+++ trunk/HtmlRoot/resource.php Thu Dec 18 07:46:39 2008
@@ -43,6 +43,7 @@
}
header('Content-Type: '.$mime);
readfile($dir.'/'.$resource);
+ exit;
}
}
Modified: trunk/HtmlRoot/scripts-standard/standardScript.js
==============================================================================
--- trunk/HtmlRoot/scripts-standard/standardScript.js (original)
+++ trunk/HtmlRoot/scripts-standard/standardScript.js Thu Dec 18 07:46:39
2008
@@ -8,32 +8,45 @@
return uri + separator + key + "=" + escape(value);
}
-function xmlLiveUpdaterForForm(aForm,uri){
- var newUri = uri;
- for (i=0; i<aForm.childNodes.length; i++) {
-
- if (aForm.childNodes[i].tagName == "INPUT") {
- if (aForm.childNodes[i].type == "checkbox" ||
- aForm.childNodes[i].type == "radio" ) {
- if (aForm.childNodes[i].checked) {
- newUri =
addParameter(newUri,aForm.childNodes[i].name,aForm.childNodes[i].value);
- }else if (aForm.childNodes[i].type != "radio" ){
- newUri =
addParameter(newUri,aForm.childNodes[i].name,aForm.childNodes[i].value);
+function processNodes(nodes, uri) {
+ for (var i = 0; i < nodes.length; i++) {
+ if (nodes[i].tagName == "INPUT") {
+ if (nodes[i].type == "checkbox" ||
+ nodes[i].type == "radio" ) {
+ if (nodes[i].type == "checkbox" ) {
+ if(nodes[i].checked){
+ uri = addParameter(uri,nodes[i].name,nodes[i].value);
+ }
+ }else if (nodes[i].type == "radio" ){
+ uri = addParameter(uri,nodes[i].name,nodes[i].value);
}
- }else{
- newUri =
addParameter(newUri,aForm.childNodes[i].name,aForm.childNodes[i].value);
+ }else{
+ uri = addParameter(uri,nodes[i].name,nodes[i].value);
}
- }else if(aForm.childNodes[i].tagName == "SELECT") {
- newUri = addParameter(newUri,
- aForm.childNodes[i].name,
-
aForm.childNodes[i].options[aForm.childNodes[i].selectedIndex].value);
- }else if (aForm.childNodes[i].tagName == "TEXTAREA") {
- newUri =
addParameter(newUri,aForm.childNodes[i].name,aForm.childNodes[i].value);
+ }else if(nodes[i].tagName == "SELECT") {
+ uri = addParameter(uri,
+ nodes[i].name,
+ nodes[i].options[nodes[i].selectedIndex].value);
+ }else if (nodes[i].tagName == "TEXTAREA") {
+ uri = addParameter(uri,nodes[i].name,nodes[i].value);
+ }else if(nodes[i].tagName == "BUTTON"){
+
+ if(nodes[i].wasClicked == true){
+ uri = addParameter(uri,nodes[i].name,nodes[i].value);
+ }
+ } else {
+ uri = processNodes(nodes[i].childNodes, uri);
}
+
}
- xmlLiveUpdaterUri(newUri);
+ return uri;
}
+
+function xmlLiveUpdaterForForm(aForm,uri){
+ xmlLiveUpdaterUri(processNodes(aForm.childNodes, uri));
+}
+
function createDataPacket(parameters) {
var dataPacket = "";
for(var i=0; i<parameters.length; i++) {
@@ -160,12 +173,14 @@
** and most likely an error. Replace the contents of the
** entire page
*/
+
if (child.tagName == "dom") {
var elementId = child.getAttribute("id");
var element = document.getElementById(elementId);
liveUpdateDOM(element, child);
}
- else if(child.tagName == "script") {
+ else if(child.tagName.toLowerCase() == "script") {
+
if(child.textContent){
eval(child.textContent);
}
@@ -178,9 +193,18 @@
//Safari!
eval(child.childNodes[1].data);
}
+
+ var src = child.getAttribute('src');
+ if (src) {
+ // append it to the body so it's processed
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = src;
+ document.body.appendChild(script);
+ }
+
}else /*if (child.tagName == "innerHtml")*/ {
var elementId = child.getAttribute("id");
-
var element = document.getElementById(elementId);
if(child.firstChild.data){
element.innerHTML = child.firstChild.data;
@@ -193,16 +217,25 @@
element.innerHTML = iHtml;
}
+ // do we have any inline js that needs to be processed?
+ processInlineJS(element);
}
}
+function processInlineJS(element) {
+ var s = element.getElementsByTagName('script');
+ for (var i = 0; i < s.length; i++) {
+ xmlLiveProcessOne(s[i]);
+ }
+}
function xmlProcessResults(response) {
for(var i=0; i < response.documentElement.childNodes.length; i++) {
var child = response.documentElement.childNodes[i];
+
xmlLiveProcessOne(child);
}
}
@@ -261,7 +294,7 @@
function processRequestChange() {
if(request.readyState == 4) {
-
+
window.status = "Getting new instructions...";
if(request && request.responseXML &&
request.responseXML.documentElement) {