| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace ModulesGarden\ProxmoxAddon\Core\UI\Traits;
- // to do disable title
- /**
- * Title elements related functions
- *
- * @author Sławomir Miśkowicz <slawomir@modulesgarden.com>
- */
- trait TableLength
- {
- protected $tableLength = 10;
- protected $tableLengthList = [10, 25];
- protected $isTableLengthInfinity = true;
- public function enabledTalbeLengthInfinity()
- {
- $this->isTableLengthInfinity = true;
- return $this;
- }
- public function disabledTalbeLengthInfinity()
- {
- $this->isTableLengthInfinity = false;
- return $this;
- }
- public function setTableLengthList(array $tableLengthList = [])
- {
- $this->tableLengthList = $tableLengthList;
- return $this;
- }
- public function getTableLengthList()
- {
- $returnList = $this->tableLengthList;
- if ($this->isTableLengthInfinity)
- {
- $returnList[] = "inf";
- }
- return $returnList;
- }
- public function setTableLength($tableLength = 10)
- {
- if (in_array($tableLength, $this->tableLengthList, true))
- {
- $this->tableLength = $tableLength;
- }
- return $this;
- }
- public function getTableLength()
- {
- return $this->tableLength;
- }
- }
|