| 1 |
<?php |
<?php |
| 2 |
// $Id: bookmarks2.module,v 1.10 2007/12/21 12:04:03 sanduhrs Exp $ |
// $Id: bookmarks2.module,v 1.11 2007/12/21 12:15:25 sanduhrs Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 122 |
// Print bookmarks list as an item list |
// Print bookmarks list as an item list |
| 123 |
$output = (count($bookmarks) ? theme('item_list', $bookmarks) : t('You have no bookmarks.')); |
$output = (count($bookmarks) ? theme('item_list', $bookmarks) : t('You have no bookmarks.')); |
| 124 |
$links = array( |
$links = array( |
| 125 |
array( |
'bookmarks2_quick_link' => array( |
| 126 |
'title' => t('quick link'), |
'title' => t('quick link'), |
| 127 |
'href' => "bookmarks2/$user->uid/add/quick", |
'href' => "bookmarks2/$user->uid/add/quick", |
| 128 |
'attributes' => array( |
'attributes' => array( |
| 129 |
'title' => t('Bookmark the current page.'), |
'title' => t('Bookmark the current page.'), |
| 130 |
|
'class' => 'bookmarks2_link', |
| 131 |
), |
), |
| 132 |
'query' => 'title='. urlencode(drupal_get_title()), |
'query' => 'title='. urlencode(drupal_get_title()), |
| 133 |
), |
), |
| 134 |
array( |
'bookmarks2_manage' => array( |
| 135 |
'title' => t('manage'), |
'title' => t('manage'), |
| 136 |
'href' => "bookmarks2/$user->uid", |
'href' => "bookmarks2/$user->uid", |
| 137 |
|
'attributes' => array( |
| 138 |
|
'title' => t('Manage your bookmarks.'), |
| 139 |
|
'class' => 'bookmarks2_link', |
| 140 |
|
), |
| 141 |
), |
), |
| 142 |
); |
); |
| 143 |
$output .= '<div class="links">'. theme('links', $links) .'</div>'; |
$output .= '<div class="links">'. theme('links', $links) .'</div>'; |
| 771 |
} |
} |
| 772 |
if ($link_display) { |
if ($link_display) { |
| 773 |
$rows[] = array(_bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), $data->uname, $decrypted_pword, ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
$rows[] = array(_bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), $data->uname, $decrypted_pword, ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
| 774 |
} |
} |
| 775 |
else { |
else { |
| 776 |
$rows[] = array($data->title, _bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), $data->uname, $decrypted_pword, ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
$rows[] = array($data->title, _bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), $data->uname, $decrypted_pword, ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
| 777 |
} |
} |
| 778 |
} |
} |
| 779 |
else { |
else { |
| 780 |
if ($link_display) { |
if ($link_display) { |
| 781 |
$rows[] = array(_bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
$rows[] = array(_bookmarks2_get_link($data->url, $data->title, $data->description, $data->options, $link_display), ' '. l(t('edit'), "bookmarks2/$user->uid/edit", null, 'url='. urlencode($data->url)) .' '. l(t('delete'), "bookmarks2/$user->uid/delete", null, 'url='. urlencode($data->url))); |
| 887 |
|
|
| 888 |
while (list($key, $value) = each($folders)) { |
while (list($key, $value) = each($folders)) { |
| 889 |
$fname = (strlen($value) > 50) ? substr($value, 0, 47) .'...' : $value; |
$fname = (strlen($value) > 50) ? substr($value, 0, 47) .'...' : $value; |
| 890 |
$rows[] = array($value, ' '. t(t('edit'), "bookmarks2/$user->uid/folderedit", null, 'fid='. $key) .' '. l(t('delete'), "bookmarks2/$user->uid/deletefolder", null, 'fid='. $key)); |
$rows[] = array($value, ' '. l(t('edit'), "bookmarks2/$user->uid/folderedit", null, 'fid='. $key) .' '. l(t('delete'), "bookmarks2/$user->uid/deletefolder", null, 'fid='. $key)); |
| 891 |
} |
} |
| 892 |
|
|
| 893 |
$output .= (count($rows) == 0) ? t('You have no folders.') : theme('table', $header, $rows); |
$output .= (count($rows) == 0) ? t('You have no folders.') : theme('table', $header, $rows); |