bookmarks - mop up and go home

This commit is contained in:
friendica
2014-02-04 17:12:13 -08:00
parent 3665bc38ef
commit aede006970
9 changed files with 66 additions and 5 deletions

View File

@@ -171,6 +171,15 @@ class Item extends BaseObject {
);
}
$has_bookmarks = false;
if(is_array($item['term'])) {
foreach($item['term'] as $t) {
if($t['type'] == TERM_BOOKMARK)
$has_bookmarks = true;
}
}
if($this->is_commentable()) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
@@ -237,6 +246,7 @@ class Item extends BaseObject {
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''),
'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
'bookmark' => (($conv->get_profile_owner() == local_user() && $has_bookmarks) ? t('Bookmark Links') : ''),
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
// end toolbar buttons

View File

@@ -29,7 +29,7 @@ function bookmark_add($channel,$sender,$taxonomy,$private) {
$arr = array();
$arr['menu_name'] = substr($sender['xchan_hash'],0,16) . ' ' . $sender['xchan_name'];
$arr['menu_desc'] = sprintf( t('%1$s\'s bookmarks'), $sender['xchan_name']);
$arr['menu_flags'] = MENU_SYSTEM|MENU_BOOKMARK;
$arr['menu_flags'] = (($sender['xchan_hash'] === $channel['channel_hash']) ? MENU_BOOKMARK : MENU_SYSTEM|MENU_BOOKMARK);
$arr['menu_channel_id'] = $channel_id;
$x = menu_list($arr['menu_channel_id'],$arr['menu_name'],$arr['menu_flags']);

View File

@@ -1496,6 +1496,14 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
'title' => t('Events and Calendar'),
'id' => 'events-tab',
);
$tabs[] = array(
'label' => t('Bookmarks'),
'url' => $a->get_baseurl() . '/bookmarks',
'sel' => ((argv(0) == 'bookmarks') ? 'active' : ''),
'title' => t('Saved Bookmarks'),
'id' => 'bookmarks-tab',
);
}
if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {

View File

@@ -110,7 +110,7 @@ function menu_create($arr) {
function menu_list($channel_id, $name = '', $flags = 0) {
$sel_options = '';
$sel_options .= (($name) ? " and name = '" . protect_sprintf(dbesc($name)) . "' " : '');
$sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : '');
$sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : '');
$r = q("select * from menu where menu_channel_id = %d $sel_options order by menu_name",