$page_writeable = can_write_wall($a,$profile_owner);
}
+ if($mode === 'notes') {
+ $profile_owner = $a->profile['profile_uid'];
+ $page_writeable = true;
+ }
+
if($mode === 'display') {
$profile_owner = $a->profile['uid'];
$page_writeable = can_write_wall($a,$profile_owner);
$noshare_tpl = get_markup_template('like_noshare.tpl');
$tpl = get_markup_template('wall_item.tpl');
$wallwall = get_markup_template('wallwall_item.tpl');
+ $droptpl = get_markup_template('wall_item_drop.tpl');
+ $fakedrop = get_markup_template('wall_fake_drop.tpl');
$alike = array();
$dlike = array();
// - just loop through the items and format them minimally for display
$tpl = get_markup_template('search_item.tpl');
- $droptpl = get_markup_template('wall_fake_drop.tpl');
foreach($items as $item) {
}
$drop = '';
- $dropping = false;
-
- if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
- $dropping = true;
- $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete')));
-
- //
localize_item($item);
$drop = replace_macros($droptpl,array('$id' => $item['id']));
$lock = '<div class="wall-item-lock"></div>';
+
+ $body = prepare_body($item,true);
$o .= replace_macros($tpl,array(
'$id' => $item['item_id'],
'$lock' => $lock,
'$thumb' => $profile_avatar,
'$title' => $item['title'],
- '$body' => smilies(bbcode($item['body'])),
- '$ago' => relative_date($item['created']),
+ '$body' => $body,
+ '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'$location' => $location,
'$indent' => '',
'$owner_url' => $owner_url,
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
- if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile')) {
+ if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
$blowhard_count ++;
if($blowhard_count == 3) {
$o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent']
if($page_writeable) {
if($toplevelpost) {
- $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
+ $likebuttons = replace_macros((($item['private'] || ($profile_owner != local_user())) ? $noshare_tpl : $like_tpl),array(
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
}
}
- $edpost = ((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1))
+ $edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes'))
? '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id']
. '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>'
: '');
- $drop = replace_macros(get_markup_template('wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
+
+
+ $drop = '';
+ $dropping = false;
+
+ if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
+ $dropping = true;
+
+ $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$select' => t('Select'), '$delete' => t('Delete')));
+
$photo = $item['photo'];
$thumb = $item['thumb'];
// Build the HTML
+ $body = prepare_body($item,true);
+
+
$tmp_item = replace_macros($template,array(
'$id' => $item['item_id'],
'$linktitle' => sprintf( t('View %s\'s profile'), $profile_name),
'$osparkle' => $osparkle,
'$sparkle' => $sparkle,
'$title' => $item['title'],
- '$body' => smilies(bbcode($item['body'])),
- '$ago' => relative_date($item['created']),
+ '$body' => $body,
+ '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'$lock' => $lock,
'$location' => $location,
'$indent' => $indent,
'$comment' => $comment
));
+
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
if($blowhard_count >= 3)
$o .= '</div>';
+ if($dropping)
+ $o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
+
return $o;
}
}}
-function status_editor($a,$x) {
+function status_editor($a,$x, $notes_cid = 0) {
$o = '';
call_hooks('jot_tool', $jotplugins);
call_hooks('jot_networks', $jotnets);
+ if($notes_cid)
+ $jotnets .= '<input type="hidden" name="contact_allow[]" value="' . $notes_cid .'" />';
+
$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
$o .= replace_macros($tpl,array(
'$return_path' => $a->cmd,
'$action' => 'item',
- '$share' => t('Share'),
+ '$share' => (($x['button']) ? $x['button'] : t('Share')),
'$upload' => t('Upload photo'),
+ '$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
'$video' => t('Insert Vorbis [.ogg] video'),
'$title' => t('Set title'),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
+ '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => '',
'$post_id' => '',
'$baseurl' => $a->get_baseurl(),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
+ '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),
'$emailcc' => t('CC: email addresses'),
'$public' => t('Public post'),
'$jotnets' => $jotnets,