Skip to content

Commit 05a4f8c

Browse files
authored
Merge pull request #58 from ggoffy/master
cosmetics
2 parents d9934a3 + 362de56 commit 05a4f8c

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

class/Constants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ interface Constants
3232
const MORE_FILES_TYPE_EMPTY = 1;
3333
const MORE_FILES_TYPE_COPY = 2;
3434

35+
const FIRST_FIELDELEMENT_TABLE = 30;
36+
3537
}

class/Files/Language/LanguageAdmin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
namespace XoopsModules\Modulebuilder\Files\Language;
44

55
use XoopsModules\Modulebuilder;
6-
use XoopsModules\Modulebuilder\Files;
6+
use XoopsModules\Modulebuilder\{
7+
Files,
8+
Constants
9+
};
710

811
/*
912
You may not change or alter any portion of this comment or credits
@@ -185,7 +188,7 @@ public function getLanguageAdminClass($language, $tables)
185188
$fieldName = $fields[$f]->getVar('field_name');
186189
$fieldElement = $fields[$f]->getVar('field_element');
187190
$rpFieldName = $this->getRightString($fieldName);
188-
if ($fieldElement > 16) {
191+
if ($fieldElement >= Constants::FIRST_FIELDELEMENT_TABLE) {
189192
$fieldElements = Modulebuilder\Helper::getInstance()->getHandler('Fieldelements')->get($fieldElement);
190193
$fieldElementName = $fieldElements->getVar('fieldelement_name');
191194
$fieldNameDesc = mb_substr($fieldElementName, \mb_strrpos($fieldElementName, ':'), mb_strlen($fieldElementName));

class/ModulesHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function getInsertId()
8787
*
8888
* @return int
8989
*/
90-
public function getCountModules($start = 0, $limit = 0, $sort = 'mod_id ASC, mod_name', $order = 'ASC')
90+
public function getCountModules($start = 0, $limit = 0, $sort = 'mod_id', $order = 'DESC')
9191
{
9292
$crCountModules = new \CriteriaCompo();
9393
$crCountModules = $this->getModulesCriteria($crCountModules, $start, $limit, $sort, $order);
@@ -105,7 +105,7 @@ public function getCountModules($start = 0, $limit = 0, $sort = 'mod_id ASC, mod
105105
*
106106
* @return array
107107
*/
108-
public function getAllModules($start = 0, $limit = 0, $sort = 'mod_id ASC, mod_name', $order = 'ASC')
108+
public function getAllModules($start = 0, $limit = 0, $sort = 'mod_id', $order = 'DESC')
109109
{
110110
$crAllModules = new \CriteriaCompo();
111111
$crAllModules = $this->getModulesCriteria($crAllModules, $start, $limit, $sort, $order);

class/TablesHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function getCountTables($start = 0, $limit = 0, $sort = 'table_id ASC, ta
108108
*
109109
* @return array
110110
*/
111-
public function getAllTables($start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
111+
public function getAllTables($start = 0, $limit = 0, $sort = 'table_mid DESC, table_order ASC, table_id', $order = 'DESC')
112112
{
113113
$crAllTables = new \CriteriaCompo();
114114
$crAllTables = $this->getTablesCriteria($crAllTables, $start, $limit, $sort, $order);

docs/changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- added default type and value for table fieldelements (goffy)
1414
- fixed bug in deleting table from fieldelements (goffy)
1515
- added check for sql creation (goffy)
16-
- delete fields when deleting table (goffy)
16+
- delete fields if table is deleted (goffy)
1717
- delete fields, tables, morefiles when deleting module (goffy)
1818

1919
<h5>3.04 Alpha 1 [2020-06-12]</h5> Dev: XOOPS 2.5.11, PHP 7.4.5

0 commit comments

Comments
 (0)