Skip to content

Commit

Permalink
🔤 BASE #280 formatando
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Dec 14, 2022
1 parent 4511595 commit 3b16449
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions base/classes/webform/TMenuDhtmlx.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,12 @@ public function add($strId
if( $menu->getIdParent() ) {
// verificar se o pai já está adicionado
$objMenu = $this->getMenuById($strIdParent);
if( ! is_null( $objMenu ) )
{
if( ! is_null( $objMenu ) ){
$objMenu->addMenu($menu);
}
else
{
}else{
$this->addOrphan($menu);
}
}
else
{
}else{
$this->addMenu( $menu );
}
/*
Expand Down Expand Up @@ -248,24 +243,16 @@ public function getHotKey()
public function getMenuById($strId)
{
static $o = null;
if( (string) $strId == '0' )
{
if( (string) $strId == '0' ) {
return null;
}
if( $this->arrMenu )
{
foreach($this->arrMenu as $k=>$objMenu)
{
if( is_null( $o ))
{
if( $objMenu->getId() == $strId )
{
if( $this->arrMenu ) {
foreach($this->arrMenu as $k=>$objMenu){
if( is_null( $o )) {
if( $objMenu->getId() == $strId ) {
$o = $objMenu;
break;

}
else
{
} else {
$o = $objMenu->getMenuById($strId);
}
}
Expand All @@ -284,8 +271,7 @@ public function getOrphans()
//--------------------------------------------------------------------------------------
public function ignoreOrphans($boolNewValue=null)
{
if( $boolNewValue === null)
{
if( $boolNewValue === null){
return $this->boolIgnoreOrphans;
}
$this->boolIgnoreOrphans = $boolNewValue;
Expand Down Expand Up @@ -371,19 +357,14 @@ public function getStructure()
if( $level == 0 )
{
// processar o itens que ficaram sem pai e coloca-los no nivel 0 para aparecer no menu principal
if($this->ignoreOrphans())
{
if($this->ignoreOrphans()) {
$this->clearOrphans();
}
else
{
if( $this->getOrphans())
{
} else {
if( $this->getOrphans()) {
foreach($this->getOrphans() as $k=>$objMenu)
{
// não adicionar o item 2 vezes
if( ! $this->getMenuById( $objMenu->getId() ) )
{
if( ! $this->getMenuById( $objMenu->getId() ) ) {
$objMenu->setIdParent(0);
$this->addMenu($objMenu);
}
Expand Down

0 comments on commit 3b16449

Please sign in to comment.