aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/profile/index.php2
-rw-r--r--mod/profile/start.php4
-rw-r--r--mod/widgettest/start.php13
-rw-r--r--mod/widgettest/views/default/widgets/widgettest/edit.php7
-rw-r--r--mod/widgettest/views/default/widgets/widgettest/view.php13
5 files changed, 35 insertions, 4 deletions
diff --git a/mod/profile/index.php b/mod/profile/index.php
index 35c1e41a6..e1f4f1651 100644
--- a/mod/profile/index.php
+++ b/mod/profile/index.php
@@ -29,7 +29,7 @@
}
- $body.= elgg_view("river/shell", array('river' => get_river_entries()));
+ $body = elgg_view_layout('widgets',$body);
page_draw($title, $body);
diff --git a/mod/profile/start.php b/mod/profile/start.php
index ddf136425..d76be446c 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -117,8 +117,6 @@
register_action("profile/iconupload",false,$CONFIG->pluginspath . "profile/actions/iconupload.php");
// Define widgets for use in this context
- if (is_callable('use_widgets')) {
- use_widgets('profile');
- }
+ use_widgets('profile');
?> \ No newline at end of file
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