[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12877] Added possibility for global home screen mess
From: |
Erik Holm-Larsen |
Subject: |
[Fmsystem-commits] [12877] Added possibility for global home screen message box |
Date: |
Thu, 19 Mar 2015 18:33:01 +0000 |
Revision: 12877
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12877
Author: erikhl
Date: 2015-03-19 18:33:00 +0000 (Thu, 19 Mar 2015)
Log Message:
-----------
Added possibility for global home screen message box
Modified Paths:
--------------
trunk/admin/inc/class.menu.inc.php
trunk/admin/inc/class.uiaccounts.inc.php
trunk/admin/setup/phpgw_no.lang
trunk/home.php
Added Paths:
-----------
trunk/admin/templates/base/home_screen_message.xsl
Modified: trunk/admin/inc/class.menu.inc.php
===================================================================
--- trunk/admin/inc/class.menu.inc.php 2015-03-19 14:38:51 UTC (rev 12876)
+++ trunk/admin/inc/class.menu.inc.php 2015-03-19 18:33:00 UTC (rev 12877)
@@ -113,6 +113,16 @@
array('menuaction' => 'admin.uiaccounts.global_message'))
);
}
+
+ if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin'))
+ {
+ $menus['admin']['home_screen_message'] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('home screen message', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'admin.uiaccounts.home_screen_message'))
+ );
+ }
if (! $GLOBALS['phpgw']->acl->check('account_access',
phpgwapi_acl::READ, 'admin'))
{
Modified: trunk/admin/inc/class.uiaccounts.inc.php
===================================================================
--- trunk/admin/inc/class.uiaccounts.inc.php 2015-03-19 14:38:51 UTC (rev
12876)
+++ trunk/admin/inc/class.uiaccounts.inc.php 2015-03-19 18:33:00 UTC (rev
12877)
@@ -56,7 +56,8 @@
'sync_accounts_contacts' => true,
'clear_user_cache' => true,
'clear_cache' => true,
- 'global_message' => true
+ 'global_message' => true,
+ 'home_screen_message' => true
);
/**
@@ -1564,7 +1565,56 @@
$GLOBALS['phpgw']->xslttpl->add_file('global_message');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('global_message' => $data));
}
+
+ /**
+ * Set a message on bottom of home-screen
+ *
+ * @return void
+ */
+ function home_screen_message()
+ {
+ if( !$GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin') )
+ {
+
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
+ }
+
+ if(phpgw::get_var('msg_title', 'string'))
+ {
+ $msg_title = phpgw::get_var('msg_title',
'string');
+ }
+ else
+ {
+ $msg_title = lang("important message");
+ }
+
+ if(phpgw::get_var('message', 'string'))
+ {
+ phpgwapi_cache::system_set('phpgwapi',
'phpgw_home_screen_message_title',$msg_title);
+ phpgwapi_cache::system_set('phpgwapi',
'phpgw_home_screen_message',phpgw::get_var('message', 'html'));
+ }
+
+ if(phpgw::get_var('delete_message', 'bool'))
+ {
+ phpgwapi_cache::system_clear('phpgwapi',
'phpgw_home_screen_message_title');
+ phpgwapi_cache::system_clear('phpgwapi',
'phpgw_home_screen_message');
+ }
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('administration');
+
+ $data = array
+ (
+ 'value_title' =>
phpgwapi_cache::system_get('phpgwapi', 'phpgw_home_screen_message_title'),
+ 'value_message' =>
phpgwapi_cache::system_get('phpgwapi', 'phpgw_home_screen_message'),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'admin.uiaccounts.home_screen_message')),
+ 'lang_cancel' => lang('cancel'),
+ 'lang_submit' => lang('submit')
+ );
+
$GLOBALS['phpgw']->xslttpl->add_file('home_screen_message');
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('home_screen_message' => $data));
+ }
+
/**
* Render a confirmation form for clear all cache (user,and
system)
*
Modified: trunk/admin/setup/phpgw_no.lang
===================================================================
--- trunk/admin/setup/phpgw_no.lang 2015-03-19 14:38:51 UTC (rev 12876)
+++ trunk/admin/setup/phpgw_no.lang 2015-03-19 18:33:00 UTC (rev 12877)
@@ -36,3 +36,6 @@
view sessions admin no Vis sessions
you must enter a password admin no Du må skrive inn et passord
you must select a file type admin no Du må velge en filtype
+home screen message admin no Melding på hjemmeskjerm
+title admin no Overskrift
+important message admin no Viktig informasjon
Added: trunk/admin/templates/base/home_screen_message.xsl
===================================================================
--- trunk/admin/templates/base/home_screen_message.xsl
(rev 0)
+++ trunk/admin/templates/base/home_screen_message.xsl 2015-03-19 18:33:00 UTC
(rev 12877)
@@ -0,0 +1,56 @@
+<!-- $Id: global_message.xsl 9282 2012-05-04 13:11:20Z sigurdne $ -->
+
+ <xsl:template name="dummy">
+ <xsl:apply-templates select="home_screen_message"/>
+ </xsl:template>
+
+ <xsl:template match="home_screen_message"
xmlns:php="http://php.net/xsl">
+ <h1><xsl:value-of select="php:function('lang', 'home screen
message')" /></h1>
+ <form method="post" action="{form_action}">
+ <table>
+ <tr>
+ <td valign="top">
+ <xsl:value-of
select="php:function('lang', 'title')" />
+ </td>
+ <td>
+ <xsl:variable
name="value_title"><xsl:value-of select="value_title" /></xsl:variable>
+ <input type="text"
name="msg_title" id="msg_title" value="{value_title}" />
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of
select="php:function('lang', 'message')" />
+ </td>
+ <td>
+ <textarea cols="40" rows="6"
id='message' name="message" wrap="virtual">
+ <xsl:attribute
name="title">
+ <xsl:value-of
select="php:function('lang', 'home screen message')" />
+ </xsl:attribute>
+ <xsl:value-of
select="value_message" disable-output-escaping="yes" />
+ </textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'delete message')" />
+ </td>
+ <td>
+ <input type="checkbox"
name="delete_message" value="1" >
+ <xsl:attribute
name="title">
+ <xsl:value-of
select="php:function('lang', 'delete message')" />
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="submit"
name="confirm" value="{lang_submit}"/>
+ <input type="submit"
name="cancel" value="{lang_cancel}" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </xsl:template>
Modified: trunk/home.php
===================================================================
--- trunk/home.php 2015-03-19 14:38:51 UTC (rev 12876)
+++ trunk/home.php 2015-03-19 18:33:00 UTC (rev 12877)
@@ -201,9 +201,9 @@
'addressbook',
);
}
-
+
$GLOBALS['phpgw']->hooks->process('home', $sorted_apps);
-
+
if ( isset($GLOBALS['portal_order']) &&
is_array($GLOBALS['portal_order']) )
{
$GLOBALS['phpgw']->preferences->delete('portal_order');
@@ -213,4 +213,12 @@
}
$GLOBALS['phpgw']->preferences->save_repository();
}
+ if( phpgwapi_cache::system_get('phpgwapi',
'phpgw_home_screen_message'))
+ {
+ echo "<div class='msg_important'><h2>";
+ echo nl2br(phpgwapi_cache::system_get('phpgwapi',
'phpgw_home_screen_message_title'));
+ echo "</h2>";
+ echo nl2br(phpgwapi_cache::system_get('phpgwapi',
'phpgw_home_screen_message'));
+ echo '</div>';
+ }
$GLOBALS['phpgw']->common->phpgw_footer();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12877] Added possibility for global home screen message box,
Erik Holm-Larsen <=