| 1 |
<?php |
<?php |
| 2 |
// $Id: bookmarks.module,v 1.47.2.4 2009/01/20 15:02:42 darthclue Exp $ |
// $Id: bookmarks.module,v 1.47.2.7 2009/03/17 12:27:52 darthclue Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 233 |
$block[0]["info"] = t("Bookmarks"); |
$block[0]["info"] = t("Bookmarks"); |
| 234 |
return $block; |
return $block; |
| 235 |
} |
} |
| 236 |
else if ($op == 'view') { |
else if ($op == 'view' && user_access('administer own bookmarks')) { |
| 237 |
foreach ($menus as $name => $title) { |
foreach ($menus as $name => $title) { |
| 238 |
// Menu blocks can't be cached because each menu item can have |
// Menu blocks can't be cached because each menu item can have |
| 239 |
// a custom access callback. menu.inc manages its own caching. |
// a custom access callback. menu.inc manages its own caching. |
| 291 |
// Add admin options to bottom of block. |
// Add admin options to bottom of block. |
| 292 |
$block['content'] .= '<div style="text-align:center;">'; |
$block['content'] .= '<div style="text-align:center;">'; |
| 293 |
$path = drupal_urlencode(drupal_get_normal_path(drupal_get_path_alias($_GET['q']))); |
$path = drupal_urlencode(drupal_get_normal_path(drupal_get_path_alias($_GET['q']))); |
| 294 |
|
$query_variables = $_GET; |
| 295 |
|
unset($query_variables['q']); |
| 296 |
|
$query_string = ''; |
| 297 |
|
foreach ($query_variables as $key => $value) { |
| 298 |
|
$query_string .= '&' . $key . '=' . $value; |
| 299 |
|
} |
| 300 |
|
|
| 301 |
if (!empty($path)) { |
if (!empty($path)) { |
| 302 |
$block['content'] .= l(t('Add this page'), 'bookmarks/item/addpage/'. $path); |
if (!empty($query_string)) { |
| 303 |
|
$path .= '?' . $query_string; |
| 304 |
|
} |
| 305 |
|
$block['content'] .= l(t('Add this page'), 'bookmarks/item/addpage/'. base64_encode($path),array('attributes' => array('id' => 'bookmarks_addthispage'))); |
| 306 |
$block['content'] .= ' | '. l(t('Customize'), 'bookmarks/mine'); |
$block['content'] .= ' | '. l(t('Customize'), 'bookmarks/mine'); |
| 307 |
} |
} |
| 308 |
else { |
else { |