phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] filemanager/inc class.uiaction_base.inc.php, 1.4 hook


From: ceb
Subject: [Phpgroupware-cvs] filemanager/inc class.uiaction_base.inc.php, 1.4 hook_preferences.inc.php, 1.16 class.bofilemanager.inc.php, 1.14 class.uiaction_edit.inc.php, 1.7 class.uifilemanager.inc.php, 1.19
Date: Thu, 24 Feb 2005 15:09:42 -0000

Update of filemanager/inc

Modified Files:
     Branch: MAIN
            class.uiaction_base.inc.php lines: +47 -2
            hook_preferences.inc.php lines: +3 -3
            class.bofilemanager.inc.php lines: +54 -36
            class.uiaction_edit.inc.php lines: +61 -81
            class.uifilemanager.inc.php lines: +54 -100

Log Message:
update

====================================================
Index: filemanager/inc/class.uiaction_base.inc.php
diff -u filemanager/inc/class.uiaction_base.inc.php:1.3 
filemanager/inc/class.uiaction_base.inc.php:1.4
--- filemanager/inc/class.uiaction_base.inc.php:1.3     Sat Jan 22 02:22:52 2005
+++ filemanager/inc/class.uiaction_base.inc.php Thu Jan 27 01:55:40 2005
@@ -1,12 +1,57 @@
 <?php
+       /***
+       * phpGroupWare Filemanager
+       * @author Jonathon Sim <address@hidden>
+       * @author Bettina Gille <address@hidden>
+       * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @package filemanager
+       * @version $Id$
+       */

        class uiaction_base
        {
-               function load_header()
+               var $public_functions = array
+               (
+                       'help' => True
+               );
+
+               function uiaction_base()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw']->xslttpl->add_file('widgets');
+
+                       if(!is_object($GLOBALS['phpgw']->js))
+                       {
+                               $GLOBALS['phpgw']->js = 
createObject('phpgwapi.javascript');
+                       }
+                       $GLOBALS['phpgw']->js->validate_file('core','popup');
+                       $this->bofilemanager = 
CreateObject('filemanager.bofilemanager');
+               }
+
+               function help()
+               {
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+
+                       //echo 'bo-help-name: ' . 
$this->bofilemanager->help_name;
+
+                       $this->bofilemanager->load_help_info();
+                       @reset($this->bofilemanager->help_info);
+
+                       //_debug_array($this->bofilemanager->help_info);
+
+                       $key = $this->bofilemanager->help_name;
+                       if($this->bofilemanager->help_info[$key])
+                       {
+                               $msg = $this->bofilemanager->help_info[$key];
+                       }
+
+                       $help['lang_close'] = lang('close window');
+                       $help['msg'] = $msg;
+
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('help' => $help));
                }
-
+
                function action_link($action)
                {
                        return $GLOBALS['phpgw']->link('/index.php',

====================================================
Index: filemanager/inc/hook_preferences.inc.php
diff -u filemanager/inc/hook_preferences.inc.php:1.15 
filemanager/inc/hook_preferences.inc.php:1.16
--- filemanager/inc/hook_preferences.inc.php:1.15       Tue Jan 25 02:40:30 2005
+++ filemanager/inc/hook_preferences.inc.php    Thu Jan 27 01:55:40 2005
@@ -8,8 +8,8 @@
        /* $Id$ */

        {
-               $file = array('Preferences'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.preferences'),
-                                       'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname));
+               $file = array('Preferences'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.preferences'));
+                                       //'Grant Access'        => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname));
                //Do not modify below this line
                display_section($appname,$file);
        }

====================================================
Index: filemanager/inc/class.bofilemanager.inc.php
diff -u filemanager/inc/class.bofilemanager.inc.php:1.13 
filemanager/inc/class.bofilemanager.inc.php:1.14
--- filemanager/inc/class.bofilemanager.inc.php:1.13    Wed Jan 26 01:14:36 2005
+++ filemanager/inc/class.bofilemanager.inc.php Thu Jan 27 01:55:40 2005
@@ -892,43 +892,61 @@
                        return $result;
                }

+               /**TODO : xslt-ise this */
+               function build_help($help_option)
+               {
+                       if($this->settings['show_help'])
+                       {
+                               $help = "open_popup('" . 
$GLOBALS['phpgw']->link('/index.php',
+                                               array('menuaction' => 
$this->appname.'.uiaction_base.help','help_name'  => urlencode($help_option))) 
. "','250','150')";
+                               return $help;
+                       }
+                       else
+                       {
+                               return '';
+                       }
+               }
+
                function load_help_info()
                {
-                       $this->help_info = Array(
-                               array ("up", "The Up button takes you to the 
directory above the current directory.  For example, if you're in 
/home/jdoe/mydir, the Up button would take you to /home/jdoe."),
-                               array ("directory_name", "The name of the 
directory you're currently in."),
-                               array ("home", "The Home button takes you to 
your personal home directory."),
-                               array ("sort_by", "Click on any of the column 
headers to sort the list by that column."),
-                               array ("filename", "The name of the file or 
directory."),
-                               array ("mime_type", "The MIME-type of the file. 
 Examples include text/plain, text/html, image/jpeg.  The special MIME-type 
Directory is used for directories."),
-                               array ("size", "The size of the file or 
directory in the most convenient units: bytes (B), kilobytes (KB), megabytes 
(MB), gigabytes (GB).  Sizes for directories include subfiles and 
subdirectories."),
-                               array ("created", "When the file or directory 
was created."),
-                               array ("modified", "When the file or directory 
was last modified."),
-                               array ("owner", "The owner of the file or 
directory.  This can be a user or group name."),
-                               array ("created_by", "Displays who created the 
file or directory."),
-                               array ("modified_by", "Displays who last 
modified the file or directory."),
-                               array ("application", "The application 
associated with the file or directory.  Usually the application used to create 
it.  A blank application field is ok."),
-                               array ("comment", "The comment for the file or 
directory.  Comments can be set when creating the file or directory, and 
created or edited any time thereafter."),
-                               array ("version", "The current version for the 
file or directory.  Clicking on the version number will display a list of 
changes made to the file or directory."),
-                               array ("edit", "Edit the text of the selected 
file(s).  You can select more than one file; this is useful when you want to 
copy part of one file into another.  Clicking Preview will show you a preview 
of the file.  Click Save to save your changes."),
-                               array ("rename", "Rename the selected file(s).  
You can select as many files or directories as you want.  You are presented 
with a text field to enter the new name of each file or directory."),
-                               array ("delete", "Delete the selected file(s).  
You can select as many files or directories as you want.  When deleting 
directories, the entire directory and all of its contents are deleted.  You 
will not be prompted to make sure you want to delete the file(s); make sure you 
really want to delete them before clicking Delete."),
-                               array ("edit_comments", "Create a comment for a 
file or directory, or edit an existing comment.  You can select as many files 
or directories as you want."),
-                               array ("go_to", "The Go to button takes you to 
the directory selected in the drop down [directory_list|Directory List]."),
-                               array ("copy_to", "This will copy all selected 
files and directories to the directory selected in the drop down 
[directory_list|Directory List]."),
-                               array ("move_to", "This will move all selected 
files and directories to the directory selected in the drop down 
[directory_list|Directory List]."),
-                               array ("directory_list", "The Directory List 
contains a list of all directories you have (at least) read access to.  
Selecting a directory and clicking one of the [go_to|Go to]/[copy_to|Copy 
to]/[move_to|Move to] buttons will perform the selected action on that 
directory.  For example, if you select \"/home/somegroup/reports\" from the 
Directory List, and click the \"[copy_to|Copy to]\" button, all selected files 
and directories will be copied to \"/home/somegroup/reports\"."),
-                               array ("download", "Download the first selected 
file to your local computer.  You can only download one file at a time.  
Directories cannot be downloaded, only files."),
-                               array ("create_folder", "Creates a directory 
(folder == directory).  The name of the directory is specified in the text box 
next to the Create Folder button."),
-                               array ("create_file", "Creates a file in the 
current directory.  The name of the file is specified in the text box next to 
the Create File button.  After clicking the Create File button you will be 
presented with the [edit|Edit] screen, where you may edit the file you just 
created.  If you do not with to make any changes to the file at this time, 
simply click the Save button and the file will be saved as an empty file."),
-                               array ("command_line", "Enter a Unix-style 
command line here, which will be executed when the [execute|Execute] button is 
pressed.  If you don't know what this is, you probably should turn the option 
off in the Preferences."),
-                               array ("execute", "Clicking the Execute button 
will execute the Unix-style [command_line|command line] specified in the text 
box above.  If you don't know what this is, you probably should turn the option 
off in the Preferences."),
-                               array ("update", "Sync the database with the 
filesystem for the current directory.  This is useful if you use another 
interface to access the same files.  Any new files or directories in the 
current directory will be read in, and the attributes for the other files will 
be updated to reflect any changes to the filesystem.  Update is run 
automatically every few page loads (currently every 20 page loads as of this 
writing, but that may have changed by now)."),
-                               array ("file_stats", "Various statistics on the 
number and size of the files in the current directory.  In some situations, 
these reflect different statistics.  For example, when in / or the base 
directory."),
-                               array ("upload_file", "The full path of the 
local file to upload.  You can type it in or use the Browse.. button to select 
it.  The file will be uploaded to the current directory.  You cannot upload 
directories, only files."),
-                               array ("upload_comment", "The inital comment to 
use for the newly uploaded file.  Totally optional and completely arbitrary.  
You can [edit_comments|create or edit the comment] at any time in the future."),
-                               array ("upload_files", "This will upload the 
files listed in the input boxes above, and store them in the current 
directory."),
-                               array ("show_upload_fields", "This setting 
determines how many [upload_files|upload fields] will be shown at once.  You 
can change the default number that will be shown in the preferences.")
+                       $this->help_info = array
+                       (
+                               'up' => 'The Up button takes you to the 
directory above the current directory. For example, if you are in 
/home/jdoe/mydir, the Up button would take you to /home/jdoe.',
+                               'current_dir' => 'The name of the directory you 
are currently in.',
+                               'home' => 'The Home button takes you to your 
personal home directory.',
+                               'sort_by' => 'Click on any of the column 
headers to sort the list by that column.',
+                               'name' => 'The name of the file or directory.',
+                               'mime_type' => "The MIME-type of the file. 
Examples include text/plain, text/html, image/jpeg. The special MIME-type 
Directory is used for directories.",
+                               'size' => "The size of the file or directory in 
the most convenient units: bytes (B), kilobytes (KB), megabytes (MB), gigabytes 
(GB).  Sizes for directories include subfiles and subdirectories.",
+                               'created' => 'When the file or directory was 
created.',
+                               'modified' => 'When the file or directory was 
last modified.',
+                               'owner' => 'The owner of the file or directory. 
This can be a user or group name.',
+                               'createdby_id' => 'Displays who created the 
file or directory.',
+                               'modifiedby_id' => 'Displays who last modified 
the file or directory.',
+                               'application' => "The application associated 
with the file or directory.  Usually the application used to create it.  A 
blank application field is ok.",
+                               'comment' => "The comment for the file or 
directory.  Comments can be set when creating the file or directory, and 
created or edited any time thereafter.",
+                               'version' => "The current version for the file 
or directory.  Clicking on the version number will display a list of changes 
made to the file or directory.",
+                               'edit' => "Edit the text of the selected 
file(s). You can select more than one file; this is useful when you want to 
copy part of one file into another. Clicking Preview will show you a preview of 
the file. Click Save to save your changes.",
+                               'rename' => "Rename the selected file(s). You 
can select as many files or directories as you want.  You are presented with a 
text field to enter the new name of each file or directory.",
+                               'delete' => "Delete the selected file(s). You 
can select as many files or directories as you want.  When deleting 
directories, the entire directory and all of its contents are deleted.  You 
will not be prompted to make sure you want to delete the file(s); make sure you 
really want to delete them before clicking Delete.",
+                               'edit_comments' => "Create a comment for a file 
or directory, or edit an existing comment.  You can select as many files or 
directories as you want.",
+                               'go_to' => 'The Go to button takes you to the 
directory selected in the drop down [directory_list|Directory List].',
+                               'copy_to' => 'This will copy all selected files 
and directories to the directory selected in the drop down 
[directory_list|Directory List].',
+                               'move_to' => 'This will move all selected files 
and directories to the directory selected in the drop down 
[directory_list|Directory List].',
+                               'dir_list' => 'The Directory List contains a 
list of all directories you have (at least) read access to. Selecting [Go to] 
[Copy to] [Move to] from the left Menu will perform the selected action on that 
directory. For example, if you select */home/somegroup/reports* from the 
Directory List, and choose [Copy to] from the left Menu, all selected files and 
directories will be copied to */home/somegroup/reports*.',
+                               'download' => 'Download the first selected file 
to your local computer. You can only download one file at a time. Directories 
cannot be downloaded, only files.',
+                               'create_folder' => "Creates a directory (folder 
== directory).  The name of the directory is specified in the text box next to 
the Create Folder button.",
+                               'create_file' => "Creates a file in the current 
directory.  The name of the file is specified in the text box next to the 
Create File button.  After clicking the Create File button you will be 
presented with the [edit|Edit] screen, where you may edit the file you just 
created.  If you do not with to make any changes to the file at this time, 
simply click the Save button and the file will be saved as an empty file.",
+                               'command_line' => "Enter a Unix-style command 
line here, which will be executed when the [execute|Execute] button is pressed. 
 If you don't know what this is, you probably should turn the option off in the 
Preferences.",
+                               'execute' => "Clicking the Execute button will 
execute the Unix-style [command_line|command line] specified in the text box 
above.  If you don't know what this is, you probably should turn the option off 
in the Preferences.",
+                               'update' => "Sync the database with the 
filesystem for the current directory.  This is useful if you use another 
interface to access the same files.  Any new files or directories in the 
current directory will be read in, and the attributes for the other files will 
be updated to reflect any changes to the filesystem.  Update is run 
automatically every few page loads (currently every 20 page loads as of this 
writing, but that may have changed by now).",
+                               'file_stats' => "Various statistics on the 
number and size of the files in the current directory.  In some situations, 
these reflect different statistics.  For example, when in / or the base 
directory.",
+                               'upload_file' => 'The full path of the local 
file to upload. You can type it in or use the Browse.. button to select it. The 
file will be uploaded to the current directory. You cannot upload directories, 
only files.',
+                               'upload_comment' => 'The inital comment to use 
for the newly uploaded file. Totally optional and completely arbitrary. You can 
[edit_comments|create or edit the comment] at any time in the future.',
+                               'upload_files' => 'This will upload the files 
listed in the input boxes above, and store them in the current directory.',
+                               'show_upload_fields' => 'This setting 
determines how many fields for uploading files will be shown at once. You can 
change the default number that will be shown by clicking one of the numbers or 
in the preferences section.',
+                               'refresh'       => 'Clicking the button 
refreshes the current window.',
+                               'menu'  => ''
                        );
                }


====================================================
Index: filemanager/inc/class.uiaction_edit.inc.php
diff -u filemanager/inc/class.uiaction_edit.inc.php:1.6 
filemanager/inc/class.uiaction_edit.inc.php:1.7
--- filemanager/inc/class.uiaction_edit.inc.php:1.6     Wed Jan 26 01:14:36 2005
+++ filemanager/inc/class.uiaction_edit.inc.php Thu Jan 27 01:55:40 2005
@@ -1,8 +1,17 @@
 <?php
-require_once('class.uiaction_base.inc.php');
-define('UIEDIT_DEBUG',0);
+       /***
+       * phpGroupWare Filemanager
+       * @author Jonathon Sim <address@hidden>
+       * @author Bettina Gille <address@hidden>
+       * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @package filemanager
+       * @version $Id$
+       */

-       class uiaction_edit extends uiaction_base
+       define('UIEDIT_DEBUG',0);
+
+       class uiaction_edit
        {
                //Lists the suported actions (human readable) indexed by their 
function name
                var $public_functions = array
@@ -12,44 +21,13 @@

                function uiaction_edit()
                {
-                                       $this->bofilemanager = 
CreateObject('filemanager.bofilemanager');
-
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));
-
-                                       $var = Array(
-                                       'img_up' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'up'),
-                                                                               
        'alt' => lang('up'),
-                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-                                                                               
                        'path'          => 
urlencode($this->bofilemanager->lesspath)
-                                                                               
                ))
-                                                                               
        )),
-
-                                       'img_home'      => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_home'),
-                                                                               
        'alt' => lang('folder'),
-                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-                                                                               
                        'path' => urlencode($this->bofilemanager->homedir)
-                                                                               
                ))
-                                                                               
        )),
-
-                                       'dir' => $this->bofilemanager->path,
-                                       'img_dir' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
-                                                                               
        'alt' => lang('folder')
-                                                                               
        )),
-                               );
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('filemanager_nav' => $var));
-                       //$this->template_dir = 
$GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']);
+                       $this->action                   = 
CreateObject('filemanager.uiaction_base');
+                       $this->bofilemanager    = $this->action->bofilemanager;
+                       $GLOBALS['phpgw']->xslttpl->add_file('edit');
                }

                function edit($parent = 0,$param = false)
                {
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('edit'));
-
-                       $this->load_header();
                        //$this->bofilemanager = &$parent->bofilemanager;
                        if (UIEDIT_DEBUG) echo ' action::edit ';
                        $edit_file = get_var('file', array('GET', 'POST'));
@@ -64,34 +42,43 @@

        //              echo "path ".$GLOBALS['phpgw']->vfs->pwd()." Editing: 
".$edit_file;
 */
+                       $data = Array(
+                               'img_up'        => array('widget' => 
array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'up'),
+                                                                               
        'title' => lang('up'),
+                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
+                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path'          => 
urlencode($this->bofilemanager->lesspath))))),
+                               'help_up'       => array('widget' => 
array('type' => 'help','onClick' => $this->bofilemanager->build_help('up'))),
+                               'img_home'      => array('widget' => 
array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
+                                                                               
        'title' => lang('go to your home directory'),
+                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
+                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path' => urlencode($this->bofilemanager->homedir))))),
+                               'help_home'             => array('widget' => 
array('type' => 'help','onClick' => $this->bofilemanager->build_help('home'))),
+                               'current_dir'   => $this->bofilemanager->path . 
'/' . $edit_file);
                        $vars = array();
-                       $vars[] = array('widget' => array('type' => 'image',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'preview'),
-                                                                               
        ));
-                       $vars[] = array('widget' => array('type' => 'submit',
-                                                'name' => 
"uiaction_edit_preview",
-                                                'value'=>lang('preview')
-                                                ));
-                       $vars[] = array('widget' => array('type' => 'image',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'filesave'),
-                                                                               
        ));
-                       $vars[]  = array('widget' => array('type' => 'submit',
-                                       'name' => 'uiaction_edit_save',
-                                       'value'=>lang('save')
-                                       ));
-                       $vars[] = array('widget' => array('type' => 'image',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'button_cancel'),
-                                                                               
        ));
-
-                       $vars[] = array('widget' => array('type' => 'submit',
-                                       'name' => 'uiaction_edit_cancel',
-                                       'value'=>lang('close')
-                                       ));
-
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'preview'),
+                                                                               
                'title' => lang('preview'),
+                                                                               
                'name'  => 'uiaction_edit_preview',
+                                                                               
                'value' => 'preview'));
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'filesave'),
+                                                                               
                'title' => lang('save'),
+                                                                               
                'name'  => 'uiaction_edit_save',
+                                                                               
                'value' => 'save'));
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'button_cancel'),
+                                                                               
                'title' => lang('close'),
+                                                                               
                'name'  => 'uiaction_edit_cancel',
+                                                                               
                'value' => 'cancel'));
                        $data['nav_data'] = $vars;
+                       $data['lang_edit'] = lang('edit file');
+                       $data['filename'] = $edit_file;

-                       $vars = array('filename' => $edit_file);
-
+                       $vars = array();
                        if (get_var('edited', array('GET', 'POST')))
                        {
                                $content = get_var('edit_file_content', 
array('GET', 'POST'));
@@ -128,29 +115,21 @@
                                }
                        }

-                               if ($edit_file && 
$GLOBALS['phpgw']->vfs->file_exists (array (
-                                                               'string'        
=> $edit_file,
-                                                               'relatives'     
=> array (RELATIVE_ALL)
-                                       ))
-                               )
-                               {
-                                       $vars['form_data'][] = array('widget' 
=> array('type' => "hidden" ,
+                       if ($edit_file && $GLOBALS['phpgw']->vfs->file_exists 
(array('string' => $edit_file,'relatives' => array (RELATIVE_ALL))))
+                       {
+                                       $v[] = array('widget' => array('type' 
=> "hidden" ,
                                                                                
        'name'=> "edited",
-                                                                               
        'value'=>"1"
-                                                                               
        ));
-
-                                       $vars['form_data'][] = array('widget' 
=> array('type' => "hidden",
+                                                                               
        'value'=>"1"));
+                                       $v[] = array('widget' => array('type' 
=> "hidden",
                                                'name' => 'edit_file',
-                                               'value' => $edit_file
-                                               ));
-
-                                       $vars['form_data'][] = array('widget' 
=> array('type'=>"hidden",
+                                               'value' => $edit_file));
+                                       $v[] = array('widget' => 
array('type'=>"hidden",
                                                                'name'=> 
"fileman[0]",
-                                                               'value' => 
$this->bofilemanager->html_encode($edit_file,1)
-                                                               ));
+                                                               'value' => 
$this->bofilemanager->html_encode($edit_file,1)));
+
+                                       $vars['form_data']      = $v;
                                        $vars['file_content'] =  $content;
-                               }
-                       //}
+                       }

                        $output = array
                        (
@@ -160,6 +139,7 @@
                                'filemanager_edit'      => $vars
                        );

+                       //_debug_array($output);
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('edit' => $output));
                }


====================================================
Index: filemanager/inc/class.uifilemanager.inc.php
diff -u filemanager/inc/class.uifilemanager.inc.php:1.18 
filemanager/inc/class.uifilemanager.inc.php:1.19
--- filemanager/inc/class.uifilemanager.inc.php:1.18    Wed Jan 26 01:14:36 2005
+++ filemanager/inc/class.uifilemanager.inc.php Thu Jan 27 01:55:40 2005
@@ -71,13 +71,11 @@

                function uifilemanager()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $GLOBALS['phpgw']->xslttpl->add_file('widgets');
-                       //$this->actions                        = 
CreateObject('filemanager.uiactions');
-                       $this->bofilemanager    = 
CreateObject('filemanager.bofilemanager');
+                       $this->action                   = 
CreateObject('filemanager.uiaction_base');
+                       $this->bofilemanager    = $this->action->bofilemanager;
+                       //$this->actions                = 
CreateObject('filemanager.uiactions');
                        //$this->nextmatchs             = 
CreateObject('phpgwapi.nextmatchs');
-                       //$this->browser                        = 
CreateObject('phpgwapi.browser');
-                       //$this->template_dir = 
$GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']);
+                       //$this->browser                = 
CreateObject('phpgwapi.browser');

                        $this->check_access();
                        $this->update();
@@ -258,53 +256,6 @@
                        
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                }

-               /**TODO : xslt-ise this */
-               function help()
-               {
-                       $this->load_header();
-                       $this->bofilemanager->load_help_info();
-                       @reset($this->bofilemanager->help_info);
-                       while(list($num,$help_array) = 
each($this->bofilemanager->help_info))
-                       {
-                               if ($help_array[0] != 
$this->bofilemanager->help_name)
-                               {
-                                       continue;
-                               }
-
-                               $help_array[1] = 
preg_replace("/\[(.*)\|(.*)\]/Ue","\$this->build_help('\\1','\\2')",$help_array[1]);
-                               $help_array[1] = 
preg_replace("/\[(.*)\]/Ue","\$this->build_help('\\1','\\1')",$help_array[1]);
-
-//                             echo '<font 
size="+4">'."\n".ucwords(str_replace('_',' 
',$help_array[0]))."\n".'</font></br>'."\n";
-//                             echo '<font 
size="+2">'."\n".$help_array[1].'</font>';
-                       }
-                       exit();
-               }
-               /**TODO : xslt-ise this */
-               function build_help($help_option,$text='')
-               {
-                       if($this->bofilemanager->settings['show_help'])
-                       {
-                               $help = ($text?'':'<font size="-2" 
color="maroon" >'."\n");
-                               $help .= '      <a href="'
-                                       . $GLOBALS['phpgw']->link('/index.php',
-                                               Array(
-                                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.help',
-                                                       'help_name'     => 
urlencode($help_option),
-                                                       'op'    => 'help'
-                                               )
-                                       )
-                                       . '" target="_new">';
-                               $help .= ($text?$text:'[?]');
-                               $help .= '</a>';
-                               $help .= ($text?'':"\n".'     </font>');
-                               return $help;
-                       }
-                       else
-                       {
-                               return '';
-                       }
-               }
-
                function display_buttons($type = 'config')
                {
                        $var = array();
@@ -317,7 +268,7 @@
                                                'type'  => 'submit',
                                                'name'  => 'save',
                                                'value' => lang('save'),
-                                               'caption' => 
$this->build_help('save')
+                                               'caption' => 
$this->bofilemanager->build_help('save')
                                        );
                                        $var[] = array('height' => 
'50','valign' => 'bottom','widget' => $button);
                                        $button = array
@@ -325,7 +276,7 @@
                                                'type'  => 'submit',
                                                'name' => 'cancel',
                                                'value' => lang('cancel'),
-                                               'caption' => 
$this->build_help('cancel')
+                                               'caption' => 
$this->bofilemanager->build_help('cancel')
                                        );
                                        $var[] = array('align' => 
'right','height' => '50','valign' => 'bottom','widget' => $button);
                                        break;
@@ -477,7 +428,7 @@
                                                $var[]  = array('widget' => 
array('type'=>'submit',
                                                                                
        'name'=> 'download',
                                                                                
        'value' => lang('download'),
-                                                                               
        'caption' => $this->build_help('download')
+                                                                               
        'caption' => $this->bofilemanager->build_help('download')
                                                                                
        ));
                                        }

@@ -486,12 +437,12 @@
                                                $var[] = array('widget' => 
array( 'type' => 'text' ,
                                                                                
                'name'=> 'command_line',
                                                                                
                'size' => '50',
-                                                                               
                'caption' => $this->build_help('command_line')
+                                                                               
                'caption' => $this->bofilemanager->build_help('command_line')
                                                                                
        ));
                                                $var[] = array('widget' => 
array( 'type' => 'submit',
                                                                                
                'name' => 'execute',
                                                                                
                'value' => lang('execute'),
-                                                                               
                'caption' => $this->build_help('execute')
+                                                                               
                'caption' => $this->bofilemanager->build_help('execute')
                                                                                
        ));
                                                $var[] = array('widget' => 
array( 'type' => 'seperator' ));
                                        }
@@ -609,7 +560,8 @@
                        $usage = 0;
                        $files_array = $this->dirs_first($files_array);

-                       $file_attributes[] = '';
+                       $file_attributes[] =  array('widget'=> array('type' => 
'text','caption' => lang('sort by')),
+                                                                               
'help' => array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('sort_by'))));
                        @reset($this->bofilemanager->file_attributes);

                        //_debug_array($this->bofilemanager->settings);
@@ -623,7 +575,8 @@
                                                                                
                                                'href' =>  
$GLOBALS['phpgw']->link('/index.php', array(
                                                                                
                                                'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
                                                                                
                                                
'path'=>$this->bofilemanager->path,
-                                                                               
                                                'sortby' => $attribute))));
+                                                                               
                                                'sortby' => $attribute))),
+                                                                               
                'help'  => array('widget' => array('type' => 'help','onClick' 
=> $this->bofilemanager->build_help($attribute))));
                                }
                        }
                        //_debug_array($file_attributes);
@@ -735,46 +688,35 @@
                                                'file'                          
=> $file_output
                                ),
                                'form'  => array('action'       => 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
-                                                                               
                                'path'                  => 
urlencode($this->bofilemanager->path))),
-                                                                               
'id'    => 'form_files',
-                                                                               
'name'  => 'files',
-                                                                       
'method'        => 'POST',
-                                                                       
'enctype'       => 'multipart/form-data'
-                                                                       ),
+                                                                               
                        'menuaction' => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
+                                                                               
                                'path' => 
urlencode($this->bofilemanager->path))),
+                                                                               
                                'id'    => 'form_files',
+                                                                               
                                'name'  => 'files',
+                                                                               
                                'method'        => 'POST',
+                                                                               
                                'enctype'       => 'multipart/form-data'),
                                'error'         => 
(isset($this->bofilemanager->errors) && 
is_array(unserialize(base64_decode($this->bofilemanager->errors)))?$GLOBALS['phpgw']->common->error_list(unserialize(base64_decode($this->bofilemanager->errors)),'Results'):''),
-                               'img_up'        => array('widget' => 
array('type' => 'image',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'up'),
-                                                                               
        'title' => lang('up'),
-                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-                                                                               
                        'path'          => 
urlencode($this->bofilemanager->lesspath)
-                                                                               
                ))
-                                                                               
        )),
-                               'help_up'       => $this->build_help('up'),
                                'img_home'      => array('widget' => 
array('type' => 'image',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_home'),
-                                                                               
        'title' => lang('go to your home directory'),
-                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-                                                                               
                        'path' => urlencode($this->bofilemanager->homedir)
-                                                                               
                ))
-                                                                               
        )),
+                                                                               
                                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
+                                                                               
                                'title' => lang('go to your home directory'),
+                                                                               
                                'link' => 
$GLOBALS['phpgw']->link('/index.php',Array(
+                                                                               
                                                        'menuaction' => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                                                        'path' => 
urlencode($this->bofilemanager->homedir))))),
+                               'help_home'     => array('widget' => 
array('type' => 'help','onClick' => $this->bofilemanager->build_help('home'))),
                                'current_dir'   => $this->bofilemanager->path,
-                               'help_home'             => 
$this->build_help('home'),
+                               'help_dir'      => array('widget' => 
array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('current_dir'))),
                                'img_upload'    => array('widget' => 
array('type' => 'image',
                                                                                
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'1uparrow'),
                                                                                
        'title' => lang('upload files'),
                                                                                
        'name'  => 'params[upload]',
                                                                                
        'value' => 'upload')),
+                               'help_upload_files'     => array('widget' => 
array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('upload_files'))),
                                'img_refresh'   => array('widget' => 
array('type' => 'image',
                                                                                
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'reload'),
                                                                                
        'title' => lang('refresh'),
                                                                                
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
                                                                                
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.update',
-                                                                               
                        'path'          => urlencode($this->bofilemanager->path)
-                                                                               
                ))
-                                                                               
        ))
+                                                                               
                        'path'          => 
urlencode($this->bofilemanager->path))))),
+                               'help_refresh'  => array('widget' => 
array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('refresh')))

                                        /*'add_moz_sidebar' => array
                                        (
@@ -789,6 +731,13 @@

                        if($this->bofilemanager->path != '/' && 
$this->bofilemanager->path != $this->bofilemanager->fakebase)
                        {
+                               $data['img_up'] = array('widget' => 
array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'up'),
+                                                                               
        'title' => lang('up'),
+                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
+                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path'          => 
urlencode($this->bofilemanager->lesspath)))));
+                               $data['help_up'] = array('widget' => 
array('type' => 'help','onClick' => $this->bofilemanager->build_help('up')));
                                $data['create_folder']  = array('widget' => 
array('type' => 'text',
                                                                                
                                                'name' => 'createdir',
                                                                                
                                                'maxlength' => '255',
@@ -798,10 +747,10 @@
                                                                                
                                                        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_new'),
                                                                                
                                                        'title' => lang('create 
folder'),
                                                                                
                                                        'name'  => 
'params[newdir]',
-                                                                               
                                                        'value' => 'newdir',
-                                                                               
                                                        'caption' => 
$this->build_help('create_folder')
+                                                                               
                                                        'value' => 'newdir'
                                                                                
                ));
                                $data['lang_create_folder']     = lang('create 
folder');
+                               $data['help_create_folder']     = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('create_folder')));
                                $data['create_file']            = 
array('widget' => array('type' => 'text',
                                                                                
                                                'name' => 'createfile',
                                                                                
                                                'maxlength' => '255',
@@ -811,10 +760,10 @@
                                                                                
                                                        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'filenew'),
                                                                                
                                                        'title' => lang('create 
file'),
                                                                                
                                                        'name'  => 
'params[newfile]',
-                                                                               
                                                        'value' => 'newfile',
-                                                                               
                                                        'caption' => 
$this->build_help('create_file')
+                                                                               
                                                        'value' => 'newfile'
                                                                                
                ));
                                $data['lang_create_file']       = lang('create 
file');
+                               $data['help_create_file']       = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('create_file')));
                        }

                        if (strlen($this->bofilemanager->errors))
@@ -864,16 +813,21 @@

                        if(!count($edit))
                        {
-                               $data['menu'] = array('widget' => array('type' 
=> 'select','name' => 'params[menu]', 'id' => 'file_menu','onChange' => 
$js,'options' => $this->display_buttons('menu')));
-                               $data['dir_menu'] = array('widget' => 
array('type' => 'select','name' => 'todir', 'id' => 'menu_todir','onChange' => 
$js_dir,'disabled' => True,'options' => $this->display_buttons('dir_menu')));
-                               $data['uploads'] = $this->display_uploads();
+                               $data['menu']                   = 
array('widget' => array('type' => 'select','name' => 'params[menu]', 'id' => 
'file_menu','onChange' => $js,'options' => $this->display_buttons('menu')));
+                               $data['help_menu']              = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('menu')));
+                               $data['dir_menu']               = 
array('widget' => array('type' => 'select','name' => 'todir', 'id' => 
'menu_todir','onChange' => $js_dir,'disabled' => True,'options' => 
$this->display_buttons('dir_menu')));
+                               $data['help_dir_list']  = array('widget' => 
array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('dir_list')));
+                               $data['uploads']                = 
$this->display_uploads();
                        }

-                       $data['lang_show']                      = lang('show');
-                       $data['lang_upload_fields']     = lang('upload fields');
-                       $data['lang_upload_files']      = lang('upload files');
-                       $data['lang_file']                      = lang('file');
-                       $data['lang_comment']           = lang('comment');
+                       $data['lang_show']                                      
= lang('show');
+                       $data['lang_upload_fields']                     = 
lang('upload fields');
+                       $data['lang_upload_files']                      = 
lang('upload files');
+                       $data['help_upload_file']                       = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('upload_file')));
+                       $data['lang_file']                                      
= lang('file');
+                       $data['lang_comment']                           = 
lang('comment');
+                       $data['help_upload_comment']            = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('upload_comment')));
+                       $data['help_show_upload_fields']        = 
array('widget' => array('type' => 'help','onClick' => 
$this->bofilemanager->build_help('show_upload_fields')));

                        foreach($this->bofilemanager->upload_boxes as $box)
                        {






reply via email to

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