Ispmanager 6 lite, pro, host documentation

Plug-in example: how to add a menu module

This article walks you through the steps you need to perform to add a custom module into the interface module.

Interface description

To add a new menu item, create an XML file:

  • create an xml file ispmgr_mod_menu.xml

The path must necessarily be /usr/local/mgr5/etc/xml/ and the name must be ispmgr_mod_<any name>.xml

The XML file must have read and write permissions for the root user.

touch /usr/local/mgr5/etc/xml/ispmgr_mod_menu.xml
  • add the following description to this file:
<?xml version="1.0" encoding="UTF-8"?>
        <mainmenu level="admin+">
                        <node name="my_group">
                                <node name="myfunc" />

        <handler name="" type="xml">
                <func name="myfunc" />

        <lang name="ru">
                <messages name="desktop">
                        <msg name="modernmenu_my_group">New menu item</msg>
                        <msg name="modernmenu_myfunc">Test</msg>

As you can see from the file, the mainmenu tag specifies at what level the section will be visible. In the example - admin+ - super administrator level.

node_name='administrator' - the new menu item will be added to the 'Administrators' section;

node_name='my_group' - the new menu item will be added to the section created by the user;

node_name='myfunc' - declare your function. In order for the panel to start displaying our menu item, it is necessary to have a function with the corresponding name in the panel.

Adding a custom function

Add a handler for the myaddon function (already added in the ispmanager_mod_menu.xml file):

<handler name="" type="xml"> 
<func name="myfunc" /> 
  • The addon must be located in the /usr/local/mgr5/addon/ directory
  • Create myaddon.xml file in the /usr/local/mgr5/addon directory:
touch myaddon.xml

Add a plugin to the file (what will be displayed on the page of the created section, don't forget to specify the name of the function we added func="myfunc".

<?xml version="1.0" encoding="UTF-8"?>
<doc lang="ru" func="myfunc" binary="/ispmgr">
        <metadata name="myfunc" type="list" key="name" mgr="ispmgr">
                <toolbar view="buttontext">
                        <toolgrp name="new">
                                <toolbtn name="new" func="webdomain.edit" type="new" img="t-new" sprite="yes"/>
                                <toolbtn name="delete" func="webdomain.delete" type="group" img="t-delete" sprite="yes"/>ls 

                        <col type="data" name="name" sort="alpha" convert="punycode" sorted="-1"/>
                        <col type="data" name="value" sort="alpha" level="reseller+"/>
        <messages name="myfunc" checked="6b49a92f5cc5153c76b78446d0d74eb4">
                <msg name="title">Test</msg>
                <msg name="hint_name"> Название </msg>
                <msg name="hint_value">Значение</msg>
                <msg name="short_new" added="common">Создать</msg>
                <msg name="short_delete" added="common">Удалить</msg>
                <msg name="hint_delete" added="common">Удалить</msg>
                <msg name="hint_new" added="common">Создать</msg>
                <msg name="name" added="common">Имя</msg>
                <msg name="value" added="common">Значение</msg>
                <msg name="hint_export">Сохранить в CSV</msg>
                <msg name="hint_selectall">Выделить все элементы списка</msg>
                <msg name="hint_reloadlist">Обновить данные</msg>
                <msg name="hint_print">Открыть версию для печати</msg>
                <msg name="hint_autoupdate_stop">Отменить автообновление текущего списка</msg>
                <msg name="hint_takefavorite">Добавить в избранное меню</msg>
                <msg name="hint_takeunfavorite">Убрать из избранного меню</msg>
                <msg name="msg_tsetting">Настроить вид таблицы</msg>

        <page> — domain.mary</page>
More details about plugin writing options can be found in the documentation
Please note that the provision of technical support services does not apply to self-written plugins.

Create a file in the addon folder (add a handler)


Set permissions for the handler with the following commands:

chmod 750 /usr/local/mgr5/addon/<handler_file_name>
chown 0:0 /usr/local/mgr5/addon/<handler_file_name>
  • Add two lines to the file
cat /usr/local/mgr5/addon/myaddon.xml

To make the panel re-read all changes, restart it with the command pkill -9 core.

When you click on the Test section (which is the name given to it in the lang block), will be called, which should return a full xml with the necessary data to the panel.