Пример #1
0
 public function getData()
 {
     $this->check_permission();
     //get global_lib Singelton
     $mainlib = global_lib::getInstance();
     //Create path of Controller Files   =>  controller/FILENAME.php
     $path = $mainlib->joinPaths("controller/", $this->meta_data["main_file"] . ".php");
     try {
         //Include Controller File
         include_once $path;
     } catch (Exception $e) {
         //Exception
         var_dump($e);
     }
     try {
         //Call Class from Controller File
         $web_call = new $this->meta_data["main_class"]($this->request);
         //Request Type (Method) to Lowercase
         $method_call = strtolower($this->request->method);
         //Rufe die methode im Class File auf
         $web_call->{$method_call}();
         // Generiere Variablen für die Template Engine
         $template_engine_var = $web_call->get_context();
         // Generiere für das Template den Pfad
         $template_path = $mainlib->joinPaths("view/", $web_call->template . ".html");
         // Lade Dwoo Template Engine
         $dwoo = new Dwoo();
         // Compare get_context and template
         $dwoo->output($template_path, $template_engine_var);
     } catch (Exception $e) {
         var_dump($e);
     }
 }
Пример #2
0
    get_load_pie($showhosts, $hosts_up, $hosts_down, $user, $conf, $metrics, $cluster, $name, $data);
}
if ($showhosts != 0) {
    get_host_metric_graphs($showhosts, $hosts_up, $hosts_down, $user, $conf, $metrics, $user['metricname'], $sort, $clustername, $get_metric_string, $cluster, $always_timestamp, $reports[$user['metricname']], $clustergraphsize, $range, $start, $end, $cs, $ce, $vlabel, $data);
}
///////////////////////////////////////////////////////////////////////////////
// Creates a heatmap
///////////////////////////////////////////////////////////////////////////////
if (isset($conf['heatmaps_enabled']) and $conf['heatmaps_enabled'] == 1 and count($hosts_up) > 0) {
    get_load_heatmap($hosts_up, $user['host_regex'], $metrics, $data, $sort);
}
$data->assign("conf", $conf);
$data->assign("showhosts", $showhosts);
// No reason to go on if we are not displaying individual hosts
if (!is_array($hosts_up) or !$showhosts) {
    $dwoo->output($tpl, $data);
    return;
}
///////////////////////////////////////////////////////////////////////////////
// Show stacked graphs
///////////////////////////////////////////////////////////////////////////////
if (isset($conf['show_stacked_graphs']) and $conf['show_stacked_graphs'] == 1 and !preg_match("/_report\$/", $user['metricname'])) {
    $cluster_url = rawurlencode($clustername);
    $stacked_args = "m={$user['metricname']}&c={$cluster_url}&r={$range}&st={$cluster['LOCALTIME']}";
    if (isset($user['host_regex'])) {
        $stacked_args .= "&host_regex=" . $user['host_regex'];
    }
    $data->assign("stacked_graph_args", $stacked_args);
}
if ($conf['picker_autocomplete'] == true) {
    $data->assign('picker_autocomplete', true);
 /**
  * Renders a Dwoo template.
  *
  * @param $templateFilename string The name of a template file.
  * @param $data array Data to pass to the template.
  *
  * @see http://dwoo.org/
  */
 public function renderTemplate($templateFilename, $data)
 {
     $dwoo = new Dwoo();
     $tpl = new Dwoo_Template_File($templateFilename);
     $compiler = new Dwoo_Compiler();
     if (!file_exists(INSTRUCTIONCONTROL__CONFIG_DWOO_COMPILEDIR)) {
         mkdir(INSTRUCTIONCONTROL__CONFIG_DWOO_COMPILEDIR);
     }
     $dwoo->setCompileDir(INSTRUCTIONCONTROL__CONFIG_DWOO_COMPILEDIR);
     $dwoo->output($tpl, $data);
 }