Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Simple skeleton for an "Inbox" workspace displaying all shares received.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Feb 22, 2016
1 parent 8f06a82 commit 1c20157
Show file tree
Hide file tree
Showing 3 changed files with 517 additions and 0 deletions.
54 changes: 54 additions & 0 deletions core/src/plugins/access.inbox/class.inboxAccessDriver.php
@@ -0,0 +1,54 @@
<?php
/*
* Copyright 2007-2015 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/

defined('AJXP_EXEC') or die('Access not allowed');


class inboxAccessDriver extends fsAccessDriver
{
public function initRepository()
{
$this->detectStreamWrapper(true);
$this->urlBase = "pydio://".$this->repository->getId();
}

public function loadNodeInfo(&$ajxpNode, $parentNode = false, $details = false)
{
$mess = ConfService::getMessages();
parent::loadNodeInfo($ajxpNode, $parentNode, $details);
if(!$ajxpNode->isRoot()){
$targetUrl = inboxAccessWrapper::translateURL($ajxpNode->getUrl());
$repoId = parse_url($targetUrl, PHP_URL_HOST);
$r = ConfService::getRepositoryById($repoId);
$owner = $r->getOwner();
$leaf = $ajxpNode->isLeaf();
$meta = array(
"shared_repository_id" => $repoId,
"ajxp_description" => ($leaf?"File":"Folder")." shared by ".$owner. " ". AJXP_Utils::relativeDate($r->getOption("CREATION_TIME"), $mess)
);
if(!$leaf){
$meta["ajxp_mime"] = "shared_folder";
}
$ajxpNode->mergeMetadata($meta);
}
}

}

0 comments on commit 1c20157

Please sign in to comment.