Back to page

− Links

 Print 


Table of contents
  • Customize Generated Module
    • Basic Customize
      • Default Action
      • SQL File
      • Edit Form File
      • Template Files

Customize Generated Module anchor.png[1] Edit [2]

Page Top

Basic Customize anchor.png[3] Edit [4]

Page Top

Default Action anchor.png[5] Edit [6]

  • Set default action. When user access module top, default action page is called.
  • {xoops_trust_path}/modules/{modulename}/class/Module.class.php
    Before:
    private function _getDefaultActionName()
    {
        // TODO insert your default action name
        return 'index';
    }
    After:
    private function _getDefaultActionName()
    {
        return 'NewsList';
    }
Page Top

SQL File anchor.png[7] Edit [8]

  • Generated sql file is very rough one. Set proper field type, length, etc. Also it has no index definition.
  • {xoops_trust_path}/modules/{modulename}/sql/mysql.sql
    Before:
    `length` int(4) unsigned NOT NULL,
    After:
    `length` smallint(4) unsigned NOT NULL,
Page Top

Edit Form File anchor.png[9] Edit [10]

  • 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);

wh0cd406487 <a href=http://viagraprice2017.com/[11]>viagra price comparison</a>

Page Top

Template Files anchor.png[12] Edit [13]

  • {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>

Last-modified: 2017-04-26 (Wed) 16:59:55 (JST) (152d) by Phyllisencug(Phyllisencug)