3 require_once('include/acl_selectors.php');
5 function editpost_content(App $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",
26 if (! dbm::is_result($itm)) {
27 notice( t('Item not found') . EOL);
31 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
32 '$title' => t('Edit post')
35 $tpl = get_markup_template('jot-header.tpl');
36 $a->page['htmlhead'] .= replace_macros($tpl, array(
37 '$baseurl' => App::get_baseurl(),
38 '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
40 '$nickname' => $a->user['nickname']
43 $tpl = get_markup_template('jot-end.tpl');
44 $a->page['end'] .= replace_macros($tpl, array(
45 '$baseurl' => App::get_baseurl(),
46 '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
48 '$nickname' => $a->user['nickname']
52 $tpl = get_markup_template("jot.tpl");
54 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'])))))
57 $lockstate = 'unlock';
62 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
64 $mail_enabled = false;
65 $pubmail_enabled = false;
67 if(! $mail_disabled) {
68 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
71 if (dbm::is_result($r)) {
73 if(intval($r[0]['pubmail']))
74 $pubmail_enabled = true;
78 // I don't think there's any need for the $jotnets when editing the post,
79 // and including them makes it difficult for the JS-free theme, so let's
81 /* if($mail_enabled) {
82 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
83 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
84 . t("Post to Email") . '</div>';
89 call_hooks('jot_tool', $jotplugins);
90 //call_hooks('jot_networks', $jotnets);
93 //$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
95 $o .= replace_macros($tpl,array(
97 '$return_path' => $_SESSION['return_url'],
99 '$share' => t('Save'),
100 '$upload' => t('Upload photo'),
101 '$shortupload' => t('upload photo'),
102 '$attach' => t('Attach file'),
103 '$shortattach' => t('attach file'),
104 '$weblink' => t('Insert web link'),
105 '$shortweblink' => t('web link'),
106 '$video' => t('Insert video link'),
107 '$shortvideo' => t('video link'),
108 '$audio' => t('Insert audio link'),
109 '$shortaudio' => t('audio link'),
110 '$setloc' => t('Set your location'),
111 '$shortsetloc' => t('set location'),
112 '$noloc' => t('Clear browser location'),
113 '$shortnoloc' => t('clear location'),
114 '$wait' => t('Please wait'),
115 '$permset' => t('Permission settings'),
116 '$ptyp' => $itm[0]['type'],
117 '$content' => undo_post_tagging($itm[0]['body']),
118 '$post_id' => $post_id,
119 '$baseurl' => App::get_baseurl(),
120 '$defloc' => $a->user['default-location'],
121 '$visitor' => 'none',
123 '$emailcc' => t('CC: email addresses'),
124 '$public' => t('Public post'),
125 '$jotnets' => $jotnets,
126 '$title' => htmlspecialchars($itm[0]['title']),
127 '$placeholdertitle' => t('Set title'),
128 '$category' => file_tag_file_to_list($itm[0]['file'], 'category'),
129 '$placeholdercategory' => (feature_enabled(local_user(),'categories') ? t('Categories (comma-separated list)') : ''),
130 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
131 '$lockstate' => $lockstate,
132 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
133 '$bang' => (($group) ? '!' : ''),
134 '$profile_uid' => $_SESSION['uid'],
135 '$preview' => t('Preview'),
136 '$jotplugins' => $jotplugins,
137 '$sourceapp' => t($a->sourcename),
138 '$cancel' => t('Cancel'),
139 '$rand_num' => random_digits(12),
141 //jot nav tab (used in some themes)
142 '$message' => t('Message'),
143 '$browser' => t('Browser'),
144 '$shortpermset' => t('permissions'),