Skip to content

Commit

Permalink
Fixed and updated
Browse files Browse the repository at this point in the history
  • Loading branch information
txmodxoops committed May 17, 2015
1 parent 7b19acb commit d8b2e7d
Show file tree
Hide file tree
Showing 26 changed files with 161 additions and 127 deletions.
6 changes: 3 additions & 3 deletions admin/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if ($countTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
unset($countTables);
unset($countTables);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
Expand Down Expand Up @@ -160,9 +160,9 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
$fieldId = XoopsRequest::getInt('field_id');
$fieldId = XoopsRequest::getInt('field_id');
// Fields Handler
$fields = $tdmcreate->getHandler('fields');
$fields = $tdmcreate->getHandler('fields');
// Set Variables
foreach($_POST['field_id'] as $key => $value)
{
Expand Down
16 changes: 8 additions & 8 deletions admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Recovered value of argument op in the URL $
$op = XoopsRequest::getString('op', 'list');
//
$mod_id = XoopsRequest::getInt('mod_id');
$modId = XoopsRequest::getInt('mod_id');
//
switch ($op) {
case 'list':
Expand Down Expand Up @@ -98,8 +98,8 @@
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($mod_id)) {
$modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
if (isset($modId)) {
$modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
} else {
$modulesObj =& $tdmcreate->getHandler('modules')->create();
}
Expand Down Expand Up @@ -184,13 +184,13 @@
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());

$modulesObj = $tdmcreate->getHandler('modules')->get($mod_id);
$modulesObj = $tdmcreate->getHandler('modules')->get($modId);
$form = $modulesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;

case 'delete':
$modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
$modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
Expand All @@ -201,12 +201,12 @@
$GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
}
} else {
xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
xoops_confirm(array('ok' => 1, 'mod_id' => $modId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
}
break;

case 'display':
//if ( $mod_id > 0 ) {
//if ( $modId > 0 ) {
$mod_admin = XoopsRequest::getInt('mod_admin');
$mod_user = XoopsRequest::getInt('mod_user');
$mod_blocks = XoopsRequest::getInt('mod_blocks');
Expand All @@ -225,7 +225,7 @@
$mod_notifications = tdmcreate_CleanVars($_REQUEST, 'mod_notifications');
$mod_permissions = tdmcreate_CleanVars($_REQUEST, 'mod_permissions'); */

$modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
$modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
if (isset($mod_admin)) {
$modulesObj->setVar('mod_admin', $mod_admin);
} elseif (isset($mod_user)) {
Expand Down
38 changes: 29 additions & 9 deletions assets/css/admin/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ tr.modules td {
vertical-align: middle;
}

tr.modules td.name {
min-width: 70px;
}

tr.tables td {
/* display: block; Problems in FireFox and Opera */
margin: 0;
Expand All @@ -59,15 +63,36 @@ tr.tables td {
vertical-align: middle;
}

tr.tables td.name {
min-width: 70px;
}

tr.tables-fields td {
/* display: block; Problems in FireFox and Opera */
margin: 0;
padding: 5px;
border-bottom: 1px solid #ccc;
background-color:rgba(230,130,100,0.3);
vertical-align: middle;
}

tr.tables-fields td.name {
min-width: 70px;
}

tr.fields td {
/* display: block; Problems in FireFox and Opera */
margin: 0;
padding: 5px;
border-bottom: 1px solid #ccc;
background-color:rgba(0,255,0,0.3);
background-color:rgba(10,215,10,0.3);
vertical-align: middle;
}

tr.fields td.name {
min-width: 80px;
}

/*#show_rows { margin: 0; padding: 0; width: 60%; }
#sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }*/

Expand Down Expand Up @@ -170,7 +195,7 @@ tbody.table-list tr td {
}

.cell.cell-width3 {
width: 8%;
width: 9%;
}

.cell.cell-width4 {
Expand Down Expand Up @@ -217,13 +242,8 @@ tbody.table-list tr td {

.field-list tr td {
padding: 5px 2px;
margin-bottom: 3px;
/* background-color: #efefef;
background-image: -moz-linear-gradient(top, #efefef, #e1e1e1);
background-image: -webkit-gradient(linear, left top,left bottom, from(#efefef), to(#e1e1e1));
background-image: linear-gradient(top, #efefef, #e1e1e1);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr=#efefef, EndColorStr=#e1e1e1); vale solo per IE */
text-shadow:1px 1px 0 #fff;
margin-bottom: 3px;
text-shadow: 1px 1px 1px #fff;
color:#ff8400;
}

Expand Down
1 change: 0 additions & 1 deletion class/fieldattributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TDMCreateFieldattributes extends XoopsObject
*/
public function __construct()
{
$this->XoopsObject();
$this->initVar('fieldattribute_id', XOBJ_DTYPE_INT);
$this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
Expand Down
1 change: 0 additions & 1 deletion class/fieldelements.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TDMCreateFieldElements extends XoopsObject
*/
public function __construct()
{
$this->XoopsObject();
$this->initVar('fieldelement_id', XOBJ_DTYPE_INT);
$this->initVar('fieldelement_mid', XOBJ_DTYPE_INT);
$this->initVar('fieldelement_tid', XOBJ_DTYPE_INT);
Expand Down
1 change: 0 additions & 1 deletion class/fieldkey.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TDMCreateFieldkey extends XoopsObject
*/
public function __construct()
{
$this->XoopsObject();
$this->initVar('fieldkey_id', XOBJ_DTYPE_INT);
$this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX);
Expand Down
1 change: 0 additions & 1 deletion class/fieldnull.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TDMCreateFieldnull extends XoopsObject
*/
public function __construct()
{
$this->XoopsObject();
$this->initVar('fieldnull_id', XOBJ_DTYPE_INT);
$this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX);
Expand Down
1 change: 0 additions & 1 deletion class/fieldtype.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TDMCreateFieldtype extends XoopsObject
*/
public function __construct()
{
$this->XoopsObject();
$this->initVar('fieldtype_id', XOBJ_DTYPE_INT);
$this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
Expand Down
17 changes: 9 additions & 8 deletions class/files/TDMCreateArchitecture.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ public function createBaseFoldersFiles($module)
$modId = $module->getVar('mod_id');
$language = $GLOBALS['xoopsConfig']['language'];
// Id of tables
$criteriaTables = new CriteriaCompo();
$criteriaTables->add(new Criteria('table_mid', $modId));
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
unset($criteriaTables);
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $modId));
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
unset($criteria);
//
$table = null;
foreach (array_keys($tables) as $t) {
Expand Down Expand Up @@ -214,10 +214,11 @@ public function createFilesToBuilding($module)
$moduleDirname = $module->getVar('mod_dirname');
$icon32 = 'assets/icons/32';
// Id of tables
$criteriaTables = new CriteriaCompo();
$criteriaTables->add(new Criteria('table_mid', $modId));
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
unset($criteriaTables);
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $modId));
$criteria->setSort('table_order');
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
unset($criteria);
$ret = array();
//
$table = array();
Expand Down
1 change: 1 addition & 0 deletions class/files/TDMCreateTableFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function getTableFields($tableId)
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_tid', $tableId));
$criteria->setSort('field_order');
$fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);

Expand Down
2 changes: 1 addition & 1 deletion class/files/admin/AdminFooter.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function render()
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
if ( isset(\$template_main) ) {
\$GLOBALS['xoopsTpl']->display("db:{\$template_main}");
\$GLOBALS['xoopsTpl']->display("db:{\$templateMain}");
}
xoops_cp_footer();
Expand Down
11 changes: 6 additions & 5 deletions class/files/admin/AdminIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function render()
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($moduleDirname, 'AM');
$language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$languageThereAre = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include __DIR__ . '/header.php';
Expand All @@ -96,15 +96,16 @@ public function render()
if (is_array($tables)) {
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
$ucfTableName = ucfirst($tableName);
$content .= <<<EOT
//\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');
\$count_{$tableName} = \${$tableName}Handler->getCount();\n
\$count{$ucfTableName} = \${$tableName}Handler->getCount();\n
EOT;
}
}
$content .= <<<EOT
// Template Index
\$template_main = '{$moduleDirname}_admin_index.tpl';\n
\$templateMain = '{$moduleDirname}_admin_index.tpl';\n
EOT;
if (is_array($tables)) {
$content .= <<<EOT
Expand All @@ -114,9 +115,9 @@ public function render()
EOT;
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
$stuTableName = $language_thereare . strtoupper($tableName);
$stuTableName = $languageThereAre . strtoupper($tableName);
$content .= <<<EOT
\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count{$ucfTableName});\n
EOT;
}
}
Expand Down
10 changes: 6 additions & 4 deletions class/files/admin/AdminObjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function getImageListSetVar($moduleDirname, $tableName, $fieldName)
* @param string $fieldName
* @return string
*/
public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName)
public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fpmf)
{
$stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
Expand All @@ -165,9 +165,11 @@ public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName)
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
//\$uploader->setPrefix('{$fieldName}_');
//\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
\$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']);
\$imgName = str_replace(' ', '', \$_POST['{$fpmf}']).'.'.\$extension;
\$uploader->setPrefix(\$imgName);
\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
Expand Down
Loading

0 comments on commit d8b2e7d

Please sign in to comment.