331
goffy
Re: Ethernial: a new freemium theme for XOOPS
  • 2014/12/24 12:57

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


really cool

thank you



332
goffy
Re: i'm working an a standard module skeleton
  • 2014/11/19 5:59

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi Mamba

of course, but at the moment it is only an example what is possible to make by a "none expert" when using TDMCreate
I want to handle first one or two real competitions with this site/module, than I can upload to SVN

and if Lucio see this module, he will thinking: oh my god, the outputs on client site are again not template base, a lot of hard coded tables, forms,...




333
goffy
Re: i'm working an a standard module skeleton
  • 2014/11/18 22:48

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


strange, fresh installed tdmdownload modules, something gone wrong, I uploaded the zip via ftp, now it works, hopefully



334
goffy
Re: i'm working an a standard module skeleton
  • 2014/11/18 19:59

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi everybody

I only understand partially, what you are discussing (and the code of vide module), because I learned php, css and so on only by myself.
I made in the past several modules like e.g. xNewsletter.
My latest project ishttp://mtbrace.eu, a website for handling mountainbike competitions with 23 tables inside (the module you can download fromhttp://wedega.com/modules/TDMDownloads/singlefile.php?cid=1&lid=1, but pay attention, it's only a first version).

All my project I have started with TDMCreate, because this module gave me the basic structure for the module and I had "only" to add the new functionalities.
In the beginning I didn't really understand the system with classes,..., but it was no problem, the basic system was available.
Maybe my modules are not perfect coded, maybe they are not cloneable, but they are working.

In my opinion the code and structure should stay clear and readable for everybody, like it is with TDMCreate, because not everybody made an university degree in programming, in order to keep xoops attractive for all persons, not only for experts.





335
goffy
Re: EGUIDE
  • 2014/10/29 17:21

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi elbaastro

APCal is based on piCal, there are only a few new features inside, the basics are the same, therefor eguide should work with apcal



336
goffy
Re: My Simple theme and site
  • 2014/10/23 19:08

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


look quit good, great job



337
goffy
Re: The name of the directories of the modules are uppercase or lowercase or ...
  • 2014/9/24 17:33

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


same results with xoops 2.5.7



338
goffy
Re: The name of the directories of the modules are uppercase or lowercase or ...
  • 2014/9/24 11:32

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi mamba

Sorry for late answer.

Quote:
but let test first to see if it works, and if there is a better and more "user-friendly" way to accomplish it


test result:
xoops 2.5.5.
update failed
mesage: Module File for xNewsletter Not Found!



339
goffy
Re: The name of the directories of the modules are uppercase or lowercase or ...
  • 2014/9/16 5:53

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


normally it makes no different, if I make a new module.

The only problem I see is, that it is not possible to update from xNewsletter to xnewsletter, because the system does not find the "old" path (with uppercase).
I know no simple way - only uninstall and reinstall, but than all data are lost.
Or I dump the tables of the module, and also all data of other tables like config, if there are data inside. If you reinsert the data later, you have to take care, that you have the right module id in the tables.
This is not the simple way of updating a module as usual in xoops ;-(

Maybe someone else know a simple way, but if there is no easy way we should let uppercase for the older modules



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

  • goffy

  • Just can't stay away

  • Posts: 535

  • 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('<table border="0" cellspacing="1" class="outer width100">'));
        
$form->addElement(new TDMCreateFormLabel('<thead class="center">'));    
        
$form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'.$title.'</th></tr>'));
        
$form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));                
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ID.'</td>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));                                                        
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));    
        
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));    
        
$form->addElement(new TDMCreateFormLabel('<tbody>'));        
        
//        
        
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('<tr class="'.$class.'">'));
        
// Index ID
        
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
        
// 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('<td class="center">'.$field_name->render().'</td>'));
        
// 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('<td class="center">'.$fieldtype_select->render().'</td>'));
        
// 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('<td class="center">'.$field_value->render().'</td>'));
        
// 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('<td class="center">'.$field_attributes_select->render().'</td>'));
        
// 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('<td class="center">'.$field_null_select->render().'</td>'));
        
// Field Default
        
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT'field_default['.$i.']'1525);
        
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
        
// 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('<td class="center">'.$field_key_select->render().'</td>'));
        
// Field Void            
        
if( ($i == 1) && ($table_autoincrement == 1)) {                
            
$form->addElement(new TDMCreateFormLabel('<td>&nbsp;</td></tr>'));
        } else {            
            
// Box header row                
            
$parameters_tray = new XoopsFormElementTray('''<br />');                            
            
// 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('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
        }    
    }
    
    
/*
    *  @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('<tr class="'.$class.'">'));
                
// Index ID
                
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$id.'</td>'));    
                
// Field Name
                
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME'field_name['.$field_id.']'15255$field->getVar('field_name'));            
                
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
                
// 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('<td class="center">'.$fieldtype_select->render().'</td>'));
                
// Field Value            
                
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE'field_value['.$field_id.']'520$field->getVar('field_value'));
                
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
                
// 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('<td class="center">'.$field_attributes_select->render().'</td>'));
                
// 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('<td class="center">'.$field_null_select->render().'</td>'));
                
// Field Default
                
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT'field_default['.$field_id.']'1525$field->getVar('field_default'));
                
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
                
// 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('<td class="center">'.$field_key_select->render().'</td>'));
                
// Field Void
                
$table_autoincrement $this->tdmcreate->getHandler('tables')->get($field_tid);
                if( (
$id == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {                
                    
$form->addElement(new TDMCreateFormLabel('<td>&nbsp;</td></tr>'));
                } else {            
                    
// Box header row                
                    
$parameters_tray = new XoopsFormElementTray('''<br />');                            
                    
// 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('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
                }            
                
$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('</tbody>'));
        
$form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
        
$form_hidden = new XoopsFormHidden('op''save');
        
$form_button = new XoopsFormButton('''submit'_SUBMIT'submit');
        
$form->addElement(new TDMCreateFormLabel('<td colspan="8">'.$form_hidden->render().'</td>'));
        
$form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
        
$form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
        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





TopTop
« 1 ... 31 32 33 (34) 35 36 37 ... 43 »



Login

Who's Online

198 user(s) are online (134 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

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

Latest GitHub Commits