Exemplo n.º 1
0
    if(  checkAccess( GangliaAcl::ALL_VIEWS, GangliaAcl::EDIT, $conf ) ) {
       print '<button onclick="return false" id=create_view_button>Create View</button>';
    }
    if ( ! isset($_GET['standalone']) && ! isset($_GET['just_graphs']) ) {
       print '<a href="views.php?standalone=1" id="detach-tab-button">Detach Tab</a>';
    }
  ?>
    <p>  <div id="views_menu">
      Existing views:
      <ul id="navlist">
    <?php

    # List all the available views
    foreach ( $available_views as $view_id => $view ) {
      $v = $view['view_name'];
      print '<li><a href="#" id=\'' . viewId($v) . '\' onClick="selectView(\'' . $v . '\'); return false;">' . $v . '</a></li>';
    }

    ?>
<script>
$(function(){
    $( "#view_range_chooser" ).buttonset();
    <?php
    if ( ! isset($_GET['standalone']) && ! isset($_GET['just_graphs']) ) {
    ?>
    $( "#detach-tab-button").button();
    <?php
    }
    ?>
    document.getElementById('view_name').value = "default";
});
Exemplo n.º 2
0
  <div class="ui-state-default ui-corner-all" style="padding: 0 .7em;"> 
    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
    <?php 
    echo $output;
    ?>
</p>
  </div>
</div>
<?php 
    exit(0);
}
$available_views = get_available_views();
$existing_views = '';
foreach ($available_views as $view) {
    $v = $view['view_name'];
    $existing_views .= '<li><a class="nobr" href="#" id="' . viewId($v) . '" onClick="selectView(\'' . $v . '\'); return false;">' . $v . '</a></li>';
}
if (isset($_GET['views_menu'])) {
    ?>
<div id="views_menu">
  <p>Existing views:</p>
  <ul id="navlist">
  <?php 
    echo $existing_views;
    ?>
  </ul>
</div>
<?php 
    exit(0);
}
$tpl = new Dwoo_Template_File(template("views_view.tpl"));
Exemplo n.º 3
0
 public function toJson($initially_open)
 {
     $pathName = $this->getPathName();
     $id = viewId($pathName);
     $json = '{"text":"' . $this->name . '","id":"' . $id . '"';
     if ($this->data != NULL) {
         $json .= ',"view_name":"' . $pathName . '"';
     }
     if ($initially_open && in_array($pathName, $initially_open)) {
         $json .= ',"state":{"opened": true}';
     }
     if ($this->children != NULL) {
         $json .= ',"children":[';
         $i = 0;
         foreach ($this->children as $child_node) {
             if ($i++ > 0) {
                 $json .= ',';
             }
             $json .= $child_node->toJson($initially_open);
         }
         $json .= ']';
     }
     $json .= '}';
     return $json;
 }
Exemplo n.º 4
0
  <div class="ui-state-default ui-corner-all" style="padding: 0 .7em;"> 
    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
    <?php 
    echo $output;
    ?>
</p>
  </div>
</div>
<?php 
    exit(0);
}
$available_views = get_available_views();
$existing_views = '';
foreach ($available_views as $view) {
    $v = $view['view_name'];
    $vid = viewId($v);
    $checked = $_GET['vn'] == $v;
    $existing_views .= '<input type="radio" id="' . $vid . '" onClick="selectView(\'' . $v . '\'); return false;"' . ($checked ? " checked" : "") . '><label style="text-align:left;" class="nobr" for="' . $vid . '">' . $v . '</label>';
}
if (isset($_GET['views_menu'])) {
    ?>
<div id="views_menu">
  <?php 
    echo $existing_views;
    ?>
</div>
<script type="text/javascript">$(function(){$("#views_menu").buttonsetv();});</script>
<?php 
    exit(0);
}
$tpl = new Dwoo_Template_File(template("views_view.tpl"));