BoonEx Home Trac
 
 

Widget Installation algorithm creating

Your widget package must contain an “install” folder with two necessary files: install.sql and install.xml and one optional permissions.xml.

install.sql” contains all MySQL queries needed for widget work or it should be empty if there are no tables for this widget. Every MySQL query should contain the “[module_db_prefix]” string before every table name (and use MODULE_DB_PREFIX constant in the XMLS application before table name):

CREATE TABLE IF NOT EXISTS `[module_db_prefix]Profiles` (
`ID` int(11) NOT NULL default '0',
`Banned` enum('true','false') NOT NULL default 'false',
`Type` enum('view','text','full') NOT NULL default 'full',
`Smileset` varchar(255) NOT NULL default '',
PRIMARY KEY (`ID`)
);

permissions.xml” contains information about any custom file (folder) that should have specific permissions for proper operation of the widget. It should look like the following:

<items>
<item key="files"><![CDATA[777]]></item>
</items>

Every “item” node should have a “key” attribute equal to the relative path (from widget directory) of the file (folder). The value of the node is the target permissions of the file (folder).

install.xml” contains the installation wizard configuration. It should look like the following:

<page>
<caption>
<![CDATA[Welcome]]>
</caption>
<text>
<![CDATA[Welcome to installation wizard.<br>Click "Next" to proceed
installation.]]>
</text>
</page>
<page>
<caption>
<![CDATA[Attention]]>
</caption>
<text>
<![CDATA[<li>
You need to finish the process of widget's integration in your community software. For this purpose you need to edit functions in the <b>modules/#widget#/inc/customFunctions.inc.php</b> file according to your database and script structures following comments in the file. NOTE. By default, this file has integration for Dolphin
community software.<br><li>You need to remove <b>modules/#widget#/install</b> folder from your host. It is not safe to leave it there.<br><li>Go to <FONT COLOR="#CC0000">Settings</FONT> of
this widget to configure it's settings.]]>
</text>
</page>

As you can see this configuration includes the description of several installation wizard pages (steps). Every page description contains “caption”, “text” (optional) and “items”. The “caption” node contains page header as a value. The “text” node contains any text (with HTML tags) as a value that is displayed just after the header. The “items” node contains all items (files/folders or settings) that should be set while installing the widget. Every item has the same structure as item in the “xml/settings.xml” file (see Widget settings section).

You should enclose your items somewhere before the last page. Normally the last page shouldn’t contain any items, merely some text with widget installation/user recommendations.