home *** CD-ROM | disk | FTP | other *** search
/ ftp.f-secure.com / 2014.06.ftp.f-secure.com.tar / ftp.f-secure.com / support / hotfix / fsav-server / FSAVSRV900_HF07.fsfix / iuwebui / forms / tree_updates / autoupdates-pm.php < prev    next >
PHP Script  |  2010-09-07  |  4KB  |  106 lines

  1. <?php 
  2.     include ("..\common\commonphp.php");
  3.  
  4.     $Page_Settings = array(    array(oid => '1.3.6.1.4.1.2213.42.1.11.20.50', type => GLOBAL_TBL));
  5.  
  6.     $tab_name = "tabAUAPM";
  7.  
  8.     if(!isset($_POST[SUBMIT_TABLE]))
  9.     {
  10.         /* first load of the page */
  11.         readSettings(&$Page_Settings);
  12.     }
  13.     else 
  14.     {
  15.         if($_POST[RESTORE_TABLE] == 1)
  16.         {
  17.             /* user wants to restore defaults */
  18.             readDefaultSettings(&$Page_Settings);
  19.         }
  20.         else
  21.         {
  22.             readSettings(&$Page_Settings);
  23.             if($_POST[REMOVE_ITEM] != -1)
  24.                 unset($Page_Settings[0][value][$_POST[REMOVE_ITEM]]);
  25.             if($_POST[SUBMIT_TABLE] == 1)    
  26.                 writeSettings($Page_Settings);
  27.         }
  28.         exit(0);
  29.     }    
  30.     
  31.     show_form_management($tab_name, 1);
  32. ?>
  33.  
  34. <script language="javascript">
  35.     tabAUAPM_remove_hit = function(item_index)
  36.     {
  37.         refreshed = true;
  38.         document.form_tabAUAPM.REMOVE_ITEM.value = item_index;
  39.         document.form_tabAUAPM.SUBMIT_TABLE.value = 1;
  40.         dojo.byId("tabAUAPM_submitit").click();
  41.     }
  42.   dojo.byId('lists_dialog').style.background="#f3f3f3";                
  43. </script>
  44.  
  45. <form method="POST" action='<?php echo "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";?>' id="form_<?php echo $tab_name;?>" name="form_<?php echo $tab_name;?>" style="padding: 0; margin: 0;">
  46.     <input type="hidden" name="SUBMIT_TABLE" value="0">
  47.     <input type="hidden" name="RESTORE_TABLE" value="0">
  48.     <input type="hidden" name="APPLY_SETTINGS" value="0">
  49.     <input type="hidden" name="REMOVE_ITEM" value="-1">
  50.     <button style='display:none' type='submit' id='tabAUAPM_submitit'></button>
  51.  
  52.     <?php show_action_menu('Policy Manager Proxies', $tab_name); ?>
  53.     <table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
  54.         <tr>
  55.             <td valign="top" width="100%">
  56.                 <p style='margin: 0; padding-top: 5px'>
  57.                 <table width=100% style='table-layout:fixed;' border=0 cellpadding=0 cellspacing=0>
  58.                     <tr>
  59.                         <td width="10px"><div class="table_stats_heading"><img src="../pics/layout/corner_up_left.gif" alt="" class="left_top"/></div></td>
  60.                         <td align="left" width=100%><div class="table_stats_heading"><span><?=fsloc("Proxy address")?></span></div></td>
  61.                         <td align="right" width=210><div class="table_stats_heading"><span><?=fsloc("Priority")?></span></div></td>
  62.                         <td align="right" width=280><div class="table_stats_heading">
  63.                             <span><?php if($global_can_edit && !isset($Page_Settings[0][lock])) echo ('<a id="tabAUAPM: add proxy" href="javascript:;" class="addtableitem" onClick="EnableExtraDialog(\'/tree_updates/popup_pm.php?NewItem\');">'.fsloc("Add new proxy...").'</a>');?></span>
  64.                         </div></td>
  65.                         <td width="10px"><div class="table_stats_heading"><img src="../pics/layout/corner_up_right.gif" alt="" class="right_top"/></div></td>
  66.                     </tr>
  67. <?php
  68. {
  69.     if(count($Page_Settings[0][value]) == 0)
  70.     {
  71.         echo '</table>
  72.               <div class="tr_setting" style="padding-left: 15px;">' .
  73.               fsloc("No Policy Manager Proxy servers are specified.").'</div>';
  74.     }
  75.     else
  76.     {
  77.         $index = 0;
  78.         $tr_type = '';
  79.         foreach($Page_Settings[0][value] as $entry)
  80.         {
  81.             $tr_type = ($tr_type == '_odd') ? '_even' : '_odd';
  82.             $font_color = $entry[2] ? '' : ' color: #999999; ';
  83.             $remove_text = "<a id='tabAUAPM: remove {$index}' href='javascript:;' onClick='javascript: {$tab_name}_remove_hit({$index});'>".fsloc("remove")."</a>";
  84.             echo "
  85.                 <tr class='tr_setting$tr_type'>
  86.                     <td></td>
  87.                     <td style='padding-left: 5px;'><a id='tabAUAPM: open {$index}' href='javascript:;' onClick='javascript: EnableExtraDialog(\"/tree_updates/popup_pm.php?EditItemFull&{$entry[1]}\");'>{$entry[1]}</a></td>
  88.                     <td id='tabAUAPM: priority {$index}' align='right' style='padding-left: 10px; $font_color'>{$entry[0]}</td>
  89.                     <td align='right' style='padding-left: 5px;'>$remove_text</td><td> </td>
  90.                 </tr>
  91.             ";    
  92.             $index++;
  93.         }
  94.         echo '</table>';
  95.     }
  96. }
  97. ?>                            
  98.             </td>
  99.         </tr>
  100.         <?php show_action_buttons($tab_name, true, true, false, false, true); ?>
  101.     </table>
  102. </form>    
  103.  
  104.  
  105.  
  106.