openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 53ef8d4249798ef84f4b938854a35fa9180d71a8
parent 2ac766d89f49af85e9c6f205c7bf35047589770a
Author: Jan Dankert <devnull@localhost>
Date:   Tue,  6 Mar 2012 22:50:55 +0100

Vererben von Rechten über eine eigene View

Diffstat:
action/ObjectAction.class.php | 18++++++++++++++++--
themes/default/templates/folder/inherit.tpl.src.xml | 23+++++++++++++++++++++++
themes/default/templates/object/rights.tpl.src.xml | 138++++++++++++++++++++++++++++++++++---------------------------------------------
3 files changed, 98 insertions(+), 81 deletions(-)

diff --git a/action/ObjectAction.class.php b/action/ObjectAction.class.php @@ -198,7 +198,6 @@ class ObjectAction extends Action */ function rightsView() { -// $this->actionName = 'object'; $o = Session::getObject(); $o->objectLoadRaw(); $this->setTemplateVar( 'show',$o->getRelatedAclTypes() ); @@ -234,10 +233,25 @@ class ObjectAction extends Action /** + * Alle Rechte anzeigen + */ + function inheritView() + { + $o = Session::getObject(); + $o->objectLoadRaw(); + $this->setTemplateVar( 'type',$o->getType() ); + + $acllist = array(); + $this->setTemplateVar('acls',$acllist ); + } + + + + /** * * @return unknown_type */ - function rightsPost() + function inheritPost() { $log = array(); diff --git a/themes/default/templates/folder/inherit.tpl.src.xml b/themes/default/templates/folder/inherit.tpl.src.xml @@ -0,0 +1,22 @@ +<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"> + <header views="aclform" /> + <form> + + <if value="var:type" equals="folder"> + <fieldset title="message:options"> + <part class="line"> + <part class="label"> + </part> + <part class="input"> + <set var="inherit" value="1"></set> + <input type="checkbox" name="inherit"></input> + <label for="inherit"> + <text key="inherit_rights"></text> + </label> + </part> + </part> + </fieldset> + </if> + </form> +</output>+ \ No newline at end of file diff --git a/themes/default/templates/object/rights.tpl.src.xml b/themes/default/templates/object/rights.tpl.src.xml @@ -1,90 +1,70 @@ <output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"> - <header views="aclform" /> - <form> - <table> - <row class="headline"> - <cell class="help"> - <text key="GLOBAL_NAME"></text> - </cell> + + <if value="var:type" equals="folder"> + <header views="inherit,aclform" /> + </if> + <else> + <header views="aclform" /> + </else> + + <table> + <row class="headline"> + <cell class="help"> + <text key="GLOBAL_NAME"></text> + </cell> + <cell class="help"> + <text key="GLOBAL_LANGUAGE"></text> + </cell> + <list list="show" value="t"> <cell class="help"> - <text key="GLOBAL_LANGUAGE"></text> + <text key="var:t" prefix="acl_" suffix="_abbrev"></text> </cell> - <list list="show" value="t"> - <cell class="help"> - <text key="var:t" prefix="acl_" suffix="_abbrev"></text> - </cell> - </list> - <cell class="help"> - <text key="global_delete"></text> + </list> + <cell class="help"> + <text key="global_delete"></text> + </cell> + </row> + <if empty="acls"> + <row class="data"> + <cell> + <text text="GLOBAL_NOT_FOUND"></text> </cell> </row> - <if empty="acls"> - <row class="data"> - <cell> - <text text="GLOBAL_NOT_FOUND"></text> - </cell> - </row> - </if> - <if not="true" empty="acls"></if> - <list list="acls" key="aclid" value="acl" extract="true"> - <row class="data"> - <cell> - <if present="username"> - <image type="user"></image> - <text var="username"></text> - </if> - <if present="groupname"> + </if> + <if not="true" empty="acls"></if> + <list list="acls" key="aclid" value="acl" extract="true"> + <row class="data"> + <cell> + <if present="username"> + <image type="user"></image> + <text var="username"></text> + </if> + <if present="groupname"> + <image type="group"></image> + <text var="groupname"></text> + </if> + <if not="true" present="username"> + <if not="true" present="groupname"> <image type="group"></image> - <text var="groupname"></text> + <text key="global_all"></text> </if> - <if not="true" present="username"> - <if not="true" present="groupname"> - <image type="group"></image> - <text key="global_all"></text> - </if> - </if> - </cell> - <cell> - <text var="languagename"></text> - </cell> - <list list="show" value="t"> - <cell> - <checkbox name="var:t" default="false" readonly="true"></checkbox> - </cell> - </list> + </if> + </cell> + <cell> + <text var="languagename"></text> + </cell> + <list list="show" value="t"> <cell> - <link type="post" subaction="delacl" id="var:aclid"> - <text key="GLOBAL_DELETE"></text> - </link> + <checkbox name="var:t" default="false" readonly="true"></checkbox> </cell> - </row> - </list> - </table> - - <link type="view" class="action" action="var:actionName" - subaction="aclform"> - <image icon="add"></image> - <text key="add"></text> - </link> - <newline></newline> - <newline></newline> - <newline></newline> - - <if value="var:type" equals="folder"> - <fieldset title="message:options"> - <part class="line"> - <part class="label"> - </part> - <part class="input"> - <set var="inherit" value="1"></set> - <input type="checkbox" name="inherit"></input> - <label for="inherit"> - <text key="inherit_rights"></text> - </label> - </part> - </part> - </fieldset> - </if> - </form> + </list> + <cell> + <link type="post" subaction="delacl" id="var:aclid"> + <text key="GLOBAL_DELETE"></text> + </link> + </cell> + </row> + </list> + </table> </output> \ No newline at end of file