diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-08-04 11:23:43 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-08-04 11:23:43 +0200 |
commit | 120e9a1e4c816eb629bc00dcf2324a26825479e0 (patch) | |
tree | d34e0a95cfea7d3fcdb7205133d34055bf4813c9 | |
parent | b49cfb2efd05a46a830238e5dff703086ffc59c4 (diff) | |
download | volse-hubzilla-120e9a1e4c816eb629bc00dcf2324a26825479e0.tar.gz volse-hubzilla-120e9a1e4c816eb629bc00dcf2324a26825479e0.tar.bz2 volse-hubzilla-120e9a1e4c816eb629bc00dcf2324a26825479e0.zip |
multi acl: port /webpages and /mitem
-rw-r--r-- | Zotlabs/Module/Editwebpage.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Mitem.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Webpages.php | 1 | ||||
-rw-r--r-- | view/tpl/mitemedit.tpl | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php index a55f81101..2da8871a2 100644 --- a/Zotlabs/Module/Editwebpage.php +++ b/Zotlabs/Module/Editwebpage.php @@ -151,6 +151,7 @@ class Editwebpage extends \Zotlabs\Web\Controller { 'post_id' => $post_id, 'visitor' => ($is_owner) ? true : false, 'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')), + 'permissions' => $itm[0], 'showacl' => ($is_owner) ? true : false, 'mimetype' => $mimetype, 'mimeselect' => true, diff --git a/Zotlabs/Module/Mitem.php b/Zotlabs/Module/Mitem.php index b64b50c8e..28f51b81b 100644 --- a/Zotlabs/Module/Mitem.php +++ b/Zotlabs/Module/Mitem.php @@ -147,12 +147,16 @@ class Mitem extends \Zotlabs\Web\Controller { else { $display = (($r) ? 'none' : 'block'); } - + $create = replace_macros(get_markup_template('mitemedit.tpl'), array( '$menu_id' => \App::$data['menu']['menu_id'], '$permissions' => t('Menu Item Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($acl->get(),false), + '$allow_cid' => acl2json($acl->get()['allow_cid']), + '$allow_gid' => acl2json($acl->get()['allow_gid']), + '$deny_cid' => acl2json($acl->get()['deny_cid']), + '$deny_gid' => acl2json($acl->get()['deny_gid']), '$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'), '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', t('Enter URL of the link or select a menu name to create a submenu'), '*', 'list="menu-names"'), '$usezid' => array('usezid', t('Use magic-auth if available'), true, '', array(t('No'), t('Yes'))), @@ -226,6 +230,10 @@ class Mitem extends \Zotlabs\Web\Controller { '$permissions' => t('Menu Item Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($mitem,false), + '$allow_cid' => acl2json($mitem['allow_cid']), + '$allow_gid' => acl2json($mitem['allow_gid']), + '$deny_cid' => acl2json($mitem['deny_cid']), + '$deny_gid' => acl2json($mitem['deny_gid']), '$mitem_id' => intval(argv(2)), '$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'), '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'), diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index d3199f223..0a48d43c6 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -127,6 +127,7 @@ class Webpages extends \Zotlabs\Web\Controller { 'nickname' => \App::$profile['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => (($is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), + 'permissions' => (($is_owner) ? $channel_acl : ''), 'showacl' => (($is_owner) ? true : false), 'visitor' => true, 'hide_location' => true, diff --git a/view/tpl/mitemedit.tpl b/view/tpl/mitemedit.tpl index 865c587ec..a06203244 100644 --- a/view/tpl/mitemedit.tpl +++ b/view/tpl/mitemedit.tpl @@ -5,7 +5,7 @@ </div> {{/if}} <div id="menu-element-creator" class="section-content-tools-wrapper" style="display: {{$display}};"> - <form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" > + <form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" class="acl-form" data-form_id="mitemedit" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'> <input type="hidden" name="menu_id" value="{{$menu_id}}" /> {{if $mitem_id}} <input type="hidden" name="mitem_id" value="{{$mitem_id}}" /> @@ -32,10 +32,10 @@ {{/if}} <button class="btn btn-primary btn-sm" type="submit" name="submit" value="{{$submit}}">{{$submit}}</button> </div> - {{$aclselect}} </div> <div class="clear"></div> </form> + {{$aclselect}} </div> {{if $header}} </div> |