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 $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_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
57 $mail_enabled = false;
58 $pubmail_enabled = false;
60 if(! $mail_disabled) {
61 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
66 if(intval($r[0]['pubmail']))
67 $pubmail_enabled = true;
72 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
73 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . 'value="1" /> '
74 . t("Post to Email") . '</div>';
79 call_hooks('jot_tool', $jotplugins);
80 call_hooks('jot_networks', $jotnets);
82 $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
84 $o .= replace_macros($tpl,array(
85 '$return_path' => $_SESSION['return_url'],
87 '$share' => t('Edit'),
88 '$upload' => t('Upload photo'),
89 '$weblink' => t('Insert web link'),
90 '$youtube' => t('Insert YouTube video'),
91 '$video' => t('Insert Vorbis [.ogg] video'),
92 '$audio' => t('Insert Vorbis [.ogg] audio'),
93 '$setloc' => t('Set your location'),
94 '$noloc' => t('Clear browser location'),
95 '$wait' => t('Please wait'),
96 '$permset' => t('Permission settings'),
97 '$content' => $itm[0]['body'],
98 '$post_id' => $post_id,
99 '$baseurl' => $a->get_baseurl(),
100 '$defloc' => $a->user['default-location'],
101 '$visitor' => 'none',
102 '$emailcc' => t('CC: email addresses'),
103 '$jotnets' => $jotnets,
104 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
105 '$lockstate' => $lockstate,
106 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
107 '$bang' => (($group) ? '!' : ''),
108 '$profile_uid' => $_SESSION['uid']