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');
39 $a->page['htmlhead'] .= replace_macros($tpl, array(
40 '$baseurl' => $a->get_baseurl(),
41 '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
42 '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
44 '$nickname' => $a->user['nickname']
47 $tpl = get_markup_template('jot-end.tpl');
48 $a->page['end'] .= replace_macros($tpl, array(
49 '$baseurl' => $a->get_baseurl(),
50 '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
51 '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
53 '$nickname' => $a->user['nickname']
57 $tpl = get_markup_template("jot.tpl");
59 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'])))))
62 $lockstate = 'unlock';
64 $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
69 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
71 $mail_enabled = false;
72 $pubmail_enabled = false;
74 if(! $mail_disabled) {
75 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
80 if(intval($r[0]['pubmail']))
81 $pubmail_enabled = true;
86 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
87 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
88 . t("Post to Email") . '</div>';
93 call_hooks('jot_tool', $jotplugins);
94 call_hooks('jot_networks', $jotnets);
97 //$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
100 $o .= replace_macros($tpl,array(
101 '$return_path' => $_SESSION['return_url'],
103 '$share' => t('Edit'),
104 '$upload' => t('Upload photo'),
105 '$attach' => t('Attach file'),
106 '$weblink' => t('Insert web link'),
107 '$youtube' => t('Insert YouTube video'),
108 '$video' => t('Insert Vorbis [.ogg] video'),
109 '$audio' => t('Insert Vorbis [.ogg] audio'),
110 '$setloc' => t('Set your location'),
111 '$noloc' => t('Clear browser location'),
112 '$wait' => t('Please wait'),
113 '$permset' => t('Permission settings'),
114 '$ptyp' => $itm[0]['type'],
115 '$content' => undo_post_tagging($itm[0]['body']),
116 '$post_id' => $post_id,
117 '$baseurl' => $a->get_baseurl(),
118 '$defloc' => $a->user['default-location'],
119 '$visitor' => 'none',
121 '$emailcc' => t('CC: email addresses'),
122 '$public' => t('Public post'),
123 '$jotnets' => $jotnets,
124 '$title' => $itm[0]['title'],
125 '$placeholdertitle' => t('Set title'),
126 '$category' => file_tag_file_to_list($itm[0]['file'], 'category'),
127 '$placeholdercategory' => t('Categories (comma-separated list)'),
128 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
129 '$lockstate' => $lockstate,
130 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
131 '$bang' => (($group) ? '!' : ''),
132 '$profile_uid' => $_SESSION['uid'],
133 '$preview' => t('Preview'),
134 '$jotplugins' => $jotplugins,
135 '$sourceapp' => t($a->sourcename),