Add login.js to phpgwapi in order to make it available for all templates. Implement socialMedia for jdots and idots templates too

This commit is contained in:
Hadi Nategh 2014-07-24 17:17:23 +00:00
commit b68cb6e5c0
4 changed files with 66 additions and 2 deletions

View File

@ -444,6 +444,9 @@ abstract class egw_framework
*/ */
function login_screen($extra_vars) function login_screen($extra_vars)
{ {
//allow to include JSONP file with social media urls from egroupware.org
self::csp_script_src_attrs('https://www.egroupware.org');
//error_log(__METHOD__."() server[template_dir]=".array2string($GLOBALS['egw_info']['server']['template_dir']).", this->template=$this->template, this->template_dir=$this->template_dir, get_class(this)=".get_class($this)); //error_log(__METHOD__."() server[template_dir]=".array2string($GLOBALS['egw_info']['server']['template_dir']).", this->template=$this->template, this->template_dir=$this->template_dir, get_class(this)=".get_class($this));
$tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']); $tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']);

54
phpgwapi/js/login.js Normal file
View File

@ -0,0 +1,54 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
egw_LAB.wait(function() {
$j.ajax('https://www.egroupware.org/social.js', {
dataType: "jsonp",
jsonp: false,
jsonpCallback: "do_social",
cache: true
}).done(function(_data)
{
$j(document).ready(function() {
var social = $j(document.createElement('div'))
.attr({
id: "socialMedia",
class: "socialMedia"
})
.appendTo($j('#socialBox'));
for(var i=0; i < _data.length; ++i)
{
var data = _data[i];
var url = (data.lang ? data.lang[$j('meta[name="language"]').attr('content')] : null) || data.url;
$j(document.createElement('a')).attr({
href: url,
target: '_blank'
})
.appendTo(social)
.append($j(document.createElement('img'))
.attr('src', data.svg));
}
});
});
});
// $j('img.bgfade').hide();
//// var dg_H = $j(window).height();
//// var dg_W = $j(window).width();
//// $j('#wrap').css({'height':dg_H,'width':dg_W});
//
// function anim() {
// $j("#wrap img.bgfade").first().appendTo('#wrap').fadeOut(3500);
// $j("#wrap img").first().fadeIn(3500);
// setTimeout(anim, 7000);
// }
//anim();
//$j(window).resize(function(){window.location.href=window.location.href});
// });
//
//});

View File

@ -1,4 +1,4 @@
<script src="./phpgwapi/js/login.js" type="text/javascript"></script>
<div id="loginMainDiv"> <div id="loginMainDiv">
<div id="divAppIconBar" style="position:relative;"> <div id="divAppIconBar" style="position:relative;">
<div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" alt="{logo_title}" title="{logo_title}" /></a></div> <div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" alt="{logo_title}" title="{logo_title}" /></a></div>
@ -61,6 +61,9 @@
</td> </td>
</tr> </tr>
<!-- END registration --> <!-- END registration -->
<tr>
<td id="socialBox"></td>
</tr>
</table> </table>
</form> </form>
</div> </div>

View File

@ -468,7 +468,11 @@ body {
position: relative; position: relative;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center 80px; background-position: center 80px;
background-image: url(../images/login-background.jpg); background-color: white;
}
#socialMedia {
left: 273px;
position: relative;
} }
#loginScreenMessage { #loginScreenMessage {
text-align: center; text-align: center;