From a1abec1d617c9330d9c06bda2f462d213f013f53 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 16 Oct 2009 20:54:48 +0000 Subject: Finish up standardizing views/default/* git-svn-id: http://code.elgg.org/elgg/trunk@3557 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/widgets/editwrapper.php | 46 +++++------ views/default/widgets/wrapper.php | 141 ++++++++++++++++------------------ 2 files changed, 86 insertions(+), 101 deletions(-) (limited to 'views/default/widgets') diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php index 75e966028..8ed29dd59 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/editwrapper.php @@ -1,37 +1,31 @@ getGUID(); - - - $form_body = $vars['body']; - $form_body .= "

"; - $form_body .= "

" . elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $guid)) . elgg_view('input/hidden', array('internalname' => 'noforward', 'value' => 'true')) . elgg_view('input/submit', array('internalname' => "submit$guid", 'value' => elgg_echo('save'))) . "

"; - - echo elgg_view('input/form', array('internalid' => "widgetform$guid", 'body' => $form_body, 'action' => "{$vars['url']}action/widgets/save")) +/** + * Elgg edit widget layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +$guid = $vars['entity']->getGUID(); + +$form_body = $vars['body']; +$form_body .= "

"; +$form_body .= "

" . elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $guid)) . elgg_view('input/hidden', array('internalname' => 'noforward', 'value' => 'true')) . elgg_view('input/submit', array('internalname' => "submit$guid", 'value' => elgg_echo('save'))) . "

"; + +echo elgg_view('input/form', array('internalid' => "widgetform$guid", 'body' => $form_body, 'action' => "{$vars['url']}action/widgets/save")) ?> - - \ No newline at end of file diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index e7791bde9..eeb6d1cd1 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -1,35 +1,35 @@ getSubtype() == 'widget') { - $handler = $vars['entity']->handler; - $title = $widgettypes[$vars['entity']->handler]->name; - if (!$title) - $title = $handler; - } else { - $handler = "error"; - $title = elgg_echo("error"); +/** + * Elgg widget wrapper + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +static $widgettypes; + +$callback = get_input('callback'); + +if (!isset($widgettypes)) { + $widgettypes = get_widget_types(); +} + +if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') { + $handler = $vars['entity']->handler; + $title = $widgettypes[$vars['entity']->handler]->name; + if (!$title) { + $title = $handler; } - - if ($callback != "true") { - -?> +} else { + $handler = "error"; + $title = elgg_echo("error"); +} + +if ($callback != "true") { + + ?>
@@ -39,60 +39,53 @@
canEdit()) { - - ?> -
elgg_view("widgets/{$handler}/edit",$vars), - 'entity' => $vars['entity'] - ) - ); - - ?>
- canEdit()) { + ?> +
-
- elgg_view("widgets/{$handler}/edit",$vars), + 'entity' => $vars['entity'] + ) + ); - echo "
getGUID()}\">"; - - - } else { // end if callback != "true" + ?>
+ +
+ + echo "
getGUID()}\">"; +} else { // end if callback != "true" + if (elgg_view_exists("widgets/{$handler}/view")) { + echo elgg_view("widgets/{$handler}/view",$vars); + } else { + echo elgg_echo('widgets:handlernotfound'); + } - + + "; - + ?>
-
+
- + - - \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3