]> git.mxchange.org Git - friendica.git/blob - mod/editpost.php
cleanup untracked files
[friendica.git] / mod / editpost.php
1 <?php
2
3 require_once('acl_selectors.php');
4
5 function editpost_content(&$a) {
6
7         $o = '';
8
9         if(! local_user()) {
10                 notice( t('Permission denied.') . EOL);
11                 return;
12         }
13
14         $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
15
16         if(! $post_id) {
17                 notice( t('Item not found') . EOL);
18                 return;
19         }
20
21         $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
22                 intval($post_id),
23                 intval(local_user())
24         );
25
26         if(! count($r)) {
27                 notice( t('Item not found') . EOL);
28                 return;
29         }
30
31
32         $o .= '<h2>' . t('Edit post') . '</h2>';
33
34         $tpl = load_view_file('view/jot-header.tpl');
35         
36         $a->page['htmlhead'] .= replace_macros($tpl, array(
37                 '$baseurl' => $a->get_baseurl(),
38                 '$geotag' => $geotag,
39                 '$nickname' => $a->user['nickname']
40         ));
41
42
43         $tpl = load_view_file("view/jot.tpl");
44                 
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'])))))
46                 $lockstate = 'lock';
47         else
48                 $lockstate = 'unlock';
49
50         $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
51
52         $jotplugins = '';
53         $jotnets = '';
54         call_hooks('jot_tool', $jotplugins);
55         call_hooks('jot_networks', $jotnets);
56
57         $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));        
58
59         $o .= replace_macros($tpl,array(
60                 '$return_path' => $_SESSION['return_url'],
61                 '$action' => 'item',
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'],
76                 '$visitor' => 'none',
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']
84         ));
85
86
87         return $o;
88
89 }
90
91