[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] filemanager/inc class.uifilemanager.inc.php, 1.15
From: |
ceb |
Subject: |
[Phpgroupware-cvs] filemanager/inc class.uifilemanager.inc.php, 1.15 |
Date: |
Thu, 24 Feb 2005 15:10:33 -0000 |
Update of filemanager/inc
Modified Files:
Branch: MAIN
class.uifilemanager.inc.php lines: +85 -98
Log Message:
update
====================================================
Index: filemanager/inc/class.uifilemanager.inc.php
diff -u filemanager/inc/class.uifilemanager.inc.php:1.14
filemanager/inc/class.uifilemanager.inc.php:1.15
--- filemanager/inc/class.uifilemanager.inc.php:1.14 Mon Jan 24 00:26:34 2005
+++ filemanager/inc/class.uifilemanager.inc.php Mon Jan 24 17:42:04 2005
@@ -12,7 +12,7 @@
* @version $Id$
*/
- define('UI_DEBUG', 0);
+ define('UI_DEBUG',0);
class uifilemanager
{
@@ -253,6 +253,14 @@
//_debug_array($params);
+ if($_GET['show_upload_boxes'])
+ {
+
$GLOBALS['phpgw']->preferences->read_repository();
+
$GLOBALS['phpgw']->preferences->change('filemanager','show_upload_boxes',$_GET['show_upload_boxes']);
+
$GLOBALS['phpgw']->preferences->save_repository();
+ $this->bofilemanager->show_upload_boxes =
$_GET['show_upload_boxes'];
+ }
+
if (UI_DEBUG)
{
echo " Debug mode <br>";
@@ -294,6 +302,13 @@
'upload',
'download'
);
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+ 'path' =>
urlencode($this->bofilemanager->path)
+ );
+
if (trim(strtolower($this->bofilemanager->cancel)) ==
strtolower(lang('cancel'))) {
$this->cancel();
exit();
@@ -311,34 +326,23 @@
//echo " bofunction $function ";
$f_function = 'f_'.$action;
$errors =
implode("\n",$this->bofilemanager->$f_function());
- $var = Array(
- 'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
- 'path' =>
urlencode($this->bofilemanager->path)
- );
+
if($function == 'newfile')
{
- $var = Array(
- 'menuaction'
=> $this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
- 'path'
=> urlencode($this->bofilemanager->path),
- 'createfile'
=> urlencode($this->bofilemanager->createfile)
- );
+
$link_data['createfile'] = urlencode($this->bofilemanager->createfile);
}
elseif(strlen($errors))
{
$var['errors'] =
$errors;
}
-
$GLOBALS['phpgw']->redirect_link('/index.php',$var);
}
else
{
-
$GLOBALS['phpgw']->redirect_link('/index.php',Array(
- 'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
- 'path' =>
urlencode($this->bofilemanager->path),
- 'errors' =>
lang('unknown action!')
- ));
+ $var['errors'] = lang('unknown
action!');
}
}
}
+
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
/**TODO : xslt-ise this */
@@ -697,111 +701,104 @@
function index()
{
- if($_GET['show_upload_boxes'])
- {
-
$GLOBALS['phpgw']->preferences->read_repository();
-
$GLOBALS['phpgw']->preferences->change('filemanager','show_upload_boxes',$_GET['show_upload_boxes']);
-
$GLOBALS['phpgw']->preferences->save_repository();
- $this->bofilemanager->show_upload_boxes =
$_GET['show_upload_boxes'];
- }
-
$files_array = $this->bofilemanager->load_files();
//_debug_array($files_array);
$usage = 0;
$files_array = $this->dirs_first($files_array);
- if(count($files_array) || $this->bofilemanager->cwd)
+
+ $file_output = array();
+ for($i=0;$i<count($files_array);$i++)
{
- $file_output = array();
- for($i=0;$i!=count($files_array);$i++)
+ $file = $files_array[$i];
+ $usage += $file['size'];
+
+ if (!count($edit) )
{
- $file = $files_array[$i];
- $usage += $file['size'];
- if (!count($edit) )
- {
-
$file_attributes['checkbox'] = '';
-
$file_output[$i]['checkbox'] = array('widget' => array( 'type' => 'checkbox',
+ $file_attributes[] = '';
+ $file_output[$i]['checkbox'] =
array('widget' => array( 'type' => 'checkbox',
'name'
=> 'fileman[]',
'value'
=> $file['name']
));
- }
-
@reset($this->bofilemanager->file_attributes);
- while(list($internal,$displayed) =
each($this->bofilemanager->file_attributes))
+ }
+ @reset($this->bofilemanager->file_attributes);
+ while(list($internal,$displayed) =
each($this->bofilemanager->file_attributes))
+ {
+ if
(!is_array($this->bofilemanager->settings)||$this->bofilemanager->settings[$internal])
{
- if
(!is_array($this->bofilemanager->settings)||$this->bofilemanager->settings[$internal])
+ if
($internal==$edit[$file['name']])
{
- if
($internal==$edit[$file['name']])
- {
-
$file_output[$i][$internal] = array('widget' => array('type' => 'text',
+
$file_output[$i][$internal] = array('widget' => array('type' => 'text',
'name'
=> 'changes['.$file['name'].']',
'value'
=> $file[$internal]
));
- }
- else
+ }
+ else
+ {
+ switch($internal)
{
-
switch($internal)
- {
- case
'owner_id':
- case
'owner':
- case
'createdby_id':
- case
'modifiedby_id':
-
$name = $GLOBALS['phpgw']->accounts->id2name($file[$internal]) ;
-
$file_output[$i][$internal] = $name ? $name: '';
-
break;
- case
'created':
- case
'modified':
-
//Convert ISO 8601 date format used by DAV into something people can read
-
$file_output[$i][$internal] =
$this->bofilemanager->convert_date($file[$internal]);
-
break;
- case
'name':
-
$mime_parts = explode('/',$file['mime_type']);
-
$file_icon = $this->mime_ico[$file['mime_type']];
-
if (!$file_icon) {
-
$file_icon = ( $this->mime_ico[$mime_parts[0]]) ?
$this->mime_ico[$mime_parts[0]] : $this->mime_ico['unknown'];
-
if (strpos($file['name'],'.exe') !== false) $file_icon =
$this->mime_ico['exe'];
-
}
+ case 'owner_id':
+ case 'owner':
+ case
'createdby_id':
+ case
'modifiedby_id':
+ $name =
$GLOBALS['phpgw']->accounts->id2name($file[$internal]) ;
+
$file_output[$i][$internal] = $name ? $name: '';
+ break;
+ case 'created':
+ case 'modified':
+
//Convert ISO 8601 date format used by DAV into something people can read
+
$file_output[$i][$internal] =
$this->bofilemanager->convert_date($file[$internal]);
+ break;
+ case 'name':
+
$mime_parts = explode('/',$file['mime_type']);
+
$file_icon = $this->mime_ico[$file['mime_type']];
+ if
(!$file_icon)
+ {
+
$file_icon = ( $this->mime_ico[$mime_parts[0]]) ?
$this->mime_ico[$mime_parts[0]] : $this->mime_ico['unknown'];
+
if (strpos($file['name'],'.exe') !== false) $file_icon =
$this->mime_ico['exe'];
+ }
-
$file_output[$i]['name']['icon'] = array(
+
$file_output[$i]['name']['icon'] = array(
'widget' => array( 'type' => 'image',
'src' =>
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,$file_icon)
));
-
if ($file['mime_type']=='Directory')
-
{
-
$href = array('menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+ if
($file['mime_type']=='Directory')
+ {
+
$href = array('menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
'path' =>
$this->bofilemanager->path.SEP.$file['name']
);
-
}
-
else
-
{
-
$href = Array( 'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.view',
+ }
+ else
+ {
+
$href = Array( 'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.view',
'path' =>
urlencode($this->bofilemanager->path),
'file' =>
urlencode($file['name'])
);
-
}
-
$file_output[$i]['name']['link'] = array(
+ }
+
$file_output[$i]['name']['link'] = array(
"widget"=> array(
'type' => 'link',
'caption' => $file['name'],
'href' =>
$GLOBALS['phpgw']->link('/index.php', $href)
));
-
if ($mime_parts[0] == 'text')
-
{
+ if
($mime_parts[0] == 'text')
+ {
$href['menuaction'] =
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action';
$href['uiaction'] = 'edit';
$file_output[$i]['name']['edit'] = array('widget' => array(
'type' => 'img',
'src' =>
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'pencil'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', $href)
));
-
}
-
break;
- default:
-
$file_output[$i][$internal] = $file[$internal];
+ }
+ break;
+ default:
+
$file_output[$i][$internal] = $file[$internal];
- }
}
-
$file_attributes[$internal] = array("widget"=> array(
+ }
+ $file_attributes[] =
array('widget'=> array(
'type'
=> 'link',
'caption' => $displayed,
'href'
=> $GLOBALS['phpgw']->link('/index.php', array(
@@ -810,10 +807,11 @@
'sortby' => $internal
))
));
- }
}
}
+ //_debug_array($file_attributes);
+
$data = array
(
'summary' => array
@@ -852,13 +850,6 @@
'path' => urlencode($this->bofilemanager->homedir)
))
)),
- 'img_dir' => array('widget' =>
array('type' => 'image',
-
'src' =>
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
-
'title' => lang('folder'),
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-
'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-
'path' => urlencode($this->bofilemanager->path)
-
))
-
)),
'current_dir' =>
$this->bofilemanager->path,
'help_home' =>
$this->build_help('home'),
'img_upload' => array('widget' =>
array('type' => 'image',
@@ -979,15 +970,11 @@
foreach($this->bofilemanager->upload_boxes as
$box)
{
- $data['show_upload_boxes'][] =
array('widget' => array('type' => 'link',
-
'caption' =>
$box,
-
'href' =>
$GLOBALS['phpgw']->link('/index.php',Array(
-
'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-
'path' => urlencode($this->bofilemanager->path),
-
'show_upload_boxes' => $box
-
))));
+ $data['show_upload_boxes'][] =
array('widget' => array('type' => 'link','caption' => $box,
+
'href'
=> $GLOBALS['phpgw']->link('/index.php',array(
+
'menuaction' =>
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
+
'show_upload_boxes' => $box))));
}
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('index' => $data));
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] filemanager/inc class.uifilemanager.inc.php, 1.15,
ceb <=
- Prev by Date:
[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.4 class.soXport.inc.php, 1.12 hook_admin.inc.php, 1.11 class.menu.inc.php, 1.8 class.soproject.inc.php, 1.9
- Next by Date:
[Phpgroupware-cvs] email/templates/base message_main.tpl, 1.2 spell_review.tpl, 1.2 compose.tpl, 1.2 debug.tpl, 1.2 error_report.tpl, 1.2 filters.tpl, 1.2 class_prefs_ui.tpl, 1.2 class_prefs_ex_accounts.tpl, 1.2 OLD-preferences.tpl, 1.2 addressbook.tpl, 1.2 class_prefs_blocks.tpl, 1.2 filters_blocks.tpl, 1.2 filters_list.tpl, 1.2 message_echo_dump.tpl, 1.2 message_printable.tpl, 1.2 search_form.tpl, 1.2 index_mlist.tpl, 1.2 index_main_b0_l2.tpl, 1.2 folder.tpl, 1.2 index_blocks.tpl, 1.2 index_main_b0_l1.tpl, 1.2
- Previous by thread:
[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.4 class.soXport.inc.php, 1.12 hook_admin.inc.php, 1.11 class.menu.inc.php, 1.8 class.soproject.inc.php, 1.9
- Next by thread:
[Phpgroupware-cvs] email/templates/base message_main.tpl, 1.2 spell_review.tpl, 1.2 compose.tpl, 1.2 debug.tpl, 1.2 error_report.tpl, 1.2 filters.tpl, 1.2 class_prefs_ui.tpl, 1.2 class_prefs_ex_accounts.tpl, 1.2 OLD-preferences.tpl, 1.2 addressbook.tpl, 1.2 class_prefs_blocks.tpl, 1.2 filters_blocks.tpl, 1.2 filters_list.tpl, 1.2 message_echo_dump.tpl, 1.2 message_printable.tpl, 1.2 search_form.tpl, 1.2 index_mlist.tpl, 1.2 index_main_b0_l2.tpl, 1.2 folder.tpl, 1.2 index_blocks.tpl, 1.2 index_main_b0_l1.tpl, 1.2
- Index(es):