commit 4f6e6e6963e57ab0ad0fdcbdf0b94781320daac6
parent 8807b6a25a8500bdfb31b4da9a0ccb0c93688c90
Author: Jan Dankert <develop@jandankert.de>
Date: Mon, 13 Apr 2020 22:33:04 +0200
New: An action for navigating to the user and group administration.
Diffstat:
5 files changed, 124 insertions(+), 1 deletion(-)
diff --git a/modules/cms/action/TreeAction.class.php b/modules/cms/action/TreeAction.class.php
@@ -200,8 +200,9 @@ class TreeAction extends BaseAction
return $result;
case 'userlist':
+ case 'usergroup':
return array(
- //$this->pathItem('userandgroups' ,0)
+ //$this->pathItem('usergroup' ,0)
);
case 'user':
return array(
diff --git a/modules/cms/action/UsergroupAction.class.php b/modules/cms/action/UsergroupAction.class.php
@@ -0,0 +1,52 @@
+<?php
+
+namespace cms\action;
+
+use cms\model\User;
+
+// OpenRat Content Management System
+// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de
+//
+// This program 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 2
+// 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+/**
+ * Show links to user and group administration.
+ * @author Jan Dankert
+ */
+class UsergroupAction extends BaseAction
+{
+ public $security = Action::SECURITY_ADMIN;
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+
+ function showView()
+ {
+ }
+
+
+ /**
+ *
+ */
+ function editView()
+ {
+ $this->nextSubAction('show');
+ }
+
+}+
\ No newline at end of file
diff --git a/modules/cms/ui/themes/default/html/views/usergroup/show.php b/modules/cms/ui/themes/default/html/views/usergroup/show.php
@@ -0,0 +1,38 @@
+<?php if (defined('OR_TITLE')) { ?>
+
+ <div class="or-table-wrapper">
+ <div class="or-table-filter">
+ <input type="search" name="filter" placeholder="<?php echo encodeHtml(htmlentities(@lang('SEARCH_FILTER'))) ?>" />
+ </div>
+ <div class="or-table-area">
+ <table width="100%">
+ <tr class="headline">
+ <td>
+ <span><?php echo encodeHtml(htmlentities(@lang('name'))) ?>
+ </span>
+ </td>
+ </tr>
+ <tr class="data">
+ <td data-name="<?php echo encodeHtml(htmlentities(@$name)) ?>" data-action="userlist" data-id="<?php echo encodeHtml(htmlentities(@$id)) ?>" class="clickable clickable">
+ <a target="_self" data-type="open" data-action="userlist" data-method="" data-id="" data-extra="[]" href="/#/userlist/">
+ <i class="image-icon image-icon--action-user">
+ </i>
+ <span><?php echo encodeHtml(htmlentities(@lang('users'))) ?>
+ </span>
+ </a>
+ </td>
+ </tr>
+ <tr class="data">
+ <td data-name="<?php echo encodeHtml(htmlentities(@$name)) ?>" data-action="grouplist" data-id="<?php echo encodeHtml(htmlentities(@$id)) ?>" class="clickable clickable">
+ <a target="_self" data-type="open" data-action="grouplist" data-method="" data-id="" data-extra="[]" href="/#/grouplist/">
+ <i class="image-icon image-icon--action-group">
+ </i>
+ <span><?php echo encodeHtml(htmlentities(@lang('groups'))) ?>
+ </span>
+ </a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <?php } ?>+
\ No newline at end of file
diff --git a/modules/cms/ui/themes/default/html/views/usergroup/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/usergroup/show.tpl.src.xml
@@ -0,0 +1,28 @@
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd">
+
+ <table>
+ <row class="headline">
+ <column>
+ <text key="name"></text>
+ </column>
+ </row>
+ <row class="data">
+ <column id="${id}" name="${name}" action="userlist" class="clickable">
+ <link type="open" id="" action="userlist">
+ <image action="user"></image>
+ <text key="users"></text>
+ </link>
+ </column>
+ </row>
+ <row class="data">
+ <column id="${id}" name="${name}" action="grouplist" class="clickable">
+ <link type="open" id="" action="grouplist">
+ <image action="group"></image>
+ <text key="groups"></text>
+ </link>
+ </column>
+ </row>
+
+ </table>
+</output>+
\ No newline at end of file
diff --git a/modules/util/Tree.class.php b/modules/util/Tree.class.php
@@ -66,6 +66,7 @@ class Tree
$treeElement->description = lang('USER_AND_GROUPS');
$treeElement->icon = 'userlist';
$treeElement->type = 'userandgroups';
+ $treeElement->action = 'usergroup';
$this->addTreeElement($treeElement);
}