Hello
Here is the modification for a customizable dashboard system
- One current core file to be modified: /admin/dashboard.php
- One folder to be added to the root folder: /dashboards
- In this new folder dashboards the build in widgets would be placed there
- For custom dashboard, developer should create a folder named dashboards in his extension folder then put here a file named custom_dashboards.php. To add new dashboard and widgets would require this file' contents like this:
define('DA_HRM', 'FrontHrm');
$dashboard->addDashboard(_('HRM'), DA_HRM);
$dashboard->addWidget(DA_HRM, 997, _('Widget name 1'), WIDGET_HALF);
$dashboard->addWidget(DA_HRM, 998, _('Widget name 2'), WIDGET_HALF);
$dashboard->addWidget(DA_HRM, 999, _('Widget name 3'), WIDGET_FULL);
...
This is a rough sketch for what I have proposed.
Following this method users can decide which widget, chart would be shown on their dashboard.
I have been doing this by simulating the Report System.
Jquery and any Js, charts libraries could be included later
Thank you
ps: also need few more new css lines
div.widget_title {
font-weight: bold;
color: #555;
font-size: 1.3em;
width: 100%;
border-bottom: 1px solid #DDD;
padding: 5px 0;
margin-bottom: 5px;
}
div.widget {
border: 1px solid #DDD;
background: #FFF;
padding: 0 10px;
margin: 10px 0;
box-sizing: border-box;
display: inline-block;
float: left;
height: 23em;
overflow: auto;
}
div.widget_full {
width: calc(100% - 40px);
margin-left: 20px;
}
div.widget_half {
width: calc(50% - 30px);
margin-left: 20px ;
}