Skip to content

Commit

Permalink
🐛 BASE #216 tornando o metodo mais OO
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Mar 1, 2020
1 parent d0c9c0d commit ef8ac74
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions base/classes/webform/TTreeView.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class TTreeView extends TControl
/**
* Implementa Tree View
*
* O parametro $mixData pode ser um array de dados ou o nome de uma tabela. Se for o nome de uma tabela,
* o carregamento dos filhos será feito dinamicamente ao clicar no item pai
* O parametro $mixData pode ser um array de dados
*
* A função definida no parametro jsOnClick recebe o id do item clicado e deve ser utilizado para
* recuperar attributos do nó.
Expand Down Expand Up @@ -168,23 +167,18 @@ public function __construct( $strName=null, $strRootLabel = null, $mixData = nul
//$this->enableRadio($boolEnableRadioButtons);
$this->addFormSearchFields( $mixFormSearchFields );
$this->enableLines( $boolEnableTreeLines );
//$this->setMixData($mixData);
$this->setData( $mixData, $strParentFieldName, $strChildFieldName, $strDescFieldName, $mixUserDataFieldNames );
$this->setMixData($mixData);
if ( is_string( $mixData ) )
{
$this->setTableName($mixData);
}
//$this->setData( $mixData, $strParentFieldName, $strChildFieldName, $strDescFieldName, $mixUserDataFieldNames );
$this->setParentFieldName($strParentFieldName);
$this->SetChildFieldName($strChildFieldName);
$this->setDescFieldName($strDescFieldName);
$this->setUserDataFieldNames($mixUserDataFieldNames);
if ( is_string( $mixData ) )
{
$this->setTableName($mixData);
/*if ( is_array( $mixUserDataFieldNames ) )
{
$mixUserDataFieldNames = implode(',',$mixUserDataFieldNames);
}
*/
//$this->setXmlFile( 'index.php?modulo='.$this->getBase().'callbacks/treeView.php&ajax=1&parentField=' . $strParentFieldName . '&childField=' . $strChildFieldName . '&descField=' . $strDescFieldName . '&tableName=' . $mixData . '&userDataFields=' . $mixUserDataFieldNames );
//$this->setXmlFile($this->getBase().'callbacks/treeView.php');
}
$this->setData();

}

/**
Expand Down Expand Up @@ -370,8 +364,14 @@ public function getEnableLines()
}

//---------------------------------------------------------------------------
public function setData( $arrData, $strParentField, $strChildField, $strDescField, $mixUserDataFields = null )
{
public function setData()
{
$arrData = $this->getMixData();
$strParentField = $this->getParentFieldName();
$strChildField = $this->getChildFieldName();
$strDescField = $this->getDescFieldName();
$mixUserDataFields = $this->getUserDataFieldNames();

if ( !is_array( $arrData ) || is_null( $strParentField ) || is_null( $strChildField ) || is_null( $strDescField ) )
{
return;
Expand Down

0 comments on commit ef8ac74

Please sign in to comment.