Main Page   File List   File Members   Related Pages  

template.php

Go to the documentation of this file.
00001 <?php
00002 // $Header: /cvsroot/modphpcms/modphpcms/modules/template.php,v 1.2 2004/05/04 22:33:17 fred87 Exp $
00003 
00004 function MODULE_NAME_install()
00005 //{{{
00006 {
00007         $info['name'] = 'MODULE_NAME';
00008         $info['title'] = 'MODULE_TITLE';
00009         $info['description'] = 'A wordy description';
00010         $info['has_admin'] = 1;
00011         $info['enabled'] = 1;
00012         set_module_info($info);
00013         
00014         // <<< SET ANY CONFIG ENTRIES HERE >>>
00015         
00016         $hooks = get_entry('hooks', 'some_hook');
00017         ListAdd('MODULE_NAME', $hooks);
00018         set_entry('hooks', 'some_hook', $hooks);
00019 
00020         module_installed();
00021 }
00022 //}}}
00023 function MODULE_NAME_uninstall($preserve_data)
00024 //{{{
00025 {
00026         delete_module('MODULE_NAME');
00027 
00028         // <<< INSERT CODE TO DELETE ANY CONFIG ENTRIES HERE if (!$preserve_data) >>>
00029 
00030         $hooks = get_entry('hooks', 'some_hook');
00031         ListDel('MODULE_NAME', $hooks);
00032         set_entry('hooks', 'some_hook', $hooks);
00033 }
00034 //}}}
00035 function MODULE_NAME_some_hook()        // the actual module code - called by a hook
00036 //{{{
00037 {
00038         $info = get_module_info('MODULE_NAME');
00039         if (!$info['enabled'])
00040                 return;
00041         
00042         // do stuff
00043 }
00044 //}}}
00045 ?>

Generated on Wed Jun 9 03:38:16 2004 for modphpcms by doxygen1.2.18