|
How to make our components to add the necessary Content Elements? |
|
|
|
|
Ysgrifennwyd gan Ivo Apostolov
|
|
Dydd Iau, 26 Ebrill 2007 01:36 |
|
There are no translations available. OK, you need a simple hack in order to make your component install the necessary content element files, when the component is installed itself. - Put the content element files in a folder named "contentelements" for example
- In the function com_install in your file install.component_name.php you need to add the following lines of code:
if (file_exists($mosConfig_absolute_path . '/administrator/components /com_joomfish/config.joomfish.php')) { @rename( "$mosConfig_absolute_path/administrator/components/com_component_name /contentelements/ce_name.xml", "$mosConfig_absolute_path/administrator/components/com_joomfish /contentelements/ce_name.xml"); @rename( "$mosConfig_absolute_path/administrator/components /com_component_name/contentelements/ce_name2.xml", "$mosConfig_absolute_path/administrator/components/com_joomfish /contentelements/ce_name2.xml"); @rmdir ("$mosConfig_absolute_path/administrator/components /com_component_name/contentelements"); } else { @unlink( "$mosConfig_absolute_path/administrator /components/com_component_name/contentelements/ce_name.xml" ); @unlink( "$mosConfig_absolute_path/administrator /components/com_component_name/contentelements/ce_name2.xml" ); @rmdir ("$mosConfig_absolute_path/administrator /components/com_component_name/contentelements"); } Basicly this few lines of code, check if Joom!Fish is installed, and if so, it copies the necessary files to the right place. If not it delete the files. Some advanced features might offer even a function those files to be added on a later stage from your component options, but this is probably the easiest way to have a build-in Joom!Fish Support.
|
DATE_FORMAT_LC1
DATE_FORMAT_LC1
DATE_FORMAT_LC1