From 2312f03eacd973c18342e26087d279ea2bebd4a8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 6 Sep 2015 20:50:31 -0700 Subject: Always open rpost editor on document ready --- mod/rpost.php | 15 ++++++--------- view/js/mod_rpost.js | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 view/js/mod_rpost.js diff --git a/mod/rpost.php b/mod/rpost.php index 4a6b87cc6..d519a996b 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -94,15 +94,13 @@ function rpost_content(&$a) { $channel = $a->get_channel(); - $channel_acl = array( - 'allow_cid' => $channel['channel_allow_cid'], - 'allow_gid' => $channel['channel_allow_gid'], - 'deny_cid' => $channel['channel_deny_cid'], - 'deny_gid' => $channel['channel_deny_gid'] - ); + + $acl = new AccessList($channel); + + $channel_acl = $acl->get(); if($_REQUEST['url']) { - $x = z_fetch_url(z_root() . '/urlinfo?f=&url=' . urlencode($_REQUEST['url'])); + $x = z_fetch_url(z_root() . '/linkinfo?f=&url=' . urlencode($_REQUEST['url'])); if($x['success']) $_REQUEST['body'] = $_REQUEST['body'] . $x['body']; } @@ -112,8 +110,7 @@ function rpost_content(&$a) { 'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''), 'default_location' => $channel['channel_location'], 'nickname' => $channel['channel_address'], - 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] - || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), + 'lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'), 'acl' => populate_acl($channel_acl), 'bang' => '', 'visitor' => true, diff --git a/view/js/mod_rpost.js b/view/js/mod_rpost.js new file mode 100644 index 000000000..06b67136b --- /dev/null +++ b/view/js/mod_rpost.js @@ -0,0 +1 @@ +$(document).ready(function() { initEditor(); }); -- cgit v1.2.3