MV framework logo
  • Architecture
    • Philosophy
    • Technologies
  • Admin Panel
  • Changelog
  • Support
  • Feedback
Download Version 2.6 from 07.10.2022
Documentation
  • Architecture
    • Philosophy
    • Technologies
  • Admin Panel
  • Changelog
  • Support
  • Feedback
Getting started
  • Installation and launch
  • System folders
  • Launch of simple website
  • Pre-installed models
  • System settings
Models
  • General principles of models
  • Data types
  • Model settings
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Simple model management
  • Additional options
Views and routes
  • General principles of views
  • Router object
  • MV object
  • Index, default and 404 templates
  • Creating a new template
  • Data display in template
  • Object of Record class
  • Files and images
  • Date and time
  • Redirects
  • Email delivery
  • Special methods
Forms
  • Forms creation
  • Form fields settings
  • Form validation rules
  • Form validation process
  • Operations with form data
  • Using data from models
  • Form methods
SQL queries
  • Query constructor
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
  • Upload from CSV files
Sessions and security
  • Work with sessions
  • AJAX
  • Security
  • Debugging
Plugins
  • General principles of plugins
  • Additions to admin panel
  • Caching
Documentation
Getting started
  • Installation and launch
  • System folders
  • Launch of simple website
  • Pre-installed models
  • System settings
Models
  • General principles of models
  • Data types
  • Model settings
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Simple model management
  • Additional options
Views and routes
  • General principles of views
  • Router object
  • MV object
  • Index, default and 404 templates
  • Creating a new template
  • Data display in template
  • Object of Record class
  • Files and images
  • Date and time
  • Redirects
  • Email delivery
  • Special methods
Forms
  • Forms creation
  • Form fields settings
  • Form validation rules
  • Form validation process
  • Operations with form data
  • Using data from models
  • Form methods
SQL queries
  • Query constructor
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
  • Upload from CSV files
Sessions and security
  • Work with sessions
  • AJAX
  • Security
  • Debugging
Plugins
  • General principles of plugins
  • Additions to admin panel
  • Caching

Additions to admin panel

Creation of own pages

To create an own page in admin panel follow the next steps:

  1. In "customs/adminpanel/" folder create php file with the name which will go to URL (go without extension), for example "mypage.php".
  2. Now this page will be available by the link "/adminpanel/custom/?view=mypage".
  3. To redirect to this page usually you need to add a button or a link to the page of model, for this create a file (for example "model-index-bottom.php") as described in the Model setting section (insert a code in admin panel).
  4. Include in "mypage.php" file header and footer of the admin interface page as shown on example below. The inner structure of HTML tags can be different, for example for dividing the page into columns, you may take the structure of tags from another page of admin panel.
<?
include $registry -> getSetting("IncludeAdminPath")."includes/header.php";
?>
 
<div id="columns-wrapper">
  <div id="model-form">
    <div class="column-inner">
       <h3 class="column-header">Mypage</h3>
 
       // ...
       //Page content, messages, forms, etc.
       // ...
 
       <input type="button" class="button-light" value="Button 1" />
       <input type="button" class="button-dark" value="Button 2" onclick="..." />
    </div>
  </div>
</div>
 
<?
include $registry -> getSetting("IncludeAdminPath")."includes/footer.php";
?>

Objects of models can be created through classes of models. All properties of Registry are accessible as described in System settings section and also additional properties may be set.

  • AdminPanelPath - URL path from server root to admin panel of the project, on the production server is "/adminpanel/" usually, but may be different if you have changed the path to admin panel
  • IncludeAdminPath - the path from file system root to the folder of admin panel, to include files
//Call the objects of required models
$products = new Products();
$catalogs = new Catalogs();
$producers = new Producers();

//Check of the user rights for a given model
//Parameters: model name in lower case 
//and one of the rights "create", "read", "update" or "delete" 
$system -> user -> extraCheckModelRights("products", "update");

//Messages about errors and successful operations 
echo "<div class="form-no-errors"><p>Data are successfully updated </p></div>";
echo "<div class="form-errors"><p>Error occurred ...</p></div>";

Previous section

General principles of plugins

Next section

Caching

© 2012-2023, MV framework

MV tracker is based on open source MV framework
License