diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-07-12 18:00:58 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-07-12 18:00:58 -0700 |
commit | baad288430baed9d7967043554cb07fdde322552 (patch) | |
tree | 3c38028d536a680b5ce22a0f14bf88e399d294fc /view | |
parent | acdfee232795684174a4eea1bc1d386ca0db1e1d (diff) | |
download | volse-hubzilla-baad288430baed9d7967043554cb07fdde322552.tar.gz volse-hubzilla-baad288430baed9d7967043554cb07fdde322552.tar.bz2 volse-hubzilla-baad288430baed9d7967043554cb07fdde322552.zip |
acl stuff
Diffstat (limited to 'view')
-rw-r--r-- | view/acl_selectors.php | 70 | ||||
-rw-r--r-- | view/jot.tpl | 3 | ||||
-rw-r--r-- | view/style.css | 15 |
3 files changed, 86 insertions, 2 deletions
diff --git a/view/acl_selectors.php b/view/acl_selectors.php new file mode 100644 index 000000000..7a69fdd5a --- /dev/null +++ b/view/acl_selectors.php @@ -0,0 +1,70 @@ +<?php + + +function group_select($selname,$selclass,$preselected = false) { + + $o = ''; + + $o .= "<select name=\"{$selname}[]\" class=\"$selclass\" multiple=\"multiple\" size=\"4\" />\r\n"; + + $r = q("SELECT * FROM `group` WHERE `uid` = %d", + $_SESSION['uid'] + ); + + if(count($r)) { + foreach($r as $rr) { + if((is_array($preselected)) && $in_array($rr['name'], $preselected)) + $selected = " selected=\"selected\" "; + else + $selected = ''; + $o .= "<option value=\"{$rr['name']}\" $selected >{$rr['name']}</option>\r\n"; + } + + } + $o .= "</select>\r\n"; + + + return $o; +} + + + +function contact_select($selname,$selclass,$preselected = false) { + + $o = ''; + + $o .= "<select name=\"{$selname}[]\" class=\"$selclass\" multiple=\"multiple\" size=\"4\" />\r\n"; + + $r = q("SELECT `name` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 ", + $_SESSION['uid'] + ); + + if(count($r)) { + foreach($r as $rr) { + if((is_array($preselected)) && $in_array($rr['name'], $preselected)) + $selected = " selected=\"selected\" "; + else + $selected = ''; + $o .= "<option value=\"{$rr['name']}\" $selected >{$rr['name']}</option>\r\n"; + } + + } + $o .= "</select>\r\n"; + + + return $o; +} + + +function populate_acl() { + + $o = ''; + + $o .= "Allow Groups: " . group_select('group_allow','group_allow'); + $o .= "Allow Contacts: " . contact_select('contact_allow','contact_allow'); + $o .= "<br />\r\n"; + $o .= "Except Groups: " . group_select('group_deny','group_deny'); + $o .= "Except Contacts: " . contact_select('contact_deny','contact_deny'); + return $o; + +}
\ No newline at end of file diff --git a/view/jot.tpl b/view/jot.tpl index b6599feec..55ee5388c 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -12,7 +12,8 @@ What's on your mind? </div> <div id="profile-jot-submit-wrapper" > <input type="submit" id="profile-jot-submit" name="submit" value="Submit" /> - + <div id="profile-jot-perms" class="profile-jot-perms" ><img src="images/$lockstate_icon.gif" alt="Permission Settings" title="Permission Settings" onClick="openClose('profile-jot-acl-wrapper');" /><div id="profile-jot-acl-wrapper" style="display: none;" >$acl</div> + </div> </div> <div id="profile-jot-end"></div> </form> diff --git a/view/style.css b/view/style.css index f54810740..261965129 100644 --- a/view/style.css +++ b/view/style.css @@ -451,7 +451,18 @@ input#dfrn-url { #profile-jot-submit-wrapper { margin-top: 15px; } + +#profile-jot-submit { + float: left; +} + +#profile-jot-perms { + float: left; + margin-left: 350px; +} + #profile-jot-end { + clear: both; margin-bottom: 30px; } #about-jot-submit-wrapper { @@ -766,4 +777,6 @@ input#dfrn-url { color: black; height: 150px; width: 350px; -}
\ No newline at end of file +} + + |