Ejemplo n.º 1
0
 /**
  * This method allow store user blocks from dashboard manager
  * render to dashboard.php view
  */
 public function store_user_block()
 {
     $data = array();
     $user_id = $this->user_id;
     if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
         $enabled_blocks = $_POST['enabled_blocks'];
         $columns = $_POST['columns'];
         $affected_rows = DashboardManager::store_user_blocks($user_id, $enabled_blocks, $columns);
         if ($affected_rows) {
             $data['success'] = true;
         }
     }
     $data['dashboard_view'] = 'list';
     // render to the view
     $this->view->set_data($data);
     $this->view->set_layout('layout');
     $this->view->set_template('dashboard');
     $this->view->render();
 }