[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] bookmarks/inc class.ui.inc.php,1.1.2.15
From: |
skwashd |
Subject: |
[Phpgroupware-cvs] bookmarks/inc class.ui.inc.php,1.1.2.15 |
Date: |
Fri, 3 Jun 2005 01:50:00 +0200 |
Update of bookmarks/inc
Modified Files:
Branch: Version-0_9_16-branch
class.ui.inc.php lines: +65 -35
Log Message:
fix link()s and while()s
====================================================
Index: bookmarks/inc/class.ui.inc.php
diff -u bookmarks/inc/class.ui.inc.php:1.1.2.14
bookmarks/inc/class.ui.inc.php:1.1.2.15
--- bookmarks/inc/class.ui.inc.php:1.1.2.14 Sat Nov 6 16:13:48 2004
+++ bookmarks/inc/class.ui.inc.php Thu Jun 2 23:50:06 2005
@@ -89,21 +89,21 @@
function app_header($where=0)
{
$tabs[1]['label'] = lang('Tree view');
- $tabs[1]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.tree');
+ $tabs[1]['link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.tree') );
$tabs[2]['label'] = lang('List');
- $tabs[2]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui._list');
+ $tabs[2]['link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui._list') );
if (!
$GLOBALS['phpgw']->acl->check('anonymous',1,'bookmarks'))
{
$tabs[3]['label'] = lang('New');
- $tabs[3]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.create');
+ $tabs[3]['link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.create') );
}
$tabs[4]['label'] = lang('Search');
- $tabs[4]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.search');
+ $tabs[4]['link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.search') );
-
$this->t->set_var('app_navbar',$GLOBALS['phpgw']->common->create_tabs($tabs,$where));
+
$this->t->set_var('app_navbar',$GLOBALS['phpgw']->common->create_tabs($tabs,
$where));
}
function app_messages()
@@ -157,7 +157,13 @@
if ($_POST['edit_category_x'] ||
$_POST['edit_category_y'])
{
$this->bo->grab_form_values($this->location_info['returnto'],'create',$_POST['bookmark']);
-
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=bookmarks&global_cats=True'));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
+ array
+ (
+ 'menuaction'
=> 'preferences.uicategories.index',
+ 'cats_app'
=> 'bookmarks',
+ 'global_cats'
=> True
+ ));
}
//save bookmark
if ($_POST['save_x'] || $_POST['save_y'])
@@ -276,7 +282,13 @@
if ($_POST['edit_category_x'] ||
$_POST['edit_category_y'])
{
$this->bo->grab_form_values($this->location_info['returnto'],'edit',$_POST['bookmark']);
-
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=bookmarks&global_cats=True'));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
+ array
+ (
+ 'menuaction'
=> 'preferences.uicategories.index',
+ 'cats_app'
=> 'bookmarks',
+ 'global_cats'
=> True
+ ));
}
//save bookmark and go to view interface
if ($_POST['save_x'] || $_POST['save_y'])
@@ -356,7 +368,7 @@
$this->t->parse('info','form_info');
$this->t->set_var(array(
'form_info' => '',
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.edit&bm_id=' .
$bm_id),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.edit', 'bm_id' => $bm_id) ),
'lang_access' => lang('Private'),
'input_access' => ('<input type="checkbox"
name="bookmark[access]" value="private"' .
($bookmark['access']=='private'?'
checked':'') . '>'
@@ -450,7 +462,7 @@
$total_matchs .= ' ' .
lang('from category
%1',$GLOBALS['phpgw']->strip_html($this->bo->categories->id2name($bm_cat))) .
' - <a href="' .
-
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui._list&bm_cat=0&start=0')
.
+ $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'bookmarks.ui._list', 'bm_cat' => 0, 'start' => 0) ) .
'">' .
lang('All bookmarks') .
'</a>';
@@ -521,7 +533,7 @@
$noquery = "1=0";
# build the where clause based on user entered fields
- if (isset($x))
+ if ( isset($x) && is_array($x) )
{
#
# we need to pre-process the input fields so we
can
@@ -529,7 +541,7 @@
# on the resulting sql because the sql_query
object
# doesn't do the quotes correctly
reset($x);
- while (list($key, $value) = each ($x))
+ foreach ($x as $key => $value)
{
$y[$key] = addslashes($value);
}
@@ -538,11 +550,12 @@
$this->t->set_var(array(
'SEARCH_SELECT' => $search_select,
- 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.search')
+ 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.search') )
));
# build the search form
- $this->t->set_var(QUERY_FORM, $q->form("x", $field,
"qry", $GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.search')));
+ $this->t->set_var(QUERY_FORM, $q->form("x", $field,
"qry", $GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.search') ) ) );
if ($q->query == $noquery)
{
@@ -634,7 +647,7 @@
$this->t->set_block('list','page_header');
$this->t->set_block('list','page_footer');
-
$this->t->set_var('list_mass_select_form',$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.mass'));
+
$this->t->set_var('list_mass_select_form',$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'bookmarks.ui.mass') ) );
if (! $page_header_shown)
{
@@ -651,7 +664,12 @@
$prev_category_id = -1;
$rows_printed = 0;
- while (list($bm_id,$bookmark) = @each($bm_list))
+ if( !is_array($bm_list) )
+ {
+ $bm_list = array();
+ }
+
+ foreach($bm_list as $bm_id => $bookmark)
{
$rows_printed++;
@@ -677,7 +695,7 @@
// Check owner
if
($this->bo->check_perms2($bookmark['owner'],$bookmark['access'],PHPGW_ACL_EDIT))
{
- $maintain_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.edit&bm_id=' .
$bm_id);
+ $maintain_url =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.edit', 'bm_id' => $bm_id) );
$maintain_link = sprintf(
'<a href="%s"><img src="%s" align="top"
border="0" alt="%s"></a>',
$maintain_url,
@@ -690,7 +708,7 @@
$maintain_link = '';
}
- $view_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.view&bm_id=' .
$bm_id);
+ $view_url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'bookmarks.ui.view', 'bm_id' => $bm_id) );
$view_link = sprintf(
'<a href="%s"><img src="%s" align="top"
border="0" alt="%s"></a>',
$view_url,
@@ -700,14 +718,15 @@
$mail_link = sprintf(
'<a href="%s"><img align="top" border="0"
src="%s" alt="%s"></a>',
-
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.mail&bm_id='.$bm_id),
+ $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'bookmarks.ui.mail', 'bm_id' => $bm_id) ),
$this->img['mail'],
lang('Mail this bookmark')
);
$this->t->set_var(array(
'maintain_link' => $maintain_link,
- 'bookmark_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.redirect&bm_id='.$bm_id),
+ 'bookmark_url' =>
$GLOBALS['phpgw']->link('/index.php',
+ array('menuaction' =>
'bookmarks.ui.redirect', 'bm_id' => $bm_id) ),
'view_link' => $view_link,
'mail_link' => $mail_link,
'checkbox' => '<input type="checkbox"
name="item_cb[]" value="' . $bm_id . '">',
@@ -805,7 +824,7 @@
function showcat($cats)
{
- while(list(,$cat) = @each($cats))
+ foreach($cats as $dogs => $cats) // :P
{
$cat_id = $cat['id'];
$status = in_array($cat_id,$this->expandedcats);
@@ -818,7 +837,13 @@
'\')"></td><td><a
style="font-weight:bold" title="' .
$GLOBALS['phpgw']->strip_html($cat['description']) .
'" href="' .
-
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui._list&start=0&bm_cat='
. $cat_id) .
+ $GLOBALS['phpgw']->link('/index.php',
+ array
+ (
+
'menuaction' => 'bookmarks.ui._list',
+ 'start'
=> 0,
+
'bm_cat' => $cat_id
+ ) ) .
'">' .
$GLOBALS['phpgw']->strip_html($cat['name']) .
'</a></td></tr>' .
@@ -833,12 +858,13 @@
$cat_id .
'">';
- while(list($bm_id,$bookmark) =
@each($bookmarks))
+ foreach ( $bookmarks as $bm_id =>
$bookmark )
{
$tree .= '<tr><td colspan="2">';
if
($this->bo->check_perms2($bookmark['owner'],$bookmark['access'],PHPGW_ACL_EDIT))
{
- $maintain_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.edit&bm_id=' .
$bm_id);
+ $maintain_url =
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.edit', 'bm_id' => $bm_id) );
$maintain_link =
sprintf(
'<a
href="%s"><img src="%s" align="top" border="0" alt="%s"></a>',
$maintain_url,
@@ -851,7 +877,8 @@
$maintain_link = '';
}
- $view_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.view&bm_id=' .
$bm_id);
+ $view_url =
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.view', 'bm_id' => $bm_id) );
$view_link = sprintf(
'<a href="%s"><img
src="%s" align="top" border="0" alt="%s"></a>',
$view_url,
@@ -860,7 +887,8 @@
);
$redirect_link = '<a href="' .
-
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.redirect&bm_id='.$bm_id)
.
+
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.redirect', 'bm_id' => $bm_id) ) .
'" target="_new">' .
$bookmark['name'] . '</a>';
$tree .= $maintain_link .
$view_link . $redirect_link .
@@ -950,11 +978,13 @@
$this->t->parse('info','form_info');
$this->t->set_var(array(
'form_info' => '',
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.view&bm_id=' .
$bm_id),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.view', 'bm_id' => $bm_id) ),
'lang_access' => lang('Access'),
'input_access' => lang($bookmark['access']),
'lang_header' => lang('View bookmark'),
- 'input_url' => ('<a href="' .
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.redirect&bm_id='.$bm_id)
.
+ 'input_url' => ('<a href="' .
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'bookmarks.ui.redirect', 'bm_id' => $bm_id) ).
'" target="_new">' . $bookmark['url'] .
'</a>'
),
'input_name' => $bookmark['name'],
@@ -1015,7 +1045,7 @@
// separated by commas. Check each one
for proper format.
$to_array = explode(",", $to);
- while (list($key, $val) =
each($to_array))
+ foreach ( $to_array as $key => $val)
{
// Is email address in the
proper format?
if (!$validate->is_email($val))
@@ -1056,7 +1086,7 @@
{
if (is_array($_POST['item_cb']))
{
- while (list(,$id) =
each($_POST['item_cb']))
+ foreach($_POST['item_cb'] as $crap =>
$id)
{
$bookmark =
$this->bo->read($id);
$links[] = array(
@@ -1074,7 +1104,7 @@
);
}
$message = lang('I thought you would be
interested in the following link(s):')."\n";
- while (list(,$link) = @each($links))
+ foreach($links as $crap => $link)
{
$message .= sprintf("%s -
%s\n",$link['name'],$link['url']);
}
@@ -1090,7 +1120,7 @@
'lang_message' => lang('Message'),
'lang_send' => lang('Send'),
'from_name' =>
$GLOBALS['phpgw']->common->display_fullname(),
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.mail'),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.mail') ),
'to' => $to,
'subject' => $subject,
'message' => $message
@@ -1108,7 +1138,7 @@
if (is_array($item_cb))
{
$i = 0;
- while (list(,$id) = each($item_cb))
+ foreach($item_cb as $crap => $id)
{
if ($this->bo->delete($id))
{
@@ -1160,7 +1190,7 @@
echo parse_navbar();
$this->t->set_file('body','export.body.tpl');
$this->t->set_var(Array(
- 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.export'),
+ 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.export') ),
'input_categories' =>
$this->bo->categories_list(0,True)
));
$this->t->pfp('out','body');
@@ -1179,7 +1209,7 @@
echo parse_navbar();
$this->t->set_file('body','import.body.tpl');
$this->t->set_var(Array(
- 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=bookmarks.ui.import'),
+ 'FORM_ACTION' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'bookmarks.ui.import') ),
'lang_name' => lang('Enter the name of the
Netscape bookmark file<br />that you want imported into bookmarker below.'),
'lang_file' => lang('Netscape Bookmark File'),
'lang_import_button' => lang('Import
Bookmarks'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] bookmarks/inc class.ui.inc.php,1.1.2.15,
skwashd <=