public static string MakeTitleForRDFa(ZonelessEvent evt, string dom_id, Dictionary<string,object> args)
{
var is_eventsonly = args.HasValue("eventsonly", true);
var coalesced_links = BuildCoalescedLinks(evt, dom_id);
bool is_coalesced = !String.IsNullOrEmpty(coalesced_links);
// case 1: eventsonly, coalesced
// <span class="ttl"><a target="elmcity" property="v:summary" title="open event page on source site" href="http://www.harriscenter.org/calendar">Homeschool Program: Biographies of Famous Birds</a></span>
//
// case 2: eventsonly, not coalesced
// <span class="ttl"><span property="v:summary">Crazy Quilters</span> [<a target="elmcity" title="gilsum church" href="http://gilsum.org/church.aspx"> 1 </a><a target="elmcity" title="town of gilsum" href="http://gilsum.org/"> 2 </a>]</span>
//
// case 3: not eventsonly, coalesced
// <span class="ttl"><span property="v:summary"><a href="javascript:show_desc('e3')">Crazy Quilters</a></span> [<a title="gilsum church" href="http://gilsum.org/church.aspx"> 1 </a><a title="town of gilsum" href="http://gilsum.org/"> 2 </a>]</span>
//
// case 4: not eventsonly, not coalesced
// <span class="ttl"><a property="v:summary" title="see details" href='javascript:show_desc("e2")'>Lunchtime Rallies at Central Square</a></span>
// <span class="ttl"><span property="v:summary">Crazy Quilters</span> [<a target="elmcity" title="gilsum church" href="http://gilsum.org/church.aspx"> 1 </a><a target="elmcity" title="town of gilsum" href="http://gilsum.org/"> 2 </a>]</span>
// otherwise this
// <span class="ttl"><span property="v:summary"><a href="javascript:show_desc('e3')">Crazy Quilters</a></span> [<a title="gilsum church" href="http://gilsum.org/church.aspx"> 1 </a><a title="town of gilsum" href="http://gilsum.org/"> 2 </a>]</span>
TitleType title_type;
if (is_coalesced)
title_type = is_eventsonly ? TitleType.EventsOnlyCoalesced : TitleType.NotEventsOnlyCoalesced;
else
title_type = is_eventsonly ? TitleType.EventsOnlyNotCoalesced : TitleType.NotEventsOnlyNotCoalesced;
string title;
if ( title_type == TitleType.EventsOnlyCoalesced )
title = string.Format("<span property=\"v:summary\">{0}</span>", evt.title);
else
title = string.Format("<a property=\"v:summary\" title=\"{0}\" href=\"{1}\">{2}</a>",
is_eventsonly ? "open event page on source site": "see details",
is_eventsonly ? evt.url : string.Format("javascript:show_desc('{0}')", dom_id),
evt.title);
if (is_coalesced)
title += coalesced_links;
return title;
}