~ubuntu-branches/ubuntu/lucid/mahara/lucid-security

« back to all changes in this revision

Viewing changes to htdocs/lib/dwoo/mahara/plugins/function.list_tags.php

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2009-11-27 22:09:03 UTC
  • mfrom: (6.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091127220903-aiigd3tr46z0rmcg
Tags: 1.2.0-2
Fix postrm script so that Mahara can be uninstalled

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Smarty plugin
 
4
 * @package Smarty
 
5
 * @subpackage plugins
 
6
 */
 
7
 
 
8
 
 
9
/**
 
10
 * Smarty {list_tags} function plugin
 
11
 *
 
12
 * Type:     function<br>
 
13
 * Name:     str<br>
 
14
 * Date:     June 22, 2006<br>
 
15
 * Purpose:  Render a list of tags
 
16
 * @author   Richard Mansfield <richard.mansfield@catalyst.net.nz>
 
17
 * @author   Penny Leach <penny@mjollnir.org>
 
18
 * @version  1.0
 
19
 * @param array
 
20
 * @param Smarty
 
21
 * @return Internationalized string
 
22
 */
 
23
function Dwoo_Plugin_list_tags(Dwoo $dwoo, $tags, $owner) {
 
24
    global $USER;
 
25
    if (!is_array($tags)) {
 
26
        return '';
 
27
    }
 
28
 
 
29
    if ($owner != $USER->get('id')) {
 
30
        return join(', ', array_map('hsc', $tags));
 
31
    }
 
32
 
 
33
    foreach ($tags as &$t) {
 
34
        $t = '<a class="tag" href="' . get_config('wwwroot') . 'tags.php?tag=' . urlencode($t) . '">' . hsc(str_shorten_text($t, 50)) . '</a>';
 
35
    }
 
36
    return join(', ', $tags);
 
37
}
 
38
 
 
39
?>