From 9cd7ebd1ece016577c435b85f56d6c30545ff363 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 7 Dec 2010 02:47:31 +0000 Subject: reorganized the layout views git-svn-id: http://code.elgg.org/elgg/trunk@7553 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/views.php | 14 ++-- mod/blog/start.php | 2 +- mod/blog/views/default/blog/sidebar_menu.php | 4 +- mod/blog/views/default/blog/sidebar_revisions.php | 2 +- views/default/layout/objects/media.php | 55 ++++++++++++++++ views/default/layout/objects/module.php | 74 ++++++++++++++++++++++ views/default/layout/shells/administration.php | 36 +++++++++++ views/default/layout/shells/content.php | 53 ++++++++++++++++ views/default/layout/shells/default.php | 18 ++++++ views/default/layout/shells/one_column.php | 16 +++++ .../layout/shells/one_column_with_sidebar.php | 31 +++++++++ views/default/layout/shells/one_sidebar.php | 31 +++++++++ views/default/layout/shells/two_sidebar.php | 42 ++++++++++++ views/default/layout/shells/widgets.php | 46 ++++++++++++++ views/default/layout_elements/media.php | 55 ---------------- views/default/layout_elements/module.php | 74 ---------------------- views/default/layouts/administration.php | 36 ----------- views/default/layouts/default.php | 18 ------ views/default/layouts/main_content.php | 53 ---------------- views/default/layouts/one_column.php | 16 ----- views/default/layouts/one_column_with_sidebar.php | 31 --------- views/default/layouts/one_sidebar.php | 31 --------- views/default/layouts/two_sidebar.php | 42 ------------ views/default/layouts/widgets.php | 46 -------------- views/default/output/tagcloud.php | 2 +- 25 files changed, 414 insertions(+), 414 deletions(-) create mode 100644 views/default/layout/objects/media.php create mode 100644 views/default/layout/objects/module.php create mode 100644 views/default/layout/shells/administration.php create mode 100644 views/default/layout/shells/content.php create mode 100644 views/default/layout/shells/default.php create mode 100644 views/default/layout/shells/one_column.php create mode 100644 views/default/layout/shells/one_column_with_sidebar.php create mode 100644 views/default/layout/shells/one_sidebar.php create mode 100644 views/default/layout/shells/two_sidebar.php create mode 100644 views/default/layout/shells/widgets.php delete mode 100644 views/default/layout_elements/media.php delete mode 100644 views/default/layout_elements/module.php delete mode 100644 views/default/layouts/administration.php delete mode 100644 views/default/layouts/default.php delete mode 100644 views/default/layouts/main_content.php delete mode 100644 views/default/layouts/one_column.php delete mode 100644 views/default/layouts/one_column_with_sidebar.php delete mode 100644 views/default/layouts/one_sidebar.php delete mode 100644 views/default/layouts/two_sidebar.php delete mode 100644 views/default/layouts/widgets.php diff --git a/engine/lib/views.php b/engine/lib/views.php index 17b93926c..26d48be2f 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -608,7 +608,7 @@ function page_draw($title, $body, $sidebar = "") { * - one_column_with_sidebar A content column with sidebar. * - widgets A widget canvas. * - * The layout views take the form canvas/layouts/$layout_name + * The layout views take the form layout/shells/$layout_name * See the individual layouts for what options are supported. The two most * common layouts have these parameters: * one_column @@ -617,7 +617,7 @@ function page_draw($title, $body, $sidebar = "") { * content => string * sidebar => string (optional) * - * @param string $layout The name of the view in canvas/layouts/. + * @param string $layout The name of the view in layout/shells/. * @param array $vars Associative array of parameters for the layout view * * @return string The layout @@ -636,10 +636,10 @@ function elgg_view_layout($layout_name, $vars = array()) { $param_array = $vars; } - if (elgg_view_exists("layouts/{$layout_name}")) { - return elgg_view("layouts/{$layout_name}", $param_array); + if (elgg_view_exists("layout/shells/$layout_name")) { + return elgg_view("layout/shells/$layout_name", $param_array); } else { - return elgg_view("layouts/default", $param_array); + return elgg_view("layout/shells/default", $param_array); } } @@ -962,7 +962,7 @@ function elgg_view_comments($entity, $add_comment = true) { * Fixed width media on the side (image, icon, flash, etc.). * Descriptive content filling the rest of the column. * - * This is a shortcut for {@elgg_view layout_elements/media}. + * This is a shortcut for {@elgg_view layout/objects/media}. * * @param string $icon The icon and other information * @param string $body Description content @@ -974,7 +974,7 @@ function elgg_view_comments($entity, $add_comment = true) { function elgg_view_media($icon, $body, $vars = array()) { $vars['icon'] = $icon; $vars['body'] = $body; - return elgg_view('layout_elements/media', $vars); + return elgg_view('layout/objects/media', $vars); } /** diff --git a/mod/blog/start.php b/mod/blog/start.php index f0967367d..8caffcb5f 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -173,7 +173,7 @@ function blog_page_handler($page) { $params['sidebar'] .= $sidebar_menu; - $body = elgg_view_layout('main_content', $params); + $body = elgg_view_layout('content', $params); echo elgg_view_page($title, $body); } diff --git a/mod/blog/views/default/blog/sidebar_menu.php b/mod/blog/views/default/blog/sidebar_menu.php index 0be818c5a..3d343d80e 100644 --- a/mod/blog/views/default/blog/sidebar_menu.php +++ b/mod/blog/views/default/blog/sidebar_menu.php @@ -31,7 +31,7 @@ echo elgg_view("blogs/sidebar", array("object_type" => 'blog')); $comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc"); $title = elgg_echo('generic_comments:latest'); $body = elgg_view('comments/latest', array('comments' => $comments)); -echo elgg_view('layout_elements/module', array('title' => $title, 'body' => $body)); +echo elgg_view('layout/objects/module', array('title' => $title, 'body' => $body)); // only show archives for users or groups. // This is a limitation of the URL schema. @@ -53,7 +53,7 @@ if ($page_owner && $vars['page'] != 'friends') { } $content .= ''; - echo elgg_view('layout_elements/module', array('title' => $title, 'body' => $content)); + echo elgg_view('layout/objects/module', array('title' => $title, 'body' => $content)); } // friends page lists all tags; mine lists owner's diff --git a/mod/blog/views/default/blog/sidebar_revisions.php b/mod/blog/views/default/blog/sidebar_revisions.php index ca0a642f2..e3919648b 100644 --- a/mod/blog/views/default/blog/sidebar_revisions.php +++ b/mod/blog/views/default/blog/sidebar_revisions.php @@ -72,6 +72,6 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { $body .= ''; - echo elgg_view('layout_elements/module', array('title' => $title, 'body' => $body)); + echo elgg_view('layout/objects/module', array('title' => $title, 'body' => $body)); } } \ No newline at end of file diff --git a/views/default/layout/objects/media.php b/views/default/layout/objects/media.php new file mode 100644 index 000000000..232acc8f1 --- /dev/null +++ b/views/default/layout/objects/media.php @@ -0,0 +1,55 @@ +$body"; + +$icon_class = 'elgg-icon'; +$additional_class = elgg_get_array_value('icon_class', $vars, ''); +if ($additional_class) { + $icon_class = "$icon_class $additional_class"; +} +if ($icon_block) { + $icon_block = "
$icon_block
"; +} + +echo << + $icon_block$body + +HTML; diff --git a/views/default/layout/objects/module.php b/views/default/layout/objects/module.php new file mode 100644 index 000000000..ffce583ff --- /dev/null +++ b/views/default/layout/objects/module.php @@ -0,0 +1,74 @@ +$header"; + } +} else { + $header = "

$title

"; +} + +$body_class = 'elgg-body'; +$additional_class = elgg_get_array_value('body_class', $vars, ''); +if ($additional_class) { + $body_class = "$body_class $additional_class"; +} +$body = "
$body
"; + + +$footer_class = 'elgg-footer'; +$additional_class = elgg_get_array_value('footer_class', $vars, ''); +if ($additional_class) { + $body_class = "$footer_class $additional_class"; +} + +if (isset($vars['footer'])) { + if ($vars['footer']) { + $header = "
$footer
"; + } +} + +$contents = $header . $body . $footer; +if (!$skip_inner) { + $contents = "
$contents
"; +} + +echo "
$contents
"; diff --git a/views/default/layout/shells/administration.php b/views/default/layout/shells/administration.php new file mode 100644 index 000000000..f7ed84935 --- /dev/null +++ b/views/default/layout/shells/administration.php @@ -0,0 +1,36 @@ + + +
+

+ + sitename; echo " ".elgg_echo('admin'); ?> + << Return to network +

+
+ +
+ +
+ +
+
+ +
+
+ \ No newline at end of file diff --git a/views/default/layout/shells/content.php b/views/default/layout/shells/content.php new file mode 100644 index 000000000..908197a39 --- /dev/null +++ b/views/default/layout/shells/content.php @@ -0,0 +1,53 @@ + $body, + 'sidebar' => $sidebar, +); +echo elgg_view_layout('one_sidebar', $params); diff --git a/views/default/layout/shells/default.php b/views/default/layout/shells/default.php new file mode 100644 index 000000000..60dc90b0d --- /dev/null +++ b/views/default/layout/shells/default.php @@ -0,0 +1,18 @@ + +
+
+ + +
+
\ No newline at end of file diff --git a/views/default/layout/shells/one_column_with_sidebar.php b/views/default/layout/shells/one_column_with_sidebar.php new file mode 100644 index 000000000..e408c6c1c --- /dev/null +++ b/views/default/layout/shells/one_column_with_sidebar.php @@ -0,0 +1,31 @@ + + +
+
+ +
+ +
+ +
+
diff --git a/views/default/layout/shells/one_sidebar.php b/views/default/layout/shells/one_sidebar.php new file mode 100644 index 000000000..d0bb3879f --- /dev/null +++ b/views/default/layout/shells/one_sidebar.php @@ -0,0 +1,31 @@ + + +
+
+ +
+ +
+ +
+
diff --git a/views/default/layout/shells/two_sidebar.php b/views/default/layout/shells/two_sidebar.php new file mode 100644 index 000000000..26fb64920 --- /dev/null +++ b/views/default/layout/shells/two_sidebar.php @@ -0,0 +1,42 @@ + + +
+
+ +
+
+ elgg_view('layout_elements/module', array('title' => 'Testing', 'body' => 'Hello, world!')) + ); + echo elgg_view('page_elements/sidebar', $params); + ?> +
+ +
+ +
+
diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php new file mode 100644 index 000000000..130b2eaad --- /dev/null +++ b/views/default/layout/shells/widgets.php @@ -0,0 +1,46 @@ +guid, $context); + +if (elgg_can_edit_widget_layout($context)) { + if ($show_add_widgets) { + echo elgg_view('widgets/add-button'); + } + $params = array( + 'widgets' => $widgets, + 'context' => $context, + ); + echo elgg_view('widgets/add_panel', $params); +} + +echo $vars['box']; + +$widget_class = "widget-{$num_columns}-columns"; +for ($column_index = 1; $column_index <= $num_columns; $column_index++) { + $column_widgets = $widgets[$column_index]; + + echo "
"; + if (is_array($column_widgets) && sizeof($column_widgets) > 0) { + foreach ($column_widgets as $widget) { + echo elgg_view_entity($widget); + } + } + echo '
'; +} + +elgg_pop_context(); \ No newline at end of file diff --git a/views/default/layout_elements/media.php b/views/default/layout_elements/media.php deleted file mode 100644 index 232acc8f1..000000000 --- a/views/default/layout_elements/media.php +++ /dev/null @@ -1,55 +0,0 @@ -$body"; - -$icon_class = 'elgg-icon'; -$additional_class = elgg_get_array_value('icon_class', $vars, ''); -if ($additional_class) { - $icon_class = "$icon_class $additional_class"; -} -if ($icon_block) { - $icon_block = "
$icon_block
"; -} - -echo << - $icon_block$body - -HTML; diff --git a/views/default/layout_elements/module.php b/views/default/layout_elements/module.php deleted file mode 100644 index ffce583ff..000000000 --- a/views/default/layout_elements/module.php +++ /dev/null @@ -1,74 +0,0 @@ -$header"; - } -} else { - $header = "

$title

"; -} - -$body_class = 'elgg-body'; -$additional_class = elgg_get_array_value('body_class', $vars, ''); -if ($additional_class) { - $body_class = "$body_class $additional_class"; -} -$body = "
$body
"; - - -$footer_class = 'elgg-footer'; -$additional_class = elgg_get_array_value('footer_class', $vars, ''); -if ($additional_class) { - $body_class = "$footer_class $additional_class"; -} - -if (isset($vars['footer'])) { - if ($vars['footer']) { - $header = "
$footer
"; - } -} - -$contents = $header . $body . $footer; -if (!$skip_inner) { - $contents = "
$contents
"; -} - -echo "
$contents
"; diff --git a/views/default/layouts/administration.php b/views/default/layouts/administration.php deleted file mode 100644 index f7ed84935..000000000 --- a/views/default/layouts/administration.php +++ /dev/null @@ -1,36 +0,0 @@ - - -
-

- - sitename; echo " ".elgg_echo('admin'); ?> - << Return to network -

-
- -
- -
- -
-
- -
-
- \ No newline at end of file diff --git a/views/default/layouts/default.php b/views/default/layouts/default.php deleted file mode 100644 index 60dc90b0d..000000000 --- a/views/default/layouts/default.php +++ /dev/null @@ -1,18 +0,0 @@ - $body, - 'sidebar' => $sidebar, -); -echo elgg_view_layout('one_sidebar', $params); diff --git a/views/default/layouts/one_column.php b/views/default/layouts/one_column.php deleted file mode 100644 index 84a304e14..000000000 --- a/views/default/layouts/one_column.php +++ /dev/null @@ -1,16 +0,0 @@ - -
-
- - -
-
\ No newline at end of file diff --git a/views/default/layouts/one_column_with_sidebar.php b/views/default/layouts/one_column_with_sidebar.php deleted file mode 100644 index e408c6c1c..000000000 --- a/views/default/layouts/one_column_with_sidebar.php +++ /dev/null @@ -1,31 +0,0 @@ - - -
-
- -
- -
- -
-
diff --git a/views/default/layouts/one_sidebar.php b/views/default/layouts/one_sidebar.php deleted file mode 100644 index d0bb3879f..000000000 --- a/views/default/layouts/one_sidebar.php +++ /dev/null @@ -1,31 +0,0 @@ - - -
-
- -
- -
- -
-
diff --git a/views/default/layouts/two_sidebar.php b/views/default/layouts/two_sidebar.php deleted file mode 100644 index 26fb64920..000000000 --- a/views/default/layouts/two_sidebar.php +++ /dev/null @@ -1,42 +0,0 @@ - - -
-
- -
-
- elgg_view('layout_elements/module', array('title' => 'Testing', 'body' => 'Hello, world!')) - ); - echo elgg_view('page_elements/sidebar', $params); - ?> -
- -
- -
-
diff --git a/views/default/layouts/widgets.php b/views/default/layouts/widgets.php deleted file mode 100644 index 130b2eaad..000000000 --- a/views/default/layouts/widgets.php +++ /dev/null @@ -1,46 +0,0 @@ -guid, $context); - -if (elgg_can_edit_widget_layout($context)) { - if ($show_add_widgets) { - echo elgg_view('widgets/add-button'); - } - $params = array( - 'widgets' => $widgets, - 'context' => $context, - ); - echo elgg_view('widgets/add_panel', $params); -} - -echo $vars['box']; - -$widget_class = "widget-{$num_columns}-columns"; -for ($column_index = 1; $column_index <= $num_columns; $column_index++) { - $column_widgets = $widgets[$column_index]; - - echo "
"; - if (is_array($column_widgets) && sizeof($column_widgets) > 0) { - foreach ($column_widgets as $widget) { - echo elgg_view_entity($widget); - } - } - echo '
'; -} - -elgg_pop_context(); \ No newline at end of file diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index b0737c6f1..5840eabe4 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -68,7 +68,7 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { 'body' => $cloud, 'body_class' => 'elgg-tagcloud', ); - echo elgg_view('layout_elements/module', $params); + echo elgg_view('layout/objects/module', $params); } else { echo "
$cloud
"; } -- cgit v1.2.3