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 $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
27 notice( t('Item not found') . EOL);
32 if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
36 $o .= '<h2>' . t('Edit post') . '</h2>';
38 $tpl = get_markup_template('jot-header.tpl');
40 $a->page['htmlhead'] .= replace_macros($tpl, array(
41 '$baseurl' => $a->get_baseurl(),
42 '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
43 '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
45 '$nickname' => $a->user['nickname']
49 $tpl = get_markup_template("jot.tpl");
51 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'])))))
54 $lockstate = 'unlock';
56 $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
61 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
63 $mail_enabled = false;
64 $pubmail_enabled = false;
66 if(! $mail_disabled) {
67 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
72 if(intval($r[0]['pubmail']))
73 $pubmail_enabled = true;
78 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
79 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
80 . t("Post to Email") . '</div>';
85 call_hooks('jot_tool', $jotplugins);
86 call_hooks('jot_networks', $jotnets);
89 //$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
92 $o .= replace_macros($tpl,array(
93 '$return_path' => $_SESSION['return_url'],
95 '$share' => t('Edit'),
96 '$upload' => t('Upload photo'),
97 '$attach' => t('Attach file'),
98 '$weblink' => t('Insert web link'),
99 '$youtube' => t('Insert YouTube video'),
100 '$video' => t('Insert Vorbis [.ogg] video'),
101 '$audio' => t('Insert Vorbis [.ogg] audio'),
102 '$setloc' => t('Set your location'),
103 '$noloc' => t('Clear browser location'),
104 '$wait' => t('Please wait'),
105 '$permset' => t('Permission settings'),
106 '$ptyp' => $itm[0]['type'],
107 '$content' => $itm[0]['body'],
108 '$post_id' => $post_id,
109 '$baseurl' => $a->get_baseurl(),
110 '$defloc' => $a->user['default-location'],
111 '$visitor' => 'none',
113 '$emailcc' => t('CC: email addresses'),
114 '$public' => t('Public post'),
115 '$jotnets' => $jotnets,
116 '$title' => $itm[0]['title'],
117 '$placeholdertitle' => t('Set title'),
118 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
119 '$lockstate' => $lockstate,
120 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
121 '$bang' => (($group) ? '!' : ''),
122 '$profile_uid' => $_SESSION['uid'],
123 '$preview' => t('Preview'),
124 '$jotplugins' => $jotplugins,