|
@@ 492-524 (lines=33) @@
|
| 489 |
|
return $activity; |
| 490 |
|
} |
| 491 |
|
|
| 492 |
|
function get_group_blogs($user, $guid, $limit, $offset, $lang) |
| 493 |
|
{ |
| 494 |
|
$user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
| 495 |
|
if (!$user_entity) { |
| 496 |
|
return "User was not found. Please try a different GUID, username, or email address"; |
| 497 |
|
} |
| 498 |
|
if (!$user_entity instanceof ElggUser) { |
| 499 |
|
return "Invalid user. Please try a different GUID, username, or email address"; |
| 500 |
|
} |
| 501 |
|
|
| 502 |
|
$group = get_entity($guid); |
| 503 |
|
if (!$group) { |
| 504 |
|
return "Group was not found. Please try a different GUID"; |
| 505 |
|
} |
| 506 |
|
if (!$group instanceof ElggGroup) { |
| 507 |
|
return "Invalid group. Please try a different GUID"; |
| 508 |
|
} |
| 509 |
|
|
| 510 |
|
if (!elgg_is_logged_in()) { |
| 511 |
|
login($user_entity); |
| 512 |
|
} |
| 513 |
|
|
| 514 |
|
$blogs = elgg_list_entities(array( |
| 515 |
|
'type' => 'object', |
| 516 |
|
'subtype' => 'blog', |
| 517 |
|
'container_guid' => $guid, |
| 518 |
|
'limit' => $limit, |
| 519 |
|
'offset' => $offset, |
| 520 |
|
'order_by' => 'e.last_action desc' |
| 521 |
|
)); |
| 522 |
|
|
| 523 |
|
return json_decode($blogs); |
| 524 |
|
} |
| 525 |
|
|
| 526 |
|
function get_group_discussions($user, $guid, $limit, $offset, $lang) |
| 527 |
|
{ |
|
@@ 526-558 (lines=33) @@
|
| 523 |
|
return json_decode($blogs); |
| 524 |
|
} |
| 525 |
|
|
| 526 |
|
function get_group_discussions($user, $guid, $limit, $offset, $lang) |
| 527 |
|
{ |
| 528 |
|
$user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
| 529 |
|
if (!$user_entity) { |
| 530 |
|
return "User was not found. Please try a different GUID, username, or email address"; |
| 531 |
|
} |
| 532 |
|
if (!$user_entity instanceof ElggUser) { |
| 533 |
|
return "Invalid user. Please try a different GUID, username, or email address"; |
| 534 |
|
} |
| 535 |
|
|
| 536 |
|
$group = get_entity($guid); |
| 537 |
|
if (!$group) { |
| 538 |
|
return "Group was not found. Please try a different GUID"; |
| 539 |
|
} |
| 540 |
|
if (!$group instanceof ElggGroup) { |
| 541 |
|
return "Invalid group. Please try a different GUID"; |
| 542 |
|
} |
| 543 |
|
|
| 544 |
|
if (!elgg_is_logged_in()) { |
| 545 |
|
login($user_entity); |
| 546 |
|
} |
| 547 |
|
|
| 548 |
|
$discussions = elgg_list_entities(array( |
| 549 |
|
'type' => 'object', |
| 550 |
|
'subtype' => 'groupforumtopic', |
| 551 |
|
'container_guid' => $guid, |
| 552 |
|
'limit' => $limit, |
| 553 |
|
'offset' => $offset, |
| 554 |
|
'order_by' => 'e.last_action desc' |
| 555 |
|
)); |
| 556 |
|
|
| 557 |
|
return json_decode($discussions); |
| 558 |
|
} |
| 559 |
|
|
| 560 |
|
function get_group_docs($user, $guid, $limit, $offset, $lang) |
| 561 |
|
{ |
|
@@ 560-592 (lines=33) @@
|
| 557 |
|
return json_decode($discussions); |
| 558 |
|
} |
| 559 |
|
|
| 560 |
|
function get_group_docs($user, $guid, $limit, $offset, $lang) |
| 561 |
|
{ |
| 562 |
|
$user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
| 563 |
|
if (!$user_entity) { |
| 564 |
|
return "User was not found. Please try a different GUID, username, or email address"; |
| 565 |
|
} |
| 566 |
|
if (!$user_entity instanceof ElggUser) { |
| 567 |
|
return "Invalid user. Please try a different GUID, username, or email address"; |
| 568 |
|
} |
| 569 |
|
|
| 570 |
|
$group = get_entity($guid); |
| 571 |
|
if (!$group) { |
| 572 |
|
return "Group was not found. Please try a different GUID"; |
| 573 |
|
} |
| 574 |
|
if (!$group instanceof ElggGroup) { |
| 575 |
|
return "Invalid group. Please try a different GUID"; |
| 576 |
|
} |
| 577 |
|
|
| 578 |
|
if (!elgg_is_logged_in()) { |
| 579 |
|
login($user_entity); |
| 580 |
|
} |
| 581 |
|
|
| 582 |
|
$docs = elgg_list_entities(array( |
| 583 |
|
'type' => 'object', |
| 584 |
|
'subtype' => 'etherpad', |
| 585 |
|
'container_guid' => $guid, |
| 586 |
|
'limit' => $limit, |
| 587 |
|
'offset' => $offset, |
| 588 |
|
'order_by' => 'e.last_action desc' |
| 589 |
|
)); |
| 590 |
|
|
| 591 |
|
return json_decode($docs); |
| 592 |
|
} |
| 593 |
|
|
| 594 |
|
function get_group_events($user, $guid, $limit, $offset, $lang) |
| 595 |
|
{ |
|
@@ 594-626 (lines=33) @@
|
| 591 |
|
return json_decode($docs); |
| 592 |
|
} |
| 593 |
|
|
| 594 |
|
function get_group_events($user, $guid, $limit, $offset, $lang) |
| 595 |
|
{ |
| 596 |
|
$user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
| 597 |
|
if (!$user_entity) { |
| 598 |
|
return "User was not found. Please try a different GUID, username, or email address"; |
| 599 |
|
} |
| 600 |
|
if (!$user_entity instanceof ElggUser) { |
| 601 |
|
return "Invalid user. Please try a different GUID, username, or email address"; |
| 602 |
|
} |
| 603 |
|
|
| 604 |
|
$group = get_entity($guid); |
| 605 |
|
if (!$group) { |
| 606 |
|
return "Group was not found. Please try a different GUID"; |
| 607 |
|
} |
| 608 |
|
if (!$group instanceof ElggGroup) { |
| 609 |
|
return "Invalid group. Please try a different GUID"; |
| 610 |
|
} |
| 611 |
|
|
| 612 |
|
if (!elgg_is_logged_in()) { |
| 613 |
|
login($user_entity); |
| 614 |
|
} |
| 615 |
|
|
| 616 |
|
$events = elgg_list_entities(array( |
| 617 |
|
'type' => 'object', |
| 618 |
|
'subtype' => 'event_calendar', |
| 619 |
|
'container_guid' => $guid, |
| 620 |
|
'limit' => $limit, |
| 621 |
|
'offset' => $offset, |
| 622 |
|
'order_by' => 'e.last_action desc' |
| 623 |
|
)); |
| 624 |
|
|
| 625 |
|
return json_decode($events); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
function get_group_files($user, $guid, $limit, $offset, $lang) |
| 629 |
|
{ |
|
@@ 628-660 (lines=33) @@
|
| 625 |
|
return json_decode($events); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
function get_group_files($user, $guid, $limit, $offset, $lang) |
| 629 |
|
{ |
| 630 |
|
$user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
| 631 |
|
if (!$user_entity) { |
| 632 |
|
return "User was not found. Please try a different GUID, username, or email address"; |
| 633 |
|
} |
| 634 |
|
if (!$user_entity instanceof ElggUser) { |
| 635 |
|
return "Invalid user. Please try a different GUID, username, or email address"; |
| 636 |
|
} |
| 637 |
|
|
| 638 |
|
$group = get_entity($guid); |
| 639 |
|
if (!$group) { |
| 640 |
|
return "Group was not found. Please try a different GUID"; |
| 641 |
|
} |
| 642 |
|
if (!$group instanceof ElggGroup) { |
| 643 |
|
return "Invalid group. Please try a different GUID"; |
| 644 |
|
} |
| 645 |
|
|
| 646 |
|
if (!elgg_is_logged_in()) { |
| 647 |
|
login($user_entity); |
| 648 |
|
} |
| 649 |
|
|
| 650 |
|
$files = elgg_list_entities(array( |
| 651 |
|
'type' => 'object', |
| 652 |
|
'subtype' => 'file', |
| 653 |
|
'container_guid' => $guid, |
| 654 |
|
'limit' => $limit, |
| 655 |
|
'offset' => $offset, |
| 656 |
|
'order_by' => 'e.last_action desc' |
| 657 |
|
)); |
| 658 |
|
|
| 659 |
|
return json_decode($files); |
| 660 |
|
} |
| 661 |
|
|
| 662 |
|
function get_groups_members($user, $guid, $limit, $offset, $lang) |
| 663 |
|
{ |