/**
  * Execute hook
  *
  * @param array $params
  */
 public static function execute($params)
 {
     $router = Di::getDefault()->get('router');
     if (!preg_match("/^\\/centreon-performance/", $router->getCurrentUri())) {
         return;
     }
     $bookmarkedGraphs = GraphView::getList();
     return array('template' => 'displayLeftMenuForGraph.tpl', 'variables' => array('bookmarkedGraphs' => $bookmarkedGraphs));
 }
Example #2
0
 /**
  * Save a graph view
  *
  * @route /view
  * @method GET
  */
 public function getListViewAction()
 {
     $router = Di::getDefault()->get('router');
     $list = GraphView::getList();
     $response = array();
     foreach ($list as $id => $text) {
         $response[] = array('id' => $id, 'text' => $text);
     }
     $router->response()->json($response);
 }