6.0.0-beta13
4/10/26

Creating a Horde Module (App)

Please follow the instructions below and choose the version for which you'd like to start a new module. Once you have your first module you need to populate it with content. This will be the subject of the next section: PopulatingYourFirstModule

Horde 5 (current)

  1. Prerequisites:
    Generate a horde checkout or get one using the Horde Developer Container
    (configure git-tools/config/conf.php first)
    /path/to/git-tools/bin/horde-git-tools git clone
    Setup an environment
    /path/to/git-tools/bin/horde-git-tools dev install
    Do basic horde initialization for dev (registry.local.php, conf.php)

  2. Create an app template
    /path/to/git-tools/bin/horde-git-tools dev new --app-name foo --author "My Name <my.name@mycompany.com>"

  3. In /path/to/horde/config/registry.d/ create a file called newmodulename.php. Please note the documentation for available module entry options in horde/config/registry.php, especially the menu parent. If you want your module to go anywhere else in the menue, you will need to change this!

This is a "registry.d" example for Horde 5:

&lt;?php
$this-&gt;applications['newmodulename'] = array(
    'name' =&gt; _(&quot;New Module&quot;),
    // This is sufficient. More options possible if needed
);
  1. If you wish you can provide your new module with a PNG icon at 20x20. This needs to be placed in the "themes" subdirectory:
mkdir newmodulename/themes/default/graphics
cp newmodulename.png newmodulename/themes/default/graphics/

This one is an example PNG from the basic horde application

https://github.com/horde/horde/raw/master/horde/themes/default/graphics/horde.png

  1. To actually run your app boilerplate, you need to re-run the git-tools dev install procedure to create appropriate symlinks

Horde 5 (pre git split)

  1. Check out the skeleton module:
 git clone --depth 1 https://github.com/horde/skeleton.git
 cd skelton
  1. Start a new module - based on the Skeleton module - by running the following helper script:
./bin/skeleton-generate-module newmodulename &quot;Me Myself &lt;me@myselfandi.com&gt;&quot;

The new module will end up in skeleton's parent directory and have the name "newmodulename".

  1. Link or copy the new module into your horde installation.
 ln -s `pwd`/../newmodulename /your/install/path/to/horde/

Linking is the preferred variant as this allows you to work within the git repository and commit any code you write to a local branch. At the same time you have the installation ready for immediate testing of any changes.

  1. In /path/to/horde/config/registry.d/ create a file called newmodulename.php. Please note the documentation for available module entry options in horde/config/registry.php, especially the menu parent. If you want your module to go anywhere else in the menue, you will need to change this!

This is a "registry.d" example for Horde 5:

&lt;?php
$this-&gt;applications['newmodulename'] = array(
    'name' =&gt; _(&quot;New Module&quot;),
    // This is sufficient. More options possible if needed
);
  1. If you wish you can provide your new module with a PNG icon at 20x20. This needs to be placed in the "themes" subdirectory:
mkdir newmodulename/themes/default/graphics
cp newmodulename.png newmodulename/themes/default/graphics/

This one is an example PNG from the basic horde application

https://github.com/horde/horde/raw/master/horde/themes/default/graphics/horde.png

Horde 4

It is not recommended to use the Horde 4 Skeleton any longer.

  1. Check out the skeleton module from horde git
 git clone --depth 1 git://github.com/horde/horde.git
 cd horde
 cp -R skeleton/ /your/install/path/to/horde/
  1. Create the following script as projectrename.php - save it somewhere sensible, like your home directory:
#!/usr/bin/php -q
&lt;?php
function analysedir( $path_, $list_ )
{
  // Read dir
  $handle = opendir($path_);
  while (false !== ($file = readdir($handle)))
  {
    if( $file!='.' &amp;&amp; $file!='..')
    {
        $file = $path_ . DIRECTORY_SEPARATOR . $file;
        //echo &quot;$filen&quot;;

        if( !is_dir( $file ) )  // If File: Append
        {
          $list_[count($list_)]=$file;
        }
        else   // If Folder: scan recursively
        {
          $list_ += analysedir($file, $list_ );
        }
   }
 }      // While END
 return $list_;
}

function substitute_skeleton( $filename, $modulname )
{
  $prjUC=strtoupper(trim($modulname));
  $prjLC=strtolower($prjUC);
  $prjMC=substr($prjUC, 0, 1) . substr($prjLC, 1, strlen($prjLC)-1);

  $filehandle=fopen(trim($filename), 'r');
  $file=fread($filehandle, filesize($filename));
  fclose($filehandle);
  $newfile=str_replace(array('SKELETON', 'Skeleton', 'skeleton'), array($prjUC, $prjMC, $prjLC), $file);
  $filehandle=fopen(trim($filename), 'w');
  fwrite($filehandle, $newfile);
  fclose($filehandle);
}

function help()
{
  echo &quot;projectrename.php &lt;/path/to/skeleton-folder/&gt; &lt;modulname&gt;n&quot;;
}

//
// ------------------- Main-Code --------------------
//

if (count($_SERVER['argv'])==3)
{
  // Preparation
  $list = array();
  $path = trim($_SERVER['argv'][1]);
  $modul = trim($_SERVER['argv'][2]);

  // Fetch Filelist
  $list = analysedir( $path, $list );

  // Modify each File
  foreach( $list as $file )
  {
        //echo $modul.&quot;: &quot;.$file.&quot;n&quot;;
        substitute_skeleton( $file, $modul );
  }
}
else
  help();
?&gt;
  1. On a unix system, use the following command to replace all skeleton strings with your project name (Not tested on Windows, but should work):
projectrename.php /path/to/skeleton modulname

3.1:

Edit your Name into all files, for example with this snippet under bash (Unix, Linux or Windows with cygwin):

find ./ -type f -exec sed -i 's/Your Name <you@example.com>/Me Myself <me@myselfandi.com>/g' {} \;

3.2 Rename

mv horde/appname/test/Skeleton horde/appname/test/Appname

and

mv horde/appname/locale/skeleton.pot horde/appname/locale/appname.pot

and

mv horde/appname/migration/1_skeleton_base_tables.php horde/appname/migration/1_appname_base_tables.php
  1. Perform some file modifications:
mkdir /path/to/modulename/themes/default/graphics
  1. Upload a PNG icon at 16x16 named appname.png for the module to the path created above. This one is an example from the basic horde application:

https://github.com/horde/horde/blob/master/horde/themes/default/graphics/horde.png

  1. In /path/to/horde/config/registry.d/ create a file called modulename.php. Please note the lack of ?> at the end of the php block, and also the menu parent. If you want your object to go *ANYWHERE ELSE* you will need to change this!

This is a registry.d example for Horde 4:

&lt;?php
$this-&gt;applications['tickplug'] = array(
        'name' =&gt; _(&quot;Tickplug&quot;),
        'provides' =&gt; array(
        'Tickets/Import'
        )
        // This is sufficient. More options possible if needed
    );
  1. On the administration - configuration page, configure your app. (It won't display in the sidebar until you do.)

Horde 3

It is not recommended to use the Horde 3 Skeleton from CVS any longer. There is currently no usable version of Skeleton which is tagged FRAMEWORK_3. An older revision of the CVS HEAD version may work though.

This is a registry.d example for Horde 3:

&lt;?php
$this-&gt;applications['modulename'] = array(
    'fileroot' =&gt; dirname(__FILE__) . '/../../modulename',
    'webroot' =&gt; $this-&gt;applications['horde']['webroot'] . '/modulename',
    'name' =&gt; _(&quot;A description of your module&quot;),
    'status' =&gt; 'active',
    'menu_parent' =&gt; 'horde'
);