Skip to content
jjeroennl edited this page Apr 3, 2015 · 1 revision

The admin functions are most commonly used in plugins. It makes it possible to modify, add or delete items from the administration environment.

All of the system functions will work too in the admin enviroment

###admin_addpage

admin_addpage($name, $function);
  • $name; String, The name of the page you want to add to the admin enviroment.
  • $function; String, The name of the function you want to run when the page is accessed.

Example:

<?php
  $name = "My Test Page";
  $function = "myplugin_testpage";
  admin_addpage($name, $function);

  function myplugin_testpage(){
    /* Everything you will put here will be displayed
    in the admin page */
  }
?>

###admin_removepage

admin_removepage($name);
  • $name; String, The name of the page you want to remove from the admin enviroment.

This function is under debate, as there might be more than one page with the same name.

Example:

<?php
  $name = "My Test Page";
  admin_addpage($name);
?>

###admin_getpageid

admin_getpageid($name);
  • $name; String, The name of the page you want to remove from the admin enviroment.

This function is under debate, as there might be more than one page with the same name.

Example:

<?php
  $name = "My Test Page";
  $num = admin_getpageid($name);
?>

###admin_loadpage

admin_loadpage($id);
  • $id; Integer, the ID of the page you want to load.

This function might not work correct when not used within the admin enviroment. Example:

<?php
  $name = "My Test Page";
  $num = admin_getpageid($name);
  admin_loadpage($num);
?>
Clone this wiki locally