Skip to content

Instantly share code, notes, and snippets.

@zzeneg
Last active December 21, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzeneg/6351960 to your computer and use it in GitHub Desktop.
Save zzeneg/6351960 to your computer and use it in GitHub Desktop.
SharePoint Lync Control HTML Code
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();
}
<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