2: 2010-02-11 (Thu) 13:08:44 admin  |
3: 2010-02-11 (Thu) 16:32:51 admin  |
| ***Default Action [#ba436f84] | | ***Default Action [#ba436f84] |
| -Set default action. When user access module top, default action page is called. | | -Set default action. When user access module top, default action page is called. |
- | -/class/Module.class.php | + | -{xoops_root_path}/modules/{modulename}/class/Module.class.php |
| Before: | | Before: |
| private function _getDefaultActionName() | | private function _getDefaultActionName() |
| return 'NewsList'; | | return 'NewsList'; |
| } | | } |
| + | |
| + | ***SQL File [#ocd9b9d1] |
| + | -Generated sql file is very rough one. Set proper field type, length, etc. Also it has no index definition. |
| + | -{xoops_root_path}/modules/{modulename}/sql/mysql.sql |
| + | Before: |
| + | `length` int(4) unsigned NOT NULL, |
| + | After: |
| + | `length` smallint(4) unsigned NOT NULL, |
| + | |
| + | ***Edit Form File [#t5ee913b] |
| + | -Validation in Edit Form checks all fields as "required". Remove required setting if the field is aribitrary input field. |
| + | -{xoops_trust_path}/modules/{modulename}/forms/XxxEditForm.class.php |
| + | Before: |
| + | $this->mFieldProperties['length'] = new XCube_FieldProperty($this); |
| + | $this->mFieldProperties['length']->setDependsByArray(array('required')); |
| + | $this->mFieldProperties['length']->addMessage('required', _MD_TUBSONP_ERROR_REQUIRED, _MD_TUBSONP_LANG_FIELD_TYPE); |
| + | After: |
| + | $this->mFieldProperties['length'] = new XCube_FieldProperty($this); |
| + | |
| + | ***Language Files [#y0a46da5] |
| + | -Generated code has minimum language definitions |
| + | -{xoops_trust_path}/modules/{modulename}/language/english/main.php |
| + | -{xoops_trust_path}/modules/{modulename}/language/english/modinfo.php |
| + | Before: |
| + | define('_MD_TNEWS_LANG_TITLE', 'TITLE'); |
| + | After: |
| + | define('_MD_TNEWS_LANG_TITLE', 'News Title'); |
| + | |
| + | ***Template Files [#q2fba8e3] |
| + | -{xoops_trust_path}/modules/{modulename}/templates/{modulename}_xxx_delete.html |
| + | -{xoops_trust_path}/modules/{modulename}/templates/{modulename}_xxx_edit.html |
| + | -{xoops_trust_path}/modules/{modulename}/templates/{modulename}_xxx_list.html |
| + | -{xoops_trust_path}/modules/{modulename}/templates/{modulename}_xxx_view.html |
| + | Before: |
| + | <dl class="viewDetail"> |
| + | <dt><{$smarty.const._MD_TNEWS_LANG_NEWS_ID}></dt> |
| + | <dd><{$object->getShow('news_id')}></dd> |
| + | <dt><{$smarty.const._MD_TNEWS_LANG_TITLE}></dt> |
| + | <dd><{$object->getShow('title')}></dd> |
| + | <dt><{$smarty.const._MD_TNEWS_LANG_DESCRIPTION}></dt> |
| + | <dd><{$object->getShow('description')}></dd> |
| + | </dl> |
| + | After: |
| + | <h1><{$smarty.const._MD_TNEWS_LANG_TITLE}> : <{$object->getShow('title')}></h1> |
| + | <dl class="viewDetail"> |
| + | <dt><{$smarty.const._MD_TNEWS_LANG_DESCRIPTION}></dt> |
| + | <dd><{$object->getShow('description')}></dd> |
| + | </dl> |