<table width="100%" border="0" cellpadding="0" cellspacing="0">
 <tr class="item">
  <th class="<?php echo ($sortby == NAG_SORT_COMPLETION) ? 'selected' : 'item' ?>" width="2%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_COMPLETION) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_COMPLETION)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' :  'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::link(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_COMPLETION)), _("Sort by Completion Status"), 'widget') . Horde::img('checkbox.png', _("Completed?")) ?></a>
  </th>
  <th class="<?php echo ($sortby == NAG_SORT_OWNER) ? 'selected' : 'item' ?>" width="2%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_OWNER) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_OWNER)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' :  'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_OWNER)), _("Sort by User Name"), 'widget', '', '', _("_Task List")) ?></a>&nbsp;
  </th>
  <th class="<?php echo ($sortby == NAG_SORT_PRIORITY) ? 'selected' : 'item' ?>" width="2%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_PRIORITY) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_PRIORITY)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' : 'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_PRIORITY)), _("Sort by Priority"), 'widget', '', '', _("P_ri")) ?></a>&nbsp;
  </th>
  <th width="2%">
    <?php echo Horde::img('edit.png', _("Edit Task"), null, $registry->getImageDir('horde')) ?>
  </td>
  <th class="<?php echo ($sortby == NAG_SORT_NAME) ? 'selected' : 'item' ?>" width="60%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_NAME) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_NAME)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' : 'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_NAME)), _("Sort by Name"), 'widget', '', '', _("Na_me")) ?></a>&nbsp;
  </th>
  <td width="2%"><?php echo Horde::img('note.png', _("Task Note?")) ?></td>
  <td width="2%"><?php echo Horde::img('alarm.png', _("Task Alarm?")) ?></td>
  <th class="<?php echo ($sortby == NAG_SORT_DUE) ? 'selected' : 'item' ?>" width="12%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_DUE) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_DUE)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' : 'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_DUE)), _("Sort by Due Date"), 'widget', '', '', _("_Due Date")) ?></a>&nbsp;
  </th>
  <th class="<?php echo ($sortby == NAG_SORT_CATEGORY) ? 'selected' : 'item' ?>" width="20%" align="left" nowrap="nowrap">
    <?php if ($sortby == NAG_SORT_CATEGORY) echo Horde::link(Horde::applicationUrl(Util::addParameter($sortbyurl, 'sortby', NAG_SORT_CATEGORY)), _("Change sort direction"), 'widget') . Horde::img($sortdir ? 'za.png' : 'az.png', _("Change sort direction"), null, $registry->getImageDir('horde')) ?></a>
    <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', NAG_SORT_CATEGORY)), _("Sort by Category"), 'widget', '', '', _("Cat_egory")) ?></a>&nbsp;
  </th>
 </tr>
