diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 17:57:25 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 17:57:25 +0000 |
commit | 683f50786a7aec4a936b7b5d59a8e6338b1c7071 (patch) | |
tree | c674bb5a47b3ac98837743d09991013a33232fb1 /mod/widgettest | |
parent | d423fd2379171706c75c60600442a2dbdc12d87a (diff) | |
download | elgg-683f50786a7aec4a936b7b5d59a8e6338b1c7071.tar.gz elgg-683f50786a7aec4a936b7b5d59a8e6338b1c7071.tar.bz2 |
Widgets, including a test widget plugin
git-svn-id: https://code.elgg.org/elgg/trunk@900 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/widgettest')
-rw-r--r-- | mod/widgettest/start.php | 13 | ||||
-rw-r--r-- | mod/widgettest/views/default/widgets/widgettest/edit.php | 7 | ||||
-rw-r--r-- | mod/widgettest/views/default/widgets/widgettest/view.php | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/mod/widgettest/start.php b/mod/widgettest/start.php new file mode 100644 index 000000000..b02423b66 --- /dev/null +++ b/mod/widgettest/start.php @@ -0,0 +1,13 @@ +<?php
+
+ // TEMPORARY!
+
+ function widgettest_init() {
+
+ add_widget_type('widgettest',"Test widget!","This is a test widget.");
+
+ }
+
+ register_elgg_event_handler('init','system','widgettest_init');
+
+?>
\ No newline at end of file diff --git a/mod/widgettest/views/default/widgets/widgettest/edit.php b/mod/widgettest/views/default/widgets/widgettest/edit.php new file mode 100644 index 000000000..10958a7ba --- /dev/null +++ b/mod/widgettest/views/default/widgets/widgettest/edit.php @@ -0,0 +1,7 @@ +<?php
+
+?>
+ <p>
+ Display a message:
+ <input type="text" name="params[description]" value="<?php echo htmlentities($vars['entity']->description); ?>" />
+ </p>
\ No newline at end of file diff --git a/mod/widgettest/views/default/widgets/widgettest/view.php b/mod/widgettest/views/default/widgets/widgettest/view.php new file mode 100644 index 000000000..16ec7390e --- /dev/null +++ b/mod/widgettest/views/default/widgets/widgettest/view.php @@ -0,0 +1,13 @@ +<h1>I am a test widget!</h1>
+<p>
+ <?php
+
+ $description = $vars['entity']->description;
+ if (!empty($description)) {
+ echo $vars['entity']->description;
+ } else {
+ echo "Click 'edit' to change my message.";
+ }
+
+ ?>
+</p>
\ No newline at end of file |