Commit 5eb8bea1 authored by Côme Chilliet's avatar Côme Chilliet

Added missing images. Changed code for code-block. Replace <code> by a new role 🐚

Not sure why it seems code coloration does not work while code-block
does.
But in the doc I only see code and not code-block.
parent 8419e9e7
......@@ -8,3 +8,9 @@
.. |phpfile| image:: /_static/images/php_file.png
:alt:
.. role:: php(code)
:language: php
.. role:: shell(code)
:language: bash
......@@ -109,7 +109,7 @@ Allow to handle several UI attributes which are stored as only one LDAP field.
For instance let's say you store an FTP connection URL in an LDAP field as "ftp://user:password@host:port" but you want to display 4 inputs for the 4 parts.
That would look like :
.. code:: php
.. code-block:: php
<?php
new CompositeAttribute (
......
......@@ -21,7 +21,7 @@ Change **templatePath** value to your custom template path (usually in the const
In your template, you'll be able to use the $sections array that contains each section render.
For instance:
.. code:: smarty
.. code-block:: smarty
<h1>Hello world!</h1>
<div class="plugin_sections">
......@@ -194,7 +194,7 @@ Please don't touch the fieldset, legend and table, just replace the foreach by w
You need to use the attributes array, which contain for each attribute, indexed by its ldap name, its label and its input html code.
For instance, for the above section, doing the following would have the same result than the default template:
.. code::
.. code-block:: smarty
<fieldset id="{$sectionId}" class="plugin_section{$sectionClasses}">
<legend>{$section}</legend>
......
......@@ -79,7 +79,7 @@ aclCategory should be the name of an existing ACL category. Most of the time omi
For instance, this is the plObjectType of the user class:
.. code:: php
.. code-block:: php
<?php
'plObjectType' => array(
......@@ -101,7 +101,7 @@ For instance the manager field in a department is a foreign key on the dn of a u
The syntax for this is:
.. code:: php
.. code-block:: php
<?php
'plForeignKeys' => array(
......@@ -112,7 +112,7 @@ The syntax for this is:
But you can omit *filter* most of the time (defaults to '*myfield*=%oldvalue%') and *hisfield* if it is the *dn*, and if there is only one field you are referring to you can omit the array, so for our department example this gives us:
.. code:: php
.. code-block:: php
'plForeignKeys' => array(
'manager' => 'user'
......
.. include:: /globals.rst
Getting started
===============
This page is a how-to to help you write a dummy plugin.
......@@ -19,6 +21,7 @@ Your plugin should have a *main.inc* file if you intend it to display on its own
Icons
-----
If your plugin packs some icons, they need to be placed in the default icon theme:
*{fd-directory}/html/themes/default/icons/{size}/{category}*
Most of the time your icons are those of an application and should therefore be placed in the *apps* folder, which is for the category *applications*.
......@@ -71,6 +74,7 @@ See :ref:`pl-info` for more details about other fields
Attributes
----------
You might have noticed the empty getAttributesInfo method. This is where the magic happens.
You should fill this function with an array of sections containing attributes.
Available attribute types are BooleanAttribute, IntAttribute, FloatAttribute, StringAttribute, SelectAttribute, PasswordAttribute…
......@@ -163,14 +167,17 @@ For each section you might also specify keys 'icon' with a section icon path, or
Displaying the plugin in FusionDirectory
----------------------------------------
Put the plugin code into a directory FusionDirectory is reading (see above).
Run <code>"fusiondirectory-setup --update-cache"</code> as root.
Run :shell:`fusiondirectory-setup --update-cache` as root.
Log out, log in.
A tab should now show in user edition mode, with the attributes we specified:
{{:en:documentation_dev:demoplugin.png?800|}}
.. image:: /_static/images/demoplugin.png
Displaying the plugin in the "My account" menu
----------------------------------------------
You may also want the plugin to show in the "My Account" menu, if your plugin is for users and you've set plModifySelf to TRUE.
For this, you need your plugin to have a main.inc PHP file.
Just put this in it:
......
......@@ -19,7 +19,7 @@ Icon theme file
Here is the minimal index.theme file to inherit another icon theme.
.. code:: ini
.. code-block:: ini
[Icon Theme]
Name=MyTheme
......@@ -31,7 +31,7 @@ For an example of a more complex index.theme file look at the one of the default
All main icon themes should be working, you can activate them by using a symlink in the right folder.
For instance on Debian if I want gnome icon theme:
.. code:: bash
.. code-block:: bash
$ ls -l /usr/share/fusiondirectory/html/themes/
drwxr-xr-x 4 root root 4096 Mar 16 10:24 breezy/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment