=====An Installation System for Wikka Actions===== >>**See also** [[InstallableActionTemplate | Template for the actions]] >> There are a certain number of patterns popping out of the action development routine -- sometimes there is MySQL, sometimes there is CSS, sometimes there are changes to the configuration file, and there is always PHP code. It would be nice if we could define all of these things in a single wiki page and then use it as a type of "installation file." That is what this action does. To start off, we're going to need to make some serious changes to the show handler, the Run() and Action() methods in wikka.php, wikka.config.php, and the header action. Let's start with the show handler... (**handler/page/show.php**) %%(php) GetMethod() == "show") ? ' ondblclick="document.location=\'' . $this->href('edit') . '\';"' : ''; $body = "
You aren't allowed to read this page.
This page doesn't exist yet. Maybe you want to Href("edit")."\">create it?
"; } else { if ($this->page["latest"] == "N") { $body .= "There are no comments on this page. '; $showcomments_text = 'Add comment'; break; case 1: $body .= '
There is one comment on this page. '; $showcomments_text = 'Display comment'; break; default: $body .= '
There are ' . count($comments) . ' comments on this page. '; $showcomments_text = 'Display comments'; } $body .= '[$showcomments_text]
Fatal Error: The Installer couldn\'t find any PHP code in the Installable Action!
'; } } break; case 'finish': echo 'Here\'s to hoping the new action works!
'; $buttons['continue'] = ''; unset($buttons['cancel']); $hidden_tag_field = ''; } $buttons = join(' ', $buttons); echo $hidden_tag_field; echo 'Action | Summary | Installed Version | Current Version | MySQL | CSS | Actions |
---|
There are no installable actions on this system.
'; } }} // end IsAdmin() check ?> %% **Note:** You'll have to find %REMOVE ME% and replace with ""%%"" in your text editor before the above code will work. Now create a page like "ActionInstaller" and call the action from within it like so -- ""{{installer}}"". If you don't have any InstallableActions in your wiki, you'll need to find some! If you'd just like to test the system, copy the InstallableActionTemplate to your wiki and load your installer page. It should look something like... ====The Screenshots==== {{image url="http://bytebrite.com/img/ia1ss.gif"}} {{image url="http://bytebrite.com/img/ia2ss.gif"}} {{image url="http://bytebrite.com/img/ia3ss.gif"}} {{image url="http://bytebrite.com/img/ia4ss.gif"}} {{image url="http://bytebrite.com/img/ia5ss.gif"}} {{image url="http://bytebrite.com/img/ia6ss.gif"}} {{image url="http://bytebrite.com/img/ia7ss.gif"}} {{image url="http://bytebrite.com/img/ia8ss.gif"}} {{image url="http://bytebrite.com/img/ia9ss.gif"}} {{image url="http://bytebrite.com/img/ia10ss.gif"}} The removal process is similar (one of them "exercise for the reader" dealies). ====Authors==== DennyShimkoski ---- CategoryUserContributions