$local_graph_id, 'name' => $hasDetail ? $aggregate['name'] : __('Not Templated'), 'graph_description' => $hasDetail ? __('Aggregated Device') : __('Not Applicable'), 'url' => $url . $local_graph_id, 'source' => GRAPH_SOURCE_AGGREGATE, ); } elseif (!cacti_sizeof($graph_local) || $graph_local['graph_template_id'] == 0) { return array( 'id' => 0, 'name' => __('Not Templated'), 'url' => '', 'source' => GRAPH_SOURCE_PLAIN, ); } elseif ($graph_local['snmp_query_id'] > 0) { $url = $config['url_path'] . 'data_queries.php?action=item_edit&id='; $detail = db_fetch_row_prepared('SELECT sqg.id, sqg.name FROM snmp_query_graph AS sqg INNER JOIN graph_local AS gl ON gl.snmp_query_graph_id=sqg.id AND gl.snmp_query_id=sqg.snmp_query_id WHERE gl.id = ?', array($local_graph_id)); $hasDetail = (cacti_sizeof($detail)); return array( 'id' => $hasDetail ? $detail['id'] : 0, 'name' => $hasDetail ? $detail['name'] : __('Not Found'), 'url' => $hasDetail ? ($url . $detail['id']) : '', 'source' => GRAPH_SOURCE_DATA_QUERY ); } else { $url = $config['url_path'] . 'graph_templates.php?action=template_edit&id='; $detail = db_fetch_row_prepared('SELECT gt.id, gt.name FROM graph_templates AS gt INNER JOIN graph_local AS gl ON gl.graph_template_id=gt.id WHERE gl.id = ?', array($local_graph_id)); $hasDetail = (cacti_sizeof($detail)); return array( 'id' => $hasDetail ? $detail['id'] :0, 'name' => $hasDetail ? $detail['name'] : __('Not Found'), 'url' => $hasDetail ? ($url . $detail['id']) : '', 'source' => GRAPH_SOURCE_TEMPLATE, ); } }