This commit is contained in:
Miles Lott 2001-10-02 03:52:56 +00:00
parent d29853b027
commit a77fd203f3
2 changed files with 28 additions and 37 deletions

View File

@ -91,8 +91,6 @@
*/ */
function return_array($type,$start,$limit = True,$query = '',$sort = '',$order = '',$public = False, $parent_id = '') function return_array($type,$start,$limit = True,$query = '',$sort = '',$order = '',$public = False, $parent_id = '')
{ {
global $phpgw, $phpgw_info;
if ($public) if ($public)
{ {
$public_cats = " OR cat_appname='phpgw' "; $public_cats = " OR cat_appname='phpgw' ";
@ -208,21 +206,19 @@
*/ */
function categories($accountid = '',$app_name = '') function categories($accountid = '',$app_name = '')
{ {
global $phpgw, $phpgw_info;
$account_id = get_account_id($accountid); $account_id = get_account_id($accountid);
if (! $app_name) if (! $app_name)
{ {
$app_name = $phpgw_info['flags']['currentapp']; $app_name = $GLOBALS['phpgw_info']['flags']['currentapp'];
} }
$this->account_id = $account_id; $this->account_id = $account_id;
$this->app_name = $app_name; $this->app_name = $app_name;
$this->db = $phpgw->db; $this->db = $GLOBALS['phpgw']->db;
$this->db2 = $this->db; $this->db2 = $this->db;
$this->total_records = $this->db2->num_rows(); $this->total_records = $this->db2->num_rows();
$this->grants = $phpgw->acl->get_grants($app_name); $this->grants = $GLOBALS['phpgw']->acl->get_grants($app_name);
$this->cats = $this->return_array($type,$start,$limit,$query,$sort,$order,$public); $this->cats = $this->return_array($type,$start,$limit,$query,$sort,$order,$public);
} }
@ -253,7 +249,6 @@
*/ */
function formated_list($format,$type,$selected = '',$public = False,$site_link = 'site') function formated_list($format,$type,$selected = '',$public = False,$site_link = 'site')
{ {
global $phpgw;
$filter = $this->filter($type); $filter = $this->filter($type);
if (!is_array($selected)) if (!is_array($selected))
@ -272,7 +267,7 @@
{ {
$s .= ' selected'; $s .= ' selected';
} }
$s .= '>' . $phpgw->strip_html($cats[$i]['name']); $s .= '>' . $GLOBALS['phpgw']->strip_html($cats[$i]['name']);
if ($cats[$i]['app_name'] == 'phpgw') if ($cats[$i]['app_name'] == 'phpgw')
{ {
$s .= '<' . lang('Global') . '>'; $s .= '<' . lang('Global') . '>';
@ -312,7 +307,7 @@
$s .= '<tr>' . "\n"; $s .= '<tr>' . "\n";
$s .= '<td width="8">' . $image_set . '</td>' . "\n"; $s .= '<td width="8">' . $image_set . '</td>' . "\n";
$s .= '<td>' . $space_set . '<a href="' . $phpgw->link($site_link,'cat_id=' . $cats[$i]['id']) . '">' . $phpgw->strip_html($cats[$i]['name']) $s .= '<td>' . $space_set . '<a href="' . $GLOBALS['phpgw']->link($site_link,'cat_id=' . $cats[$i]['id']) . '">' . $GLOBALS['phpgw']->strip_html($cats[$i]['name'])
. '</a></td>' . "\n"; . '</a></td>' . "\n";
$s .= '</tr>' . "\n"; $s .= '</tr>' . "\n";
} }

View File

@ -49,8 +49,7 @@
*/ */
function preferences($account_id = '') function preferences($account_id = '')
{ {
global $phpgw, $phpgw_info; $this->db = $GLOBALS['phpgw']->db;
$this->db = $phpgw->db;
$this->account_id = get_account_id($account_id); $this->account_id = get_account_id($account_id);
} }
@ -166,10 +165,8 @@
*/ */
function save_repository($update_session_info = False) function save_repository($update_session_info = False)
{ {
global $phpgw, $phpgw_info;
$temp_data = $this->data; $temp_data = $this->data;
if (! $phpgw->acl->check('session_only_preferences',1,'preferences')) if (! $GLOBALS['phpgw']->acl->check('session_only_preferences',1,'preferences'))
{ {
$this->db->transaction_begin(); $this->db->transaction_begin();
$this->db->query("delete from phpgw_preferences where preference_owner='" . $this->account_id $this->db->query("delete from phpgw_preferences where preference_owner='" . $this->account_id
@ -190,13 +187,13 @@
} }
else else
{ {
$phpgw_info['user']['preferences'] = $this->data; $GLOBALS['phpgw_info']['user']['preferences'] = $this->data;
$phpgw->session->save_repositories(); $GLOBALS['phpgw']->session->save_repositories();
} }
if ($phpgw_info['server']['cache_phpgw_info'] && $this->account_id == $phpgw_info['user']['account_id']) if ($GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $this->account_id == $GLOBALS['phpgw_info']['user']['account_id'])
{ {
$phpgw->session->read_repositories(False); $GLOBALS['phpgw']->session->read_repositories(False);
} }
return $temp_data; return $temp_data;
@ -238,50 +235,49 @@
*/ */
function verify_basic_settings() function verify_basic_settings()
{ {
global $phpgw, $phpgw_info; if (gettype($GLOBALS['phpgw_info']['user']['preferences']) != 'array')
if (gettype($phpgw_info['user']['preferences']) != 'array')
{ {
$phpgw_info['user']['preferences'] = array(); $GLOBALS['phpgw_info']['user']['preferences'] = array();
} }
/* This takes care of new users who dont have proper default prefs setup */ /* This takes care of new users who dont have proper default prefs setup */
if (!isset($phpgw_info['flags']['nocommon_preferences']) || if (!isset($GLOBALS['phpgw_info']['flags']['nocommon_preferences']) ||
!$phpgw_info['flags']['nocommon_preferences']) !$GLOBALS['phpgw_info']['flags']['nocommon_preferences'])
{ {
$preferences_update = False; $preferences_update = False;
if (!isset($phpgw_info['user']['preferences']['common']['maxmatchs']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) ||
!$phpgw_info['user']['preferences']['common']['maxmatchs']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'])
{ {
$this->add('common','maxmatchs',15); $this->add('common','maxmatchs',15);
$preferences_update = True; $preferences_update = True;
} }
if (!isset($phpgw_info['user']['preferences']['common']['theme']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['theme']) ||
!$phpgw_info['user']['preferences']['common']['theme']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'])
{ {
$this->add('common','theme','default'); $this->add('common','theme','default');
$preferences_update = True; $preferences_update = True;
} }
if (!isset($phpgw_info['user']['preferences']['common']['template_set']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']) ||
!$phpgw_info['user']['preferences']['common']['template_set']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
{ {
$this->add('common','template_set','default'); $this->add('common','template_set','default');
$preferences_update = True; $preferences_update = True;
} }
if (!isset($phpgw_info['user']['preferences']['common']['dateformat']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']) ||
!$phpgw_info['user']['preferences']['common']['dateformat']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
{ {
$this->add('common','dateformat','m/d/Y'); $this->add('common','dateformat','m/d/Y');
$preferences_update = True; $preferences_update = True;
} }
if (!isset($phpgw_info['user']['preferences']['common']['timeformat']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat']) ||
!$phpgw_info['user']['preferences']['common']['timeformat']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'])
{ {
$this->add('common','timeformat',12); $this->add('common','timeformat',12);
$preferences_update = True; $preferences_update = True;
} }
if (!isset($phpgw_info['user']['preferences']['common']['lang']) || if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) ||
!$phpgw_info['user']['preferences']['common']['lang']) !$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
{ {
$this->add('common','lang',$phpgw->common->getPreferredLanguage()); $this->add('common','lang',$GLOBALS['phpgw']->common->getPreferredLanguage());
$preferences_update = True; $preferences_update = True;
} }
if ($preferences_update) if ($preferences_update)