aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 12:42:12 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 12:42:12 +0000
commit872a5469da80557721e32b22e93af531c2a279fa (patch)
tree105d1fba22acd7f370578f91055028af7c217065 /mod
parent2aaf2d80f1cbc2a6ad4a1b4b5ef97c3494d6a0bd (diff)
downloadelgg-872a5469da80557721e32b22e93af531c2a279fa.tar.gz
elgg-872a5469da80557721e32b22e93af531c2a279fa.tar.bz2
cleaned up tagcloud plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8076 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/tagcloud/languages/de.php12
-rw-r--r--mod/tagcloud/languages/en.php20
-rw-r--r--mod/tagcloud/manifest.xml8
-rw-r--r--mod/tagcloud/start.php6
-rw-r--r--mod/tagcloud/tagcloud.php24
-rw-r--r--mod/tagcloud/views/default/tagcloud/css.php6
-rw-r--r--mod/tagcloud/views/default/widgets/tagcloud/content.php8
-rw-r--r--mod/tagcloud/views/default/widgets/tagcloud/edit.php35
8 files changed, 39 insertions, 80 deletions
diff --git a/mod/tagcloud/languages/de.php b/mod/tagcloud/languages/de.php
deleted file mode 100644
index 1192202b3..000000000
--- a/mod/tagcloud/languages/de.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
- $german = array(
- "tagcloud:widget:title" => "Schlagworte",
- "tagcloud:widget:description" => "Schlagworte",
- "tagcloud:widget:notags" => "Anzahl anzeigen",
- "item:object" => "Alle Einträge",
- );
-
- add_translation("de",$german);
-
-?>
diff --git a/mod/tagcloud/languages/en.php b/mod/tagcloud/languages/en.php
index 749a86434..f64e0553a 100644
--- a/mod/tagcloud/languages/en.php
+++ b/mod/tagcloud/languages/en.php
@@ -1,14 +1,12 @@
<?php
+/**
+ * Tag cloud English language file
+ */
- $english = array(
- 'tagcloud:widget:title' => 'Tag Cloud',
- 'tagcloud:site:title' => 'Site Tag Cloud',
- 'tagcloud:widget:description' => 'Tag cloud',
- 'tagcloud:widget:numtags' => 'Number of tags to show',
- 'item:object' => 'Items',
- 'advancedsearchtitle' => '%s with tags matching %s',
- );
+$english = array(
+ 'tagcloud:widget:title' => 'Tag Cloud',
+ 'tagcloud:widget:description' => 'Tag cloud',
+ 'tagcloud:widget:numtags' => 'Number of tags to show',
+);
- add_translation('en',$english);
-
-?>
+add_translation('en', $english);
diff --git a/mod/tagcloud/manifest.xml b/mod/tagcloud/manifest.xml
index 6338debaf..8966926c3 100644
--- a/mod/tagcloud/manifest.xml
+++ b/mod/tagcloud/manifest.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest>
- <field key="author" value="Curverider, Cash Costello" />
+ <field key="author" value="Cash Costello" />
<field key="version" value="1.0" />
- <field key="description" value="Site-wide and widget-based tag clouds." />
- <field key="website" value="http://www.elgg.org/" />
- <field key="copyright" value="(C) Curverider 2008-2010" />
+ <field key="description" value="Widget-based tag clouds." />
+ <field key="website" value="http://cashcostello.com/" />
+ <field key="copyright" value="(C) Cash Costello 2008-2011" />
<field key="licence" value="GNU Public License version 2" />
<field key="elgg_version" value="2010030101" />
<field key="admin_interface" value="advanced" />
diff --git a/mod/tagcloud/start.php b/mod/tagcloud/start.php
index 6e6df0445..663cec0e6 100644
--- a/mod/tagcloud/start.php
+++ b/mod/tagcloud/start.php
@@ -1,12 +1,10 @@
<?php
/**
- *
+ * Tagcloud plugin
*/
+elgg_register_event_handler('init', 'system', 'tagcloud_init');
function tagcloud_init() {
elgg_register_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description'));
- elgg_extend_view('css/screen', 'tagcloud/css');
}
-
-elgg_register_event_handler('init', 'system', 'tagcloud_init');
diff --git a/mod/tagcloud/tagcloud.php b/mod/tagcloud/tagcloud.php
deleted file mode 100644
index df280bbae..000000000
--- a/mod/tagcloud/tagcloud.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Display sidebar tagcloud
- **/
-
-// Load Elgg engine
-require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
-$title = elgg_view_title(elgg_echo('tagcloud:site:title'));
-
-$options = array(
- 'threshold' => 0,
- 'limit' => 100,
- 'tag_name' => 'tags',
-);
-$tags = elgg_view_tagcloud($options);
-
-$params = array(
- 'content' => $title . $tags,
- 'sidebar' => $sidebar
-);
-$body = elgg_view_layout("one_sidebar", $params);
-
-echo elgg_view_page(elgg_echo('tagcloud:site:title', array($page_owner->name)), $body); \ No newline at end of file
diff --git a/mod/tagcloud/views/default/tagcloud/css.php b/mod/tagcloud/views/default/tagcloud/css.php
deleted file mode 100644
index 37f887075..000000000
--- a/mod/tagcloud/views/default/tagcloud/css.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
- /**
- * Elgg tagcloud
- */
-?>
-
diff --git a/mod/tagcloud/views/default/widgets/tagcloud/content.php b/mod/tagcloud/views/default/widgets/tagcloud/content.php
index 5ed71d66a..af1d6a5f6 100644
--- a/mod/tagcloud/views/default/widgets/tagcloud/content.php
+++ b/mod/tagcloud/views/default/widgets/tagcloud/content.php
@@ -1,10 +1,11 @@
<?php
+/**
+ * Tag cloud widget
+ */
$num_items = $vars['entity']->num_items;
-if (!isset($num_items)) {
- $num_items = 30;
-}
+elgg_push_context('tags');
$options = array(
'owner_guid' => elgg_get_page_owner_guid(),
'threshold' => 1,
@@ -12,3 +13,4 @@ $options = array(
'tag_name' => 'tags',
);
echo elgg_view_tagcloud($options);
+elgg_pop_context();
diff --git a/mod/tagcloud/views/default/widgets/tagcloud/edit.php b/mod/tagcloud/views/default/widgets/tagcloud/edit.php
index b3b0f43ef..d860df549 100644
--- a/mod/tagcloud/views/default/widgets/tagcloud/edit.php
+++ b/mod/tagcloud/views/default/widgets/tagcloud/edit.php
@@ -1,20 +1,23 @@
-<p>
-<?php
+<?php
+/**
+ * Tagcloud widget edit view
+ *
+ */
+
+// set default value
+if (!isset($vars['entity']->num_items)) {
+ $vars['entity']->num_items = 30;
+}
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 30;
+$params = array(
+ 'internalname' => 'params[num_items]',
+ 'value' => $vars['entity']->num_items,
+ 'options' => array(10, 20, 30, 50, 100),
+);
+$dropdown = elgg_view('input/dropdown', $params);
- echo elgg_echo('tagcloud:widget:numtags');
-
- echo elgg_view('input/dropdown', array(
- 'internalname' => 'params[num_items]',
- 'options_values' => array( '10' => '10',
- '20' => '20',
- '30' => '30',
- '50' => '50',
- '100' => '100',
- ),
- 'value' => $num_items
- ));
?>
+<p>
+ <?php echo elgg_echo('tagcloud:widget:numtags'); ?>:
+ <?php echo $dropdown; ?>
</p>