Version 5.0.0 beta 3
This commit is contained in:
1 parent
f61b0da85d
commit
e86153356a
108 files changed
+2927
-1573
No files matched your search
@@ -143,9 +143,17 @@ class Controller extends DispatcherController
|
||||
$this->protectRoots = TRUE;
|
||||
}
|
||||
|
||||
$tree = new Tree( $this->url, $nodeClass::$nodeTitle, array( $this, '_getRoots' ), array( $this, '_getRow' ), array( $this, '_getRowParentId' ), array( $this, '_getChildren' ), array( $this, '_getRootButtons' ), TRUE, $this->lockParents, $this->protectRoots );
|
||||
$tree = new Tree( $this->url, $nodeClass::$nodeTitle, array( $this, '_getRoots' ), array( $this, '_getRow' ), array( $this, '_getRowParentId' ), array( $this, '_getChildren' ), array( $this, '_getRootButtons' ), TRUE, $this->lockParents, $this->protectRoots, $this->_getRootsPerPage(), array( $this, '_getTotalRoots' ) );
|
||||
Output::i()->output .= $tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function _getRootsPerPage(): ?int
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Root Rows
|
||||
@@ -163,7 +171,16 @@ class Controller extends DispatcherController
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function _getTotalRoots(): int
|
||||
{
|
||||
$nodeClass = $this->nodeClass;
|
||||
return count( $nodeClass::roots( NULL ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the "add" button in the page root rather than the table root
|
||||
*/
|
||||
@@ -460,7 +477,7 @@ class Controller extends DispatcherController
|
||||
if ( $new and isset( $node::$databaseColumnOrder ) AND $node::$automaticPositionDetermination === TRUE )
|
||||
{
|
||||
$orderColumn = $node::$databaseColumnOrder;
|
||||
$node->$orderColumn = Db::i()->select( 'MAX(' . $node::$databasePrefix . $orderColumn . ')', $node::$databaseTable )->first() + 1;
|
||||
$node->$orderColumn = intval( Db::i()->select( 'MAX(' . $node::$databasePrefix . $orderColumn . ')', $node::$databaseTable )->first() ) + 1;
|
||||
}
|
||||
|
||||
$old = NULL;
|
||||
|
||||
@@ -964,7 +964,7 @@ abstract class Model extends ActiveRecord
|
||||
protected function get__position(): int|null
|
||||
{
|
||||
$orderColumn = static::$databaseColumnOrder;
|
||||
return $this->$orderColumn;
|
||||
return (int) $this->$orderColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user