From 5922d93173db6353e3404c1c2a941842a9f166ed Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 15 Dec 2010 22:20:20 +0000 Subject: moved widget into layout/objects as one of our core css objects git-svn-id: http://code.elgg.org/elgg/trunk@7639 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/layout/objects/widget.php | 52 +++++++++++++++++++++ views/default/layout/objects/widget/controls.php | 44 ++++++++++++++++++ views/default/layout/objects/widget/settings.php | 44 ++++++++++++++++++ views/default/layout/shells/widgets.php | 4 +- views/default/layout/shells/widgets/add_button.php | 13 ++++++ views/default/layout/shells/widgets/add_panel.php | 51 +++++++++++++++++++++ views/default/object/widget.php | 2 +- views/default/widgets/add_button.php | 13 ------ views/default/widgets/add_panel.php | 51 --------------------- views/default/widgets/controls.php | 44 ------------------ views/default/widgets/settings.php | 44 ------------------ views/default/widgets/wrapper.php | 53 ---------------------- 12 files changed, 207 insertions(+), 208 deletions(-) create mode 100644 views/default/layout/objects/widget.php create mode 100644 views/default/layout/objects/widget/controls.php create mode 100644 views/default/layout/objects/widget/settings.php create mode 100644 views/default/layout/shells/widgets/add_button.php create mode 100644 views/default/layout/shells/widgets/add_panel.php delete mode 100644 views/default/widgets/add_button.php delete mode 100644 views/default/widgets/add_panel.php delete mode 100644 views/default/widgets/controls.php delete mode 100644 views/default/widgets/settings.php delete mode 100644 views/default/widgets/wrapper.php (limited to 'views/default') diff --git a/views/default/layout/objects/widget.php b/views/default/layout/objects/widget.php new file mode 100644 index 000000000..d109693e1 --- /dev/null +++ b/views/default/layout/objects/widget.php @@ -0,0 +1,52 @@ +handler; + +$title = $widget->getTitle(); + +$can_edit = $widget->canEdit(); + +$widget_id = "widget-$widget->guid"; +$widget_instance = "widget-instance-$handler"; + +?> +
+
+

+
+ $widget)); + } + ?> +
+ $widget)); + } + ?> +
+ +
+
+
diff --git a/views/default/layout/objects/widget/controls.php b/views/default/layout/objects/widget/controls.php new file mode 100644 index 000000000..5e6aaf193 --- /dev/null +++ b/views/default/layout/objects/widget/controls.php @@ -0,0 +1,44 @@ + ' ', + 'href' => "#", + 'class' => 'widget-collapse-button', + 'internalid' => "widget-collapse-button_$widget->guid" +); +$collapse_link = elgg_view('output/url', $params); + +$params = array( + 'text' => ' ', + 'title' => elgg_echo('widget:delete', array($widget->getTitle())), + 'href' => elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", + 'is_action' => true, + 'class' => 'widget-delete-button', + 'internalid' => "widget-delete-button_$widget->guid" +); +$delete_link = elgg_view('output/url', $params); + +$params = array( + 'text' => ' ', + 'title' => elgg_echo('widget:edit'), + 'href' => "#", + 'class' => 'widget-edit-button', + 'internalid' => "widget-edit-button_$widget->guid" +); +$edit_link = elgg_view('output/url', $params); + +echo <<<___END +
+ $collapse_link + $delete_link + $edit_link +
+___END; diff --git a/views/default/layout/objects/widget/settings.php b/views/default/layout/objects/widget/settings.php new file mode 100644 index 000000000..5814e5821 --- /dev/null +++ b/views/default/layout/objects/widget/settings.php @@ -0,0 +1,44 @@ +handler/edit"; +$custom_form_section = elgg_view($edit_view, array('entity' => $widget)); + +$access_label = elgg_echo('access'); +$access = elgg_view('input/access', array('internalname' => 'params[access_id]','value' => $widget->access_id)); +$access_html = "

$access

"; + +$hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid)); +$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); + +// dashboard widgets do not get access controls +if (elgg_in_context('dashboard')) { + $access = ''; +} + +$body = <<<___END + $custom_form_section + $access +

+ $hidden + $submit +

+___END; + +?> +
+ $body, + 'action' => "action/widgets/save" +); +echo elgg_view('input/form', $params); +?> +
diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php index 130b2eaad..e5b63114b 100644 --- a/views/default/layout/shells/widgets.php +++ b/views/default/layout/shells/widgets.php @@ -19,13 +19,13 @@ $widgets = elgg_get_widgets($owner->guid, $context); if (elgg_can_edit_widget_layout($context)) { if ($show_add_widgets) { - echo elgg_view('widgets/add-button'); + echo elgg_view('layout/shells/widgets/add_button'); } $params = array( 'widgets' => $widgets, 'context' => $context, ); - echo elgg_view('widgets/add_panel', $params); + echo elgg_view('layout/shells/widgets/add_panel', $params); } echo $vars['box']; diff --git a/views/default/layout/shells/widgets/add_button.php b/views/default/layout/shells/widgets/add_button.php new file mode 100644 index 000000000..92de8a99f --- /dev/null +++ b/views/default/layout/shells/widgets/add_button.php @@ -0,0 +1,13 @@ + +
+ '#', + 'text' => elgg_echo('widgets:add'), + 'class' => 'action-button', +); +echo elgg_view('output/url', $options); +?> +
diff --git a/views/default/layout/shells/widgets/add_panel.php b/views/default/layout/shells/widgets/add_panel.php new file mode 100644 index 000000000..d9acc5518 --- /dev/null +++ b/views/default/layout/shells/widgets/add_panel.php @@ -0,0 +1,51 @@ +handler; + } +} + +?> + diff --git a/views/default/object/widget.php b/views/default/object/widget.php index b3ef5bb8c..1da5897c3 100644 --- a/views/default/object/widget.php +++ b/views/default/object/widget.php @@ -6,4 +6,4 @@ * @subpackage Core */ -echo elgg_view('widgets/wrapper',$vars); +echo elgg_view('layout/objects/widget', $vars); diff --git a/views/default/widgets/add_button.php b/views/default/widgets/add_button.php deleted file mode 100644 index 92de8a99f..000000000 --- a/views/default/widgets/add_button.php +++ /dev/null @@ -1,13 +0,0 @@ - -
- '#', - 'text' => elgg_echo('widgets:add'), - 'class' => 'action-button', -); -echo elgg_view('output/url', $options); -?> -
diff --git a/views/default/widgets/add_panel.php b/views/default/widgets/add_panel.php deleted file mode 100644 index d9acc5518..000000000 --- a/views/default/widgets/add_panel.php +++ /dev/null @@ -1,51 +0,0 @@ -handler; - } -} - -?> - diff --git a/views/default/widgets/controls.php b/views/default/widgets/controls.php deleted file mode 100644 index 5e6aaf193..000000000 --- a/views/default/widgets/controls.php +++ /dev/null @@ -1,44 +0,0 @@ - ' ', - 'href' => "#", - 'class' => 'widget-collapse-button', - 'internalid' => "widget-collapse-button_$widget->guid" -); -$collapse_link = elgg_view('output/url', $params); - -$params = array( - 'text' => ' ', - 'title' => elgg_echo('widget:delete', array($widget->getTitle())), - 'href' => elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", - 'is_action' => true, - 'class' => 'widget-delete-button', - 'internalid' => "widget-delete-button_$widget->guid" -); -$delete_link = elgg_view('output/url', $params); - -$params = array( - 'text' => ' ', - 'title' => elgg_echo('widget:edit'), - 'href' => "#", - 'class' => 'widget-edit-button', - 'internalid' => "widget-edit-button_$widget->guid" -); -$edit_link = elgg_view('output/url', $params); - -echo <<<___END -
- $collapse_link - $delete_link - $edit_link -
-___END; diff --git a/views/default/widgets/settings.php b/views/default/widgets/settings.php deleted file mode 100644 index 5814e5821..000000000 --- a/views/default/widgets/settings.php +++ /dev/null @@ -1,44 +0,0 @@ -handler/edit"; -$custom_form_section = elgg_view($edit_view, array('entity' => $widget)); - -$access_label = elgg_echo('access'); -$access = elgg_view('input/access', array('internalname' => 'params[access_id]','value' => $widget->access_id)); -$access_html = "

$access

"; - -$hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid)); -$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); - -// dashboard widgets do not get access controls -if (elgg_in_context('dashboard')) { - $access = ''; -} - -$body = <<<___END - $custom_form_section - $access -

- $hidden - $submit -

-___END; - -?> -
- $body, - 'action' => "action/widgets/save" -); -echo elgg_view('input/form', $params); -?> -
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php deleted file mode 100644 index 5c71aa8f8..000000000 --- a/views/default/widgets/wrapper.php +++ /dev/null @@ -1,53 +0,0 @@ -handler; - -$title = $widget->getTitle(); - -$can_edit = $widget->canEdit(); - -$widget_id = "widget-$widget->guid"; -$widget_instance = "widget-instance-$handler"; - -?> -
-
-

-
- $widget)); - } - ?> -
- $widget)); - } - ?> -
- -
-
-
-- cgit v1.2.3