|
@@ -132,7 +132,11 @@ function dashboard_application_bottom(){
|
|
|
</ul>
|
|
|
</template>
|
|
|
<template id="properties-model">
|
|
|
- <h3>Propriétés</h3>
|
|
|
+ <div class="p-3">
|
|
|
+ <h3>Propriétés</h3>
|
|
|
+ <div id="dashboard-properties-form"></div>
|
|
|
+ <div class="btn btn-primary mt-1" id="dashboard-properties-save">Enregistrer</div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template id="configure-style">
|
|
|
<div class="row">
|
|
@@ -195,7 +199,7 @@ function dashboard_application_bottom(){
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
- <button type="button" class="btn">Fermer</button>
|
|
|
+ <button type="button" class="btn" data-dismiss="modal">Fermer</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -215,20 +219,21 @@ Plugin::addHook('widget',function(&$models){
|
|
|
$model->css = array(__DIR__.'/css/widget-clock.css?v='.time());
|
|
|
$model->js = array(__DIR__.'/js/widget-clock.js?v='.time());
|
|
|
$model->content = function(&$widget){
|
|
|
- $widget->content = '<div class="text-center m-auto widget-clock-content">'.date('H:i:s').'</div>';
|
|
|
- $widget->label = 'Horloge '.date('d-m-Y H:i:s');
|
|
|
+ if(empty($widget->meta['hour-format'])) $widget->meta['hour-format'] = 'H:i:s';
|
|
|
+ $widget->content = '<div class="text-center m-auto widget-clock-content">'.date($widget->meta['hour-format']).'</div>';
|
|
|
+ $widget->label = 'Horloge '.date($widget->meta['hour-format']);
|
|
|
};
|
|
|
- $model->configure = function($widget,$form){
|
|
|
- //conf form @todo
|
|
|
- $form[] = array(
|
|
|
- 'type' => 'boolean',
|
|
|
- 'value' => $widget->meta['enabled'],
|
|
|
- 'label' => 'Activé',
|
|
|
- 'sort' => 1
|
|
|
- );
|
|
|
+ $model->configure = function($widget){
|
|
|
+ if(empty($widget->meta['hour-format'])) $widget->meta['hour-format'] = 'H:i:s';
|
|
|
+ ?>
|
|
|
+ <label>Format de l'heure : </label>
|
|
|
+ <input class="form-control" type="text" id="hour-format" placeholder="H:i:s" value="<?php echo $widget->meta['hour-format']; ?>">
|
|
|
+ <?php
|
|
|
};
|
|
|
- $model->save = function($widget){
|
|
|
- //save conf action @todo
|
|
|
+ $model->save = function($widget,$form){
|
|
|
+
|
|
|
+ $widget->meta['hour-format'] = $form['hour-format'];
|
|
|
+ $widget->save();
|
|
|
};
|
|
|
$models[$model->model] = $model;
|
|
|
});
|