12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- /**
- * Define a Bloc de tableau de bord
- * @author Jean CARRUESCO
- * @category Plugin
- * @license copyright
- */
- class DashboardWidget extends Entity{
- public $id;
- public $model; //Modèle (Texte)
- public $type; //Type (Liste classique)
- public $meta; //Meta (Texte Long)
- public $column = 0 ; //Colonne (Nombre Entier)
- public $row = 0 ; //Ligne (Nombre Entier)
- public $width = 1; //Largeur (Nombre Entier)
- public $height = 1; //Hauteur (Nombre Entier)
- public $dashboard; //Tableau de bord (Nombre Entier)
-
- protected $TABLE_NAME = 'dashboard_widget';
- public $entityLabel = 'Bloc de tableau de bord';
- public $fields = array(
- 'id' => array('type'=>'key', 'label' => 'Identifiant'),
- 'model' => array('type'=>'text','label' => 'Modèle'),
- 'type' => array('type'=>'list','label' => 'Type'),
- 'meta' => array('type'=>'textarea','label' => 'Meta'),
- 'column' => array('type'=>'integer','label' => 'Colonne'),
- 'row' => array('type'=>'integer','label' => 'Ligne'),
- 'width' => array('type'=>'integer','label' => 'Largeur'),
- 'height' => array('type'=>'integer','label' => 'Hauteur'),
- 'dashboard' => array('type'=>'integer','label' => 'Tableau de bord','link'=>'plugin/dashboard/Dashboard.class.php')
- );
- //Colonnes indexées
- public $indexes = array();
-
- //liste des Type possibles
- public static function types($key=null){
- $items = array(
- 'widget' => array('label'=>'Widget'),
- 'model' => array('label'=>'Modèle de widget'),
- );
- if(!isset($key)) return $items;
- return isset($items[$key]) ? $items[$key] : array('label'=>'Non définis');
- }
- public static function model($slug = null){
-
- /*$model = array();
- Plugin::callHook('widget',array(&$models));
- foreach($models as $model)
- $models[$model->model] = $model;
- if(!isset($modelUid)) return $models;*/
-
- //todo
- $model = array(
- 'icon' => 'far fa-user',
- 'headerBackground' => 'rgb(0, 123, 255)',
- 'label' => 'Nouveau widget',
- 'content' => '<p class="text-center p-5">Cliquez sur l\'icone <i class="fas fa-ellipsis-v text-muted"></i> en haut à droite pour configurer votre widget</p>',
- 'width' => 3,
- 'height' => 2
- );
- /*return isset($models[$modelUid]) ? $models[$modelUid] : $model;*/
-
- return $model;
- }
- }
- ?>
|