make lockview work, bring back acl widget theming in redbasic

This commit is contained in:
friendica 2013-01-20 18:05:29 -08:00
parent 127b605f32
commit 060716f172
4 changed files with 134 additions and 44 deletions

22
done
View File

@ -15,7 +15,7 @@ include/
+ account.php + account.php
acl_selectors.php acl_selectors.php
+ activities.php + activities.php
api.php ? api.php
? attach.php ? attach.php
+ auth.php + auth.php
- bb2diaspora.php (check for function dependencies before removing) - bb2diaspora.php (check for function dependencies before removing)
@ -34,7 +34,7 @@ include/
+ directory.php + directory.php
- email.php - email.php
+ enotify.php + enotify.php
event.php + event.php
+ expire.php + expire.php
fcontact.php fcontact.php
? follow.php ? follow.php
@ -47,11 +47,11 @@ include/
? items.php ? items.php
+ js_strings.php + js_strings.php
+ language.php + language.php
message.php ? message.php
- msgclean.php - msgclean.php
? nav.php ? nav.php
network.php network.php
notifier.php + notifier.php
oauth.php oauth.php
oembed.php oembed.php
? onepoll.php ? onepoll.php
@ -63,7 +63,7 @@ include/
? queue_fn.php ? queue_fn.php
? queue.php ? queue.php
- salmon.php - salmon.php
Scrape.php = Scrape.php
+ security.php + security.php
? session.php ? session.php
socgraph.php socgraph.php
@ -104,14 +104,14 @@ mod/
fsuggest.php fsuggest.php
+ group.php + group.php
- hcard.php -> not needed - hcard.php -> not needed
help.php = help.php
+ home.php + home.php
hostxrd.php -> probably not needed hostxrd.php -> probably not needed
? install.php ? install.php
invite.php invite.php
+ item.php + item.php
+ like.php + like.php
lockview.php + lockview.php
+ login.php + login.php
lostpass.php lostpass.php
magic.php magic.php
@ -157,10 +157,10 @@ mod/
suggest.php suggest.php
tagger.php tagger.php
tagrm.php tagrm.php
uexport.php ? uexport.php
update_community.php - needs converting to json ? update_community.php - needs converting to json
update_network.php - needs converting to json ? update_network.php - needs converting to json
update_profile.php - needs converting to json ? update_profile.php - needs converting to json
viewcontacts.php viewcontacts.php
view.php view.php
+ viewsrc.php + viewsrc.php

View File

@ -1798,9 +1798,11 @@ function magic_link($s) {
return $s; return $s;
} }
function stringify_array_elms(&$arr) { // if $escape is true, dbesc() each element before adding quotes
function stringify_array_elms(&$arr,$escape = false) {
for($x = 0; $x < count($arr); $x ++) for($x = 0; $x < count($arr); $x ++)
$arr[$x] = "'" . $arr[$x] . "'"; $arr[$x] = "'" . (($escape) ? dbesc($arr[$x]) : $arr[$x]) . "'";
} }
/** /**

View File

@ -3,12 +3,12 @@
function lockview_content(&$a) { function lockview_content(&$a) {
$type = (($a->argc > 1) ? $a->argv[1] : 0); $type = ((argc() > 1) ? argv(1) : 0);
if (is_numeric($type)) { if (is_numeric($type)) {
$item_id = intval($type); $item_id = intval($type);
$type='item'; $type='item';
} else { } else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0); $item_id = ((argc() > 2) ? intval(argv(2)) : 0);
} }
if(! $item_id) if(! $item_id)
@ -17,20 +17,20 @@ function lockview_content(&$a) {
if (!in_array($type, array('item','photo','event'))) if (!in_array($type, array('item','photo','event')))
killme(); killme();
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1", $r = q("SELECT * FROM %s WHERE id = %d LIMIT 1",
dbesc($type), dbesc($type),
intval($item_id) intval($item_id)
); );
if(! count($r)) if(! $r)
killme(); killme();
$item = $r[0]; $item = $r[0];
if($item['uid'] != local_user()) if($item['uid'] != local_user())
killme(); killme();
if(($item['item_private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
echo t('Remote privacy information not available.') . '<br />'; echo t('Remote privacy information not available.') . '<br />';
killme(); killme();
} }
@ -43,40 +43,34 @@ function lockview_content(&$a) {
$o = t('Visible to:') . '<br />'; $o = t('Visible to:') . '<br />';
$l = array(); $l = array();
stringify_array_elms($allowed_groups,true);
stringify_array_elms($allowed_users,true);
stringify_array_elms($deny_groups,true);
stringify_array_elms($deny_users,true);
if(count($allowed_groups)) { if(count($allowed_groups)) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )", $r = q("SELECT name FROM group WHERE hash IN ( " . implode(', ', $allowed_groups) . " )");
dbesc(implode(', ', $allowed_groups)) if($r)
);
if(count($r))
foreach($r as $rr) foreach($r as $rr)
$l[] = '<b>' . $rr['name'] . '</b>'; $l[] = '<b>' . $rr['name'] . '</b>';
} }
if(count($allowed_users)) { if(count($allowed_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )", $r = q("SELECT xchan_name FROM xchan WHERE xchan_hash IN ( " . implode(', ',$allowed_users) . " )");
dbesc(implode(', ',$allowed_users)) if($r)
);
if(count($r))
foreach($r as $rr) foreach($r as $rr)
$l[] = $rr['name']; $l[] = $rr['xchan_name'];
} }
if(count($deny_groups)) { if(count($deny_groups)) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )", $r = q("SELECT name FROM group WHERE hash IN ( " . implode(', ', $deny_groups) . " )");
dbesc(implode(', ', $deny_groups)) if($r)
);
if(count($r))
foreach($r as $rr) foreach($r as $rr)
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>'; $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
} }
if(count($deny_users)) { if(count($deny_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )", $r = q("SELECT xchan_name FROM xchan WHERE xchan_hash IN ( " . implode(', ', $deny_users) . " )");
dbesc(implode(', ',$deny_users)) if($r)
);
if(count($r))
foreach($r as $rr) foreach($r as $rr)
$l[] = '<strike>' . $rr['name'] . '</strike>'; $l[] = '<strike>' . $rr['xchan_name'] . '</strike>';
} }
echo $o . implode(', ', $l); echo $o . implode(', ', $l);

View File

@ -3779,3 +3779,97 @@ ul.menu-popup {
.tabs-end { .tabs-end {
clear: both; clear: both;
} }
#acl-wrapper {
width: 690px;
float:left;
}
#acl-search {
float:right;
background: #ffffff url("../../../../images/search_18.png") no-repeat right center;
padding-right:20px;
}
#acl-showall {
float: left;
display: block;
width: auto;
height: 18px;
background-color: #cccccc;
background-image: url("../../../../images/show_all_off.png");
background-position: 7px 7px;
background-repeat: no-repeat;
padding: 7px 5px 0px 30px;
-webkit-border-radius: 5px ;
-moz-border-radius: 5px;
border-radius: 5px;
color: #999999;
}
#acl-showall.selected {
color: #000000;
background-color: #ff9900;
background-image: url("../../../../images/show_all_on.png");
}
#acl-list {
height: 210px;
border: 1px solid #cccccc;
clear: both;
margin-top: 30px;
overflow: auto;
}
#acl-list-content {
}
.acl-list-item {
display: block;
width: 150px;
height: 30px;
border: 1px solid #cccccc;
margin: 5px;
float: left;
}
.acl-list-item img{
width:22px;
height: 22px;
float: left;
margin: 4px;
}
.acl-list-item p { height: 12px; font-size: 10px; margin: 0px; padding: 2px 0px 1px; overflow: hidden;}
.acl-list-item a {
font-size: 8px;
display: block;
width: 40px;
height: 10px;
float: left;
color: #999999;
background-color: #cccccc;
background-position: 3px 3px;
background-repeat: no-repeat;
margin-right: 5px;
-webkit-border-radius: 2px ;
-moz-border-radius: 2px;
border-radius: 2px;
padding-left: 15px;
}
#acl-wrapper a:hover {
text-decoration: none;
color:#000000;
}
.acl-button-show { background-image: url("../../../../images/show_off.png"); }
.acl-button-hide { background-image: url("../../../../images/hide_off.png"); }
.acl-button-show.selected {
color: #000000;
background-color: #9ade00;
background-image: url("../../../../images/show_on.png");
}
.acl-button-hide.selected {
color: #000000;
background-color: #ff4141;
background-image: url("../../../../images/hide_on.png");
}
.acl-list-item.groupshow { border-color: #9ade00; }
.acl-list-item.grouphide { border-color: #ff4141; }