Merge pull request #698 from ferOnti/master

CODE STYLE for 19 classes files
This commit is contained in:
ferOnti
2012-10-09 10:50:58 -07:00
19 changed files with 12204 additions and 12263 deletions

View File

@@ -1,6 +1,8 @@
<?php
/**
* class.replacementLogo.php
*
* @package workflow.engine.classes
*
* ProcessMaker Open Source Edition
@@ -13,93 +15,98 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @package workflow.engine.classes
*/
class replacementLogo {
//var $dir='';
/**
* This function is the constructor of the replacementLogo class
* param
* @return void
*/
function replacementLogo() {
}
/**
* This function upload a file
*
*
* @name upLoadFile
*
* @param string $dirUpload
* @param string $namefile
* @param string $typefile
* @param string $errorfile
* @param string $tpnfile
* @param string $formf
* @return string
*/
function upLoadFile($dirUpload, $namefile, $typefile, $errorfile, $tpnfile, $formf) {
//we are cheking the extension for file
$aExt = explode ( ".", $namefile );
$infoupload = ''; //|| ($formf["type"]['uploadfile'] == "application/octet-stream")image/png
if (($typefile == "image/jpeg") || ($typefile == "image/png")) {
if ($errorfile > 0) {
$infoupload = "Return Code: " . $errorfile . "<br />";
} else {
if (file_exists ( $dirUpload . $namefile )) {
$infoupload = $namefile . " already exist. ";
} else {
move_uploaded_file ( $tpnfile, $dirUpload . $namefile );
$infoupload = "Stored in: " . $dirUpload . $namefile;
}
}
} else {
$infoupload = "- " . $typefile . " Invalid file your file should be jpeg";
class replacementLogo
{
//var $dir='';
/**
* This function is the constructor of the replacementLogo class
* param
*
* @return void
*/
public function replacementLogo ()
{
}
return $infoupload;
}
/**
* This function gets the logos' names
*
*
* @name getNameLogo
*
* param
* @return array
*/
function getNameLogo($usrUid) {
require_once 'classes/model/Configuration.php';
$oCriteria = new Criteria ( 'workflow' );
$oCriteria->addSelectColumn ( ConfigurationPeer::CFG_VALUE );
$oCriteria->add ( ConfigurationPeer::CFG_UID, 'USER_LOGO_REPLACEMENT' );
$oDataset = ConfigurationPeer::doSelectRS ( $oCriteria );
$oDataset->next ();
$aRow = $oDataset->getRow ();
if (isset ( $aRow [0] ))
$ainfoLogo = @unserialize ( $aRow [0] );
else
$ainfoLogo = NULL;
return ($ainfoLogo);
}
} // end class
/**
* This function upload a file
*
*
* @name upLoadFile
*
* @param string $dirUpload
* @param string $namefile
* @param string $typefile
* @param string $errorfile
* @param string $tpnfile
* @param string $formf
* @return string
*/
public function upLoadFile ($dirUpload, $namefile, $typefile, $errorfile, $tpnfile, $formf)
{
//we are cheking the extension for file
$aExt = explode( ".", $namefile );
$infoupload = ''; //|| ($formf["type"]['uploadfile'] == "application/octet-stream")image/png
if (($typefile == "image/jpeg") || ($typefile == "image/png")) {
if ($errorfile > 0) {
$infoupload = "Return Code: " . $errorfile . "<br />";
} else {
if (file_exists( $dirUpload . $namefile )) {
$infoupload = $namefile . " already exist. ";
} else {
move_uploaded_file( $tpnfile, $dirUpload . $namefile );
$infoupload = "Stored in: " . $dirUpload . $namefile;
}
}
} else {
$infoupload = "- " . $typefile . " Invalid file your file should be jpeg";
}
return $infoupload;
}
/**
* This function gets the logos' names
*
*
* @name getNameLogo
*
* param
* @return array
*/
public function getNameLogo ($usrUid)
{
require_once 'classes/model/Configuration.php';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ConfigurationPeer::CFG_VALUE );
$oCriteria->add( ConfigurationPeer::CFG_UID, 'USER_LOGO_REPLACEMENT' );
$oDataset = ConfigurationPeer::doSelectRS( $oCriteria );
$oDataset->next();
$aRow = $oDataset->getRow();
if (isset( $aRow[0] )) {
$ainfoLogo = @unserialize( $aRow[0] );
} else {
$ainfoLogo = null;
}
return ($ainfoLogo);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
<?php
/**
* class.toolBar.php
*
* @package workflow.engine.ProcessMaker
*
* ProcessMaker Open Source Edition
@@ -13,162 +15,154 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* ToolBar - ToolBar class
*
* @package workflow.engine.ProcessMaker
*/
class ToolBar extends form
class ToolBar extends form
{
var $type = 'toolbar';
var $align = 'left';
var $type = 'toolbar';
var $align = 'left';
}
/**
/**
* XmlForm_Field_ToolBar - XmlForm_Field_ToolBar class
*
* @package workflow.engine.ProcessMaker
*/
class XmlForm_Field_ToolBar extends XmlForm_Field
class XmlForm_Field_ToolBar extends XmlForm_Field
{
var $xmlfile = '';
var $type = 'toolbar';
var $toolBar;
var $home='';
var $withoutLabel = true;
/**
* Constructor of the class XmlForm_Field_ToolBar
* @param string $xmlNode
* @param string $lang
* @param string $home
* @param string $owner
* @return void
*/
function XmlForm_Field_ToolBar($xmlNode, $lang='en', $home='', $owner)
{
parent::XmlForm_Field($xmlNode, $lang, $home, $owner);
$this->home = $home;
}
/**
* Prints the ToolBar
* @param string $value
* @return string
*/
function render( $value )
{
$this->toolBar = new toolBar( $this->xmlfile , $this->home );
$template = PATH_CORE . 'templates/' . $this->type . '.html';
$out = $this->toolBar->render( $template , $scriptCode ) ;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile( $this->toolBar->scriptURL );
$oHeadPublisher->addScriptCode( $scriptCode );
return $out;
}
var $xmlfile = '';
var $type = 'toolbar';
var $toolBar;
var $home = '';
var $withoutLabel = true;
/**
* Constructor of the class XmlForm_Field_ToolBar
*
* @param string $xmlNode
* @param string $lang
* @param string $home
* @param string $owner
* @return void
*/
function XmlForm_Field_ToolBar ($xmlNode, $lang = 'en', $home = '', $owner)
{
parent::XmlForm_Field( $xmlNode, $lang, $home, $owner );
$this->home = $home;
}
/**
* Prints the ToolBar
*
* @param string $value
* @return string
*/
function render ($value)
{
$this->toolBar = new toolBar( $this->xmlfile, $this->home );
$template = PATH_CORE . 'templates/' . $this->type . '.html';
$out = $this->toolBar->render( $template, $scriptCode );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile( $this->toolBar->scriptURL );
$oHeadPublisher->addScriptCode( $scriptCode );
return $out;
}
}
/**
* XmlForm_Field_toolButton - XmlForm_Field_toolButton class
*
* @package workflow.engine.ProcessMaker
*/
class XmlForm_Field_toolButton extends XmlForm_Field
{
var $file = '';
var $fileAlt = '';
var $url = '';
var $urlAlt = '';
var $home = 'public_html';
/* types of buttons:
var $file = '';
var $fileAlt = '';
var $url = '';
var $urlAlt = '';
var $home = 'public_html';
/* types of buttons:
* image
* text
* image/text
* text/image
*/
var $buttonType = 'image';
var $withoutLabel = false;
var $buttonStyle = '';
var $buttonType = 'image';
var $withoutLabel = false;
var $buttonStyle = '';
/*$hoverMethod : back | switch*/
var $hoverMethod='back';
var $class;
/**
* Prints the components of the toolBar
* @param string $value
* @return string
*/
function render( $value )
{
$url = $this->file;
if ($this->home === "methods")
$url = G::encryptlink( SYS_URI . $url );
if ($this->home === "public_html")
$url ='/' . $url ;
$urlAlt = $this->fileAlt;
if ($this->fileAlt!=='') {
if ($this->home === "methods")
$urlAlt = G::encryptlink( SYS_URI . $urlAlt );
if ($this->home === "public_html")
$urlAlt ='/' . $urlAlt ;
}
$this->url=$url;
$this->urlAlt=$urlAlt;
switch($this->buttonType){
case 'image':
$html='';
if ($this->hoverMethod==='back') {
$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) . '\' />';
}
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').'")\'/>';
}
else {
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'.
(($this->style)?' style="'.$this->style.'"':'').'/>';
var $hoverMethod = 'back';
var $class;
/**
* Prints the components of the toolBar
*
* @param string $value
* @return string
*/
function render ($value)
{
$url = $this->file;
if ($this->home === "methods")
$url = G::encryptlink( SYS_URI . $url );
if ($this->home === "public_html")
$url = '/' . $url;
$urlAlt = $this->fileAlt;
if ($this->fileAlt !== '') {
if ($this->home === "methods")
$urlAlt = G::encryptlink( SYS_URI . $urlAlt );
if ($this->home === "public_html")
$urlAlt = '/' . $urlAlt;
}
break;
case 'text':
$html=$this->htmlentities($this->label, ENT_QUOTES,'utf-8');
break;
case 'html':
$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>';
//$html=$this->label;
break;
case 'image/text':
$html='<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'.
(($this->style)?' style="'.$this->style.'"':'').'/><br/>'.
$this->htmlentities($this->label, ENT_QUOTES,'utf-8');
break;
case 'text/image':
$html=$this->htmlentities($this->label, ENT_QUOTES,'utf-8').
'<br/><img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'"'.
(($this->style)?' style="'.$this->style.'"':'').'/>';
break;
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">
<div class="'.$this->class.'" title="'.strip_tags($this->label).'" style="width:25px;height:25px;margin-bottom:3px"></div>
$this->url = $url;
$this->urlAlt = $urlAlt;
switch ($this->buttonType) {
case 'image':
$html = '';
if ($this->hoverMethod === 'back') {
$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 ) . '\' />';
} 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' ) . '")\'/>';
} else {
$html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/>';
}
break;
case 'text':
$html = $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' );
break;
case 'html':
$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>';
//$html=$this->label;
break;
case 'image/text':
$html = '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' );
break;
case 'text/image':
$html = $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' ) . '<br/><img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/>';
break;
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">
<div class="' . $this->class . '" title="' . strip_tags( $this->label ) . '" style="width:25px;height:25px;margin-bottom:3px"></div>
</a>';
return $html;
return $html;
}
return '<a class="toolButton" ' . (($this->buttonStyle) ? ' style="' . $this->buttonStyle . '"' : '') . (($this->onclick) ? ' onclick="' . htmlentities( $this->onclick, ENT_QUOTES, 'utf-8' ) . '"' : '') . '>' . $html . '</a>';
}
return '<a class="toolButton" '.
(($this->buttonStyle)?' style="'.$this->buttonStyle.'"':'').
(($this->onclick)?' onclick="'. htmlentities($this->onclick, ENT_QUOTES,'utf-8').'"':'').
'>'.$html.'</a>';
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
<?php
/**
* class.xmlfield_Image.php
*
* @package workflow.engine.classes
*
* ProcessMaker Open Source Edition
@@ -13,11 +15,11 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
@@ -26,23 +28,27 @@
// DEPRECATED this class is also part of the xmlform package this class will be also removed
// in future releases of pm, its discouraged the inclusion this class in the future from a
// external file like this
/**
/**
*
* @package workflow.engine.classes
*/
class XmlForm_Field_Image extends XmlForm_Field
{
var $file = '';
var $home = 'public_html';
var $withoutLabel = false;
function render( $value, $owner = null )
{
$url = G::replaceDataField($this->file, $owner->values);
if ($this->home === "methods") $url = G::encryptlink( SYS_URI . $url );
if ($this->home === "public_html") $url ='/' . $url ;
return '<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'" '.
(($this->style)?'style="'.$this->style.'"':'')
.' alt ="'.htmlentities($value,ENT_QUOTES,'utf-8').'"/>';
}
}
?>
public $file = '';
public $home = 'public_html';
public $withoutLabel = false;
public function render ($value, $owner = null)
{
$url = G::replaceDataField( $this->file, $owner->values );
if ($this->home === "methods") {
$url = G::encryptlink( SYS_URI . $url );
}
if ($this->home === "public_html") {
$url = '/' . $url;
}
return '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '" ' . (($this->style) ? 'style="' . $this->style . '"' : '') . ' alt ="' . htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '"/>';
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff