phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] filemanager/preferences.php, 1.11


From: nomail
Subject: [Phpgroupware-cvs] filemanager/preferences.php, 1.11
Date: Thu, 30 Dec 2004 10:17:57 +0100

Update of /filemanager
Modified Files:
        Branch: 
          preferences.php

date: 2004/12/30 09:17:57;  author: skwashd;  state: Exp;  lines: +53 -28

Log Message:
clean up, merge, remove crud and apply patch #3525
=====================================================================
Index: filemanager/preferences.php
diff -u filemanager/preferences.php:1.10 filemanager/preferences.php:1.11
--- filemanager/preferences.php:1.10    Thu Nov 13 16:58:08 2003
+++ filemanager/preferences.php Thu Dec 30 09:17:57 2004
@@ -24,37 +24,62 @@
        /*
           To add an on/off preference, just add it here.  Key is internal 
name, value is displayed name
        */
-       $other_checkboxes = array ("viewinnewwin" => lang("View documents in 
new window"), "viewonserver" => lang("View documents on server (if 
available)"), "viewtextplain" => lang("Unknown MIME-type defaults to text/plain 
when viewing"), "dotdot" => lang('Show ..'), "dotfiles" => lang('Show 
dotfiles'), "show_help" => lang('Show help'), "show_command_line" => lang('Show 
command line (EXPERIMENTAL. DANGEROUS)'));
+       $other_checkboxes = array("viewinnewwin" => lang("View documents in new 
window"),
+                                                               "viewonserver" 
=> lang("View documents on server (if available)"),
+                                                               "viewtextplain" 
=> lang("Unknown MIME-type defaults to text/plain when viewing"),
+                                                               "dotdot" => 
lang('Show ..'),
+                                                               "dotfiles" => 
lang('Show dotfiles'),
+                                                               "show_help" => 
lang('Show help'),
+                                                               
"show_command_line" => lang('Show command line (EXPERIMENTAL. DANGEROUS)'));
 
        /*
           To add a dropdown preferences, add it here.  Key is internal name, 
value key is
           displayed name, value values are choices in the dropdown
        */
-       $other_dropdown = array ("show_upload_boxes" => array (lang("Default 
number of upload fields to show"), "5", "10", "20", "30"));
+       $other_dropdown = array ("show_upload_boxes" => array (lang("Default 
number of upload fields to show"), "1", "5", "10", "20", "30"));
+       //if ( $GLOBALS['phpgw_info']['server']['file_repository'] == 'dav' )
+       {
+               // the 0 value is for getting the default from apache server
+               $other_dropdown += array ('lock_timeout' => 
array(lang('File/Dir Locks Timeout (in 
seconds)'),"0","600","3600","28800","Infinite"));
+       }
+       
+       /*
+          To add a input field preferences, add it here.  Key is internal 
name, value key is
+          displayed name, value values are choices in the dropdown
+       */
 
        if ($_POST['save'])
        {
-               $GLOBALS['phpgw']->preferences->read_repository ();
-
-               reset ($file_attributes);
-               while (list ($internal, $displayed) = each ($file_attributes))
-               {
-                       $GLOBALS['phpgw']->preferences->add 
($phpgw_info["flags"]["currentapp"], $internal, $$internal);
-               }
-
-               reset ($other_checkboxes);
-               while (list ($internal, $displayed) = each ($other_checkboxes))
-               {
-                       $GLOBALS['phpgw']->preferences->add 
($phpgw_info["flags"]["currentapp"], $internal, $$internal);
-               }
-
-               reset ($other_dropdown);
-               while (list ($internal, $displayed) = each ($other_dropdown))
-               {
-                       $GLOBALS['phpgw']->preferences->add 
($phpgw_info["flags"]["currentapp"], $internal, $$internal);
-               }
-
-               $GLOBALS['phpgw']->preferences->save_repository (True);
+               $values = $_POST['values'];
+               $select_values = $_POST['select_values'];
+               $quota_value = '';
+               //_debug_array($_POST);
+               
+               $repository = $GLOBALS['phpgw']->preferences->read();
+               $quota_value = $repository['filemanager']['set_quota'];
+               
+               $GLOBALS['phpgw']->preferences->read_repository();
+               $GLOBALS['phpgw']->preferences->delete('filemanager','');
+               
+               while (is_array($values) && list($internal) = each($values))
+               {
+                       
$GLOBALS['phpgw']->preferences->change('filemanager',$internal,(isset($internal)?$internal:''));
+               }
+               
+               while (is_array($select_values) && list($internal,$displayed) = 
each($select_values))
+               {
+                       
$GLOBALS['phpgw']->preferences->change('filemanager',$internal,$displayed);
+               }
+               
+               while (is_array($select_values) && list ($internal, $displayed) 
= each ($select_values))
+               {
+                       echo 'drin';
+                       
$GLOBALS['phpgw']->preferences->change('filemanager',$internal,$displayed);
+               }
+               
+               
$GLOBALS['phpgw']->preferences->change('filemanager','set_quota',$quota_value);
+               
+               $GLOBALS['phpgw']->preferences->save_repository();
      
                $GLOBALS['phpgw']->redirect_link('/preferences/index.php');
                $GLOBALS['phpgw']->common->phpgw_exit();
@@ -109,7 +134,7 @@
                        $checked = 1;
                }
 
-               $str = html_form_input("checkbox", $internal, NULL, NULL, NULL, 
$checked, NULL, 1);
+               $str = html_form_input("checkbox", $internal, NULL, NULL, NULL, 
$checked, NULL, '', 1, True);
                display_item ($displayed, $str);
                //$str .= html_form_input("checkbox", $internal, NULL, NULL, 
NULL, $checked, NULL, 1) . " $displayed" . html_break (1, NULL, 1);
        }
@@ -125,7 +150,7 @@
                        $checked = 1;
                }
 
-               $str = html_form_input ("checkbox", $internal, NULL, NULL, 
NULL, $checked, NULL, 1);
+               $str = html_form_input ("checkbox", $internal, NULL, NULL, 
NULL, $checked, NULL, '', 1, True);
                display_item ($displayed, $str);
        }
 
@@ -142,10 +167,10 @@
                                continue;
                        }
 
-                       $options .= html_form_option($value, 
$value,$GLOBALS['phpgw_info']["user"]["preferences"]["filemanager"][$internal] 
== $value, True);
+                       $options .= html_form_option($value, 
$value,$GLOBALS['phpgw_info']["user"]["preferences"]["filemanager"][$internal] 
== $value, '', True);
                }
 
-               $output = html_form_select_begin($internal, True);
+               $output = html_form_select_begin($internal, True, True, True);
                $output .= $options;
                $output .= html_form_select_end(True);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]