SF.net SVN: postfixadmin:[1142] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-07-29 20:34:42
|
Revision: 1142 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1142&view=rev Author: christian_boltz Date: 2011-07-29 20:34:36 +0000 (Fri, 29 Jul 2011) Log Message: ----------- Replaced motd*.txt with $CONF[motd_*] options config.inc.php: - new config options $CONF['motd_user'], $CONF['motd_admin'] and $CONF['motd_superadmin'] templates/index.tpl: - added $CONF[motd_*] handling css/default.css: - new style #motd templates/users_menu.tpl, templates/menu.tpl: - removed inclusion of motd-users.txt / $motd_file smarty.inc.php: - removed handling for motd*.txt files templates/motd-users.txt, templates/motd.txt: - deleted Modified Paths: -------------- trunk/config.inc.php trunk/css/default.css trunk/smarty.inc.php trunk/templates/index.tpl trunk/templates/menu.tpl trunk/templates/users_menu.tpl Removed Paths: ------------- trunk/templates/motd-users.txt trunk/templates/motd.txt Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/config.inc.php 2011-07-29 20:34:36 UTC (rev 1142) @@ -286,6 +286,13 @@ $CONF['footer_text'] = 'Return to change-this-to-your.domain.tld'; $CONF['footer_link'] = 'http://change-this-to-your.domain.tld'; +// MOTD ("Motto of the day") +// You can display a MOTD below the menu on all pages. +// This can be configured seperately for users, domain admins and superadmins +$CONF['motd_user'] = ''; +$CONF['motd_admin'] = ''; +$CONF['motd_superadmin'] = ''; + // Welcome Message // This message is send to every newly created mailbox. // Change the text between EOM. Modified: trunk/css/default.css =================================================================== --- trunk/css/default.css 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/css/default.css 2011-07-29 20:34:36 UTC (rev 1142) @@ -81,6 +81,11 @@ color: #d01313; } +#motd { + color: maroon; + padding-top:2em; +} + .standout { color: maroon; padding: 3px 3px 3px 3px; Modified: trunk/smarty.inc.php =================================================================== --- trunk/smarty.inc.php 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/smarty.inc.php 2011-07-29 20:34:36 UTC (rev 1142) @@ -66,16 +66,6 @@ $smarty->assign ('boolconf_alias_domain', boolconf('alias_domain')); $smarty->assign ('authentication_has_role', array ('global_admin' => authentication_has_role ('global-admin'), 'admin' => authentication_has_role ('admin'), 'user' => authentication_has_role ('user'))); -if (authentication_has_role('global-admin')) { - $motd_file = "motd-admin.txt"; -} else { - $motd_file = "motd.txt"; -} -$smarty->assign('motd_file', ''); -if (file_exists ($incpath.'/templates/'.$motd_file)) { - $smarty->assign ('motd_file', $motd_file); -} - function select_options($aValues, $aSelected) { $ret_val = ''; foreach ($aValues as $val) { Modified: trunk/templates/index.tpl =================================================================== --- trunk/templates/index.tpl 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/templates/index.tpl 2011-07-29 20:34:36 UTC (rev 1142) @@ -9,6 +9,16 @@ {include file='menu.tpl'} {/if} {/if} +<br clear="all" /> + +{if $authentication_has_role.user && $CONF.motd_user} + <div id="motd">{$CONF.motd_user}</div> +{elseif $authentication_has_role.global_admin && $CONF.motd_superadmin} + <div id="motd">{$CONF.motd_superadmin}</div> +{elseif $authentication_has_role.admin && $CONF.motd_admin} + <div id="motd">{$CONF.motd_admin}</div> +{/if} + {include file='flash_error.tpl'} {if $smarty_template} {include file="$smarty_template.tpl"} Modified: trunk/templates/menu.tpl =================================================================== --- trunk/templates/menu.tpl 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/templates/menu.tpl 2011-07-29 20:34:36 UTC (rev 1142) @@ -81,11 +81,6 @@ <li class="logout"><a target="_top" href="{#url_logout#}">{$PALANG.pMenu_logout}</a></li> </ul> </div> -{if !empty($motd_file)} - <div id="motd"> - {include file=$motd_file} - </div> -{/if} {literal} <script type='text/javascript'> // <![CDATA[ Deleted: trunk/templates/motd-users.txt =================================================================== --- trunk/templates/motd-users.txt 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/templates/motd-users.txt 2011-07-29 20:34:36 UTC (rev 1142) @@ -1,7 +0,0 @@ -<div class="standout"> -=== Announcement ===<br /> -This is a new version of Postfix Admin.<br /> -If you have any questions please direct them to the <a href="mailto:{$CONF.admin_email}">Site Admin</a><br /> -=== Announcement ===<br /> -</div> -<br /> Deleted: trunk/templates/motd.txt =================================================================== --- trunk/templates/motd.txt 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/templates/motd.txt 2011-07-29 20:34:36 UTC (rev 1142) @@ -1,7 +0,0 @@ -<div class="standout"> -=== Announcement ===<br /> -This is a new version of Postfix Admin.<br /> -If you have any questions please direct them to the <a href="mailto:{$CONF.admin_email}">Site Admin</a><br /> -=== Announcement ===<br /> -</div> -<br /> Modified: trunk/templates/users_menu.tpl =================================================================== --- trunk/templates/users_menu.tpl 2011-07-29 20:20:16 UTC (rev 1141) +++ trunk/templates/users_menu.tpl 2011-07-29 20:34:36 UTC (rev 1142) @@ -9,12 +9,3 @@ <li class="logout"><a target="_top" href="{#url_user_logout#}">{$PALANG.pMenu_logout}</a></li> </ul> </div> -<br clear="all"/><br/> -{php} -if (file_exists (realpath ("../motd-users.txt"))) -{ - print "<div id=\"motd\">\n"; - include ("../motd-users.txt"); - print "</div>"; -} -{/php} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |