|
@@ -50,7 +50,6 @@ class DashboardWidget extends Entity{
|
|
}
|
|
}
|
|
|
|
|
|
public function toArray($decoded=false){
|
|
public function toArray($decoded=false){
|
|
-
|
|
|
|
return array_merge(array(
|
|
return array_merge(array(
|
|
'icon' => $this->icon,
|
|
'icon' => $this->icon,
|
|
'headerBackground' => $this->headerBackground,
|
|
'headerBackground' => $this->headerBackground,
|
|
@@ -82,13 +81,10 @@ class DashboardWidget extends Entity{
|
|
|
|
|
|
|
|
|
|
public static function model($slug = null){
|
|
public static function model($slug = null){
|
|
-
|
|
|
|
$model = array();
|
|
$model = array();
|
|
Plugin::callHook('widget',array(&$models));
|
|
Plugin::callHook('widget',array(&$models));
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //todo placer en hook
|
|
|
|
|
|
+ //@TODO: Placer en hook
|
|
$clock = new DashboardWidget();
|
|
$clock = new DashboardWidget();
|
|
$clock->icon = 'far fa-user';
|
|
$clock->icon = 'far fa-user';
|
|
$clock->headerBackground = 'rgb(0, 123, 255)';
|
|
$clock->headerBackground = 'rgb(0, 123, 255)';
|
|
@@ -98,30 +94,24 @@ class DashboardWidget extends Entity{
|
|
$clock->width = 3;
|
|
$clock->width = 3;
|
|
$clock->height = 3;
|
|
$clock->height = 3;
|
|
$models['clock'] = $clock;
|
|
$models['clock'] = $clock;
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$newModel = new DashboardWidget();
|
|
$newModel = new DashboardWidget();
|
|
$newModel->icon = 'far fa-user';
|
|
$newModel->icon = 'far fa-user';
|
|
$newModel->headerBackground = 'rgb(0, 123, 255)';
|
|
$newModel->headerBackground = 'rgb(0, 123, 255)';
|
|
- $newModel->description = 'Type de widget non définit';
|
|
|
|
|
|
+ $newModel->description = 'Type de widget non défini';
|
|
$newModel->label = 'Nouveau widget';
|
|
$newModel->label = 'Nouveau widget';
|
|
$newModel->content = '<div class="text-center m-auto">Cliquez sur l\'icone <i class="fas fa-ellipsis-v text-muted mx-1"></i> en haut à droite pour configurer votre widget</div>';
|
|
$newModel->content = '<div class="text-center m-auto">Cliquez sur l\'icone <i class="fas fa-ellipsis-v text-muted mx-1"></i> en haut à droite pour configurer votre widget</div>';
|
|
$newModel->width = 3;
|
|
$newModel->width = 3;
|
|
$newModel->height = 2;
|
|
$newModel->height = 2;
|
|
$models[self::MODEL_NEW] = $newModel;
|
|
$models[self::MODEL_NEW] = $newModel;
|
|
-
|
|
|
|
|
|
|
|
foreach($models as $model){
|
|
foreach($models as $model){
|
|
if(!isset($model->model)) continue;
|
|
if(!isset($model->model)) continue;
|
|
$models[$model->model] = $model;
|
|
$models[$model->model] = $model;
|
|
}
|
|
}
|
|
-
|
|
|
|
if(!isset($slug)) return $models;
|
|
if(!isset($slug)) return $models;
|
|
|
|
|
|
-
|
|
|
|
return isset($models[$slug]) ? $models[$slug] : $model;
|
|
return isset($models[$slug]) ? $models[$slug] : $model;
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-?>
|
|
|