This is an old revision of the document!


Make your plugin compatible to Admidio 4

In Admidio 4 we have changed the way the menu is structured. For this you have to change your plugin if you have worked with $page→getMenu(); before.

Now you don't have to create an instance of the menu to add the single entries there. Also there is now a simple function to add a back button to the page.

So far you had to do the following steps for the back button:

$page = new HtmlPage('My Headline');
$myMenu = $page->getMenu();
$myMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'fa-arrow-circle-left');

Now it's only necessary to call the following function:

$page = new HtmlPage('My Headline');
$page->setUrlPreviousPage($gNavigation->getPreviousUrl());

If you want to add a menu entry to the page than just add this code:

$page->addPageFunctionsMenuItem('menu_item_new', 'Name of Menuentry', ADMIDIO_URL.FOLDER_MODULES.'/groups-roles/groups_roles_new.php', 'fa-plus-circle');

$page→hideThemeHtml(); is replaced by $page→setInlineMode();

$page→hideMenu(); is replaced by $page→setInlineMode();

The HtmlPage constructor has become a new necessary parameter:

$page = new HtmlPage('My Headline');
// must now be
$page = new HtmlPage('admidio-page-id', 'My Headline');

New method to open the modal window. Just add a class and a data-href:

<a class="openPopup" href="javascript:void(0);" data-href="http://www.example.com">My Link to a modal window</a>
  • en/entwickler/make_your_plugin_compatible_to_admidio_4.1600635299.txt.gz
  • Last modified: 2020/09/20 22:54
  • by fasse