summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-27 13:58:16 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-27 13:58:16 +0000
commit0c61274fcf75d2fcc545b761d64d3307323afcd3 (patch)
tree33c8c74f5ddd66cde9c98bbc6f7aca8d3c46cb23 /frontends/php/include/config.inc.php
parent4f6965b12e09c357d57b03fae328dcbb9d384310 (diff)
downloadzabbix-0c61274fcf75d2fcc545b761d64d3307323afcd3.tar.gz
zabbix-0c61274fcf75d2fcc545b761d64d3307323afcd3.tar.xz
zabbix-0c61274fcf75d2fcc545b761d64d3307323afcd3.zip
- [DEV-91] added printable view for pages (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5204 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php49
1 files changed, 43 insertions, 6 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index b0e6bdb3..2be1d66f 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1007,26 +1007,63 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
return DBexecute('update config set '.implode(',',$update).
' where '.DBin_node('configid', get_current_nodeid(false)));
}
+
+/* Function:
+ * hide_form_items()
+ *
+ * Desc:
+ * Searches items/objects for Form tags like "<input"/Form classes like CForm, and makes it empty
+ *
+ * Author:
+ * Aly
+ */
+ function hide_form_items(&$obj){
+ if(is_array($obj)){
+ foreach($obj as $id => $item){
+ hide_form_items($obj[$id]); // Attention recursion;
+ }
+ }
+ else if(is_object($obj)){
+ if(in_array(strtolower(get_class($obj)),array('cform','ccheckbox','cselect','cbutton','cbuttonqmessage','cbuttondelete','cbuttoncancel'))){
+ $obj=SPACE;
+ }
+ if(isset($obj->items) && !empty($obj->items)){
+ foreach($obj->items as $id => $item){
+ hide_form_items($obj->items[$id]); // Recursion
+ }
+ }
+ }
+ else{
+ foreach(array('<form','<input','<select') as $item){
+ if(strpos($obj,$item) !== FALSE) $obj = SPACE;
+ }
+ }
+ }
- function &get_table_header($col1, $col2=SPACE)
- {
+ function get_table_header($col1, $col2=SPACE){
+ if(isset($_REQUEST['print'])){
+ hide_form_items($col1);
+ hide_form_items($col2);
+ //if empty header than do not show it
+ if(($col1 == SPACE) && ($col2 == SPACE)) return new CScript('');
+ }
+
$table = new CTable(NULL,"header");
$table->SetCellSpacing(0);
$table->SetCellPadding(1);
$table->AddRow(array(new CCol($col1,"header_l"), new CCol($col2,"header_r")));
- return $table;
+ return $table;
}
function show_table_header($col1, $col2=SPACE)
{
- $table =& get_table_header($col1, $col2);
+ $table = get_table_header($col1, $col2);
$table->Show();
}
# Show History Graph
- function show_history($itemid,$from,$stime,$period)
- {
+ function show_history($itemid,$from,$stime,$period){
$till=date(S_DATE_FORMAT_YMDHMS,time(NULL)-$from*3600);
show_table_header(S_TILL.SPACE.$till.' ('.($period/3600).' HOURs)');