Fix widget custom

This commit is contained in:
Matteo 2019-02-27 17:37:09 +01:00
parent 4bf49f6206
commit fc9d4c14b0
1 changed files with 33 additions and 17 deletions

View File

@ -153,29 +153,45 @@ class WidgetManager implements ManagerInterface
protected function custom($widget) protected function custom($widget)
{ {
$result = ' $result = '
<button type="button" class="close" onclick="if(confirm(\'Disabilitare questo widget?\')) { $.post( \''.ROOTDIR.'/modules/aggiornamenti/actions.php?id_module='.$widget['id_module'].'\', { op: \'disable_widget\', id: \''.$widget['id'].'\' }, function(response){ location.reload(); }); };" >
<li class="'.$widget['class'].'" id="'.$widget['id'].'"> <span aria-hidden="true">&times;</span><span class="sr-only">'.tr('Chiudi').'</span>
<!-- small box --> </button>';
<div class="small-box bg-'.$widget['bgcolor'].'">
<div class="inner">';
// Codice specifico
include_once $widget['php_include'];
$result .= ' $result .= '
</div>';
// Icona <div class="info-box">
if (!empty($widget['icon'])) { <span class="info-box-icon" style="background-color:'.$widget['bgcolor'].'">';
$result .= '
<div class="icon"> if (!empty($widget['icon'])) {
<i class="'.$widget['icon'].'"></i> $result .= '
</div>'; <i class="'.$widget['icon'].'"></i>';
}
$result .= '
</span>
<div class="info-box-content">
<span class="info-box-text">';
if(!empty($widget['php_include'])){
$result_ob = '';
ob_start();
include(DOCROOT."/".$widget['php_include']);
$result_ob = ob_get_contents();
ob_end_clean();
$result .= $result_ob;
} }
$result .= ' $result .= '
</div> </span>
</li>'; </div>';
$result .= '
</div>';
return $result; return $result;
} }