CODE STYLE class.toolBar.php

This commit is contained in:
Fernando Ontiveros
2012-10-09 13:25:46 -04:00
parent 46a75b7867
commit eb8a057ac1

View File

@@ -1,6 +1,8 @@
<?php <?php
/** /**
* class.toolBar.php * class.toolBar.php
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
@@ -26,6 +28,7 @@
/** /**
* ToolBar - ToolBar class * ToolBar - ToolBar class
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
*/ */
class ToolBar extends form class ToolBar extends form
@@ -36,6 +39,7 @@ class ToolBar extends form
/** /**
* XmlForm_Field_ToolBar - XmlForm_Field_ToolBar class * XmlForm_Field_ToolBar - XmlForm_Field_ToolBar class
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
*/ */
class XmlForm_Field_ToolBar extends XmlForm_Field class XmlForm_Field_ToolBar extends XmlForm_Field
@@ -48,6 +52,7 @@ class XmlForm_Field_ToolBar extends XmlForm_Field
/** /**
* Constructor of the class XmlForm_Field_ToolBar * Constructor of the class XmlForm_Field_ToolBar
*
* @param string $xmlNode * @param string $xmlNode
* @param string $lang * @param string $lang
* @param string $home * @param string $home
@@ -62,6 +67,7 @@ class XmlForm_Field_ToolBar extends XmlForm_Field
/** /**
* Prints the ToolBar * Prints the ToolBar
*
* @param string $value * @param string $value
* @return string * @return string
*/ */
@@ -79,6 +85,7 @@ class XmlForm_Field_ToolBar extends XmlForm_Field
/** /**
* XmlForm_Field_toolButton - XmlForm_Field_toolButton class * XmlForm_Field_toolButton - XmlForm_Field_toolButton class
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
*/ */
class XmlForm_Field_toolButton extends XmlForm_Field class XmlForm_Field_toolButton extends XmlForm_Field
@@ -103,6 +110,7 @@ class XmlForm_Field_toolButton extends XmlForm_Field
/** /**
* Prints the components of the toolBar * Prints the components of the toolBar
*
* @param string $value * @param string $value
* @return string * @return string
*/ */
@@ -126,37 +134,26 @@ class XmlForm_Field_toolButton extends XmlForm_Field
case 'image': case 'image':
$html = ''; $html = '';
if ($this->hoverMethod === 'back') { if ($this->hoverMethod === 'back') {
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'. $html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'backImage(this,"url(' . htmlentities( $urlAlt, ENT_QUOTES, 'utf-8' ) . ') no-repeat")\' onmouseout=\'backImage(this,"")\' title=\'' . addslashes( $this->label ) . '\' />';
(($this->style)?' style="'.$this->style.'"':'').' onmouseover=\'backImage(this,"url('.htmlentities( $urlAlt, ENT_QUOTES, 'utf-8').') no-repeat")\' onmouseout=\'backImage(this,"")\' title=\'' . addslashes($this->label) . '\' />'; } elseif ($this->hoverMethod === 'switch') {
} $html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'switchImage(this,"' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '","' . htmlentities( $urlAlt, ENT_QUOTES, 'utf-8' ) . '")\' onmouseout=\'switchImage(this,"' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '","' . htmlentities( $urlAlt, ENT_QUOTES, 'utf-8' ) . '")\'/>';
elseif($this->hoverMethod==='switch'){ } else {
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'. $html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/>';
(($this->style)?' style="'.$this->style.'"':'').' onmouseover=\'switchImage(this,"'.htmlentities( $url, ENT_QUOTES, 'utf-8').'","'.htmlentities( $urlAlt, ENT_QUOTES, 'utf-8').'")\' onmouseout=\'switchImage(this,"'.htmlentities( $url, ENT_QUOTES, 'utf-8').'","'.htmlentities( $urlAlt, ENT_QUOTES, 'utf-8').'")\'/>';
}
else {
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'.
(($this->style)?' style="'.$this->style.'"':'').'/>';
} }
break; break;
case 'text': case 'text':
$html = $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' ); $html = $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' );
break; break;
case 'html': case 'html':
$html='<div '. $html = '<div ' . ' onmouseover=\'backImage(this,"url(' . htmlentities( $urlAlt, ENT_QUOTES, 'utf-8' ) . ') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">' . $this->label . '</div>';
' onmouseover=\'backImage(this,"url('.htmlentities( $urlAlt, ENT_QUOTES, 'utf-8').') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">'.
$this->label.'</div>';
//$html=$this->label; //$html=$this->label;
break; break;
case 'image/text': case 'image/text':
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'. $html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' );
(($this->style)?' style="'.$this->style.'"':'').'/><br/>'.
$this->htmlentities($this->label, ENT_QUOTES,'utf-8');
break; break;
case 'text/image': case 'text/image':
$html=$this->htmlentities($this->label, ENT_QUOTES,'utf-8'). $html = $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' ) . '<br/><img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/>';
'<br/><img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'.
(($this->style)?' style="'.$this->style.'"':'').'/>';
break; break;
case 'class': case 'class':
$html = '<a href="#" onclick="' . $this->onclick . '" onmouseover="backImage(this, \'url(/images/dynamicForm/hover.gif) no-repeat\')" onmouseout="backImage(this, \'\')" style="width:25px;height:25px;margin-bottom:3px"> $html = '<a href="#" onclick="' . $this->onclick . '" onmouseover="backImage(this, \'url(/images/dynamicForm/hover.gif) no-repeat\')" onmouseout="backImage(this, \'\')" style="width:25px;height:25px;margin-bottom:3px">
@@ -165,10 +162,7 @@ class XmlForm_Field_toolButton extends XmlForm_Field
return $html; return $html;
} }
return '<a class="toolButton" '. return '<a class="toolButton" ' . (($this->buttonStyle) ? ' style="' . $this->buttonStyle . '"' : '') . (($this->onclick) ? ' onclick="' . htmlentities( $this->onclick, ENT_QUOTES, 'utf-8' ) . '"' : '') . '>' . $html . '</a>';
(($this->buttonStyle)?' style="'.$this->buttonStyle.'"':'').
(($this->onclick)?' onclick="'. htmlentities($this->onclick, ENT_QUOTES,'utf-8').'"':'').
'>'.$html.'</a>';
} }
} }
?> ?>