openrat-cms

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

commit 4c31c52a2e612c1ee82e6847ecdaa9af7bcc50bf
parent 29147fe6a6cffb47281286838667ffbf3bf40514
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 27 Dec 2017 23:22:34 +0100

Titelleiste erscheint jetzt fehlerfrei im nicht angemeldeten Zustand. Neuer Menüpunkt "Verlauf" für das Profil. Neuer Menüpunkt "Hilfe" mit Lizenzinformationen.

Diffstat:
modules/cms-core/action/ProfileAction.class.php | 12++++++++++++
modules/cms-core/action/TitleAction.class.php | 19++++++++++---------
themes/default/templates/profile/history.tpl.out.php | 39+++++++++++++++++++++++++++++++++++++++
themes/default/templates/profile/history.tpl.src.xml | 34++++++++++++++++++++++++++++++++++
themes/default/templates/title/show.tpl.src.xml | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
5 files changed, 169 insertions(+), 46 deletions(-)

diff --git a/modules/cms-core/action/ProfileAction.class.php b/modules/cms-core/action/ProfileAction.class.php @@ -310,4 +310,16 @@ class ProfileAction extends Action Session::setConfig($conf); } + + + /** + * Ermittelt die letzten Änderungen, die durch den aktuellen Benutzer in allen Projekten gemacht worden sind. + */ + public function historyView() + { + $result = $this->user->getLastChanges(); + $this->setTemplateVar('timeline', $result); + } + + } \ No newline at end of file diff --git a/modules/cms-core/action/TitleAction.class.php b/modules/cms-core/action/TitleAction.class.php @@ -48,20 +48,21 @@ class TitleAction extends Action if ( !is_object($user) ) { - $this->setTemplateVar('isLoggedIn',false ); + $this->setTemplateVar('isLoggedIn' ,false ); + $this->setTemplateVar('userfullname',lang('NOT_LOGGED_IN') ); return; // Kein Benutzer angemeldet. } $this->setTemplateVar('isLoggedIn',true ); - $db = Session::getDatabase(); - $this->setTemplateVar('dbname',$db->conf['name'].(readonly()?' ('.lang('readonly').')':'')); - $this->setTemplateVar('dbid' ,$db->id); - - $databases = array(); - - $this->setTemplateVar('username' ,$user->name ); - $this->setTemplateVar('userfullname',$user->fullname); + $db = Session::getDatabase(); + $this->setTemplateVar('dbname',$db->conf['name'].(readonly()?' ('.lang('readonly').')':'')); + $this->setTemplateVar('dbid' ,$db->id); + + $databases = array(); + + $this->setTemplateVar('username' ,$user->name ); + $this->setTemplateVar('userfullname',$user->fullname); $project = Session::getProject(); if ( is_object($project) ) diff --git a/themes/default/templates/profile/history.tpl.out.php b/themes/default/templates/profile/history.tpl.out.php @@ -0,0 +1,38 @@ + + + <table width="100%"> + <tr class="headline"> + <td> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang(''.'project'.'')))); ?></span> + + </td> + <td> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang(''.'filename'.'')))); ?></span> + + </td> + <td> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang(''.'lastchange'.'')))); ?></span> + + </td> + </tr> + <?php foreach($timeline as $list_key=>$list_value){ ?><?php extract($list_value) ?> + <tr class="data"> + <td class="clickable"> + <a target="_self" data-type="post" data-action="start" data-method="projectmenu" data-id="<?php echo $projectid ?>" data-data="{&quot;action&quot;:&quot;start&quot;,&quot;subaction&quot;:&quot;projectmenu&quot;,&quot;id&quot;:&quot;<?php echo $projectid ?>&quot;,&quot;token&quot;:&quot;<?php echo token() ?>&quot;,&quot;none&quot;:&quot;0&quot;}"> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities($projectname))); ?></span> + + </a> + + </td> + <td title="<?php echo $filename ?>"> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities(Text::maxLength( $filename,30,'..',constant('STR_PAD_BOTH') )))); ?></span> + + </td> + <td> + <?php include_once( 'modules/template-engine/components/html/date/component-date.php') ?><?php component_date($lastchange_date) ?> + + </td> + </tr> + <?php } ?> + </table> + + \ No newline at end of file diff --git a/themes/default/templates/profile/history.tpl.src.xml b/themes/default/templates/profile/history.tpl.src.xml @@ -0,0 +1,33 @@ +<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"> + <table> + <row class="headline"> + <column> + <text key="project"></text> + </column> + <column> + <text key="filename"></text> + </column> + <column> + <text key="lastchange" /> + </column> + </row> + + <list list="timeline" extract="true"> + <row class="data"> + <column class="clickable"> + <link type="post" action="start" subaction="projectmenu" id="var:projectid"> + <text var="projectname"></text> + </link> + </column> + <column title="var:filename"> + <text var="filename" maxlength="30"></text> + </column> + <column> + <date date="var:lastchange_date" /> + </column> + + </row> + </list> + </table> +</output>+ \ No newline at end of file diff --git a/themes/default/templates/title/show.tpl.src.xml b/themes/default/templates/title/show.tpl.src.xml @@ -399,57 +399,94 @@ <!-- Suche --> - <part class="search"> - <input name="text" hint="message:search" icon="search"></input> + <if true="var:isLoggedIn"> + <part class="search"> + <input name="text" hint="message:search" icon="search"></input> + <part class="dropdown"> + <text raw=""></text> + </part> + </part> + </if> + + <!-- Hilfe --> + <part class="toolbar-icon menu"> + <image action="user" align="left"></image> + <text class="titletext" key="menu_help"></text> + <image method="arrow_down" align="left"></image> <part class="dropdown"> - <text raw=""></text> + + <part class="entry clickable"> + <link type="dialog" title="message:menu_license_DESC" action="login" subaction="license"> + <image method="license" align="left"></image> + <text key="menu_license"></text> + </link> + </part> + </part> </part> + <!-- Benutzer --> <part class="toolbar-icon user menu"> <image action="user" align="left"></image> <text class="titletext" var="userfullname" maxlength="25"></text> + + <if true="var:isLoggedIn"> <image method="arrow_down" align="left"></image> + </if> <!-- <part class="arrow-down" />--> - <part class="dropdown"> - <part class="entry clickable"> - <link type="dialog" title="message:menu_PROFILE_DESC" action="profile" subaction="edit"> - <image action="user" align="left"></image> - <text key="menu_profile"></text> - </link> - </part> - <part class="entry clickable"> - <link type="dialog" title="message:menu_password_DESC" action="profile" subaction="pw"> - <image method="password" align="left"></image> - <text key="menu_password"></text> - </link> - </part> - <part class="entry clickable"> - <link type="dialog" title="message:menu_mail_DESC" action="profile" subaction="mail"> - <image method="mail" align="left"></image> - <text key="menu_mail"></text> - </link> - </part> - <part class="entry clickable"> - <link type="post" title="message:menu_start_desc" action="start" - subaction="start"> - <image action="dashboard" align="left"></image> - <text key="menu_start"></text> - </link> - </part> + <if true="var:isLoggedIn"> - <part class="divide" /> + <part class="dropdown"> - <part class="entry clickable"> - <link type="post" class="entry" title="message:USER_LOGOUT_DESC" - action="login" subaction="logout"> - <image method="close" align="left"></image> - <text key="USER_LOGOUT"></text> - </link> + <part class="entry clickable"> + <link type="dialog" title="message:menu_PROFILE_DESC" action="profile" subaction="edit"> + <image action="user" align="left"></image> + <text key="menu_profile"></text> + </link> + </part> + <part class="entry clickable"> + <link type="dialog" title="message:menu_password_DESC" action="profile" subaction="pw"> + <image method="password" align="left"></image> + <text key="menu_password"></text> + </link> + </part> + <part class="entry clickable"> + <link type="dialog" title="message:menu_mail_DESC" action="profile" subaction="mail"> + <image method="mail" align="left"></image> + <text key="menu_mail"></text> + </link> + </part> + <part class="entry clickable"> + <link type="post" title="message:menu_start_desc" action="start" + subaction="start"> + <image action="dashboard" align="left"></image> + <text key="menu_start"></text> + </link> + </part> + + <part class="divide" /> + + <part class="entry clickable"> + <link type="dialog" title="message:menu_history_desc" action="profile" subaction="history"> + <image method="history" align="left"></image> + <text key="menu_history"></text> + </link> + </part> + + <part class="divide" /> + + <part class="entry clickable"> + <link type="post" class="entry" title="message:USER_LOGOUT_DESC" + action="login" subaction="logout"> + <image method="close" align="left"></image> + <text key="USER_LOGOUT"></text> + </link> + </part> </part> - </part> + + </if> </part> </output> \ No newline at end of file