$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);
load_contact_links(local_user());
- $cmnt_tpl = file_get_contents('view/comment_item.tpl');
- $like_tpl = file_get_contents('view/like.tpl');
- $noshare_tpl = file_get_contents('view/like_noshare.tpl');
- $tpl = load_view_file('view/wall_item.tpl');
- $wallwall = load_view_file('view/wallwall_item.tpl');
+ $cmnt_tpl = get_markup_template('comment_item.tpl');
+ $like_tpl = get_markup_template('like.tpl');
+ $noshare_tpl = get_markup_template('like_noshare.tpl');
+ $tpl = get_markup_template('wall_item.tpl');
+ $wallwall = get_markup_template('wallwall_item.tpl');
$alike = array();
$dlike = array();
// "New Item View" on network page or search page results
// - just loop through the items and format them minimally for display
- $tpl = load_view_file('view/search_item.tpl');
- $droptpl = file_get_contents('view/wall_fake_drop.tpl');
+ $tpl = get_markup_template('search_item.tpl');
+ $droptpl = get_markup_template('wall_fake_drop.tpl');
foreach($items as $item) {
$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']
- . '" onclick="openClose(' . '\'icollapse-' . $item['parent'] . '\');" >'
+ . '" onclick="openClose(' . '\'icollapse-' . $item['parent'] . '\'); $(\'#icollapse-wrapper-' . $item['parent'] . '\').hide();" >'
. t('See more posts like this') . '</div>' . '<div class="icollapse" id="icollapse-'
. $item['parent'] . '" style="display: none;" >';
}
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) {
$o .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
- . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\');" >'
+ . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
. sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
. '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
$comments_collapsed = true;
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(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
+ $drop = replace_macros(get_markup_template('wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo'];
$thumb = $item['thumb'];
}}
-function status_editor($a,$x) {
+function status_editor($a,$x, $notes_cid = 0) {
$o = '';
- $geotag = (($x['allow_location']) ? file_get_contents('view/jot_geotag.tpl') : '');
+ $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
- $tpl = load_view_file('view/jot-header.tpl');
+ $tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
));
- $tpl = load_view_file("view/jot.tpl");
+ $tpl = get_markup_template("jot.tpl");
$jotplugins = '';
$jotnets = '';
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'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube 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,
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $x['lockstate'],