steffen: server/kolab-horde-fbview/kolab-horde-fbview/fbview/turba/templates/browse actions.inc, NONE, 1.1 column_footers.inc, NONE, 1.1 column_headers.inc, NONE, 1.1 contactrow.inc, NONE, 1.1 footer.inc, NONE, 1.1 footerAlpha.inc, NONE, 1.1 header.inc, NONE, 1.1 javascript.inc, NONE, 1.1 search.inc, NONE, 1.1 search_criteria.inc, NONE, 1.1 select.inc, NONE, 1.1

cvs at intevation.de cvs at intevation.de
Mon Oct 31 12:43:43 CET 2005


Author: steffen

Update of /kolabrepository/server/kolab-horde-fbview/kolab-horde-fbview/fbview/turba/templates/browse
In directory doto:/tmp/cvs-serv18388/kolab-horde-fbview/kolab-horde-fbview/fbview/turba/templates/browse

Added Files:
	actions.inc column_footers.inc column_headers.inc 
	contactrow.inc footer.inc footerAlpha.inc header.inc 
	javascript.inc search.inc search_criteria.inc select.inc 
Log Message:
Fbview in separate package

--- NEW FILE: actions.inc ---
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
  <td align="left" nowrap="nowrap" class="control">
    <?php echo Horde::widget('', $listType == 'list' ? _("Remove from this list") : _("Delete"), 'widget', '', "Submit('delete'); return false;", $listType == 'list' ? _("_Remove from this list") : _("_Delete")) . '</a>' ?>
  </td>

<?php if (!empty($add_source_options)): ?>
  <td align="left" nowrap="nowrap" class="control">
    <form name='copymove' action="javascript:void(0);" onsubmit="return false;">
     |
    <?php echo Horde::link('', _("Move"), 'widget', '', "CopyMove('move'); return false;") . _("Move") . '</a> | ';
          echo Horde::link('', _("Copy"), 'widget', '', "CopyMove('copy'); return false;") . _("Copy") . '</a>' ?>
    <select name="targetAddressbook">
      <option value=""><?php echo _("to Selected Address Book") ?></option>
      <?php echo $add_source_options ?>
    </select>
    </form>
  </td>
<?php endif; ?>

<?php if (!empty($cfgSources[$source]['map']['__type'])): ?>
  <td align="left" nowrap="nowrap" class="control">
    <form name='targetList' action="javascript:void(0);" onsubmit="return false;">
     |
    <?php echo Horde::link('', _("Add to"), 'widget', '', "Add(); return false;") . _("Add to") . '</a>' ?>
    <select name="listList">
      <option value=""><?php echo _("Select List") ?></option>
      <option value="">-----</option>
      <option value="*new*"><?php echo _("New List") ?></option>
      <option value="">-----</option>
<?php foreach ($addToList as $list): ?>
      <option value="<?php echo $list['key'] ?>"><?php echo $list['name'] ?></option>
<?php endforeach; ?>
    </select>
    </form>
  </td>
<?php endif; ?>

  <td align="right" nowrap="nowrap" width="100%" class="control">
<?php
$browse_link = Util::addParameter(Horde::applicationUrl('browse.php'), 'source', $source);
if ($listType == 'directory' && !empty($cfgSources[$source]['map']['__type'])) {
    echo Horde::widget(Util::addParameter($browse_link, 'show', 'lists'), _("Show Lists"), 'widget', '', '', _("Show _Lists")) . ' | ';
    echo Horde::widget(Util::addParameter($browse_link, 'show', 'contacts'), _("Show Contacts"), 'widget', '', '', _("Show _Contacts")) . ' | ';
    echo Horde::widget(Util::addParameter($browse_link, 'show', 'all'), _("Show All"), 'widget', '', '', _("Sho_w All"));
} elseif ($listType == 'list' && !empty($cfgSources[$source]['map']['__type'])) {
    echo Horde::widget(Util::addParameter($browse_link, 'show', 'all'), sprintf(_("Back to %s"), $cfgSources[$source]['title']), 'widget', '', '', sprintf(_("Ba_ck to %s"), $cfgSources[$source]['title']));
} elseif ($listType == 'search') {
    if ($conf['search']['cache']) {
        $search_link = Util::addParameter(Horde::applicationUrl('search.php'), 'source', $source);
        echo Horde::widget(Util::addParameter($search_link, 'clear', '1'), _("Clear Search"), 'widget', '', '', _("C_lear Search"));
    } else {
        echo ' ';
    }
}
?>
  </td>
</tr>
</table>
</td></tr>

--- NEW FILE: column_footers.inc ---
    </table>
    <input type="hidden" name="actionID" value="" />
    <input type="hidden" name="show" value="<?php echo Util::getFormData('show','all') ?>" />
    <input type="hidden" name="source" value="<?php echo $source ?>" />
    <input type="hidden" name="sortby" value="<?php echo $prefs->getValue('sortby') ?>" />
    <input type="hidden" name="sortdir" value="<?php echo $prefs->getValue('sortdir') ?>" />
    <input type="hidden" name="key" value="<?php echo Util::getFormData('key', '') ?>" />
    <input type="hidden" name="targetAddressbook" value="" />
    <input type="hidden" name="targetList" value="" />
    <input type="hidden" name="targetNew" value="" />
    </form>
  </td>
</tr>

--- NEW FILE: column_headers.inc ---
<tr>
  <td class="control" align="left">
    <form method="post" name="contacts" action="<?php echo Horde::selfURL() ?>">
    <?php echo Util::formInput() ?>
    <table border="0" cellpadding="0" cellspacing="1" width="100%">
    <tr>
      <th class="item" width="1%" style="cursor:pointer;" onclick="document.contacts.checkAll.checked = !document.contacts.checkAll.checked; SelectAll();" align="left" nowrap="nowrap" width="8%"><input type="checkbox" name="checkAll" onclick="document.contacts.checkAll.checked = !document.contacts.checkAll.checked; SelectAll();" <?php echo Horde::getAccessKeyAndTitle(_("Check _All/None")) ?>" /></th>
      <th class="item" width="1%"><?php echo Horde::img('edit.gif', _("Edit")) ?></th>
      <th class="item" width="1%"><?php echo Horde::img('mime/vcard.gif', _("vCard"), '', $registry->getParam('graphics', 'horde')) ?></th>
      <th class="item" width="1%"><?php echo Horde::img('group.gif', _("Group")) ?></th>
      <th class="<?php echo ($prefs->getValue('sortby') == 0) ? 'selected' : 'item' ?>" width="<?php echo $width ?>%" align="left" nowrap="nowrap">
        <a class="widget" href="" onclick="Sort(0, <?php echo abs(1 - $prefs->getValue('sortdir')) ?>); return false; "><?php echo Horde::img($prefs->getValue('sortdir') ? 'za.gif' : 'az.gif', _("Sort Direction"), null, $registry->getParam('graphics', 'horde')) ?></a>
        <a class="widget" href="" onclick="Sort(0, <?php echo $prefs->getValue('sortdir') ?>); return false;"><?php echo $attributes['name']['label'] ?></a>
      </th>
    <?php for ($i = 1; $i <= count($columns); $i++): ?>
      <th class="<?php echo ($prefs->getValue('sortby') == $i) ? 'selected' : 'item' ?>" width="<?php echo $width ?>%" align="left" nowrap="nowrap">
        <a class="widget" href="" onclick="Sort(<?php echo $i ?>, <?php echo abs(1 - $prefs->getValue('sortdir')) ?>); return false; "><?php echo Horde::img($prefs->getValue('sortdir') ? 'za.gif' : 'az.gif', _("Sort Direction"), null, $registry->getParam('graphics', 'horde')) ?></a>
        <a class="widget" href="" onclick="Sort(<?php echo $i ?>, <?php echo $prefs->getValue('sortdir') ?>); return false;"><?php echo $attributes[$columns[$i-1]]['label'] ?></a>
      </th>
    <?php endfor; ?>
    </tr>

--- NEW FILE: contactrow.inc ---
<?php

if ($this->list->isFresh($ob)) {
    $class = 'listitem';
} else {
    $class = 'oldlistitem';
}

if ($ob->hasValue('name')) {
    $link_text = htmlspecialchars(Turba::formatName($ob));
} else {
    $link_text = '';
}

$edit_url = ' ';

global $prefs;
if ($ob->hasValue('__key')) {
    if ($ob->isGroup()) {
        $url = 'browse.php';
    } else {
        $url = 'display.php';
    }
    $url = Util::addParameter($url, 'source', $ob->getSource());
    $url = Util::addParameter($url, 'key', $ob->getValue('__key'));

    $vcard_url = Util::addParameter('vcard.php', 'source', $ob->getSource());
    $vcard_url = Util::addParameter($vcard_url, 'key', $ob->getValue('__key'));
    $vcard_url = Horde::link(Horde::applicationUrl($vcard_url), _("Download VCard")) . Horde::img('mime/vcard.gif', _("Download vCard"), '', $GLOBALS['registry']->getParam('graphics', 'horde')) . '</a>';

    $cell = Horde::link(Horde::applicationUrl($url), sprintf(_("View '%s'"), $ob->getValue('name')));
    $cell .= $link_text . '</a>';
    if (Turba::checkPermissions($ob, 'object', PERMS_EDIT)) {
        $edit_url = Util::addParameter('edit.php', 'source', $ob->getSource());
        $edit_url = Util::addParameter($edit_url, 'key', $ob->getValue('__key'));
        $edit_url = Util::addParameter($edit_url, 'url', Horde::selfURL());
        $edit_url = Horde::link(Horde::applicationUrl($edit_url), sprintf(_("Edit '%s'"), $ob->getValue('name'))) . Horde::img('edit.gif', _("Edit")) . '</a>';
    }
} else {
    $cell = $link_text;
}
?>
<tr class="<?php echo $class ?>" onmouseover="className='<?php echo $class ?>-hi';" onmouseout="className='<?php echo $class ?>';">
  <td><input type="checkbox" name="objectkeys[]" value="<?php echo htmlspecialchars($ob->getSource() . ':' . $ob->getValue('__key')) ?>" /></td>
  <td><?php echo $edit_url ?></td>
  <td><?php echo $vcard_url ?></td>
  <td><?php echo $ob->isGroup() ? Horde::img('group.gif', _("Group")) : ' ' ?></td>
  <td><?php
echo $cell;

// We purposefully do this before the </td> so that if we end up
// including a script file (say, for the IMP compose window), it's in
// a legal spot.
//
// Build the columns to display.
$show = array();
foreach ($GLOBALS['columns'] as $column) {
    if ($ob->hasValue($column)) {
        $show[$column] = htmlspecialchars($ob->getValue($column));
        if ($GLOBALS['attributes'][$column]['type'] == 'email') {
            $show[$column] = Turba::formatEmailAddresses($show[$column], $ob);
        }
    } else {
        $show[$column] = ' ';
    }
}

?></td>
<?php foreach ($show as $field): ?>
  <td><?php echo $field ?></td>
<?php endforeach; ?>
</tr>

--- NEW FILE: footer.inc ---
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
  <td align="left" class="control" nowrap="nowrap">
    <span class="legend">
    <b><?php echo _("Records displayed:") ?></b>
<?php
if (!empty($numDisplayed)) {
    echo '[' . sprintf(_("%s to %s of %s"), $start, $end, $numDisplayed) . ']';
} else {
    echo _("None");
}
?>
  </span>
  </td>
  <td class="control" width="100%">
    <?php if (isset($pager)) echo $pager->render() ?>
  </td>
</tr>
</table>

--- NEW FILE: footerAlpha.inc ---
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
  <td class="control" width="100%" align="center">
<?php
$show = Util::getFormData('show', 'all');
$currentPage = String::upper($page);
if ($currentPage == '*') {
    echo '<b>(' . _("All") . ')</b> ';
} else {
    echo Horde::link(Horde::applicationUrl(Util::addParameter($viewurl, array('page' => '*',
                                                                              'show' => $show)))) . _("All") . '</a> ';
}
for ($i = 65; $i < 91; $i++) {
    $a = chr($i);
    if ($currentPage == $a) {
        echo '<b>(' . $a . ')</b> ';
    } else {
        $link = Util::addParameter($viewurl, array('page' => $a,
                                                   'show' => $show));
        echo Horde::link(Horde::applicationUrl($link)) . $a . '</a> ';
    }
}
?>
  </td>
</tr>
</table>

--- NEW FILE: header.inc ---
<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr><td>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
  <td align="left" class="header"><b><?php echo $title ?></b></td>
  <td align="right" class="header"> </td>
</tr>
</table></td></tr>

--- NEW FILE: javascript.inc ---
<script language="JavaScript" type="text/javascript">
<!--

function AnySelected()
{
    for (i = 0; i < document.contacts.elements.length; i++) {
        if (document.contacts.elements[i].checked) {
            return true;
        }
    }
    return false;
}

function Add() 
{
    key = document.targetList.listList[document.targetList.listList.selectedIndex].value;
    if (key == '') {
        alert('<?php echo addslashes(_("You must select a target list.")) ?>');
        return false;
    }

    document.contacts.targetList.value = key;

    if (key == "*new*") {
        var newList = window.prompt('<?php echo addslashes(_("You are creating a distribution list.")) . '\n' . addslashes(_("Please enter the name of the new list:")) ?>\n', '');
        if (newList != null && newList != '') {
            document.contacts.targetNew.value = 1;
            document.contacts.targetList.value = newList;
        } else {
            return false;
        }
    }

    Submit('add');
}

function CopyMove(action)
{
    key = document.copymove.targetAddressbook[document.copymove.targetAddressbook.selectedIndex].value;
    if (key == '') {
        alert('<?php echo addslashes(_("You must select a target address book.")) ?>');
        return false;
    }

    document.contacts.targetAddressbook.value = key;
    Submit(action);
}

function Submit(action)
{
    if (AnySelected()) {
        if (action != 'delete' ||
            confirm('<?php echo addslashes(_("Are you sure that you want to delete the selected entries?")) ?>')) {
            document.contacts.actionID.value = action;
            document.contacts.submit();
        }
    } else {
        window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>');
        return false;
    }
}

function Sort(col, direction)
{
    document.contacts.sortby.value = col;
    document.contacts.sortdir.value = direction;
    document.contacts.submit();
}

function SelectAll()
{
    for (i = 0; i < document.contacts.elements.length; i++) {
        document.contacts.elements[i].checked = document.contacts.checkAll.checked;
    }
}

function confirmDelete(name)
{
    return confirm('<?php echo addslashes(_("Are you sure that you want to delete %s?")) ?>'.replace('%s', name));
}

//-->
</script>

--- NEW FILE: search.inc ---
<?php
/* Build the directory sources select widget. */
$source_options = '';
$criteria_options = '';
$js_criteria = "var criteriaOptions = new Array();\n";
$source_count = 0;
foreach ($cfgSources as $key => $entry) {
    $js_criteria .= "criteriaOptions[$source_count] = new Array()\n";
    $js_criteria .= "criteriaOptions[$source_count][0] = '$key';\n";

    /* Build the criteria select widget. */
    $field_count = 1;
    foreach ($entry['search'] as $field) {
        $js_criteria .= "criteriaOptions[$source_count][$field_count] = new Array('$field', '" . $attributes[$field]['label'] . "');\n";
        if ($key == $source) {
            $criteria_options .= "<option value=\"$field\">";
            $criteria_options .= $attributes[$field]['label'] . "</option>\n";
        }
        $field_count++;
    }

    $selected = ($key == $source) ? ' selected="selected"' : '';
    $source_options .= "<option value=\"$key\"$selected>";
    $source_options .= $entry['title'] . "</option>\n";

    $source_count++;
}

if ($_SESSION['turba_search_mode'] == 'basic'): ?>
<script language="JavaScript" type="text/javascript">
<!--
<?php echo $js_criteria ?>
function updateCriterias()
{
    var f = document.directory_search;

    while (f.criteria.length > 0) {
        f.criteria.options[f.criteria.length-1] = null;
    }

    for (var i = 0; i < criteriaOptions.length; i++) {
        if (criteriaOptions[i][0] == f.source.options[f.source.selectedIndex].value) {
            for (var j = 1; j < criteriaOptions[i].length; j++) {
                f.criteria.options[f.criteria.length] = new Option(criteriaOptions[i][j][1], criteriaOptions[i][j][0]);
            }
            f.criteria.selectedIndex = 0;
            return;
        }
    }
}
//-->
</script>

<form name="directory_search" action="<?php echo Horde::applicationUrl('search.php') ?>" method="get">
<input type="hidden" name="actionID" value="1" />
<?php echo Util::formInput() ?>

<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr class="header">
  <td class="header">
      <b><?php echo _("Basic Search") ?></b>
  </td>
  <td align="right" class="header">
    <?php echo Horde::widget(Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'advanced'), _("Advanced Search"), 'menuitem', '', '', _("Ad_vanced Search")) ?></a>
  </td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="5">
<tr>
    <td class="light" align="right"><b><?php echo _("Find") ?></b></td>
    <td class="item">
        <select name="criteria">
<?php echo $criteria_options ?>
        </select>
    </td>

    <td class="light" align="right"><b><?php echo _("Matching") ?></b></td>
    <td class="item">
        <input type="text" size="30" name="val" value="" />
    </td>

<?php if (count($cfgSources) > 1): ?>
    <td class="light" align="right"><b><?php echo _("From") ?></b></td>
    <td class="item">
        <select name="source" onchange="updateCriterias()">
<?php echo $source_options ?>
        </select>
    </td>
<?php else: ?>
    <td>
        <input type="hidden" name="source" value="<?php reset($cfgSources); echo key($cfgSources) ?>" />
    </td>
<?php endif; ?>

    <td>
        <input class="button" type="submit" value="<?php echo _("Search") ?>" />
    </td>
</tr>
</table>
</form>
<br/>

<?php else: ?>

<form name="directory_search" action="<?php echo Horde::applicationUrl('search.php') ?>" method="get">
<?php echo Util::formInput() ?>

<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr class="header">
  <td class="header">
    <b><?php echo _("Advanced Search") ?></b>
  </td>
  <td align="right" class="header">
    <?php echo Horde::widget(Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'basic'), _("Basic Search"), 'menuitem', '', '', _("Basi_c Search")) ?></a>
  </td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="5" width="100%">
<tr>
    <td> </td>
    <td>
        <input type="submit" class="button" name="search" value="<?php echo _("Search") ?>" />
        <input type="reset" class="button" name="reset" value="<?php echo _("Reset") ?>" />
    </td>
</tr>

<tr><td class="light" align="right"><b><?php echo _("Directory") ?></b></td>
    <td align="left"><select name="source" onchange="directory_search.submit()">
<?php echo $source_options ?>
</select></td></tr>

<?php endif;

--- NEW FILE: search_criteria.inc ---
<?php
foreach ($map as $name => $v) {
  if ($name != '__owner' &&
      $name != '__type' &&
      $name != '__members') {
?>
<tr>
    <td width="1%" nowrap="nowrap" class="light" align="right"><b><?php echo $attributes[$name]['label'] ?></b></td>
    <td align="left"><input type="text" size="30" name="<?php echo $name ?>" /></td>
</tr>
<?php
  }
}
?>

</table>
</form>
--- NEW FILE: select.inc ---
<form name="directory_list" action="<?php echo Horde::applicationUrl('browse.php') ?>" method="get">
<?php echo Util::formInput() ?>
<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
  <td>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
      <td class="header">
        <b><?php echo _("Select Address Book") ?>  </b>
        <select name="source" onchange="document.directory_list.submit();"><?php echo $source_options ?></select>
        <input class="button" type="submit" value="<?php echo _("Show") ?>" />
      </td>
    </tr>
    </table>
  </td>
</tr>
</table>
</form>
<br />





More information about the commits mailing list