History: FeatureCreationDev
Preview of version: 15
Getting Started With Feature Development
So, you've built a Module ( ModuleCreationDev ) or two and are ready to build a full Feature?
I won't be delving too deeply into the internals of your feature, but instead focusing more heavily on the current system of integrating that feature into the rest of the TikiWiki framework. Basically, a feature needs to do several things:
- Use ))AdminFeatures(( to turn itself On/Off
- Initialize itself in php-setup
- Display a menu in the ApplicationMenu
- Expose itself for administration in either the Admin Menu or Section
Turning a Feature On/Off
In tikiwiki, all features are enabled or disabled through the use of the Admin Control Panel Features which can be found in the control panel. It is quite simple to add your feature to this list. Just copy a line from an existing feature in the template file ( tiki/templates/tiki-admin-include-features.tpl ) and replace the old feature name with the new. Then do the same thing in the php file ( /tiki/tiki-admin.php ) so that the setting is recorded.
See tiki/templates/tiki-admin-include-features.tpl
<CODE><div class="cbox"> <div class="cbox-title">Features{/tr}</div> <div class="cbox-data"> <table width="100%"><tr> <td valign="top"> <div class="simplebox"> Tiki sections and features{/tr} <form action="tiki-admin.php?page=features" method="post"> <table><tr> <td class="form">Wiki{/tr}:</td> <td><input type="checkbox" name="feature_wiki" {if $feature_wiki eq 'y'}checked="checked"{/if}/></td> </tr><tr> <td class="form">New Feature{/tr}:</td> <td><input type="checkbox" name="feature_new_feature" {if $feature_new_feature eq 'y'}checked="checked"{/if}/></td> </tr><tr> <td class="form">Search{/tr}:</td> <td><input type="checkbox" name="feature_search" {if $feature_search eq 'y'}checked="checked"{/if}/></td> </tr><tr> . . .</CODE> Feature Layout Notes Keep in mind that the current admin-feature layout is a 5 column table that follows this pattern
checkbox | name | space (nbsp) | checkbox | name |
See tiki/tiki-admin.php
<CODE>' ' ' // Process Features form(s) if $_REQUEST%22features%22 { simple_set_toggle( "feature_wiki" ); simple_set_toggle( "feature_new_feature" ); simple_set_toggle( "feature_polls" ); . . .</CODE>
-