summaryrefslogtreecommitdiff
path: root/modules/photoannotation/views/photoannotation_user_search.html.php
blob: 2182a32446776a1f1999828a129df8e461ad0bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
  $("#g-user-search-form").ready(function() {
    var url = $("#g-user-search-results").attr("ref") + "/autocomplete";
    $("#g-user-search-form input:text").autocomplete(
      url, {
        max: 30,
        multiple: false,
        cacheLength: 1
      }
    );
  });
</script>
<div id="g-user-search-results" ref="<?= url::site("photoannotation") ?>">
  <h1><?= t("Search results") ?></h1>
  <?= $search_form ?>
  <? if (count($users)): ?>
  <div class="g-message photoannotation-user-search">
    <?= t("%count people found for <b>%term</b>", array("count" => $count, "term" => $q)) ?>
  </div>
  <? foreach ($users as $user): ?>
  <? $profile_link = "<a href=\"". user_profile::url($user->id) ."\">" ?>
  <div class="g-block">
    <h2><img src="<?= $user->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
       alt="<?= html::clean_attribute($user->display_name()) ?>"
       class="g-avatar" width="40" height="40" />
       <?= $profile_link . $user->name ?></a></h2>
    <div>
      <table class="g-message">
        <tbody>
          <tr>
            <th style="width: 20%"><?= t("Full name") ?></th>
            <td><?= $user->display_name() ?></td>
          </tr>
          <tr>
            <th style="width: 20%"><?= t("Tagged photos") ?></th>
            <td colspan="2"><?= photoannotation::annotation_count($user->id) ?></td>
          </tr>
          <? if (module::is_active("comment")): ?>
          <tr>
            <th style="width: 20%"><?= t("Comments") ?></th>
            <td colspan="2"><?= photoannotation::comment_count($user->id) ?></td>
          </tr>
          <? endif ?>
        </tbody></table>
    </div>
  </div>
  <? endforeach ?>
  <?= $paginator ?>
  <? else: ?>
  <div class="photoannotation-user-search">
    <?= t("No users found for <b>%term</b>", array("term" => $q)) ?>
  </div>
  <? endif; ?>
</div>