|
@@ -19,6 +19,8 @@ Action::register('dashboard_widget_search',function(&$response){
|
|
|
|
|
|
$response['widgets'] = array();
|
|
|
foreach($widgets as $widget){
|
|
|
+ $model = DashboardWidget::model($widget->model);
|
|
|
+ $model->getContent($widget);
|
|
|
$response['widgets'][] = $widget->toData();
|
|
|
}
|
|
|
});
|
|
@@ -149,12 +151,9 @@ Action::register('dashboard_widget_refresh',function(&$response){
|
|
|
|
|
|
foreach(DashboardWidget::model() as $model){
|
|
|
if(!isset($model->content) || is_string($model->content) || !isset($widgets[$model->model]) ) continue;
|
|
|
-
|
|
|
- $method = $model->content;
|
|
|
+
|
|
|
foreach($widgets[$model->model] as $currentWidget){
|
|
|
- $currentWidget->meta = json_decode($currentWidget->meta,true);
|
|
|
- if(!is_array($currentWidget->meta)) $currentWidget->meta = array();
|
|
|
- $method($currentWidget);
|
|
|
+ $model->getContent($currentWidget);
|
|
|
$response['rows'][] = $currentWidget;
|
|
|
}
|
|
|
}
|