public function __construct(Factory $languageFactory)
 {
     $this->languageFactory = $languageFactory;
     foreach (Data::findAllGroup() as $group) {
         $this->groups[$group['id']] = $group['name'];
     }
 }
Пример #2
0
 public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager)
 {
     $this->languageFactory = $languageFactory;
     $this->URLGenerator = $URLGenerator;
     $this->activityManager = $activityManager;
     foreach (Data::findAllGroup() as $group) {
         $this->groups[$group['id']] = $group['name'];
     }
 }
Пример #3
0
                $l = \OC::$server->getL10N('core');
                OCP\JSON::error(array('data' => array('message' => $l->t("Couldn't send mail to following users: %s ", implode(', ', $result)))));
            }
            break;
    }
} else {
    if (isset($_GET['fetch'])) {
        switch ($_GET['fetch']) {
            case 'getItemsSharedStatuses':
                if (isset($_GET['itemType'])) {
                    $return = OCP\Share::getItemsShared((string) $_GET['itemType'], OCP\Share::FORMAT_STATUSES);
                    is_array($return) ? OC_JSON::success(array('data' => $return)) : OC_JSON::error();
                }
                break;
            case 'getItem':
                foreach (\OCA\Sharing_Group\Data::findAllGroup() as $group) {
                    $sharing_groups[$group['id']] = $group['name'];
                }
                if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkReshare']) && isset($_GET['checkShares'])) {
                    if ($_GET['checkReshare'] == 'true') {
                        $reshare = OCP\Share::getItemSharedWithBySource((string) $_GET['itemType'], (string) $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true);
                    } else {
                        $reshare = false;
                    }
                    if ($_GET['checkShares'] == 'true') {
                        $shares = OCP\Share::getItemShared((string) $_GET['itemType'], (string) $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true);
                        foreach ($shares as $index => $share) {
                            if ($share['share_type'] === OCP\Share::SHARE_TYPE_SHARING_GROUP) {
                                $share['share_with_displayname'] = $sharing_groups[$share['share_with_displayname']];
                                $shares[$index] = $share;
                            }