User Login    
 + Register
  • Main navigation
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Who's Online
73 user(s) are online (8 user(s) are browsing XoopsWiki)

Members: 1
Guests: 72

pacho, more...
[Main Page]

Dev:xoops version.php

From XOOPS Project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

Contents

xoops_version.php File

This file is used during module installation and removal, but otherwise not utilized during module usage. The <path2module>/language/<lang>/modinfo.php file is automatically included and expects the defines for module installation included here. However, define statements and other defined variables in these files will NOT be available to your module except the Module Configuration data entered during installation.

Main Info

   *
     $modversion['name'] = _MI_NEWBB_NAME;
         o Name of the module
   *
     $modversion['version'] = 1.00;
         o Module version
   *
     $modversion['description'] = _MI_NEWBB_DESC;
         o Module description
   *
     $modversion['credits'] = "Kazumi Ono
( http:/ /www.myweb.ne.jp/ )"; o Module credits *
     $modversion['author'] = "Me";
         o Module Author
   *
     $modversion['help'] = "newbb.html";
         o Module help template
   *
     $modversion['license'] = "GPL see LICENSE";
         o Module License
   *
     $modversion['official'] = 1;
         o Is official Xoops module (usually 0 for us)
   *
     $modversion['image'] = "images/xoopsbb_slogo.png";
         o Image in the modules panel and left nav menu (if any)
   *
     $modversion['dirname'] = "newbb";
         o Directory of the module

Install, Uninstall and Update

   *
     $modversion['onInstall'] = "path/to/file/with/install/function";
         o Path to the file (from the module folder) containing a function called xoops_module_install_{dirname} that takes a XoopsModule object as parameter. This function will be run AFTER module is installed
   *
     $modversion['onUninstall'] = "path/to/file/with/uninstall/function";
         o Path to the file (from the module folder) containing a function called xoops_module_uninstall_{dirname} that takes a XoopsModule object as parameter. This function will be run AFTER module is uninstalled
   *
     $modversion['onUpdate'] = "path/to/file/with/update/function";
         o Path to the file (from the module folder) containing a function called xoops_module_update_{dirname} that takes a XoopsModule object as parameter and a string indicating the former vers installed. This function will be run when the module is updated

SQL

   *
     $modversion['sqlfile']['mysql'] = "sql/mysql.sql";
         o SQL statements to create the database tables needed by this module
   *
     $modversion['tables'][0] = "bb_categories";
         o List of tables created by the the sql dump; Used for uninstallation
         o Increase [0] by one for the next table (ex: ['tables'][1],['tables'][2],etc)

Admin

   *
     $modversion['hasAdmin'] = 1;
         o Display in the admin nav bar
   *
     $modversion['adminindex'] = "admin/index.php";
         o Admin index
   *
     $modversion['adminmenu'] = "admin/menu.php";
         o Popup menu for admin menu icon

Menu

   * $modversion['hasMain'] = 1;
   Put in the Main Menu (0 for no). Please note that setting this to 0 also removes this module from the list of modules you can give a group access to from the groups admin screen. It's last permission value will remain in effect.
   *
     $modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
         o Name of the submenu in the Main Menu (when you click on the module)
   *
     $modversion['sub'][1]['url'] = "submit.php";
         o File to run in the module directory

Templates

   *
     $modversion['templates'][1]['file'] = 'newbb_index.html';
         o All the template files (for subdirs do 'subdir/newbb_sub.html')
         o Increase [1] by one for the next file (ex: ['templates'][2],['templates'][3],etc)
         o It will be saved in the database
         o Note: This item starts at [1], not [0].
   *
     $modversion['templates'][1]['description'] = ;
         o A short description of the template file
         o Increase [1] by one for the next description (ex: ['description'][2],['description'][3],etc)
         o It will be saved in the database
         o Note: This item starts at [1], not [0].

Blocks

   * a 'file' can have many names, descriptions, functions, options, edit_func, and templates --- (just create another set, ie: [2])
   * $modversion['blocks'][1]['file'] = "newbb_new.php";
   * $modversion['blocks'][1]['name'] = _MI_NEWBB_BNAME1;
   * $modversion['blocks'][1]['description'] = "Shows recent topics in the forums";
   * $modversion['blocks'][1]['show_func'] = "b_newbb_new_show";
   * $modversion['blocks'][1]['options'] = "10|1|time";
   * $modversion['blocks'][1]['edit_func'] = "b_newbb_new_edit";
   * $modversion['blocks'][1]['template'] = 'newbb_block_new.html';

Search

   * $modversion['hasSearch'] = 1;
   * $modversion['search']['file'] = "include/search.inc.php";
   * $modversion['search']['func'] = "newbb_search";

Notification

   * $modversion['hasNotification'] = 1;
   * $modversion['notification']['lookup_file'] = 'include/notification.inc.php';
   * $modversion['notification']['lookup_func'] = 'newbb_notify_iteminfo';
   * $modversion['notification']['category'][1]['name'] = 'thread';
   * $modversion['notification']['category'][1]['title'] = _MI_NEWBB_THREAD_NOTIFY;
   * $modversion['notification']['category'][1]['description'] = _MI_NEWBB_THREAD_NOTIFYDSC;
   * $modversion['notification']['category'][1]['subscribe_from'] = 'viewtopic.php';
   * $modversion['notification']['category'][1]['item_name'] = 'topic_id';
   * $modversion['notification']['category'][1]['allow_bookmark'] = 1;
   * $modversion['notification']['event'][1]['name'] = 'new_post';
   * $modversion['notification']['event'][1]['category'] = 'thread';
   * $modversion['notification']['event'][1]['title'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFY;
   * $modversion['notification']['event'][1]['caption'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP;
   * $modversion['notification']['event'][1]['description'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC;
   * $modversion['notification']['event'][1]['mail_template'] = 'thread_newpost_notify';
   * $modversion['notification']['event'][1]['mail_subject'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ;


Configuration

Configuration items

   * $modversion['config'][1]['name'] = 'profile_search';
   * $modversion['config'][1]['title'] = '_PROFILE_MI_PROFILE_SEARCH';
   * $modversion['config'][1]['description'] = '_PROFILE_MI_PROFILE_SEARCH_DSC';
   * $modversion['config'][1]['formtype'] = 'yesno';

can be 'yesno', 'select', 'select_multi', 'group', 'group_multi', 'textbox', 'textarea', 'user', 'user_multi', 'timezone' or 'language'

   * $modversion['config'][1]['valuetype'] = 'int';

can be 'int', 'float', 'textarea' or 'array'. All items with formtype 'multi_xxx' must have the valuetype 'array'

   * $modversion['config'][1]['default'] = 1;
   * $modversion['config'][1]['category'] = 'settings'; //Implemented in XOOPS 2.2

Configuration Categories (Implemented in XOOPS 2.2)

   * $modversion['configcat'][1]['nameid'] = 'settings';

the referenced name used in the configuration item's 'category'

   * $modversion['configcat'][1]['name'] = '_PROFILE_MI_CAT_SETTINGS';

the displayed name/title

   * $modversion['configcat'][1]['description'] = '_PROFILE_MI_CAT_SETTINGS_DSC';

Page Awareness (Implemented in XOOPS 2.2)

   * $modversion['pages'][1]['name'] = _PROFILE_MI_PAGE_INFO;
   * $modversion['pages'][1]['url'] = "filename.php";

Dynamic User Profile (Implemented in XOOPS 2.2)

   * $modversion['hasProfile'] = 1;
   * $modversion['profile']['field'][1]['name'] = 'profile_aim';

field name - can be referenced with $xoopsUser->getVar('profile_aim') in module code

   * $modversion['profile']['field'][1]['type'] = 'textbox';

type of form element for editing

   * $modversion['profile']['field'][1]['valuetype'] = XOBJ_DTYPE_TXTBOX;

type of field - use XoopsObject valuetypes found in kernel/object.php

   * $modversion['profile']['field'][1]['maxlength'] = 255;

maxlength of the field - Note: Mandatory when dealing with XOBJ_DTYPE_TXTBOX fields

   * $modversion['profile']['field'][1]['default'] = ;

Default value

   * $modversion['profile']['field'][1]['show'] = 1;

can this field be shown in user profiles (still subject to group permissions)

   * $modversion['profile']['field'][1]['title'] = _PROFILE_AIM_TITLE;

Name of field, when displayed - such as in user profile or editing

   * $modversion['profile']['field'][1]['edit'] = 1;

can this field be edited in user profile editing (still subject to group permissions)

   * $modversion['profile']['field'][1]['description'] = _PROFILE_AIM_DESCRIPTION;

description - such as when editing the profile, this will show up

   * $modversion['profile']['field'][1]['required'] = 0;

is field required when editing?

   * $modversion['profile']['field'][1]['config'] = 1;

can this field be configured? Set this to zero if you rely on this field's information in your module code as configuration can alter the field completely - or DELETE it - if this is enabled

   * $modversion['profile']['field'][1]['options'] = array();

Retrieved from "http://www.xoops.org/modules/mediawiki/index.php/Dev:xoops_version.php"

This page has been accessed 783 times. This page was last modified 16:01, 1 November 2008. Content is available under XOOPS Project.


Developers for Hire
Developers for Hire
Local Support Sites
Make a donation
Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Powered by
XOOPS Code hosted on SourceForge

Powered by PHP

PHP 5

Powered by MySQL

Powered by Smarty

OSI certified

GPL

All content on this site is subject to the Creative Commons License
Top Tags
Theme (5) news (2) security (2) sport (1) Arabic (1) wiki (1) Christmas (1) jQuery (1) tag (1) module (1) SEO (1) comments (1)
Advertisement