mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
remove obsolete files
This commit is contained in:
parent
bf943fdce0
commit
f67b3cb853
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
error_reporting (8);
|
||||
|
||||
/* Any initializations that need to be done */
|
||||
function db_init ()
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
$phpgw->db->Auto_Free = 0;
|
||||
}
|
||||
|
||||
/* General SQL query */
|
||||
function db_query ($query)
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
return $phpgw->db->query ($query);
|
||||
}
|
||||
|
||||
/* Fetch next array for $query_id */
|
||||
function db_fetch_array ($query_id)
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
// $phpgw->db->Query_ID = $query_id;
|
||||
$phpgw->db->next_record ();
|
||||
return $phpgw->db->Record;
|
||||
}
|
||||
|
||||
/*
|
||||
General wrapper for all other db calls
|
||||
Calls in here are simply returned, so not all will work
|
||||
*/
|
||||
function db_call ($function, $query_id)
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
// $phpgw->db->Query_ID = $query_id;
|
||||
return $phpgw->db->$function ();
|
||||
}
|
||||
|
||||
?>
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
require (PHPGW_APP_INC . '/main.inc.php');
|
||||
|
||||
?>
|
@ -1,545 +0,0 @@
|
||||
<?php
|
||||
|
||||
function html_form_begin ($action, $method = 'post', $enctype = NULL, $string = HTML_FORM_BEGIN_STRING, $return = 0)
|
||||
{
|
||||
$action = string_encode ($action, 1);
|
||||
$action = SEP . $action;
|
||||
$text = 'action="'.html_link ($action, NULL, 1, 0, 1).'"';
|
||||
|
||||
if ($method == NULL)
|
||||
{
|
||||
$method = 'post';
|
||||
}
|
||||
$text .= ' method="'.$method.'"';
|
||||
|
||||
if ($enctype != NULL && $enctype)
|
||||
{
|
||||
$text .= ' enctype="'.$enctype.'"';
|
||||
}
|
||||
|
||||
$rstring = '<form '.$text.' '.$string.'>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_input ($type = NULL, $name = NULL, $value = NULL, $maxlength = NULL, $size = NULL, $checked = NULL, $string = HTML_FORM_INPUT_STRING, $return = 0)
|
||||
{
|
||||
$text = ' ';
|
||||
if ($type != NULL && $type)
|
||||
{
|
||||
if ($type == 'checkbox')
|
||||
{
|
||||
$value = string_encode ($value, 1);
|
||||
}
|
||||
$text .= 'type="'.$type.'" ';
|
||||
}
|
||||
if ($name != NULL && $name)
|
||||
{
|
||||
$text .= 'name="'.$name.'" ';
|
||||
}
|
||||
if ($value != NULL && $value)
|
||||
{
|
||||
$text .= 'value="'.$value.'" ';
|
||||
}
|
||||
if (is_int ($maxlength) && $maxlength >= 0)
|
||||
{
|
||||
$text .= 'maxlength="'.$maxlength.'" ';
|
||||
}
|
||||
if (is_int ($size) && $size >= 0)
|
||||
{
|
||||
$text .= 'size="'.$size.'" ';
|
||||
}
|
||||
if ($checked != NULL && $checked)
|
||||
{
|
||||
$text .= 'checked ';
|
||||
}
|
||||
|
||||
$rstring = '<input'.$text.$string.'>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_textarea ($name = NULL, $rows = NULL, $cols = NULL, $value = NULL, $string = HTML_FORM_TEXTAREA_STRING, $return = 0)
|
||||
{
|
||||
$text =' ';
|
||||
if ($name != NULL && $name)
|
||||
{
|
||||
$text .= 'name="'.$name.'" ';
|
||||
}
|
||||
if (is_int ($rows) && $rows >= 0)
|
||||
{
|
||||
$text .= 'rows="'.$rows.'" ';
|
||||
}
|
||||
if (is_int ($cols) && $cols >= 0)
|
||||
{
|
||||
$text .= 'cols="'.$cols.'" ';
|
||||
}
|
||||
$rstring = '<textarea'.$text.$string.'>'.$value.'</textarea>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_select_begin ($name = NULL, $return = 0)
|
||||
{
|
||||
$text = ' ';
|
||||
if ($name != NULL && $name)
|
||||
{
|
||||
$text .= 'name="'.$name.'" ';
|
||||
}
|
||||
$rstring = '<select'.$text.'>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_select_end ($return = 0)
|
||||
{
|
||||
$rstring = '</select>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_option ($value = NULL, $displayed = NULL, $selected = NULL, $return = 0)
|
||||
{
|
||||
$text = ' ';
|
||||
if ($value != NULL && $value)
|
||||
{
|
||||
$text .= ' value="'.$value.'" ';
|
||||
}
|
||||
if ($selected != NULL && $selected)
|
||||
{
|
||||
$text .= ' selected';
|
||||
}
|
||||
$rstring = '<option'.$text.'>'.$displayed.'</option>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_form_end ($return = 0)
|
||||
{
|
||||
$rstring = '</form>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_nbsp ($times = 1, $return = 0)
|
||||
{
|
||||
if ($times == NULL)
|
||||
{
|
||||
$times = 1;
|
||||
}
|
||||
for ($i = 0; $i != $times; $i++)
|
||||
{
|
||||
if ($return)
|
||||
{
|
||||
$rstring .= ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ' ';
|
||||
}
|
||||
}
|
||||
if ($return)
|
||||
{
|
||||
return ($rstring);
|
||||
}
|
||||
}
|
||||
|
||||
function html ($string, $times = 1, $return = 0)
|
||||
{
|
||||
for ($i = 0; $i != $times; $i++)
|
||||
{
|
||||
if ($return)
|
||||
{
|
||||
$rstring .= $string;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $string;
|
||||
}
|
||||
}
|
||||
if ($return)
|
||||
{
|
||||
return ($rstring);
|
||||
}
|
||||
}
|
||||
|
||||
function html_break ($break, $string = '', $return = 0)
|
||||
{
|
||||
switch($break)
|
||||
{
|
||||
case 1:
|
||||
$break_str = '<br>';
|
||||
break;
|
||||
case 2:
|
||||
$break_str = '<p>';
|
||||
break;
|
||||
case 5:
|
||||
$break_str = '<hr>';
|
||||
break;
|
||||
}
|
||||
return (eor ($break_str . $string, $return));
|
||||
}
|
||||
|
||||
function html_page_begin ($title = NULL, $return = 0)
|
||||
{
|
||||
// $rstring = HTML_PAGE_BEGIN_BEFORE_TITLE . $title . HTML_PAGE_BEGIN_AFTER_TITLE;
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_page_body_begin ($bgcolor = HTML_PAGE_BODY_COLOR, $background = NULL, $text = NULL, $link = NULL, $vlink = NULL, $alink = NULL, $string = HTML_PAGE_BODY_STRING, $return = 0)
|
||||
{
|
||||
$text_out = ' ';
|
||||
if ($bgcolor != NULL && $bgcolor)
|
||||
{
|
||||
$text_out .= 'bgcolor="'.$bgcolor.'" ';
|
||||
}
|
||||
if ($background != NULL && $background)
|
||||
{
|
||||
$text_out .= 'background="'.$background.'" ';
|
||||
}
|
||||
if ($text != NULL && $text)
|
||||
{
|
||||
$text_out .= 'text="'.$text.'" ';
|
||||
}
|
||||
if ($link != NULL && $link)
|
||||
{
|
||||
$text_out .= 'link="'.$link.'" ';
|
||||
}
|
||||
if ($vlink != NULL && $vlink)
|
||||
{
|
||||
$text_out .= 'vlink="'.$vlink.'" ';
|
||||
}
|
||||
if ($alink != NULL && $alink)
|
||||
{
|
||||
$text_out .= 'alink="'.$alink.'" ';
|
||||
}
|
||||
// $rstring = '<body'.$text_out.$string.'>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_page_body_end ($return = 0)
|
||||
{
|
||||
// $rstring = '</body>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_page_end ($return = 0)
|
||||
{
|
||||
// $rstring = '</html>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_page_close ()
|
||||
{
|
||||
// html_page_body_end ();
|
||||
// html_page_end ();
|
||||
$GLOBALS['phpgw']->common->phpgw_footer ();
|
||||
$GLOBALS['phpgw']->common->phpgw_exit ();
|
||||
}
|
||||
function html_text_bold ($text = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
if ($lang)
|
||||
{
|
||||
$text = translate ($text);
|
||||
}
|
||||
$rstring = '<b>'.$text.'</b>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_text_underline ($text = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
if ($lang)
|
||||
{
|
||||
$text = translate ($text);
|
||||
}
|
||||
$rstring = '<u>'.$text.'</u>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_text_italic ($text = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
if ($lang)
|
||||
{
|
||||
$text = translate ($text);
|
||||
}
|
||||
$rstring = '<i>'.$text.'</i>';
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_text_summary ($text = NULL, $size = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
if ($lang)
|
||||
{
|
||||
$text = translate ($text);
|
||||
}
|
||||
$rstring = html_break (1, NULL, $return);
|
||||
$rstring .= html_text_bold ($text, $return);
|
||||
$rstring .= html_nbsp (3, $return);
|
||||
if ($size != NULL && $size >= 0)
|
||||
$rstring .= borkb ($size, 1, $return);
|
||||
|
||||
$rstring = html_encode ($rstring, 1);
|
||||
|
||||
if ($return)
|
||||
{
|
||||
return ($rstring);
|
||||
}
|
||||
}
|
||||
|
||||
function html_text_summary_error ($text = NULL, $text2 = NULL, $size = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
if ($lang)
|
||||
{
|
||||
$text = translate ($lang);
|
||||
}
|
||||
$rstring = html_text_error ($text, 1, $return);
|
||||
|
||||
if (($text2 != NULL && $text2) || ($size != NULL && $size))
|
||||
{
|
||||
$rstring .= html_nbsp (3, $return);
|
||||
}
|
||||
if ($text2 != NULL && $text2)
|
||||
{
|
||||
$rstring .= html_text_error ($text2, NULL, $return);
|
||||
}
|
||||
if ($size != NULL && $size >= 0)
|
||||
{
|
||||
$rstring .= borkb ($size, 1, $return);
|
||||
}
|
||||
|
||||
if ($return)
|
||||
{
|
||||
return ($rstring);
|
||||
}
|
||||
}
|
||||
|
||||
function html_font_set ($size = NULL, $color = NULL, $family = NULL, $return = 0)
|
||||
{
|
||||
if ($size != NULL && $size)
|
||||
$size = "size=$size";
|
||||
if ($color != NULL && $color)
|
||||
$color = "color=$color";
|
||||
if ($family != NULL && $family)
|
||||
$family = "family=$family";
|
||||
|
||||
$rstring = "<font $size $color $family>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_font_end ($return = 0)
|
||||
{
|
||||
$rstring = "</font>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_text_error ($errorwas = NULL, $break = 1, $return = 0)
|
||||
{
|
||||
if ($break)
|
||||
$rstring .= html_break (1, NULL, 1);
|
||||
|
||||
$rstring .= html_font_set (NULL, HTML_TEXT_ERROR_COLOR, NULL, 1);
|
||||
$rstring .= html_text_bold (html_text_italic ($errorwas, 1), 1);
|
||||
$rstring .= html_font_end (1);
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_page_error ($errorwas = NULL, $title = "Error", $return = 0)
|
||||
{
|
||||
$rstring = html_page_begin ($title, $return);
|
||||
$rstring .= html_page_body_begin (HTML_PAGE_BODY_COLOR, $return);
|
||||
$rstring .= html_break (2, NULL, $return);
|
||||
$rstring .= html_text_error ($errorwas, $return);
|
||||
$rstring .= html_page_body_end ($return);
|
||||
$rstring .= html_page_end ($return);
|
||||
if (!$return)
|
||||
html_page_close ();
|
||||
else
|
||||
return ($rstring);
|
||||
}
|
||||
|
||||
function html_link ($href = NULL, $text = NULL, $return = 0, $encode = 1, $linkonly = 0, $target = NULL)
|
||||
{
|
||||
if ($encode)
|
||||
$href = string_encode ($href, 1);
|
||||
|
||||
###
|
||||
# This decodes / back to normal
|
||||
###
|
||||
$href = preg_replace ("/%2F/", "/", $href);
|
||||
$text = trim ($text);
|
||||
|
||||
/* Auto-detect and don't disturb absolute links */
|
||||
if (!preg_match ("|^http(.{0,1})://|", $href))
|
||||
{
|
||||
//Only add an extra / if there isn't already one there
|
||||
if (!($href[0] == SEP))
|
||||
{
|
||||
$href = SEP . $href;
|
||||
}
|
||||
|
||||
/* $phpgw->link requires that the extra vars be passed separately */
|
||||
$link_parts = explode ("?", $href);
|
||||
$address = $GLOBALS['phpgw']->link ($link_parts[0], $link_parts[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$address = $href;
|
||||
}
|
||||
|
||||
/* If $linkonly is set, don't add any HTML */
|
||||
if ($linkonly)
|
||||
{
|
||||
$rstring = $address;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($target)
|
||||
{
|
||||
$target = 'target='.$target;
|
||||
}
|
||||
|
||||
$rstring = '<a href="'.$address.'" '.$target.'>'.$text.'</a>';
|
||||
}
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_link_back ($return = 0)
|
||||
{
|
||||
global $path;
|
||||
|
||||
$rstring .= html_link ($GLOBALS['appname'].'/index.php?path='.$path, HTML_TEXT_NAVIGATION_BACK_TO_USER, 1);
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $cellpadding = NULL, $rules = NULL, $string = HTML_TABLE_BEGIN_STRING, $return = 0)
|
||||
{
|
||||
if ($width != NULL && $width)
|
||||
$width = "width=$width";
|
||||
if (is_int ($border) && $border >= 0)
|
||||
$border = "border=$border";
|
||||
if (is_int ($cellspacing) && $cellspacing >= 0)
|
||||
$cellspacing = "cellspacing=$cellspacing";
|
||||
if (is_int ($cellpadding) && $cellpadding >= 0)
|
||||
$cellpadding = "cellpadding=$cellpadding";
|
||||
if ($rules != NULL && $rules)
|
||||
$rules = "rules=$rules";
|
||||
|
||||
$rstring = "<table $width $border $cellspacing $cellpadding $rules $string>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_link_email ($address = NULL, $text = NULL, $return = 0, $encode = 1)
|
||||
{
|
||||
if ($encode)
|
||||
$href = string_encode ($href, 1);
|
||||
|
||||
$rstring = "<a href=mailto:$address>$text</a>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_end ($return = 0)
|
||||
{
|
||||
$rstring = "</table>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_row_begin ($align = NULL, $halign = NULL, $valign = NULL, $bgcolor = NULL, $string = HTML_TABLE_ROW_BEGIN_STRING, $return = 0)
|
||||
{
|
||||
if ($align != NULL && $align)
|
||||
$align = "align=$align";
|
||||
if ($halign != NULL && $halign)
|
||||
$halign = "halign=$halign";
|
||||
if ($valign != NULL && $valign)
|
||||
$valign = "valign=$valign";
|
||||
if ($bgcolor != NULL && $bgcolor)
|
||||
$bgcolor = "bgcolor=$bgcolor";
|
||||
$rstring = "<tr $align $halign $valign $bgcolor $string>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_row_end ($return = 0)
|
||||
{
|
||||
$rstring = "</tr>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_col_begin ($align = NULL, $halign = NULL, $valign = NULL, $rowspan = NULL, $colspan = NULL, $string = HTML_TABLE_COL_BEGIN_STRING, $return = 0)
|
||||
{
|
||||
if ($align != NULL && $align)
|
||||
$align = "align=$align";
|
||||
if ($halign != NULL && $halign)
|
||||
$halign = "halign=$halign";
|
||||
if ($valign != NULL && $valign)
|
||||
$valign = "valign=$valign";
|
||||
if (is_int ($rowspan) && $rowspan >= 0)
|
||||
$rowspan = "rowspan=$rowspan";
|
||||
if (is_int ($colspan) && $colspan >= 0)
|
||||
$colspan = "colspan=$colspan";
|
||||
|
||||
$rstring = "<td $align $halign $valign $rowspan $colspan $string>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_col_end ($return = 0)
|
||||
{
|
||||
$rstring = "</td>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_text ($string, $times = 1, $return = 0, $lang = 0)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
if ($lang)
|
||||
$string = translate ($string);
|
||||
|
||||
if ($times == NULL)
|
||||
$times = 1;
|
||||
for ($i = 0; $i != $times; $i++)
|
||||
{
|
||||
if ($return)
|
||||
$rstring .= $string;
|
||||
else
|
||||
echo $string;
|
||||
}
|
||||
if ($return)
|
||||
return ($rstring);
|
||||
}
|
||||
|
||||
function html_text_header ($size = 1, $string = NULL, $return = 0, $lang = 0)
|
||||
{
|
||||
$rstring = "<h$size>$string</h$size>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_align ($align = NULL, $string = HTML_ALIGN_MAIN_STRING, $return = 0)
|
||||
{
|
||||
$rstring = "<p align=$align $string>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_image ($src = NULL, $alt = NULL, $align = NULL, $border = NULL, $string = HTML_IMAGE_MAIN_STRING, $return = 0)
|
||||
{
|
||||
if ($src != NULL && $src)
|
||||
$src = "src=$src";
|
||||
if ($alt != NULL && $alt)
|
||||
$alt = "alt=\"$alt\"";
|
||||
if ($align != NULL && $align)
|
||||
$align = "align=$align";
|
||||
if (is_int ($border) && $border >= 0)
|
||||
$border = "border=$border";
|
||||
$rstring = "<img $src $alt $align $border $string>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_help_link ($help_name = NULL, $text = "[?]", $target = "_new", $return = 0)
|
||||
{
|
||||
global $settings;
|
||||
global $appname;
|
||||
|
||||
if (!$settings["show_help"])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$rstring = html_link ("$appname/index.php?op=help&help_name=$help_name", $text, True, 1, 0, $target);
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
?>
|
@ -1,271 +0,0 @@
|
||||
<?php
|
||||
|
||||
error_reporting (4);
|
||||
|
||||
if (@!is_object($GLOBALS['phpgw']->vfs))
|
||||
{
|
||||
$GLOBALS['phpgw']->vfs = CreateObject ('phpgwapi.vfs');
|
||||
}
|
||||
|
||||
### Start Configuration Options ###
|
||||
### These are automatically set in phpGW - do not edit ###
|
||||
|
||||
$sep = SEP;
|
||||
$GLOBALS['rootdir'] = $GLOBALS['phpgw']->vfs->basedir;
|
||||
$GLOBALS['fakebase'] = $GLOBALS['phpgw']->vfs->fakebase;
|
||||
$GLOBALS['appname'] = $GLOBALS['phpgw_info']['flags']['currentapp'];
|
||||
$GLOBALS['settings'] = $GLOBALS['phpgw_info']['user']['preferences'][$appname];
|
||||
|
||||
if (stristr ($GLOBALS['rootdir'], PHPGW_SERVER_ROOT))
|
||||
{
|
||||
$GLOBALS['filesdir'] = substr ($GLOBALS['rootdir'], strlen (PHPGW_SERVER_ROOT));
|
||||
}
|
||||
else
|
||||
{
|
||||
unset ($GLOBALS['filesdir']);
|
||||
}
|
||||
|
||||
$GLOBALS['hostname'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . $GLOBALS['filesdir'];
|
||||
|
||||
###
|
||||
# Note that $userinfo["username"] is actually the id number, not the login name
|
||||
###
|
||||
|
||||
$GLOBALS['userinfo']['username'] = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||
$GLOBALS['userinfo']['account_lid'] = $GLOBALS['phpgw']->accounts->id2name ($GLOBALS['userinfo']['username']);
|
||||
$GLOBALS['userinfo']['hdspace'] = 10000000000;
|
||||
$GLOBALS['homedir'] = $GLOBALS['fakebase'].'/'.$GLOBALS['userinfo']['account_lid'];
|
||||
|
||||
### End Configuration Options ###
|
||||
|
||||
if (!defined ('NULL'))
|
||||
{
|
||||
define ('NULL', '');
|
||||
}
|
||||
|
||||
require (PHPGW_APP_INC . '/db.inc.php');
|
||||
|
||||
/* Set up any initial db settings */
|
||||
db_init ();
|
||||
|
||||
###
|
||||
# Get user settings from database
|
||||
###
|
||||
|
||||
/* We have to define these by hand in phpGW, or rely on it's templates */
|
||||
|
||||
define ('HTML_TABLE_FILES_HEADER_BG_COLOR', '');
|
||||
define ('HTML_TABLE_FILES_HEADER_TEXT_COLOR', 'maroon');
|
||||
define ('HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR', '#cccccc');
|
||||
define ('HTML_TABLE_FILES_COLUMN_HEADER_TEXT_COLOR', '#000000');
|
||||
define ('HTML_TABLE_FILES_BG_COLOR', '#dedede');
|
||||
define ('HTML_TABLE_FILES_TEXT_COLOR', 'maroon');
|
||||
define ('HTML_TEXT_ERROR_COLOR', 'red');
|
||||
define ('HTML_TEXT_NAVIGATION_BACK_TO_USER', lang('Back to file manager'));
|
||||
|
||||
###
|
||||
# Need to include this here so they recognize the settings
|
||||
###
|
||||
|
||||
require (PHPGW_APP_INC . '/html.inc.php');
|
||||
|
||||
###
|
||||
# Define the list of file attributes. Format is "internal_name" => "Displayed name"
|
||||
# This is used both by internally and externally for things like preferences
|
||||
###
|
||||
|
||||
$file_attributes = Array(
|
||||
'name' => lang('File Name'),
|
||||
'mime_type' => lang('MIME Type'),
|
||||
'size' => lang('Size'),
|
||||
'created' => lang('Created'),
|
||||
'modified' => lang('Modified'),
|
||||
'owner' => lang('Owner'),
|
||||
'createdby_id' => lang('Created by'),
|
||||
'modifiedby_id' => lang('Created by'),
|
||||
'modifiedby_id' => lang('Modified by'),
|
||||
'app' => lang('Application'),
|
||||
'comment' => lang('Comment'),
|
||||
'version' => lang('Version')
|
||||
);
|
||||
|
||||
###
|
||||
# Calculate and display B or KB
|
||||
# And yes, that first if is strange,
|
||||
# but it does do something
|
||||
###
|
||||
|
||||
function borkb ($size, $enclosed = NULL, $return = 0)
|
||||
{
|
||||
if (!$size)
|
||||
$size = 0;
|
||||
|
||||
if ($enclosed)
|
||||
{
|
||||
$left = '(';
|
||||
$right = ')';
|
||||
}
|
||||
|
||||
if ($size < 1024)
|
||||
$rstring = $left . $size . 'B' . $right;
|
||||
else
|
||||
$rstring = $left . round($size/1024) . 'KB' . $right;
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
###
|
||||
# Check for and return the first unwanted character
|
||||
###
|
||||
|
||||
function bad_chars ($string, $all = True, $return = 0)
|
||||
{
|
||||
if ($all)
|
||||
{
|
||||
if (preg_match("-([\\/<>\'\"\&])-", $string, $badchars))
|
||||
$rstring = $badchars[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (preg_match("-([\\/<>])-", $string, $badchars))
|
||||
$rstring = $badchars[1];
|
||||
}
|
||||
|
||||
return trim ((eor ($rstring, $return)));
|
||||
}
|
||||
|
||||
###
|
||||
# Match character in string using ord ().
|
||||
###
|
||||
|
||||
function ord_match ($string, $charnum)
|
||||
{
|
||||
for ($i = 0; $i < strlen ($string); $i++)
|
||||
{
|
||||
$character = ord (substr ($string, $i, 1));
|
||||
|
||||
if ($character == $charnum)
|
||||
{
|
||||
return True;
|
||||
}
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
###
|
||||
# Decide whether to echo or return. Used by HTML functions
|
||||
###
|
||||
|
||||
function eor ($rstring, $return)
|
||||
{
|
||||
if ($return)
|
||||
return ($rstring);
|
||||
else
|
||||
{
|
||||
html_text ($rstring . "\n");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
# URL encode a string
|
||||
# First check if its a query string, then if its just a URL, then just encodes it all
|
||||
# Note: this is a hack. It was made to work with form actions, form values, and links only,
|
||||
# but should be able to handle any normal query string or URL
|
||||
###
|
||||
|
||||
function string_encode ($string, $return = False)
|
||||
{
|
||||
if (preg_match ("/=(.*)(&|$)/U", $string))
|
||||
{
|
||||
$rstring = $string;
|
||||
|
||||
preg_match_all ("/=(.*)(&|$)/U", $string, $matches, PREG_SET_ORDER);
|
||||
|
||||
reset ($matches);
|
||||
while (list (,$match_array) = each ($matches))
|
||||
{
|
||||
$var_encoded = rawurlencode (base64_encode ($match_array[1]));
|
||||
$rstring = str_replace ($match_array[0], '=' . $var_encoded . $match_array[2], $rstring);
|
||||
}
|
||||
}
|
||||
elseif (ereg ('^'.$GLOBALS['hostname'], $string))
|
||||
{
|
||||
$rstring = ereg_replace ('^'.$GLOBALS['hostname'].'/', '', $string);
|
||||
$rstring = preg_replace ("/(.*)(\/|$)/Ue", "rawurlencode (base64_encode ('\\1')) . '\\2'", $rstring);
|
||||
$rstring = $GLOBALS['hostname'].'/'.$rstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rstring = rawurlencode ($string);
|
||||
|
||||
/* Terrible hack, decodes all /'s back to normal */
|
||||
$rstring = preg_replace ("/%2F/", '/', $rstring);
|
||||
}
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function string_decode ($string, $return = False)
|
||||
{
|
||||
$rstring = rawurldecode ($string);
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
###
|
||||
# HTML encode a string
|
||||
# This should be used with anything in an HTML tag that might contain < or >
|
||||
###
|
||||
|
||||
function html_encode ($string, $return)
|
||||
{
|
||||
$rstring = htmlspecialchars ($string);
|
||||
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function translate ($text)
|
||||
{
|
||||
return ($GLOBALS['phpgw']->lang($text));
|
||||
}
|
||||
|
||||
$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].")
|
||||
);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user