Elgg  Version 1.9
tagcloud_block.php
Go to the documentation of this file.
1 <?php
13 if (!$owner_guid) {
15 }
16 
19  // not supporting groups so return
20  return true;
21 }
22 
23 $type = 'object';
24 
25 $options = array(
26  'type' => $type,
27  'subtype' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE),
28  'owner_guid' => $owner_guid,
29  'threshold' => 0,
30  'limit' => elgg_extract('limit', $vars, 50),
31  'tag_name' => 'tags',
32 );
33 
34 $title = elgg_echo('tagcloud');
35 if (is_array($options['subtype']) && count($options['subtype']) > 1) {
36  // we cannot provide links to tagged objects with multiple types
37  $tag_data = elgg_get_tags($options);
38  $cloud = elgg_view("output/tagcloud", array(
39  'value' => $tag_data,
40  'type' => $type,
41  ));
42 } else {
44 }
45 if (!$cloud) {
46  return true;
47 }
48 
49 // add a link to all site tags
50 $cloud .= '<p class="small">';
51 $cloud .= elgg_view_icon('tag');
52 $cloud .= elgg_view('output/url', array(
53  'href' => 'tags',
54  'text' => elgg_echo('tagcloud:allsitetags'),
55  'is_trusted' => true,
56 ));
57 $cloud .= '</p>';
58 
59 
elgg_view_icon($name, $class= '')
View one of the elgg sprite icons.
Definition: views.php:1370
elgg_get_tags(array $options=array())
Get popular tags and their frequencies.
Definition: tags.php:71
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1197
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.
Definition: views.php:1317
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an ElggEntity and optionally for type and subtype.
Definition: entities.php:1886
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if($owner_entity &&elgg_instanceof($owner_entity, 'group')) $type
const ELGG_ENTITIES_ANY_VALUE
Definition: elgglib.php:2134
elgg echo
Translates a string.
Definition: languages.js:43
if(!$owner_guid) $owner_entity
$options
if(!$cloud) $cloud
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$owner_guid
Display content-based tags.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:604
if(file_exists($welcome)) $vars
Definition: upgrade.php:93
$title