aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/canvas/layouts/widgets.php29
-rw-r--r--views/default/widgets/wrapper.php13
2 files changed, 40 insertions, 2 deletions
diff --git a/views/default/canvas/layouts/widgets.php b/views/default/canvas/layouts/widgets.php
index e98d2f99a..39a5b92c9 100644
--- a/views/default/canvas/layouts/widgets.php
+++ b/views/default/canvas/layouts/widgets.php
@@ -11,6 +11,33 @@
* @link http://elgg.org/
*/
+ $widgettypes = get_widget_types();
+
+ if (is_array($widgettypes) && sizeof($widgettypes) > 0) {
+
+?>
+
+ <p>
+ <b>Temporarily, add a widget to this page:</b><br />
+
+<?php
+
+ foreach($widgettypes as $handler => $widgettype) {
+ $url = $vars['url'] . "action/widgets/add";
+ $url .= "?handler=" . $handler;
+ $url .= "&amp;context=" . get_context();
+ $url .= "&amp;user=" . page_owner();
+ $url .= "&amp;column=1";
+ echo "<a href=\"{$url}\">{$widgettype->name}</a><br />";
+ }
+
+?>
+ </p>
+
+<?php
+
+ }
+
?>
<!-- right sidebar -->
@@ -22,6 +49,7 @@
<?php
if ($widgets = get_widgets(page_owner(),get_context(),2)) {
+ if (is_array($widgets) && sizeof($widgets) > 0)
foreach($widgets as $widget) {
echo elgg_view_entity($widget);
}
@@ -44,6 +72,7 @@
<?php
if ($widgets = get_widgets(page_owner(),get_context(),1)) {
+ if (is_array($widgets) && sizeof($widgets) > 0)
foreach($widgets as $widget) {
echo elgg_view_entity($widget);
}
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php
index 93db61725..fcf3782fe 100644
--- a/views/default/widgets/wrapper.php
+++ b/views/default/widgets/wrapper.php
@@ -18,7 +18,7 @@
$handler = "error";
$title = elgg_echo("error");
}
-
+
?>
<div class="collapsable_box">
@@ -29,7 +29,16 @@
echo $vars['entity']->title;
?></h1></div>
- <div class="collapsable_box_editpanel"><?php echo elgg_view('widgets/editwrapper',array('body' => elgg_view("widgets/{$handler}/edit",$vars))); ?></div><!-- /collapsable_box_editpanel -->
+ <div class="collapsable_box_editpanel"><?php
+
+ echo elgg_view('widgets/editwrapper',
+ array(
+ 'body' => elgg_view("widgets/{$handler}/edit",$vars),
+ 'entity' => $vars['entity']
+ )
+ );
+
+ ?></div><!-- /collapsable_box_editpanel -->
<div class="collapsable_box_content">
<?php echo elgg_view("widgets/{$handler}/view",$vars); ?>
</div><!-- /.collapsable_box_content -->