[phaux commit] r115 - in trunk: Classes/Base Classes/Phaux-base Configuration

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 5, 2007, 3:38:36 PM10/5/07
to phau...@googlegroups.com
Author: WHarford
Date: Fri Oct 5 12:37:48 2007
New Revision: 115

Modified:
trunk/Classes/Base/WHException.php
trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php
trunk/Classes/Phaux-base/WHSession.php
trunk/Configuration/base.ini

Log:
You can hide the development toolbar

Modified: trunk/Classes/Base/WHException.php
==============================================================================
--- trunk/Classes/Base/WHException.php (original)
+++ trunk/Classes/Base/WHException.php Fri Oct 5 12:37:48 2007
@@ -58,7 +58,7 @@
it from fulfilling the request.<br /><br />
<b>Error ".$errorNumber."</b><br /><br />
Please contact the webmaster ".$adminEmail.
- "<hr /><img src='/icon.png' /></body></html>");
+ "<hr /><img src='../icon.png' /></body></html>");
}

public function pretyExceptionAndDie(){
@@ -126,9 +126,9 @@
$current = $start;
for($current = $start;$current < $end ; $current++){
if($current == $line-1){
- $return .= "/*HERE --->*/";
+ $return .= "/*--->*/";
}
- $return .= $fileLines{$current};
+ $return .= $fileLines[$current];
}
if($highlight){
$return = highlight_string("<?\n".$return."?>",TRUE);

Modified: trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php
==============================================================================
--- trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php (original)
+++ trunk/Classes/Phaux-base/WHMainDevelopmentDecoration.php Fri Oct 5
12:37:48 2007
@@ -4,7 +4,7 @@
protected $showErrorConsole = FALSE;
protected $showUserErrors = TRUE;
protected $showPhpErrors = TRUE;
-
+ protected $showToolbar = true;

public function renderDecorationOn($html,$parentHtml){
return $this->renderDecoratedComponentOn($html,$parentHtml).
@@ -41,6 +41,11 @@
return $this;
}

+ public function toggleToolbar(){
+ $this->showToolbar = !$this->showToolbar;
+ return $this;
+ }
+
public function errorConsoleContent(){
$showErrors = array();
/*
@@ -111,8 +116,28 @@
}

public function renderToolbarOn($html){
+ if($this->showToolbar){
+ return $this->renderActiveToolbarOn($html);
+ }else{
+ return $this->renderInactiveToolbarOn($html);
+ }
+ }
+
+ public function renderInactiveToolbarOn($html){
+ return $html->div()->id('toolbar')->class('toolbar-inactive')->with(
+ $html->anchor()->
+ callback($this,'toggleToolbar')->
+ // liveUpdateOn('onClick',$this,'renderToolbarOn')->
+ with($html->text('>')));
+ }
+
+ public function renderActiveToolbarOn($html){
return $html->div()->id('toolbar')->with(
$html->anchor()->
+ callback($this,'toggleToolbar')->
+ //liveUpdateOn('onClick',$this,'renderToolbarOn')->
+ with($html->text('<')).
+ $html->anchor()->
callback($this->session(),'terminate')->
with('New Session').
$html->space().
@@ -156,6 +181,10 @@
font-size: 8pt;
z-index: 20;
height:15px;
+ }
+ .toolbar-inactive{
+ width:13px;
+ right:15px;
}
#toolbar a{
border:1px outset;

Modified: trunk/Classes/Phaux-base/WHSession.php
==============================================================================
--- trunk/Classes/Phaux-base/WHSession.php (original)
+++ trunk/Classes/Phaux-base/WHSession.php Fri Oct 5 12:37:48 2007
@@ -9,6 +9,7 @@
protected $currentRegistry;
protected $currentKey;
protected $isHalosOn = FALSE;
+ protected $isProfilerOn = FALSE;
protected $debugCallbackTime;
protected $debugErrors = array();

@@ -61,16 +62,20 @@
}

public function toggleHalos(){
- if($this->isHalosOn){
- $this->isHalosOn = FALSE;
- }else{
- $this->isHalosOn = TRUE;
- }
+ $this->isHalosOn = !$this->isHalosOn;
return $this;
}

public function isHalosOn(){
return $this->isHalosOn;
+ }
+
+ public function toggleProfiler(){
+ $this->isProfilerOn = !$this->isProfilerOn;
+ }
+
+ public function isProfilerOn(){
+ return $this->isProfilerOn;
}

public function debugCallbackTime(){

Modified: trunk/Configuration/base.ini
==============================================================================
--- trunk/Configuration/base.ini (original)
+++ trunk/Configuration/base.ini Fri Oct 5 12:37:48 2007
@@ -6,6 +6,7 @@

#If set to 0 the website users will not see tracebacks
debug="1"
+
#The ip address of the client that is allowed to see the workspace
workspace_ipaddr="127.0.0.1"

Reply all
Reply to author
Forward
0 new messages