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);
54 call_hooks('jot_tool', $jotplugins);
55 call_hooks('jot_networks', $jotnets);
57 $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
59 $o .= replace_macros($tpl,array(
60 '$return_path' => $_SESSION['return_url'],
62 '$share' => t('Edit'),
63 '$upload' => t('Upload photo'),
64 '$weblink' => t('Insert web link'),
65 '$youtube' => t('Insert YouTube video'),
66 '$video' => t('Insert Vorbis [.ogg] video'),
67 '$audio' => t('Insert Vorbis [.ogg] audio'),
68 '$setloc' => t('Set your location'),
69 '$noloc' => t('Clear browser location'),
70 '$wait' => t('Please wait'),
71 '$permset' => t('Permission settings'),
72 '$content' => $r[0]['body'],
73 '$post_id' => $post_id,
74 '$baseurl' => $a->get_baseurl(),
75 '$defloc' => $a->user['default-location'],
77 '$emailcc' => t('CC: email addresses'),
78 '$jotnets' => $jotnets,
79 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
80 '$lockstate' => $lockstate,
81 '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
82 '$bang' => (($group) ? '!' : ''),
83 '$profile_uid' => $_SESSION['uid']