summaryrefslogtreecommitdiffstats
path: root/app/view/common
diff options
context:
space:
mode:
Diffstat (limited to 'app/view/common')
-rw-r--r--app/view/common/group.setting.modal.view.php96
-rw-r--r--app/view/common/newgroup.modal.view.php49
-rw-r--r--app/view/common/ownership.setting.modal.view.php35
-rw-r--r--app/view/common/permissions.setting.modal.view.php82
-rw-r--r--app/view/common/setting.modal.view.php14
-rw-r--r--app/view/common/topp.view.php26
6 files changed, 300 insertions, 2 deletions
diff --git a/app/view/common/group.setting.modal.view.php b/app/view/common/group.setting.modal.view.php
new file mode 100644
index 0000000..d0e11ca
--- /dev/null
+++ b/app/view/common/group.setting.modal.view.php
@@ -0,0 +1,96 @@
+<?php
+
+/*
+ * SCROTT Copyright (C) 2016 Malf Furious
+ *
+ * Scrott is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Scrott is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ */
+
+?>
+
+<?php require_once "view/common/permissions.setting.modal.view.php"; ?>
+
+<div class="tab-pane fade <?=$mod->getSettingModalTabDispClasses()?>" id="settGroupTab">
+ <p>&nbsp;</p>
+
+ <form method="post" action="<?=$mod->ap()?>" enctype="multipart/form-data">
+ <input type="hidden" name="input[action]" value="common-setting-group" />
+ <input type="hidden" name="input[guid]" value="<?=$mod->group->guid?>" />
+
+ <div class="row">
+ <div class="col-md-8">
+ <div class="form-group">
+ <label>Group name</label>
+ <input type="text" name="input[name]" class="form-control" value="<?=$mod->group->name?>" required="true" maxlength="50" <?=($mod->group->canModify($mod->getCurrentUser()) ? "" : "disabled")?> />
+ </div>
+ </div>
+
+ <div class="col-md-4 text-center">
+ <img src="<?=$mod->group->getHeadImage()?>" alt="<?=$mod->group->name?>" class="img-circle" height="100" />
+
+ <?php if ($mod->group->canModify($mod->getCurrentUser())) { ?>
+ <br />
+ <br />
+ <button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#inputGroupImageCollapse">
+ <span class="glyphicon glyphicon-camera"></span> Upload new image
+ </button>
+ <br />
+ <button type="submit" name="input[rmImage]" class="btn btn-danger btn-xs" onclick="return assertConfirm()">
+ <span class="glyphicon glyphicon-remove"></span> Remove image
+ </button>
+ <?php } ?>
+ </div>
+ </div>
+
+ <div class="collapse" id="inputGroupImageCollapse">
+ <div class="form-group">
+ <label>Group Image</label>
+ <input type="file" name="attachment" />
+ </div>
+ </div>
+
+ <?php common_setting_permissions($mod, $mod->group); ?>
+
+ <?php if ($mod->group->canModify($mod->getCurrentUser())) { ?>
+ <p>&nbsp;</p>
+ <button type="submit" class="btn btn-success pull-right">Save</button>
+ <?php } ?>
+ </form>
+
+ <p>&nbsp;</p>
+ <p>&nbsp;</p>
+
+ <div class="btn-toolbar pull-right">
+ <?php if ($mod->group->canModifyMembers($mod->getCurrentUser())) { ?>
+ <div class="btn-group">
+ <a href="<?=$mod->group->getURL()?>/members" class="btn btn-primary btn-xs">
+ <span class="glyphicon glyphicon-user"></span> Manage Members
+ </a>
+ </div>
+ <?php } ?>
+
+ <?php if ($mod->group->isOwner($mod->getCurrentUser())) { ?>
+ <div class="btn-group">
+ <a href="<?=$mod->group->getURL()?>/transfer" class="btn btn-danger btn-xs">
+ <span class="glyphicon glyphicon-new-window"></span> Transfer Ownership
+ </a>
+ </div>
+
+ <div class="btn-group">
+ <a href="<?=$mod->group->getURL()?>/delete" class="btn btn-danger btn-xs">
+ <span class="glyphicon glyphicon-trash"></span> Delete Group
+ </a>
+ </div>
+ <?php } ?>
+ </div>
+
+ <p>&nbsp;</p>
+</div>
diff --git a/app/view/common/newgroup.modal.view.php b/app/view/common/newgroup.modal.view.php
new file mode 100644
index 0000000..3dd631c
--- /dev/null
+++ b/app/view/common/newgroup.modal.view.php
@@ -0,0 +1,49 @@
+<?php
+
+/*
+ * SCROTT Copyright (C) 2016 Malf Furious
+ *
+ * Scrott is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Scrott is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ */
+
+?>
+
+<div id="newgroupModal" class="modal fade" tabindex="-1" role="dialog">
+ <div class="modal-dialog modal-sm" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+
+ <button type="button" class="close" data-dismiss="modal">
+ <span aria-hidden="true">&times;</span>
+ </button>
+
+ <h4 class="modal-title"><span class="glyphicon glyphicon-th"></span> Create new Group</h4>
+
+ </div>
+
+ <div class="modal-body">
+ <form method="post" action="<?=$mod->ap()?>">
+ <input type="hidden" name="input[action]" value="common-group-add" />
+ <div class="form-group">
+ <label>Group Name</label>
+ <input type="text" name="input[name]" class="form-control" required="true" maxlength="50" />
+ </div>
+
+ <button type="submit" class="btn btn-success pull-right">
+ <span class="glyphicon glyphicon-plus"></span> Add
+ </button>
+ </form>
+
+ <p>&nbsp;</p>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/app/view/common/ownership.setting.modal.view.php b/app/view/common/ownership.setting.modal.view.php
new file mode 100644
index 0000000..3f7c382
--- /dev/null
+++ b/app/view/common/ownership.setting.modal.view.php
@@ -0,0 +1,35 @@
+<?php
+
+/*
+ * SCROTT Copyright (C) 2016 Malf Furious
+ *
+ * Scrott is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Scrott is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ */
+
+?>
+
+<?php function common_setting_ownership($mod, $obj) { ?>
+ <?php if ($obj->isOwner($mod->getCurrentUser())) { ?>
+ <label class="text-danger">Change Owner</label>
+ <div class="checkbox">
+ <label data-toggle="collapse" data-target="#inputGroupOwnerCollapse">
+ <input type="checkbox" name="input[setOwner]" value="1" /> Transfer Ownership
+ </label>
+ </div>
+
+ <div class="collapse" id="inputGroupOwnerCollapse">
+ <div class="form-group has-error">
+ <label class="control-label">Owner Username</label>
+ <input type="text" name="input[newOwner]" class="form-control" value="<?=$obj->getOwner()->name?>" />
+ </div>
+ </div>
+ <?php } ?>
+<?php } ?>
diff --git a/app/view/common/permissions.setting.modal.view.php b/app/view/common/permissions.setting.modal.view.php
new file mode 100644
index 0000000..55e4157
--- /dev/null
+++ b/app/view/common/permissions.setting.modal.view.php
@@ -0,0 +1,82 @@
+<?php
+
+/*
+ * SCROTT Copyright (C) 2016 Malf Furious
+ *
+ * Scrott is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Scrott is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ */
+
+?>
+
+<?php function common_setting_permissions($mod, $obj) { ?>
+ <?php if ($obj->canModifyPermissions($mod->getCurrentUser())) { ?>
+ <label>Permissions</label>
+ <div class="row">
+ <div class="col-md-6">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm0]" value="1" <?=($obj->perms & 0x100 ? "checked" : "")?> /> Members can modify
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm1]" value="1" <?=($obj->perms & 0x080 ? "checked" : "")?> /> Members can modify members
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm2]" value="1" <?=($obj->perms & 0x040 ? "checked" : "")?> /> Members can access children
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm3]" value="1" <?=($obj->perms & 0x020 ? "checked" : "")?> /> Members can create children
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm4]" value="1" <?=($obj->perms & 0x010 ? "checked" : "")?> /> Members can modify children
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm5]" value="1" <?=($obj->perms & 0x008 ? "checked" : "")?> /> Members can modify children's members
+ </label>
+ </div>
+ </div>
+
+ <div class="col-md-6">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm6]" value="1" <?=($obj->perms & 0x004 ? "checked" : "")?> /> Public can access
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm7]" value="1" <?=($obj->perms & 0x002 ? "checked" : "")?> /> Public can access children
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[perm8]" value="1" <?=($obj->perms & 0x001 ? "checked" : "")?> /> Public can create children
+ </label>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+<?php } ?>
diff --git a/app/view/common/setting.modal.view.php b/app/view/common/setting.modal.view.php
index 68d3e2d..2217805 100644
--- a/app/view/common/setting.modal.view.php
+++ b/app/view/common/setting.modal.view.php
@@ -31,7 +31,13 @@
<div class="modal-body">
<ul class="nav nav-tabs" role="tablist">
- <li class="active"><a href="#settUserTab" aria-controls="settUserTab" data-toggle="tab">
+ <?php if ($mod->common_settingShowTab['group']) { ?>
+ <li class="<?=$mod->getSettingModalTabActiveClass()?>"><a href="#settGroupTab" aria-controls="settGroupTab" data-toggle="tab">
+ <span class="glyphicon glyphicon-th"></span> <?=$mod->group->name?>
+ </a></li>
+ <?php } ?>
+
+ <li class="<?=$mod->getSettingModalTabActiveClass()?>"><a href="#settUserTab" aria-controls="settUserTab" data-toggle="tab">
<span class="glyphicon glyphicon-user"></span> <?=$mod->getCurrentUser()->getDisplayName()?>
</a></li>
@@ -42,7 +48,11 @@
</ul>
<div class="tab-content">
- <div class="tab-pane fade in active" id="settUserTab">
+ <?php if ($mod->common_settingShowTab['group']) { ?>
+ <?php include "view/common/group.setting.modal.view.php"; ?>
+ <?php } ?>
+
+ <div class="tab-pane fade <?=$mod->getSettingModalTabDispClasses()?>" id="settUserTab">
<p>&nbsp;</p>
<form method="post" action="<?=$mod->ap()?>" enctype="multipart/form-data">
diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php
index 5908462..d9e0df0 100644
--- a/app/view/common/topp.view.php
+++ b/app/view/common/topp.view.php
@@ -20,6 +20,7 @@
<?php if ($mod->getCurrentUser()) { ?>
<?php include "view/common/setting.modal.view.php"; ?>
+ <?php include "view/common/newgroup.modal.view.php"; ?>
<?php } ?>
<nav class="navbar navbar-inverse navbar-fixed-top">
@@ -39,6 +40,31 @@
<?php if (!$mod->getCurrentUser()) { ?>
<p class="navbar-text navbar-right"><i>Not Logged In&nbsp;</i></p>
<?php } else { ?>
+ <ul class="nav navbar-nav">
+ <li><a href="<?=$mod->ap()?>"><span class="glyphicon glyphicon-refresh"></span></a></li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
+ <?=(isset($mod->obj) ? $mod->obj->name : "<i>Dashboard</i>")?> <span class="caret"></span>
+ </a>
+
+ <ul class="dropdown-menu">
+ <?php foreach ($mod->getCurrentUser()->getGroups() as $group) { ?>
+ <li><a href="<?=$mod->ar()?>/<?=$group->guid?>"><?=$group->name?></a></li>
+ <?php } ?>
+ </ul>
+ </li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
+ <span class="glyphicon glyphicon-plus"></span> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="#" data-toggle="modal" data-target="#newgroupModal">New Group</a></li>
+ </ul>
+ </li>
+ </ul>
+
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">