You can create custom admin pages and functions for an easy administration for your project.
For this, just include some files inside Admin folder.
The menu.php file will be looked for into Admin folder for displaying the list of options inside Magrathea Admin.
menu.php sample:
<ul> <li><a href="add_object.php"><i class="fa fa-plus-circle"></i> Add Object</a></li> <li><a href="list_object.php"><i class="fa fa-bars"></i> List objects</a></li> </ul>The files related on the link should be inside Admin folder as well.
You don't need to load default configuration for any file loaded on Magrathea Admin.
Everything should already be locked and loaded, just start your objects:
<?php $objects = ObjectControl::GetAll(); p_r($objects); ?>Easy as that!
Any page called inside MagratheaAdmin should be done via Ajax using Magrathea's Admin own function:
function MagratheaPost(page, data, callback){ /* magic code here */ if(!callback){ callback = function(data){ $("#main_content").html(data); scrollToTop(); }; } $.ajax({ url: url, type: "POST", data: data, success: callback }); }The parameters to be sent are:
If dropbox plugin is included in custom admin, you can as well call some of the adapted ColorBox functions:
function ColorBox(page, options){ /* magic code here */ options.href = page; $.colorbox(options); } function ColorBoxDo(action){ switch(action){ case "close": $.colorbox.close() } }The parameters for ColorBox are:
Lots of possibilities can be done with the MagratheaAdmin object.
From it, you can include Magrathea Plugins in the code, include custom CSS, define titles and vars and create more complex administration systems.