3 require_once('acl_selectors.php');
5 function editpost_content(&$a) {
10 notice( t('Permission denied.') . EOL);
14 $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
17 notice( t('Item not found') . EOL);
21 $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
27 notice( t('Item not found') . EOL);
32 $o .= '<h2>' . t('Edit post') . '</h2>';
34 $tpl = load_view_file('view/jot-header.tpl');
36 $a->page['htmlhead'] .= replace_macros($tpl, array(
37 '$baseurl' => $a->get_baseurl(),
39 '$nickname' => $a->user['nickname']
43 $tpl = load_view_file("view/jot.tpl");
45 if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))))
48 $lockstate = 'unlock';
50 $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
55 $mail_enabled = false;
56 $pubmail_enabled = false;
59 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
64 if(intval($r[0]['pubmail']))
65 $pubmail_enabled = true;
69 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
70 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . 'value="1" /> '
71 . t("Post to Email") . '</div>';
76 call_hooks('jot_tool', $jotplugins);
77 call_hooks('jot_networks', $jotnets);
79 $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
81 $o .= replace_macros($tpl,array(
82 '$return_path' => $_SESSION['return_url'],
84 '$share' => t('Edit'),
85 '$upload' => t('Upload photo'),
86 '$weblink' => t('Insert web link'),
87 '$youtube' => t('Insert YouTube video'),
88 '$video' => t('Insert Vorbis [.ogg] video'),
89 '$audio' => t('Insert Vorbis [.ogg] audio'),
90 '$setloc' => t('Set your location'),
91 '$noloc' => t('Clear browser location'),
92 '$wait' => t('Please wait'),
93 '$permset' => t('Permission settings'),
94 '$content' => $r[0]['body'],
95 '$post_id' => $post_id,
96 '$baseurl' => $a->get_baseurl(),
97 '$defloc' => $a->user['default-location'],
99 '$emailcc' => t('CC: email addresses'),
100 '$jotnets' => $jotnets,
101 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
102 '$lockstate' => $lockstate,
103 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
104 '$bang' => (($group) ? '!' : ''),
105 '$profile_uid' => $_SESSION['uid']