mirror of
https://github.com/netzbegruenung/circles.git
synced 2024-05-12 08:06:05 +02:00
ocs + removing navigation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
0e1b0ab196
commit
4262c6dba9
|
@ -26,6 +26,8 @@
|
|||
|
||||
return [
|
||||
'ocs' => [
|
||||
['name' => 'Local#circles', 'url' => '/circles', 'verb' => 'GET'],
|
||||
['name' => 'Local#create', 'url' => '/circles', 'verb' => 'POST']
|
||||
],
|
||||
'routes' => [
|
||||
['name' => 'Settings#getSettings', 'url' => '/admin/settings', 'verb' => 'GET'],
|
||||
|
@ -34,7 +36,6 @@ return [
|
|||
['name' => 'Test#testAsyncStatus', 'url' => '/admin/testAsync', 'verb' => 'GET'],
|
||||
['name' => 'Test#testAsyncReset', 'url' => '/admin/testAsync', 'verb' => 'DELETE'],
|
||||
['name' => 'Test#testAsyncRun', 'url' => '/admin/testAsync', 'verb' => 'PUT'],
|
||||
['name' => 'Navigation#navigate', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'Navigation#settings', 'url' => '/settings', 'verb' => 'GET'],
|
||||
['name' => 'Circles#create', 'url' => '/v1/circles', 'verb' => 'PUT'],
|
||||
['name' => 'Circles#listing', 'url' => '/v1/circles', 'verb' => 'GET'],
|
||||
|
@ -66,9 +67,10 @@ return [
|
|||
['name' => 'Shares#create', 'url' => '/v1/circles/{circleUniqueId}/share', 'verb' => 'PUT'],
|
||||
|
||||
['name' => 'RemoteWrapper#asyncBroadcast', 'url' => '/async/{token}/', 'verb' => 'POST'],
|
||||
// ['name' => 'RemoteWrapper#broadcast', 'url' => '/v1/gs/broadcast', 'verb' => 'POST'],
|
||||
// ['name' => 'RemoteWrapper#status', 'url' => '/v1/gs/status', 'verb' => 'POST'],
|
||||
// ['name' => 'RemoteWrapper#broadcast', 'url' => '/v1/gs/broadcast', 'verb' => 'POST'],
|
||||
// ['name' => 'RemoteWrapper#status', 'url' => '/v1/gs/status', 'verb' => 'POST'],
|
||||
|
||||
['name' => 'Remote#appService', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'Remote#test', 'url' => '/test/', 'verb' => 'GET'],
|
||||
['name' => 'Remote#event', 'url' => '/event/', 'verb' => 'POST'],
|
||||
['name' => 'Remote#incoming', 'url' => '/incoming/', 'verb' => 'POST'],
|
||||
|
|
8
composer.lock
generated
8
composer.lock
generated
|
@ -12,12 +12,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/daita/my-small-php-tools.git",
|
||||
"reference": "de8ec51e51eb8a1e4d752dbd3a25bf07428f4cb9"
|
||||
"reference": "1aa50b2063c7a9d73fad60e37be676229c4ed5bf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/daita/my-small-php-tools/zipball/de8ec51e51eb8a1e4d752dbd3a25bf07428f4cb9",
|
||||
"reference": "de8ec51e51eb8a1e4d752dbd3a25bf07428f4cb9",
|
||||
"url": "https://api.github.com/repos/daita/my-small-php-tools/zipball/1aa50b2063c7a9d73fad60e37be676229c4ed5bf",
|
||||
"reference": "1aa50b2063c7a9d73fad60e37be676229c4ed5bf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -45,7 +45,7 @@
|
|||
"issues": "https://github.com/daita/my-small-php-tools/issues",
|
||||
"source": "https://github.com/daita/my-small-php-tools/tree/master"
|
||||
},
|
||||
"time": "2021-02-16T02:17:26+00:00"
|
||||
"time": "2021-02-22T13:33:04+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
|
|
@ -128,7 +128,6 @@ class Application extends App implements IBootstrap {
|
|||
$context->injectFn(Closure::fromCallable([$this, 'registerMountProvider']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerDavHooks']));
|
||||
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerNavigation']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerFilesNavigation']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerFilesPlugin']));
|
||||
}
|
||||
|
@ -165,34 +164,6 @@ class Application extends App implements IBootstrap {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register Navigation elements
|
||||
*
|
||||
* @param IServerContainer $container
|
||||
*/
|
||||
public function registerNavigation(IServerContainer $container) {
|
||||
if (!$this->configService->stillFrontEnd()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$appManager = $container->getNavigationManager();
|
||||
$appManager->add(
|
||||
function() {
|
||||
$urlGen = OC::$server->getURLGenerator();
|
||||
$navName = OC::$server->getL10N(self::APP_ID)
|
||||
->t('Circles');
|
||||
|
||||
return [
|
||||
'id' => self::APP_ID,
|
||||
'order' => 5,
|
||||
'href' => $urlGen->linkToRoute('circles.Navigation.navigate'),
|
||||
'icon' => $urlGen->imagePath(self::APP_ID, 'circles.svg'),
|
||||
'name' => $navName
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public function registerFilesPlugin(IServerContainer $container) {
|
||||
$eventDispatcher = $container->getEventDispatcher();
|
||||
$eventDispatcher->addListener(
|
||||
|
@ -229,6 +200,5 @@ class Application extends App implements IBootstrap {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
150
lib/Controller/LocalController.php
Normal file
150
lib/Controller/LocalController.php
Normal file
|
@ -0,0 +1,150 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
/**
|
||||
* Circles - Bring cloud-users closer together.
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Maxence Lange <maxence@artificial-owl.com>
|
||||
* @copyright 2021
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
namespace OCA\Circles\Controller;
|
||||
|
||||
|
||||
use daita\MySmallPhpTools\Traits\Nextcloud\nc21\TNC21Controller;
|
||||
use daita\MySmallPhpTools\Traits\Nextcloud\nc21\TNC21Deserialize;
|
||||
use Exception;
|
||||
use OCA\Circles\Exceptions\CircleNotFoundException;
|
||||
use OCA\Circles\Exceptions\FederatedUserNotFoundException;
|
||||
use OCA\Circles\Exceptions\InitiatorNotFoundException;
|
||||
use OCA\Circles\Exceptions\InvalidIdException;
|
||||
use OCA\Circles\Service\CircleService;
|
||||
use OCA\Circles\Service\ConfigService;
|
||||
use OCA\Circles\Service\FederatedUserService;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserSession;
|
||||
|
||||
|
||||
/**
|
||||
* Class LocalController
|
||||
*
|
||||
* @package OCA\Circles\Controller
|
||||
*/
|
||||
class LocalController extends OcsController {
|
||||
|
||||
|
||||
use TNC21Deserialize;
|
||||
use TNC21Controller;
|
||||
|
||||
|
||||
/** @var IUserSession */
|
||||
private $userSession;
|
||||
|
||||
/** @var FederatedUserService */
|
||||
private $federatedUserService;
|
||||
|
||||
/** @var CircleService */
|
||||
private $circleService;
|
||||
|
||||
/** @var ConfigService */
|
||||
protected $configService;
|
||||
|
||||
|
||||
/**
|
||||
* BaseController constructor.
|
||||
*
|
||||
* @param string $appName
|
||||
* @param IRequest $request
|
||||
* @param IUserSession $userSession
|
||||
* @param FederatedUserService $federatedUserService
|
||||
* @param CircleService $circleService
|
||||
* @param ConfigService $configService
|
||||
*/
|
||||
public function __construct(
|
||||
$appName, IRequest $request, IUserSession $userSession, FederatedUserService $federatedUserService,
|
||||
CircleService $circleService, ConfigService $configService
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userSession = $userSession;
|
||||
$this->federatedUserService = $federatedUserService;
|
||||
$this->circleService = $circleService;
|
||||
$this->configService = $configService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @return DataResponse
|
||||
* @throws CircleNotFoundException
|
||||
* @throws FederatedUserNotFoundException
|
||||
* @throws InvalidIdException
|
||||
* @throws InitiatorNotFoundException
|
||||
*/
|
||||
public function circles(): DataResponse {
|
||||
$this->setCurrentFederatedUser();
|
||||
|
||||
return $this->success($this->circleService->getCircles(), false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $personal
|
||||
*
|
||||
* @return DataResponse
|
||||
* @throws CircleNotFoundException
|
||||
* @throws FederatedUserNotFoundException
|
||||
* @throws InitiatorNotFoundException
|
||||
* @throws InvalidIdException
|
||||
*/
|
||||
public function create(string $name, bool $personal = false): DataResponse {
|
||||
$this->setCurrentFederatedUser();
|
||||
|
||||
try {
|
||||
$result = $this->circleService->create($name);
|
||||
|
||||
return $this->successObj($result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws CircleNotFoundException
|
||||
* @throws FederatedUserNotFoundException
|
||||
* @throws InvalidIdException
|
||||
*/
|
||||
private function setCurrentFederatedUser() {
|
||||
$user = $this->userSession->getUser();
|
||||
$this->federatedUserService->setLocalCurrentUser($user);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -26,65 +26,14 @@
|
|||
|
||||
namespace OCA\Circles\Controller;
|
||||
|
||||
use daita\MySmallPhpTools\Exceptions\JsonNotRequestedException;
|
||||
use daita\MySmallPhpTools\Exceptions\SignatoryException;
|
||||
use daita\MySmallPhpTools\Traits\Nextcloud\nc21\TNC21LocalSignatory;
|
||||
use Exception;
|
||||
use OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException;
|
||||
use OCA\Circles\AppInfo\Application;
|
||||
use OCA\Circles\Model\DeprecatedCircle;
|
||||
use OCA\Circles\Service\ConfigService;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
|
||||
class NavigationController extends BaseController {
|
||||
|
||||
|
||||
use TNC21LocalSignatory;
|
||||
|
||||
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
* @NoSubAdminRequired
|
||||
* @PublicPage
|
||||
*
|
||||
* @return Response
|
||||
* @throws Exception
|
||||
*/
|
||||
public function navigate(): Response {
|
||||
try {
|
||||
return $this->appService();
|
||||
} catch (JsonNotRequestedException $e) {
|
||||
}
|
||||
|
||||
$this->mustHaveFrontEndEnabled();
|
||||
|
||||
$data = [
|
||||
'allowed_circles' => array(
|
||||
DeprecatedCircle::CIRCLES_PERSONAL => $this->configService->isCircleAllowed(
|
||||
DeprecatedCircle::CIRCLES_PERSONAL
|
||||
),
|
||||
DeprecatedCircle::CIRCLES_SECRET => $this->configService->isCircleAllowed(
|
||||
DeprecatedCircle::CIRCLES_SECRET
|
||||
),
|
||||
DeprecatedCircle::CIRCLES_CLOSED => $this->configService->isCircleAllowed(
|
||||
DeprecatedCircle::CIRCLES_CLOSED
|
||||
),
|
||||
DeprecatedCircle::CIRCLES_PUBLIC => $this->configService->isCircleAllowed(
|
||||
DeprecatedCircle::CIRCLES_PUBLIC
|
||||
),
|
||||
)
|
||||
];
|
||||
|
||||
return new TemplateResponse(
|
||||
Application::APP_ID, 'navigate', $data
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoSubAdminRequired
|
||||
|
@ -118,21 +67,6 @@ class NavigationController extends BaseController {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Response
|
||||
* @throws NotLoggedInException
|
||||
* @throws JsonNotRequestedException
|
||||
* @throws SignatoryException
|
||||
*/
|
||||
public function appService(): Response {
|
||||
$this->setup('app', 'circles');
|
||||
$this->publicPageJsonLimited();
|
||||
|
||||
$confirm = $this->request->getParam('auth', '');
|
||||
return new DataResponse($this->remoteStreamService->getAppSignatory(false, $confirm));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace OCA\Circles\Controller;
|
|||
use daita\MySmallPhpTools\Exceptions\InvalidItemException;
|
||||
use daita\MySmallPhpTools\Exceptions\InvalidOriginException;
|
||||
use daita\MySmallPhpTools\Exceptions\ItemNotFoundException;
|
||||
use daita\MySmallPhpTools\Exceptions\JsonNotRequestedException;
|
||||
use daita\MySmallPhpTools\Exceptions\MalformedArrayException;
|
||||
use daita\MySmallPhpTools\Exceptions\SignatoryException;
|
||||
use daita\MySmallPhpTools\Exceptions\SignatureException;
|
||||
|
@ -41,7 +42,9 @@ use daita\MySmallPhpTools\Exceptions\UnknownTypeException;
|
|||
use daita\MySmallPhpTools\Model\Nextcloud\nc21\NC21SignedRequest;
|
||||
use daita\MySmallPhpTools\Model\SimpleDataStore;
|
||||
use daita\MySmallPhpTools\Traits\Nextcloud\nc21\TNC21Controller;
|
||||
use daita\MySmallPhpTools\Traits\Nextcloud\nc21\TNC21LocalSignatory;
|
||||
use Exception;
|
||||
use OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException;
|
||||
use OCA\Circles\Db\CircleRequest;
|
||||
use OCA\Circles\Exceptions\CircleNotFoundException;
|
||||
use OCA\Circles\Exceptions\FederatedEventDSyncException;
|
||||
|
@ -73,6 +76,7 @@ class RemoteController extends Controller {
|
|||
|
||||
|
||||
use TNC21Controller;
|
||||
use TNC21LocalSignatory;
|
||||
|
||||
|
||||
/** @var CircleRequest */
|
||||
|
@ -129,6 +133,29 @@ class RemoteController extends Controller {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @return DataResponse
|
||||
* @throws NotLoggedInException
|
||||
* @throws SignatoryException
|
||||
*/
|
||||
public function appService(): DataResponse {
|
||||
$this->setup('app', 'circles');
|
||||
|
||||
try {
|
||||
$this->publicPageJsonLimited();
|
||||
} catch (JsonNotRequestedException $e) {
|
||||
return new DataResponse([]);
|
||||
}
|
||||
|
||||
$confirm = $this->request->getParam('auth', '');
|
||||
|
||||
return new DataResponse($this->remoteStreamService->getAppSignatory(false, $confirm));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
* @NoCSRFRequired
|
||||
|
|
|
@ -614,7 +614,7 @@ class ConfigService {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRemotePath(string $route = 'circles.Navigation.navigate', array $args = []): string {
|
||||
public function getRemotePath(string $route = 'circles.Remote.appService', array $args = []): string {
|
||||
$base = $this->getAppValue(self::LOCAL_CLOUD_SCHEME) . '://' . $this->getLocalInstance();
|
||||
|
||||
if ($route === '') {
|
||||
|
|
|
@ -60,6 +60,7 @@ use OCA\Circles\Model\Federated\RemoteInstance;
|
|||
use OCA\Circles\Model\FederatedUser;
|
||||
use OCA\Circles\Model\ManagedModel;
|
||||
use OCA\Circles\Model\Member;
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
|
||||
|
||||
|
@ -128,15 +129,21 @@ class FederatedUserService {
|
|||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * @param string $userId
|
||||
// *
|
||||
// * @throws CircleNotFoundException
|
||||
// * @throws NoUserException
|
||||
// */
|
||||
// public function setLocalInitiator(string $userId): void {
|
||||
// $this->currentUser = $this->createLocalFederatedUser($userId);
|
||||
// }
|
||||
/**
|
||||
* @param IUser|null $user
|
||||
*
|
||||
* @throws CircleNotFoundException
|
||||
* @throws FederatedUserNotFoundException
|
||||
* @throws InvalidIdException
|
||||
*/
|
||||
public function setLocalCurrentUser(?IUser $user) {
|
||||
if ($user === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->currentUser = $this->getLocalFederatedUser($user->getUID());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set a CurrentUser, based on a IFederatedUser.
|
||||
|
|
|
@ -82,6 +82,14 @@ class RemoteUpstreamService {
|
|||
private $configService;
|
||||
|
||||
|
||||
/**
|
||||
* RemoteUpstreamService constructor.
|
||||
*
|
||||
* @param IL10N $l10n
|
||||
* @param RemoteWrapperRequest $remoteWrapperRequest
|
||||
* @param RemoteStreamService $remoteStreamService
|
||||
* @param ConfigService $configService
|
||||
*/
|
||||
public function __construct(
|
||||
IL10N $l10n, RemoteWrapperRequest $remoteWrapperRequest, RemoteStreamService $remoteStreamService,
|
||||
ConfigService $configService
|
||||
|
|
|
@ -1,449 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Circles - Bring cloud-users closer together.
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Maxence Lange <maxence@pontapreta.net>
|
||||
* @copyright 2017
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use OCA\Circles\Api\v1\Circles;
|
||||
use OCA\Circles\AppInfo\Application;
|
||||
|
||||
script(Application::APP_ID, 'vendor/notyf');
|
||||
style(Application::APP_ID, 'notyf');
|
||||
|
||||
Circles::addJavascriptAPI();
|
||||
script(
|
||||
Application::APP_ID, [
|
||||
'jquery',
|
||||
'circles.app.elements', 'circles.app.actions',
|
||||
'circles.app.navigation', 'circles.app.settings',
|
||||
'circles.app.results.circles', 'circles.app.results.members',
|
||||
'circles.app.results.groups', 'circles.app.results.links',
|
||||
'circles.app'
|
||||
]
|
||||
);
|
||||
|
||||
style(Application::APP_ID, 'navigation');
|
||||
?>
|
||||
|
||||
|
||||
<div id="circle-navigation" class="noborder" style="position: relative">
|
||||
<div class="navigation-element" style="height: 100%; padding-top: 15px">
|
||||
<input id="circles_new_name" type="text"
|
||||
placeholder="<?php p($l->t('Create a new circle')); ?>" />
|
||||
<select id="circles_new_type" style="display: none;" class="select_none">
|
||||
<option value="" style="font-style: italic"> <?php p(
|
||||
$l->t("Select a circle type")
|
||||
); ?></option>
|
||||
<?php
|
||||
|
||||
// Personal Circle
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PERSONAL]) {
|
||||
print_unescaped(
|
||||
sprintf(
|
||||
'<option value="%s">%s</option>',
|
||||
\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PERSONAL,
|
||||
$l->t("Create a personal circle")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Public Circle
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PUBLIC]) {
|
||||
print_unescaped(
|
||||
sprintf(
|
||||
'<option value="%s">%s</option>',
|
||||
\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PUBLIC,
|
||||
$l->t("Create a public circle")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Closed Circle
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_CLOSED]) {
|
||||
print_unescaped(
|
||||
sprintf(
|
||||
'<option value="%s">%s</option>',
|
||||
\OCA\Circles\Model\DeprecatedCircle::CIRCLES_CLOSED,
|
||||
$l->t("Create a closed circle")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Secret Circle
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_SECRET]) {
|
||||
print_unescaped(
|
||||
sprintf(
|
||||
'<option value="%s">%s</option>',
|
||||
\OCA\Circles\Model\DeprecatedCircle::CIRCLES_SECRET,
|
||||
$l->t("Create a secret circle")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</select>
|
||||
<input id="circles_new_submit" type="submit" value="<?php p($l->t('Creation')); ?>"
|
||||
style="display: none;" />
|
||||
|
||||
<div id="circles_new_type_definition" style="display: none;">
|
||||
<div id="circles_new_type_1"><b>
|
||||
<?php p(
|
||||
$l->t(
|
||||
"A personal circle is a list of users known only to the owner."
|
||||
)
|
||||
); ?>
|
||||
</b><br />
|
||||
<?php p(
|
||||
$l->t(
|
||||
"This is the right option if you want to do recurrent sharing with the same list of local users."
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
<div id="circles_new_type_2"><b>
|
||||
<?php p(
|
||||
$l->t(
|
||||
"A secret circle is an hidden group that can only be seen by its members or by people knowing the exact name of the circle."
|
||||
)
|
||||
); ?></b><br /><?php p(
|
||||
$l->t(
|
||||
"Non-members won't be able to find your secret circle using the search bar."
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
<div id="circles_new_type_4"><b><?php p(
|
||||
$l->t(
|
||||
"Joining a closed circle requires an invitation or confirmation by a moderator."
|
||||
)
|
||||
); ?>
|
||||
</b><br /><?php p(
|
||||
$l->t(
|
||||
"Anyone can find and request an invitation to the circle; but only members will see who's in it and get access to it's shared items."
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
<div id="circles_new_type_8"><b><?php p(
|
||||
$l->t(
|
||||
"A public circle is an open group visible to anyone willing to join."
|
||||
)
|
||||
); ?></b><br /><?php p(
|
||||
$l->t(
|
||||
"Anyone can see, join, and access the items shared within the circle."
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="circles_list">
|
||||
|
||||
<?php
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PERSONAL]) {
|
||||
print_unescaped(
|
||||
'<div circle-type="' . \OCA\Circles\Model\DeprecatedCircle::CIRCLES_PERSONAL . '">' . $l->t(
|
||||
'Personal circles'
|
||||
) . '</div>'
|
||||
);
|
||||
}
|
||||
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_PUBLIC]) {
|
||||
print_unescaped(
|
||||
'<div circle-type="' . \OCA\Circles\Model\DeprecatedCircle::CIRCLES_PUBLIC . '">' . $l->t(
|
||||
'Public circles'
|
||||
) . '</div>'
|
||||
);
|
||||
}
|
||||
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_CLOSED]) {
|
||||
print_unescaped(
|
||||
'<div circle-type="' . \OCA\Circles\Model\DeprecatedCircle::CIRCLES_CLOSED . '">' . $l->t(
|
||||
'Closed circles'
|
||||
) . '</div>'
|
||||
);
|
||||
}
|
||||
|
||||
if ($_['allowed_circles'][\OCA\Circles\Model\DeprecatedCircle::CIRCLES_SECRET]) {
|
||||
print_unescaped(
|
||||
'<div circle-type="' . \OCA\Circles\Model\DeprecatedCircle::CIRCLES_SECRET . '">' . $l->t(
|
||||
'Secret circles'
|
||||
) . '</div>'
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div circle-type="all"><?php p($l->t('All circles')); ?></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="circle-navigation" class="circles" style="display: none;">
|
||||
<input id="circles_search" type="text"
|
||||
placeholder="<?php p($l->t('Search circles')); ?>" />
|
||||
<select id="circles_filters">
|
||||
<option value="0"><?php p($l->t('No filter')); ?></option>
|
||||
<option value="1"><?php p($l->t('Circles you belong to')); ?></option>
|
||||
<option value="9"><?php p($l->t('Circles you own')); ?></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<script id="tmpl_circle" type="text/template">
|
||||
<div class="title">%title%</div>
|
||||
<div class="type"><b>%type%</b> (%status%, %level_string%)</div>
|
||||
<div class="owner"><b><?php p($l->t('Owner')); ?>:</b> %owner%</div>
|
||||
</script>
|
||||
|
||||
<div id="app-content" style="position: relative">
|
||||
|
||||
<div id="emptycontent">
|
||||
<div class="icon-circles"></div>
|
||||
<h2><?php p($l->t('No circle selected')); ?></h2>
|
||||
</div>
|
||||
|
||||
<div id="mainui">
|
||||
|
||||
<div id="circle_details">
|
||||
<div class="lightenbg">
|
||||
<input id="adminsettingscircle" type="submit"
|
||||
value="<?php p($l->t('Settings')); ?>" />
|
||||
</div>
|
||||
<div id="name"></div>
|
||||
<div id="type"></div>
|
||||
|
||||
|
||||
<div id="circle-actions">
|
||||
<div id="circle-actions-buttons">
|
||||
<div id="joincircle_invit"><?php p(
|
||||
$l->t("Pending invitation to join this circle")
|
||||
); ?></div>
|
||||
<div id="joincircle_request"><?php p(
|
||||
$l->t('You have a pending request to join this circle')
|
||||
); ?></div>
|
||||
<button id="circle-actions-add" class="icon-add-user"
|
||||
title="<?php p($l->t('Add a member')); ?>"></button>
|
||||
<button id="circle-actions-group" class="icon-link-group"
|
||||
title="<?php p($l->t('Link a group')); ?>"></button>
|
||||
<button id="circle-actions-link" class="icon-public"
|
||||
title="<?php p($l->t('Link a circle')); ?>"></button>
|
||||
<button id="circle-actions-join" class="icon-join"
|
||||
title="<?php p($l->t('Join this circle')); ?>"></button>
|
||||
<button id="circle-actions-delete" class="icon-delete"
|
||||
title="<?php p($l->t('Delete circle')); ?>"></button>
|
||||
<button id="circle-actions-settings" class="icon-settings-dark"
|
||||
title="<?php p($l->t('Edit circle')); ?>"></button>
|
||||
</div>
|
||||
|
||||
<div id="circle-actions-more">
|
||||
<input id="joincircle_acceptinvit" type="submit"
|
||||
value="<?php p($l->t('Accept the invitation')); ?>" />
|
||||
<input id="joincircle_rejectinvit" type="submit"
|
||||
value="<?php p($l->t('Decline the invitation')); ?>" />
|
||||
<input id="joincircle" type="submit"
|
||||
value="<?php p($l->t('Join this circle')); ?>" />
|
||||
<input id="leavecircle" type="submit"
|
||||
value="<?php p($l->t('Leave this circle')); ?>" />
|
||||
<input id="addmember" type="text"
|
||||
placeholder="<?php p($l->t('Add a member')); ?>" />
|
||||
<input id="linkgroup" type="text"
|
||||
placeholder="<?php p($l->t('Link a group')); ?>" />
|
||||
<input id="linkcircle" type="text"
|
||||
placeholder="<?php p($l->t('Link to a circle')); ?>" />
|
||||
<button id="circle-actions-return" class="icon-close"
|
||||
title="<?php p($l->t('Return to menu')); ?>"></button>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="members_search_result"></div>
|
||||
<div id="groups_search_result"></div>
|
||||
</div>
|
||||
<div id="circledata">
|
||||
<div id="circle_desc"></div>
|
||||
<div id="memberslist">
|
||||
<table id="memberslist_table">
|
||||
<tr class="header">
|
||||
<td class="username"><?php p($l->t('Username')); ?></td>
|
||||
<td class="level"><?php p($l->t('Level')); ?></td>
|
||||
<td class="status"><?php p($l->t('Status')); ?></td>
|
||||
<td class="joined"><?php p($l->t('Joined')); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><br /><br /><br />
|
||||
|
||||
<table id="groupslist_table">
|
||||
<tr class="header">
|
||||
<td class="groupid"><?php p($l->t('Group Name')); ?></td>
|
||||
<td class="level"><?php p($l->t('Level')); ?></td>
|
||||
<!-- <td class="joined">--><?php //p($l->t('Joined')); ?><!--</td>-->
|
||||
</tr>
|
||||
</table>
|
||||
<br /><br /><br /><br />
|
||||
|
||||
<table id="linkslist_table">
|
||||
<tr class="header">
|
||||
<td class="address"><?php p($l->t('Link')); ?></td>
|
||||
<td class="status"><?php p($l->t('Status')); ?></td>
|
||||
<td class="linked"><?php p($l->t('Linked')); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script id="tmpl_member" type="text/template">
|
||||
<tr class="entry" member-id="%username%" member-type="%type%" member-level="%level%"
|
||||
member-instance="%instance%"
|
||||
member-levelString="%levelString%"
|
||||
member-status="%status%">
|
||||
<td class="username" style="padding-left: 15px;">%displayname%</td>
|
||||
<td class="level">
|
||||
<select class="level-select">
|
||||
<option value="1"><?php p($l->t('Member')); ?></option>
|
||||
<option value="4"><?php p($l->t('Moderator')); ?></option>
|
||||
<option value="8"><?php p($l->t('Admin')); ?></option>
|
||||
<option value="9"><?php p($l->t('Owner')); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="status">
|
||||
<select class="status-select">
|
||||
</select>
|
||||
</td>
|
||||
<td class="joined">%joined%</td>
|
||||
<td>
|
||||
<div class="icon-checkmark" style="display: none;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
<script id="tmpl_group" type="text/template">
|
||||
<tr class="entry" group-id="%groupid%" group-level="%level%">
|
||||
<td class="groupid" style="padding-left: 15px;">%groupid%</td>
|
||||
<td class="level">
|
||||
<select class="level-select">
|
||||
<option value="1"><?php p($l->t('Member')); ?></option>
|
||||
<option value="4"><?php p($l->t('Moderator')); ?></option>
|
||||
<option value="8"><?php p($l->t('Admin')); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<!-- <td class="joined">%joined%</td>-->
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
<script id="tmpl_link" type="text/template">
|
||||
<tr class="entry" link-id="%id%" link-address="%address%"
|
||||
link-status="%status%">
|
||||
<td class="address" style="padding-left: 15px;">%token%@%address%</td>
|
||||
<td class="status">
|
||||
<select class="link-status-select">
|
||||
</select>
|
||||
</td>
|
||||
<td class="joined">%joined%</td>
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="settings-panel">
|
||||
<table id="settings-table">
|
||||
|
||||
<tr>
|
||||
<td class="left"><?php p($l->t('Name of the Circle')); ?></td>
|
||||
<td colspan="2"><input type="text" id="settings-name" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="left" style="vertical-align: top"><?php p($l->t('Description')); ?></td>
|
||||
<td colspan="2"><textarea type="text" id="settings-desc"></textarea></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr id="settings-entry-limit">
|
||||
<td class="left"><?php p($l->t('Members limit')); ?><br />
|
||||
<span class="hint"><?php p(
|
||||
$l->t(
|
||||
'Change the limit to the number of members. (0: default, -1: unlimited)'
|
||||
)
|
||||
); ?></span>
|
||||
</td>
|
||||
<td colspan="2"><input type="text" value="" id="settings-limit"></td>
|
||||
</tr>
|
||||
|
||||
<tr id="settings-password-enforcement">
|
||||
<td class="left"><?php p($l->t('Password enforcement')); ?><br />
|
||||
<span class="hint"><?php p(
|
||||
$l->t('External share will be protected by a randomly generated password')
|
||||
); ?></span>
|
||||
</td>
|
||||
<td colspan="2"><input type="checkbox" value="1" id="settings-password"></td>
|
||||
</tr>
|
||||
|
||||
<tr id="settings-password-single">
|
||||
<td class="left"><?php p($l->t('Single password')); ?><br />
|
||||
<span class="hint"><?php p(
|
||||
$l->t(
|
||||
'One password for all shares. If not, a randomly generated password is sent by mail.'
|
||||
)
|
||||
); ?></span>
|
||||
</td>
|
||||
<td><input type="checkbox" value="1" id="single-password-enabled"></td>
|
||||
<td><input type="text" value="" id="single-password" placeholder="<?php p($l->t('Change password')); ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr id="settings-entry-link">
|
||||
<td class="left"><?php p($l->t('Allow Federated Links')); ?><br />
|
||||
<span class="hint"><?php p(
|
||||
$l->t(
|
||||
'Makes the circle federated, and enables sharing between federated circles'
|
||||
)
|
||||
); ?></span>
|
||||
</td>
|
||||
<td colspan="2"><input type="checkbox" value="1" id="settings-link"></td>
|
||||
</tr>
|
||||
<!--<tr id="settings-entry-link-files">
|
||||
<td class="left">Share Files With Linked Circles<br/>
|
||||
<span class="hint">Files that are locally shared with this circle will be shared with all Linked circles</span>
|
||||
</td>
|
||||
<td><input type="checkbox" value="1" id="settings-link-files"></td>
|
||||
</tr>-->
|
||||
<tr id="settings-entry-link-auto">
|
||||
<td class="left"><?php p($l->t('Accept Link Request Automatically')); ?>
|
||||
<br />
|
||||
<span class="hint"><?php p(
|
||||
$l->t(
|
||||
'Warning: Enabling this will automatically accept new link requests from other circles.'
|
||||
)
|
||||
); ?></span>
|
||||
</td>
|
||||
<td colspan="2"><input type="checkbox" value="1" id="settings-link-auto"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center;">
|
||||
<input type="submit" id="settings-submit"
|
||||
value="<?php p($l->t('Save settings')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue