getVar('mod_id');
+ $ret['name'] = $this->getVar('mod_name');
+ $ret['version'] = $this->getVar('mod_version');
+ $ret['image'] = $this->getVar('mod_image');
+ $ret['release'] = $this->getVar('mod_release');
+ $ret['status'] = $this->getVar('mod_status');
+ $ret['admin'] = $this->getVar('mod_admin');
+ $ret['user'] = $this->getVar('mod_user');
+ $ret['blocks'] = $this->getVar('mod_blocks');
+ $ret['search'] = $this->getVar('mod_search');
+ $ret['comments'] = $this->getVar('mod_comments');
+ $ret['notifications'] = $this->getVar('mod_notifications');
+ $ret['permissions'] = $this->getVar('mod_permissions');
+
+ return $ret;
+ }
}
/*
@@ -505,4 +529,30 @@ public function &insert(&$field, $force = false)
return true;
}
+
+ /**
+ * Get Count Modules
+ */
+ public function getCountModules($start = 0, $limit = 0, $sort = 'mod_id ASC, mod_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getCount($criteria);
+ }
+
+ /**
+ * Get All Modules
+ */
+ public function getAllModules($start = 0, $limit = 0, $sort = 'mod_id ASC, mod_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getAll($criteria);
+ }
}
diff --git a/class/tables.php b/class/tables.php
index f0d15373..9e35335e 100644
--- a/class/tables.php
+++ b/class/tables.php
@@ -58,7 +58,8 @@ public function __construct()
$this->initVar('table_order', XOBJ_DTYPE_INT);
$this->initVar('table_image', XOBJ_DTYPE_TXTBOX);
$this->initVar('table_autoincrement', XOBJ_DTYPE_INT);
- $this->initVar('table_blocks', XOBJ_DTYPE_INT);
+ $this->initVar('table_index', XOBJ_DTYPE_INT);
+ $this->initVar('table_blocks', XOBJ_DTYPE_INT);
$this->initVar('table_admin', XOBJ_DTYPE_INT);
$this->initVar('table_user', XOBJ_DTYPE_INT);
$this->initVar('table_submenu', XOBJ_DTYPE_INT);
@@ -211,6 +212,11 @@ public function getForm($action = false)
$table_checkbox_all->setClass('xo-checkall');
$options_tray->addElement($table_checkbox_all);
//
+ $table_index = $isNew ? 0 : $this->getVar('table_index');
+ $check_table_index = new XoopsFormCheckBox(' ', 'table_index', $table_index);
+ $check_table_index->addOption(1, _AM_TDMCREATE_TABLE_INDEX);
+ $options_tray->addElement($check_table_index);
+ //
$table_blocks = $isNew ? 0 : $this->getVar('table_blocks');
$check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks);
$check_table_blocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS);
@@ -327,6 +333,31 @@ public function getForm($action = false)
return $form;
}
+
+ /**
+ * Get Values
+ */
+ public function getValues($keys = null, $format = null, $maxDepth = null)
+ {
+ $ret = parent::getValues($keys, $format, $maxDepth);
+ // Values
+ $ret['id'] = $this->getVar('table_id');
+ $ret['mid'] = $this->getVar('table_mid');
+ $ret['name'] = ucfirst($this->getVar('table_name'));
+ $ret['image'] = $this->getVar('table_image');
+ $ret['nbfields'] = $this->getVar('table_nbfields');
+ $ret['order'] = $this->getVar('table_order');
+ $ret['blocks'] = $this->getVar('table_blocks');
+ $ret['admin'] = $this->getVar('table_admin');
+ $ret['user'] = $this->getVar('table_user');
+ $ret['submenu'] = $this->getVar('table_submenu');
+ $ret['search'] = $this->getVar('table_search');
+ $ret['comments'] = $this->getVar('table_comments');
+ $ret['notifications'] = $this->getVar('table_notifications');
+ $ret['permissions'] = $this->getVar('table_permissions');
+
+ return $ret;
+ }
}
/*
@@ -401,4 +432,44 @@ public function &insert(&$field, $force = false)
return true;
}
+
+ /**
+ * Get Count Modules
+ */
+ public function getCountTables($start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getCount($criteria);
+ }
+
+ /**
+ * Get All Modules
+ */
+ public function getAllTables($start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getAll($criteria);
+ }
+
+ /**
+ * Get All Tables By Module Id
+ */
+ public function getAllTablesByModuleId($modId, $start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $modId));
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getAll($criteria);
+ }
}
diff --git a/sql/mysql.sql b/sql/mysql.sql
index 9fe8875a..55930390 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -106,7 +106,7 @@ CREATE TABLE `tdmcreate_modules` (
)ENGINE =InnoDB;
#
-# Table structure for table `tdmcreate_tables` 27
+# Table structure for table `tdmcreate_tables` 28
#
CREATE TABLE `tdmcreate_tables` (
@@ -119,7 +119,8 @@ CREATE TABLE `tdmcreate_tables` (
`table_nbfields` INT(5) UNSIGNED NOT NULL DEFAULT '0',
`table_order` INT(5) UNSIGNED NOT NULL DEFAULT '0',
`table_image` VARCHAR(150) NOT NULL DEFAULT '',
- `table_autoincrement` TINYINT(1) NOT NULL DEFAULT '1',
+ `table_autoincrement` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `table_index` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`table_blocks` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`table_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`table_user` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
diff --git a/templates/admin/tdmcreate_modules.tpl b/templates/admin/tdmcreate_modules.tpl
index 2eb8aece..3d00ff6f 100644
--- a/templates/admin/tdmcreate_modules.tpl
+++ b/templates/admin/tdmcreate_modules.tpl
@@ -27,19 +27,19 @@
 |
<{$module.release}> |
<{$module.status}> |
- 
+ | 
|
- 
+ | 
|
- 
+ | 
|
- 
+ | 
|
-
+ |
|
- 
+ | 
|
- 
+ | 
|
diff --git a/templates/admin/tdmcreate_tables.tpl b/templates/admin/tdmcreate_tables.tpl
index 3d8a3ad2..83509b7b 100644
--- a/templates/admin/tdmcreate_tables.tpl
+++ b/templates/admin/tdmcreate_tables.tpl
@@ -30,20 +30,20 @@
| <{$module.name}> |
 |
 |
- 
+ | 
|
- 
+ | 
|
- 
+ | 
|
 |
- 
+ | 
|
-
+ |
|
- 
+ | 
|
- 
+ | 
|
diff --git a/templates/admin/tdmcreate_tables_item.tpl b/templates/admin/tdmcreate_tables_item.tpl
index 6ea54290..828cc774 100644
--- a/templates/admin/tdmcreate_tables_item.tpl
+++ b/templates/admin/tdmcreate_tables_item.tpl
@@ -7,21 +7,21 @@
| <{$table.name}> |
 |
<{$table.nbfields}> |
- 
+ | 
|
- 
+ | 
|
- 
+ | 
|
-
+ |
|
- 
+ | 
|
-
+ |
|
- 
+ | 
|
- 
+ | 
|
|