telepark.wiki User and Developer Manual

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).



Copyright © 2010 telepark. All rights reserved. Powered by telepark.cms
Message Box
 Your Email
 Your message *
Search


Sign-up to our newsletter

Contact us
Email: info [at] telepark.de
Tel: +49 89 3001803
Fax: +49 89 3001804
Skype IM: telepark
English
Deutsch