array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), null), // 0 - screens, 1 - slides "screenid"=> array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '{config}==0&&{form}=="update"'), "hsize"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,100), '{config}==0&&isset({save})'), "vsize"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,100), '{config}==0&&isset({save})'), "slideshowid"=> array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '{config}==1&&{form}=="update"'), "name"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), "delay"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,86400),'{config}==1&&isset({save})'), "steps"=> array(null, O_OPT, null, null, null), "new_step"=> array(null, O_OPT, null, null, null), "move_up"=> array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0,65534), null), "move_down"=> array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0,65534), null), "edit_step"=> array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0,65534), null), "add_step"=> array(T_ZBX_STR, O_OPT, P_ACT, null, null), "cancel_step"=> array(T_ZBX_STR, O_OPT, P_ACT, null, null), "sel_step"=> array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0,65534), null), "del_sel_step"=> array(T_ZBX_STR, O_OPT, P_ACT, null, null), "clone"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null), "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null), "delete"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null), "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS, null, null), "form"=> array(T_ZBX_STR, O_OPT, P_SYS, null, null), "form_refresh"=> array(T_ZBX_INT, O_OPT, null, null, null) ); check_fields($fields); $config = $_REQUEST['config'] = get_request('config', 0); update_profile('web.screenconf.config', $_REQUEST['config']); ?> AddItem(0, S_SCREENS); $cmbConfig->AddItem(1, S_SLIDESHOWS); $form->AddItem($cmbConfig); $form->AddItem(new CButton("form", 0 == $config ? S_CREATE_SCREEN : S_SLIDESHOW)); show_table_header(0 == $config ? S_CONFIGURATION_OF_SCREENS_BIG : S_CONFIGURATION_OF_SLIDESHOWS_BIG, $form); echo BR; if( 0 == $config ) { if(isset($_REQUEST["form"])) { insert_screen_form(); } else { show_table_header(S_SCREENS_BIG); $table = new CTableInfo(S_NO_SCREENS_DEFINED); $table->SetHeader(array(S_NAME,S_DIMENSION_COLS_ROWS,S_SCREEN)); $result=DBselect("select screenid,name,hsize,vsize from screens where ".DBid2nodeid("screenid")."=".$ZBX_CURNODEID. " order by name"); while($row=DBfetch($result)) { if(!screen_accessiable($row["screenid"], PERM_READ_WRITE)) continue; $table->AddRow(array( new CLink($row["name"],"?config=0&form=update&screenid=".$row["screenid"], 'action'), $row["hsize"]." x ".$row["vsize"], new CLink(S_EDIT,"screenedit.php?screenid=".$row["screenid"]) )); } $table->Show(); } } else { if(isset($_REQUEST["form"])) { insert_slideshow_form(); } else { show_table_header(S_SLIDESHOWS_BIG); $table = new CTableInfo(S_NO_SLIDESHOWS_DEFINED); $table->SetHeader(array(S_NAME,S_DELAY,S_COUNT_OF_SLIDES)); $db_slides = DBselect('select s.slideshowid, s.name, s.delay, count(*) as cnt '. ' from slideshows s left join slides sl on sl.slideshowid=s.slideshowid '. ' where '.DBid2nodeid('s.slideshowid').'='.$ZBX_CURNODEID. ' group by s.slideshowid,s.name,s.delay '. ' order by s.name,s.slideshowid'); while($slide_data = DBfetch($db_slides)) { if(!slideshow_accessiable($slide_data['slideshowid'], PERM_READ_WRITE)) continue; $table->AddRow(array( new CLink($slide_data['name'],'?config=1&form=update&slideshowid='.$slide_data['slideshowid'], 'action'), $slide_data['delay'], $slide_data['cnt'] )); } $table->Show(); } } ?>