Last active
December 21, 2015 19:09
-
-
Save zzeneg/6351960 to your computer and use it in GitHub Desktop.
SharePoint Lync Control HTML Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private UserProfile _profile; | |
public string PublicUrl | |
{ | |
get | |
{ | |
return _profile.PublicUrl != null ? _profile.PublicUrl.AbsoluteUri : string.Empty; | |
} | |
} | |
public string PictureUrl | |
{ | |
get | |
{ | |
var value = string.Empty; | |
var pictureUrl = _profile[PropertyConstants.PictureUrl]; | |
if (pictureUrl != null && pictureUrl.Value != null) | |
value = pictureUrl.Value.ToString(); | |
if (string.IsNullOrWhiteSpace(value)) | |
value = "/_layouts/15/images/PersonPlaceholder.96x96x32.png"; | |
return value; | |
} | |
} | |
public string SipAddress | |
{ | |
get | |
{ | |
var sipAddress = _profile[PropertyConstants.SipAddress]; | |
if (sipAddress != null && sipAddress.Value != null) | |
return sipAddress.Value.ToString(); | |
return string.Empty; | |
} | |
} | |
protected override void OnInit(EventArgs e) | |
{ | |
base.OnInit(e); | |
InitializeControl(); | |
} | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
var serviceContext = SPServiceContext.GetContext(SPContext.Current.Site); | |
var upm = new UserProfileManager(serviceContext); | |
_profile = upm.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName); | |
Page.DataBind(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="ms-imnSpan">\ | |
<a onclick="IMNImageOnClick(event);return false;" href="#" style="float:left;">\ | |
<span class="ms-spimn-presenceWrapper ms-spimn-imgSize-8x72">\ | |
<img name="imnmark" | |
class="ms-spimn-img ms-spimn-presence-disconnected-8x72x32" | |
id="bStatusImg<%= Guid.NewGuid() %>" | |
src="/_layouts/15/images/spimn.png" | |
sip="<%# DataBinder.Eval(this, "SipAddress") %>" showofflinepawn="1">\ | |
</span>\ | |
</a>\ | |
<a onclick="GoToLinkOrDialogNewWindow(this);return false;" href="<%# DataBinder.Eval(this, "User.PublicUrl") %>">\ | |
<img style="height: 72px; width: 72px;" src="<%# DataBinder.Eval(this, "User.PictureUrl") %>">\ | |
</a>\ | |
</span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment