Main Page   File List   File Members   Related Pages  

logo.php

Go to the documentation of this file.
00001 <?php
00002 // $Header: /cvsroot/modphpcms/modphpcms/modules/logo.php,v 1.2 2004/05/04 22:33:17 fred87 Exp $
00003 
00004 function logo_install()
00005 //{{{
00006 {
00007         $info['name'] = 'logo';
00008         $info['title'] = 'Logo';
00009         $info['description'] = 'Inserts an image into any of the corners.';
00010         $info['has_admin'] = 1;
00011         $info['enabled'] = 1;
00012         set_module_info($info);
00013 
00014         set_entry('config', 'logo_image', 'images/logo.png');
00015         set_entry('config', 'logo_text', 'modphpcms logo');
00016         set_entry('config', 'logo_cell', 'tl');
00017 
00018 //{{{Install hooks
00019         $hooks = get_entry('hooks', 'tl_cell');
00020         ListAdd('logo', $hooks);
00021         set_entry('hooks', 'tl_cell', $hooks);
00022 
00023         $hooks = get_entry('hooks', 'tr_cell');
00024         ListAdd('logo', $hooks);
00025         set_entry('hooks', 'tr_cell', $hooks);
00026 
00027         $hooks = get_entry('hooks', 'bl_cell');
00028         ListAdd('logo', $hooks);
00029         set_entry('hooks', 'bl_cell', $hooks);
00030 
00031         $hooks = get_entry('hooks', 'br_cell');
00032         ListAdd('logo', $hooks);
00033         set_entry('hooks', 'br_cell', $hooks);
00034 //}}}
00035         
00036         module_installed();
00037 }
00038 //}}}
00039 function logo_uninstall($preserve_data)
00040 //{{{
00041 {
00042         delete_module('logo');
00043 
00044         if (!$preserve_data)
00045         {
00046                 delete_entry('config', 'logo_image');
00047                 delete_entry('config', 'logo_text');
00048                 delete_entry('config', 'logo_cell');
00049         }
00050 
00051 //{{{Delete hooks
00052         $hooks = get_entry('hooks', 'tl_cell');
00053         ListDel('logo', $hooks);
00054         set_entry('hooks', 'tl_cell', $hooks);
00055 
00056         $hooks = get_entry('hooks', 'tr_cell');
00057         ListDel('logo', $hooks);
00058         set_entry('hooks', 'tr_cell', $hooks);
00059         
00060         $hooks = get_entry('hooks', 'bl_cell');
00061         ListDel('logo', $hooks);
00062         set_entry('hooks', 'bl_cell', $hooks);
00063 
00064         $hooks = get_entry('hooks', 'br_cell');
00065         ListDel('logo', $hooks);
00066         set_entry('hooks', 'br_cell', $hooks);
00067 //}}}
00068 }
00069 //}}}
00070 //{{{Fake hooks
00071 function logo_tl_cell()
00072 {
00073         Ilogo_doLogo('tl');
00074 }
00075 function logo_tr_cell()
00076 {
00077         Ilogo_doLogo('tr');
00078 }
00079 function logo_bl_cell()
00080 {
00081         Ilogo_doLogo('bl');
00082 }
00083 function logo_br_cell()
00084 {
00085         Ilogo_doLogo('br');
00086 }
00087 //}}}
00088 function Ilogo_doLogo($cell)
00089 //{{{
00090 {
00091         $info = get_module_info('logo');
00092         if (!$info['enabled'])
00093                 return;
00094         
00095         if (get_entry('config', 'logo_cell') != $cell)
00096                 return;
00097 
00098         $image = get_entry('config', 'logo_image');
00099         $alt = get_entry('config', 'logo_text');
00100         print "\n               <img src='$image' alt='$alt' />\n";
00101 }
00102 //}}}
00103 ?>

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