progress on the acl selector - it should mostly work, but the returned data isn't yet parsed correctly in mod_item
This commit is contained in:
parent
c2c048dc59
commit
1079c10fa4
@ -105,7 +105,7 @@ ACL.prototype.on_button_hide = function(event){
|
|||||||
|
|
||||||
ACL.prototype.set_allow = function(itemid){
|
ACL.prototype.set_allow = function(itemid){
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
switch(type){
|
switch(type){
|
||||||
case "g":
|
case "g":
|
||||||
if (that.allow_gid.indexOf(id)<0){
|
if (that.allow_gid.indexOf(id)<0){
|
||||||
@ -129,7 +129,7 @@ ACL.prototype.set_allow = function(itemid){
|
|||||||
|
|
||||||
ACL.prototype.set_deny = function(itemid){
|
ACL.prototype.set_deny = function(itemid){
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
switch(type){
|
switch(type){
|
||||||
case "g":
|
case "g":
|
||||||
if (that.deny_gid.indexOf(id)<0){
|
if (that.deny_gid.indexOf(id)<0){
|
||||||
@ -178,7 +178,7 @@ ACL.prototype.update_view = function(){
|
|||||||
$("#acl-list-content .acl-list-item").each(function(){
|
$("#acl-list-content .acl-list-item").each(function(){
|
||||||
itemid = $(this).attr('id');
|
itemid = $(this).attr('id');
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
|
|
||||||
btshow = $(this).children(".acl-button-show").removeClass("selected");
|
btshow = $(this).children(".acl-button-show").removeClass("selected");
|
||||||
bthide = $(this).children(".acl-button-hide").removeClass("selected");
|
bthide = $(this).children(".acl-button-hide").removeClass("selected");
|
||||||
@ -248,7 +248,7 @@ ACL.prototype.populate = function(data){
|
|||||||
that.list_content.height(height);
|
that.list_content.height(height);
|
||||||
$(data.items).each(function(){
|
$(data.items).each(function(){
|
||||||
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
|
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
|
||||||
html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
|
html = html.format( this.photo, this.name, this.type, this.xid, '', this.network, this.link );
|
||||||
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
|
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
|
||||||
//console.log(html);
|
//console.log(html);
|
||||||
that.list_content.append(html);
|
that.list_content.append(html);
|
||||||
|
@ -114,7 +114,8 @@ function acl_init(&$a){
|
|||||||
"type" => "g",
|
"type" => "g",
|
||||||
"photo" => "images/twopeople.png",
|
"photo" => "images/twopeople.png",
|
||||||
"name" => $g['name'],
|
"name" => $g['name'],
|
||||||
"id" => $g['hash'],
|
"id" => $g['id'],
|
||||||
|
"xid" => $g['hash'],
|
||||||
"uids" => explode(",",$g['uids']),
|
"uids" => explode(",",$g['uids']),
|
||||||
"link" => ''
|
"link" => ''
|
||||||
);
|
);
|
||||||
@ -122,7 +123,7 @@ function acl_init(&$a){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($type=='' || $type=='c') {
|
if ($type=='' || $type=='c') {
|
||||||
$r = q("SELECT xchan_hash as id, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick
|
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick
|
||||||
FROM abook left join xchan on abook_xchan = xchan_hash
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" ,
|
WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" ,
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
@ -186,6 +187,7 @@ function acl_init(&$a){
|
|||||||
"photo" => $g['micro'],
|
"photo" => $g['micro'],
|
||||||
"name" => $g['name'],
|
"name" => $g['name'],
|
||||||
"id" => $g['id'],
|
"id" => $g['id'],
|
||||||
|
"xid" => $g['hash'],
|
||||||
"link" => $g['url'],
|
"link" => $g['url'],
|
||||||
"nick" => $g['nick'],
|
"nick" => $g['nick'],
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user