Add new config to the admin site configuration in order to be able to upload a custom header logo

This commit is contained in:
Hadi Nategh 2017-10-23 13:23:26 +02:00
parent 1fe95ec07e
commit fdb3202b6b
3 changed files with 17 additions and 3 deletions

View File

@ -57,6 +57,13 @@
<file onchange="egw.json('admin.admin_config.ajax_upload_anon_images',[widget.get_value()], function(_data){widget._parent._children[0].set_value(_data.path)}).sendRequest()" width="100%" label="upload"/>
</vbox>
</row>
<row>
<description value="Upload your header logo or enter the URL (leave it empty if it is the same as login logo)" label="%s:"/>
<vbox>
<textbox id="newsettings[login_logo_header]" width="100%"/>
<file onchange="egw.json('admin.admin_config.ajax_upload_anon_images',[widget.get_value()], function(_data){widget._parent._children[0].set_value(_data.path)}).sendRequest()" width="100%" label="upload"/>
</vbox>
</row>
<row>
<description value="Enter the url where your logo should link to" label="%s:"/>
<textbox id="newsettings[login_logo_url]" width="100%"/>

View File

@ -525,12 +525,19 @@ abstract class Framework extends Framework\Extra
if (substr($GLOBALS['egw_info']['server']['login_logo_file'],0,4) == 'http' ||
$GLOBALS['egw_info']['server']['login_logo_file'][0] == '/')
{
$var['logo_file'] = $GLOBALS['egw_info']['server']['login_logo_file'];
$var['logo_header'] = $var['logo_file'] = $GLOBALS['egw_info']['server']['login_logo_file'];
}
else
{
$var['logo_file'] = Image::find('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo', '', null); // null=explicit allow svg
$var['logo_header'] = $var['logo_file'] = Image::find('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo', '', null); // null=explicit allow svg
}
if (substr($GLOBALS['egw_info']['server']['login_logo_header'],0,4) == 'http' ||
$GLOBALS['egw_info']['server']['login_logo_header'][0] == '/')
{
$var['logo_header'] = $GLOBALS['egw_info']['server']['login_logo_header'];
}
$var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url']?$GLOBALS['egw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
if (substr($var['logo_url'],0,4) != 'http')

View File

@ -27,7 +27,7 @@
{hook_after_navbar}
<div id="egw_fw_basecontainer">
<div id="egw_fw_header">
<div id="egw_divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" title="{logo_title}" alt="EGroupware"/></a></div>
<div id="egw_divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_header}" title="{logo_title}" alt="EGroupware"/></a></div>
<div id="egw_fw_topmenu">