31
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/7 7:45

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Good!

As soon as we're done with these tests alpha 1, we can move on to alpha 2 to modify and add functionality to:
1) Comments
2) Notifications
3) Search

Then move on to alpha 3 and relate to, and then add files on the user side

32
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/7 8:06

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


Does german language files exist for tdmcreate?

33
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/7 10:14

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


If you've see, there is already a table tdmcreate_languages to the mysql.sql file.

This table should be used in the next versions just to handle all languages ​​directly from admin side.

The base language is always English.

If possible, we will use part of the code of the module xtransam to translate automatically in other languages.

All translated material will be stored in the database even if we uninstall the module, making a backup of the database, we will always have our translations of the modules, and this also applies to the module tdmcreate.

34
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/7 10:22

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


Quote:

timgno wrote:
If you've see, there is already a table tdmcreate_languages to the mysql.sql file.

This table should be used in the next versions just to handle all languages ​​directly from admin side.

The base language is always English.

If possible, we will use part of the code of the module xtransam to translate automatically in other languages.

All translated material will be stored in the database even if we uninstall the module, making a backup of the database, we will always have our translations of the modules, and this also applies to the module tdmcreate.


that sounds great

but I meaned the module tdmcreate himself?
if you want, I can make the german langs for tdmcreate

35
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/7 11:54

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


I don't know if there is already a translation, but it absolutely is that you can make it

36
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/18 12:34

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


tdmcreate 1.91
download from github, 11.08.2014 12:50
Xoops 2.5.7.


1) you can select "Table: Main Field" for each field

2) if you are on tab "tables", than select a module and click than on "Edit fields" for a specific table, you do not get the field edit mode.
change \templates\admin\tdmcreate_tables.tpl line 86 from
<a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._EDIT}>">
into
[code]<a href="fields.php?op=edit&field_tid=<{$table.id}>&field_mid=<{$table.mid}>" title="<{$smarty.const._EDIT}>">

or change fields.php, because there is a module id neccessary in line 242

3) you create a new table and define 4 fields for this table. if yo later change the number of fields, e.g. you say now 5, you get only 4 fields in editing mode of table fields

following code of class/fields.php can solve this problem - all changes are marked with 'goffy'
/*
*  @Class TDMCreateFields
*  @extends XoopsObject 
*/
class TDMCreateFields extends XoopsObject

    
/**
     * @var mixed
     */
    
private $tdmcreate null;    
    
    
/*
    *  @public function constructor class
    *  @param null
    */
    
public function __construct()
    {
        
$this->tdmcreate TDMCreate::getInstance();        
        
$this->initVar('field_id'XOBJ_DTYPE_INT);
        
$this->initVar('field_mid'XOBJ_DTYPE_INT);
        
$this->initVar('field_tid'XOBJ_DTYPE_INT);
        
$this->initVar('field_numb'XOBJ_DTYPE_INT);    
        
$this->initVar('field_name'XOBJ_DTYPE_TXTBOX);        
        
$this->initVar('field_type'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_value'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_attribute'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_null'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_default'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_key'XOBJ_DTYPE_TXTBOX);        
        
$this->initVar('field_element'XOBJ_DTYPE_TXTBOX);
        
$this->initVar('field_parent'XOBJ_DTYPE_INT);
        
$this->initVar('field_inlist'XOBJ_DTYPE_INT);
        
$this->initVar('field_inform'XOBJ_DTYPE_INT);
        
$this->initVar('field_admin'XOBJ_DTYPE_INT);        
        
$this->initVar('field_user'XOBJ_DTYPE_INT);    
        
$this->initVar('field_block'XOBJ_DTYPE_INT);    
        
$this->initVar('field_main'XOBJ_DTYPE_INT);    
        
$this->initVar('field_search'XOBJ_DTYPE_INT);    
        
$this->initVar('field_required'XOBJ_DTYPE_INT);        
    }
    
    
/**
     * @param string $method
     * @param array  $args
     *
     * @return mixed
     */
    
public function __call($method$args)
    {
        
$arg = isset($args[0]) ? $args[0] : null;
        return 
$this->getVar($method$arg);
    }
    
    
/*
    *  @static function &getInstance
    *  @param null
    */
    
public static function &getInstance()
    {
        static 
$instance false;
        if (!
$instance) {
            
$instance = new self();
        }
        return 
$instance;
    }
    
    
/*
    *  @private function getHeaderForm
    *  @param mixed $action
    */
    
private function getHeaderForm($action false)
    {
        if (
$action === false) {
            
$action $_SERVER['REQUEST_URI'];
        }
        
        
$isNew $this->isNew();
        
$title $isNew sprintf(_AM_TDMCREATE_FIELDS_NEW) : sprintf(_AM_TDMCREATE_FIELDS_EDIT);
        
        
$form = new TDMCreateThemeForm(null'form'$action'post'true);
        
$form->setExtra('enctype="multipart/form-data"');            
                        
        
// New Object HtmlTable           
        
$form->addElement(new TDMCreateFormLabel(''));
        
$form->addElement(new TDMCreateFormLabel(''));    
        
$form->addElement(new TDMCreateFormLabel(''.$title.''));
        
$form->addElement(new TDMCreateFormLabel(''));                
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_ID.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_NAME.''));                                                        
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_TYPE.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_VALUE.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_ATTRIBUTE.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_NULL.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_DEFAULT.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_KEY.''));
        
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_PARAMETERS.''));    
        
$form->addElement(new TDMCreateFormLabel(''));    
        
$form->addElement(new TDMCreateFormLabel(''));        
        
//        
        
return $form;
    }
    
    
/*
    *  @public function getFormNew
    *
    *  @param integer $field_mid
    *  @param integer $field_tid
    *  @param integer $field_numb
    *  @param string $f_name
    *  @param mixed $action
    */
    
public function getFormNew($field_mid null$field_tid null$field_numb null$f_name null$action false)
    {
        
// Header function class
        
$fields_form TDMCreateFields::getInstance();
        
$form $fields_form->getHeaderForm($action);
        
//
        
$table_obj $this->tdmcreate->getHandler('tables')->get($field_tid); //changed by goffy
        
$table_autoincrement $table_obj->getVar('table_autoincrement'); //added by goffy
        //
        
$class 'even';
        for(
$i 1$i <= $field_numb$i++) {
            
$class = ($class == 'even') ? 'odd' 'even';
            
//replaced creation of new line by new function - goffy
            
$this->getFormNewLine($form$class$i$field_mid$field_tid$f_name$table_autoincrement);
        }                        
        
// Footer form
        
return $fields_form->getFooterForm($form);
    }
    
    
/*
    *  @public function getFormNewLine - goffy
    *
    *  @param mixed $form
    *  @param mixed $class
    *  @param integer $i
    *  @param integer $field_mid
    *  @param integer $field_tid
    *  @param mixed $f_name
    *  @param integer $table_autoincrement
    */
    
public function getFormNewLine($form$class$i$field_mid$field_tid$f_name$table_autoincrement)
    {
        
$form->addElement(new XoopsFormHidden('field_id['.$i.']''new'));    
        
$form->addElement(new XoopsFormHidden('field_mid'$field_mid));
        
$form->addElement(new XoopsFormHidden('field_tid'$field_tid));
                        
        
$form->addElement(new TDMCreateFormLabel('.$class.'">'));
        
// Index ID
        
$form->addElement(new TDMCreateFormLabel(''.$i.''));
        
// Field Name
        
$this_field_name = (!empty($f_name) ? $f_name '_' '');
        
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME'field_name['.$i.']'15255$this_field_name);            
        
$form->addElement(new TDMCreateFormLabel(''.$field_name->render().''));
        
// Field Type    
        
$value = ($i == 1) && ($table_autoincrement == 1) ? '2' '';        
        
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE'field_type['.$i.']'$value);
        
$fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList()); 
        
$form->addElement(new TDMCreateFormLabel(''.$fieldtype_select->render().''));
        
// Field Value    
        
$value = ($i == 1) && ($table_autoincrement == 1) ? '8' '';
        
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE'field_value['.$i.']'520$value);
        
$form->addElement(new TDMCreateFormLabel(''.$field_value->render().''));
        
// Field Attributes                        
        
$field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE'field_attribute['.$i.']');  
        
$field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
        
$form->addElement(new TDMCreateFormLabel(''.$field_attributes_select->render().''));
        
// Field Null            
        
$field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL'field_null['.$i.']');
        
$field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());            
        
$form->addElement(new TDMCreateFormLabel(''.$field_null_select->render().''));
        
// Field Default
        
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT'field_default['.$i.']'1525);
        
$form->addElement(new TDMCreateFormLabel(''.$field_default->render().''));
        
// Field Key
        
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY'field_key['.$i.']');
        
$field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
        
$form->addElement(new TDMCreateFormLabel(''.$field_key_select->render().''));
        
// Field Void            
        
if( ($i == 1) && ($table_autoincrement == 1)) {                
            
$form->addElement(new TDMCreateFormLabel(' '));
        } else {            
            
// Box header row                
            
$parameters_tray = new XoopsFormElementTray('''');                            
            
// Field Elements    
            
$criteria_element = new CriteriaCompo();                
            
$criteria_element->add(new Criteria('fieldelement_tid'0));                    
            
$criteria_table = new CriteriaCompo();    
            
$criteria_table->add(new Criteria('fieldelement_mid'$field_mid));            
            
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME'field_element['.$i.']');                
                
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
                
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
                unset(
$criteria_element); unset($criteria_table);                    
                
$parameters_tray->addElement($field_elements_select);
                            
            
$field_parent 0;
                
$check_field_parent = new XoopsFormCheckBox(' ''field_parent['.$i.']');
                
$check_field_parent->addOption($field_parent_AM_TDMCREATE_FIELD_PARENT );
                
$parameters_tray->addElement($check_field_parent);
                
            
$field_inlist 0;
                
$check_field_inlist = new XoopsFormCheckBox(' ''field_inlist['.$i.']'$field_inlist);
                
$check_field_inlist->addOption(1_AM_TDMCREATE_FIELD_INLIST);
                
$parameters_tray->addElement($check_field_inlist);
            
            
$field_inform 0;
                
$check_field_inform = new XoopsFormCheckBox(' ''field_inform['.$i.']'$field_inform);
                
$check_field_inform->addOption(1_AM_TDMCREATE_FIELD_INFORM);
                
$parameters_tray->addElement($check_field_inform);

            
$field_admin 0;
                
$check_field_admin = new XoopsFormCheckBox(' ''field_admin['.$i.']'$field_admin);
                
$check_field_admin->addOption(1_AM_TDMCREATE_FIELD_ADMIN);
                
$parameters_tray->addElement($check_field_admin);

            
$field_user 0;
                
$check_field_user = new XoopsFormCheckBox(' ''field_user['.$i.']'$field_user);
                
$check_field_user->addOption(1_AM_TDMCREATE_FIELD_USER);
                
$parameters_tray->addElement($check_field_user);

            
$field_block 0;
                
$check_field_block = new XoopsFormCheckBox('''field_block['.$i.']'$field_block);
                
$check_field_block->addOption(1_AM_TDMCREATE_FIELD_BLOCK);
                
$parameters_tray->addElement($check_field_block);
            
            if((
$i == 1)) {
                
$field_main 1;
                
$check_field_main = new XoopsFormRadio('''field_main['.$i.']'$field_main);
                
$check_field_main->addOption($field_main_AM_TDMCREATE_FIELD_MAINFIELD );
            } else {
                
$field_main 0;
                
$check_field_main = new XoopsFormRadio('''field_main['.$i.']');
                
$check_field_main->addOption($field_main_AM_TDMCREATE_FIELD_MAINFIELD );
            }                
            
$parameters_tray->addElement($check_field_main);            
            
            
$field_search 0;
                
$check_field_search = new XoopsFormCheckBox(' ''field_search['.$i.']'$field_search);
                
$check_field_search->addOption(1_AM_TDMCREATE_FIELD_SEARCH);    
                
$parameters_tray->addElement($check_field_search);                    

            
$field_required 0;
                
$check_field_required = new XoopsFormCheckBox(' ''field_required['.$i.']'$field_required);
                
$check_field_required->addOption(1_AM_TDMCREATE_FIELD_REQUIRED);
                
$parameters_tray->addElement($check_field_required);
            
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'
'.$parameters_tray->render().'
'));
        }    
    }
    
    
/*
    *  @public function getFormEdit
    *
    *  @param integer $field_mid
    *  @param integer $field_tid
    *  @param mixed $action
    */
    
public function getFormEdit($field_mid null$field_tid null$action false)
    {            
        
// Header function class
        
$fields_form TDMCreateFields::getInstance();
        
$form $fields_form->getHeaderForm($action);
        
//
        
$class 'even';    
        
// Get the number of fields - goffy
        
$tablesHandler =& $this->tdmcreate->getHandler('tables');
        
$table_nbfields $tablesHandler->get($field_tid)->getVar("table_nbfields");
        
$f_name $tablesHandler->get($field_tid)->getVar("table_fieldname");

        
// Get the list of fields
        
$criteria = new CriteriaCompo();
        
$criteria->add(new Criteria('field_mid'$field_mid));
        
$criteria->add(new Criteria('field_tid'$field_tid));
        
$criteria->setSort('field_id'); //added by goffy
        
$fields $this->tdmcreate->getHandler('fields')->getObjects($criteria);
        unset(
$criteria);
        
$id 1;
        foreach(
$fields as $field)    {
            
$class = ($class == 'even') ? 'odd' 'even';
            
$field_id $field->getVar('field_id');
            if (
$id>$table_nbfields) {   //delete additional fields, if number of fields is reduced - goffy
                
$fieldsObj =& $this->tdmcreate->getHandler('fields')->get$field_id );
                
$this->tdmcreate->getHandler('fields')->delete($fieldsObjtrue);
            } else {  
                
// show field with settings
                
$form->addElement(new XoopsFormHidden('field_id['.$field_id.']'$field_id));    
                
$form->addElement(new XoopsFormHidden('field_mid'$field_mid));
                
$form->addElement(new XoopsFormHidden('field_tid'$field_tid));
                                
                
$form->addElement(new TDMCreateFormLabel('.$class.'">'));
                
// Index ID
                
$form->addElement(new TDMCreateFormLabel(''.$id.''));    
                
// Field Name
                
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME'field_name['.$field_id.']'15255$field->getVar('field_name'));            
                
$form->addElement(new TDMCreateFormLabel(''.$field_name->render().''));
                
// Field Type            
                
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE'field_type['.$field_id.']'$field->getVar('field_type'));
                
$fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList()); 
                
$form->addElement(new TDMCreateFormLabel(''.$fieldtype_select->render().''));
                
// Field Value            
                
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE'field_value['.$field_id.']'520$field->getVar('field_value'));
                
$form->addElement(new TDMCreateFormLabel(''.$field_value->render().''));
                
// Field Attributes                        
                
$field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE'field_attribute['.$field_id.']'$field->getVar('field_attribute'));  
                
$field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
                
$form->addElement(new TDMCreateFormLabel(''.$field_attributes_select->render().''));
                
// Field Null            
                
$field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL'field_null['.$field_id.']'$field->getVar('field_null'));
                
$field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());            
                
$form->addElement(new TDMCreateFormLabel(''.$field_null_select->render().''));
                
// Field Default
                
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT'field_default['.$field_id.']'1525$field->getVar('field_default'));
                
$form->addElement(new TDMCreateFormLabel(''.$field_default->render().''));
                
// Field Key
                
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY'field_key['.$field_id.']'$field->getVar('field_key'));
                
$field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
                
$form->addElement(new TDMCreateFormLabel(''.$field_key_select->render().''));
                
// Field Void
                
$table_autoincrement $this->tdmcreate->getHandler('tables')->get($field_tid);
                if( (
$id == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {                
                    
$form->addElement(new TDMCreateFormLabel(' '));
                } else {            
                    
// Box header row                
                    
$parameters_tray = new XoopsFormElementTray('''');                            
                    
// Field Elements    
                    
$criteria_element = new CriteriaCompo();                
                    
$criteria_element->add(new Criteria('fieldelement_tid'0));                    
                    
$criteria_table = new CriteriaCompo();    
                    
$criteria_table->add(new Criteria('fieldelement_mid'$field_mid));            
                    
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME'field_element['.$field_id.']'$field->getVar('field_element'));                
                    
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
                    
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
                    unset(
$criteria_element); unset($criteria_table);                    
                    
$parameters_tray->addElement($field_elements_select);
                                
                    
$check_field_parent = new XoopsFormCheckBox(' ''field_parent['.$field_id.']'$field->getVar('field_parent'));
                    
$check_field_parent->addOption(1_AM_TDMCREATE_FIELD_PARENT );
                    
$parameters_tray->addElement($check_field_parent);
                    
                    
$check_field_inlist = new XoopsFormCheckBox(' ''field_inlist['.$field_id.']'$field->getVar('field_inlist'));
                    
$check_field_inlist->addOption(1_AM_TDMCREATE_FIELD_INLIST);
                    
$parameters_tray->addElement($check_field_inlist);
                
                    
$check_field_inform = new XoopsFormCheckBox(' ''field_inform['.$field_id.']'$field->getVar('field_inform'));
                    
$check_field_inform->addOption(1_AM_TDMCREATE_FIELD_INFORM);
                    
$parameters_tray->addElement($check_field_inform);

                    
$check_field_admin = new XoopsFormCheckBox(' ''field_admin['.$field_id.']'$field->getVar('field_admin'));
                    
$check_field_admin->addOption(1_AM_TDMCREATE_FIELD_ADMIN);
                    
$parameters_tray->addElement($check_field_admin);

                    
$check_field_user = new XoopsFormCheckBox(' ''field_user['.$field_id.']'$field->getVar('field_user'));
                    
$check_field_user->addOption(1_AM_TDMCREATE_FIELD_USER);
                    
$parameters_tray->addElement($check_field_user);

                    
$check_field_block = new XoopsFormCheckBox('''field_block['.$field_id.']'$field->getVar('field_block'));
                    
$check_field_block->addOption(1_AM_TDMCREATE_FIELD_BLOCK);
                    
$parameters_tray->addElement($check_field_block);
                    
                    
$field_main $field->getVar('field_main'); 
                    if(
$field_main == 1) {
                        
$check_field_main = new XoopsFormRadio('''field_main['.$field_id.']'$field_main);
                    } else {
                        
$check_field_main = new XoopsFormRadio('''field_main['.$field_id.']');
                    }
                    
$check_field_main->addOption($field_main_AM_TDMCREATE_FIELD_MAINFIELD );
                    
$parameters_tray->addElement($check_field_main);            
                    
                    
$check_field_search = new XoopsFormCheckBox(' ''field_search['.$field_id.']'$field->getVar('field_search'));
                    
$check_field_search->addOption(1_AM_TDMCREATE_FIELD_SEARCH);
                    
$parameters_tray->addElement($check_field_search);            

                    
$check_field_required = new XoopsFormCheckBox(' ''field_required['.$field_id.']'$field->getVar('field_required'));
                    
$check_field_required->addOption(1_AM_TDMCREATE_FIELD_REQUIRED);
                    
$parameters_tray->addElement($check_field_required);
                    
$form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'
'.$parameters_tray->render().'
'));
                }            
                
$id++;
            }
        }
        
//add missing fields - goffy
        
for ($i=$id$i<=$table_nbfields$i++) {
            
$class = ($class == 'even') ? 'odd' 'even';
            
$this->getFormNewLine($form$class$i$field_mid$field_tid$f_name0);
        }
        unset(
$id);
        
// Footer form
        
return $fields_form->getFooterForm($form);
    }    
    
/*
    *  @private function getFooterForm
    *  @param null
    */
    
private function getFooterForm($form)
    {
        
// Send Form Data
        
$form->addElement(new TDMCreateFormLabel(''));
        
$form->addElement(new TDMCreateFormLabel(''));
        
$form_hidden = new XoopsFormHidden('op''save');
        
$form_button = new XoopsFormButton('''submit'_SUBMIT'submit');
        
$form->addElement(new TDMCreateFormLabel(''.$form_hidden->render().''));
        
$form->addElement(new TDMCreateFormLabel(''.$form_button->render().''));
        
$form->addElement(new TDMCreateFormLabel(''));
        return 
$form;
    }
}
/*
*  @Class TDMCreateFieldsHandler
*  @extends XoopsPersistableObjectHandler
*/
class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler 
{    
    
/*
    *  @public function constructor class
    *  @param mixed $db
    */
    
public function __construct(&$db
    {        
        
parent::__construct($db'tdmcreate_fields''tdmcreatefields''field_id''field_name');
    }
    
    
/**
     * @param bool $isNew
     *
     * @return object
     */
    
public function &create($isNew true)
    {
        return 
parent::create($isNew);
    }

    
/**
     * retrieve a field
     *
     * @param int $i field id
     *
     * @return mixed reference to the {@link TDMCreateFields} object
     */
    
public function &get($i null$fields null)
    {        
        return 
parent::get($i$fields);
    }    

    
/**
     * get IDs of objects matching a condition
     *
     * @param object $criteria {@link CriteriaElement} to match
     * @return array of object IDs
     */
    
function &getIds($criteria)
    {
        return 
parent::getIds($criteria);
    }
        
    
/**
     * insert a new field in the database
     *
     * @param object $field reference to the {@link TDMCreateFields} object
     * @param bool   $force
     *
     * @return bool FALSE if failed, TRUE if already present and unchanged or successful
     */
    
public function insert(&$field$force false)
    {        
        if (!
parent::insert($field$force)) {
            return 
false;
        }        
        return 
true;
    }        
}


I have made a new function 'getFormNewLine', because a new field can now be in function getFormNew and also in getFormEdit

4) deleting a table does not delete the corresponding items in tdmcreate_fields

5) I started to translate to german, but there are a lot of not used defines, maybe should some be use in future, i dont know. I wait for Beta version to make a translation


37
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/18 16:54

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Quote:
goffy wrote: tdmcreate 1.91
download from github, 11.08.2014 12:50
Xoops 2.5.7.
...
4) deleting a table does not delete the corresponding items in tdmcreate_fields

5) I started to translate to german, but there are a lot of not used defines, maybe should some be use in future, i dont know. I wait for Beta version to make a translation



Point 4) Instead, the problem is with your code because if We go to edit the fields of table, were added or subtracted fields number, but empty.

Your code is to delete the data fields in the database.

This code should be revised.

Point 5) Great !!!

38
Bleekk
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/27 13:08

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


Hi,

I have copied a created module in a fresh xoops 2.5.7 and there I get following error
Fatal error: Call to a member function getForm() on a non-object in C:\xampp\htdocs\xoops257final_1\modules\mymodule\admin\atable.php

the created module works fine when the tdmcreate module is installed

this line causes the error
$form $atableObj->getForm();

39
Bleekk
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2014/8/27 13:22

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


sorry my fault! I have changed some things and didn't update the database

40
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/1/8 16:20

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21



Login

Who's Online

303 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 303


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits