Hello World
This is the classic Hello World example, a 2 minute introduction to create your first Wiki App.
You will create four text files with your favourite editor. We recommend the free PSPAD text editor but Windows notepad.exe or other will do just fine:
app.php
app.php is the main application file that is shown when the user opens a Wiki page to view it.
<div align="center">
<?php
// display content of "helloworld_Title" constant defined in language file
echo helloworld_Title;
?>
</div>
settings.php
settings.php is shown when the user clicks to edit the application page. It is used for your Apps settings.
<div align="center">
<?php
// display content of "helloworld_Admin" constant defined in language file
echo helloworld_Admin;
?>
</div>
<!-- we put two buttons on settings so user can save settings or cancel what he changed -->
<input type="button" class="wikiButton" name="sub" value="Submit" onclick="submitModuleData(true)" /><br/>
<input type="button" class="wikiButton" onclick="cancelModuleForm()" value="<?php echo str_CANCEL; ?>" />
changelog.txt
In changelog.txt you keep a tab on changes made to your App in different versions. Mandatory in this file is the "- COMPATIBILITY" line which determines what minimum Wiki version is required to run your App.
v1.0.0 (2008-06-09)
- NEW: first release
- COMPATIBILITY: 2.4.31
lang/english.inc.php
The language file (here it is english) defines constants that will be used in your Apps php files. Mandatory in this file is to define the variable $appname. The value of this variable will be shown in the "Select app" dropdown of a Wiki page when editing.
<?php
// we define application name
$appname="Hello World";
// we define constants that will be used in app.php and settings.php
define("helloworld_Title","Hello World");
define("helloworld_Admin","Hello World Admin Panel");
?>
Create and edit those four files. Upload them to a new subdirectory of your (wikiroot)/apps/ directory and you are done.
Your App is ready and can be embedded in any Wiki page (except your Wikis root page).

