From dd09373e0cefa8d33d0e9faa741593802d53c2a7 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Fri, 18 Feb 2011 18:37:32 +0000 Subject: Refs #2950: layout/objects => page/components git-svn-id: http://code.elgg.org/elgg/trunk@8288 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/core/river/body.php | 2 +- views/default/layout/objects/gallery.php | 75 --------------------------- views/default/layout/objects/image_block.php | 52 ------------------- views/default/layout/objects/list.php | 75 --------------------------- views/default/layout/objects/module.php | 52 ------------------- views/default/layout/objects/widget.php | 67 ------------------------ views/default/object/widget.php | 2 +- views/default/page/components/gallery.php | 75 +++++++++++++++++++++++++++ views/default/page/components/image_block.php | 52 +++++++++++++++++++ views/default/page/components/list.php | 75 +++++++++++++++++++++++++++ views/default/page/components/module.php | 52 +++++++++++++++++++ views/default/page/components/widget.php | 67 ++++++++++++++++++++++++ views/default/page/elements/owner_block.php | 2 +- views/default/river/item.php | 2 +- 14 files changed, 325 insertions(+), 325 deletions(-) delete mode 100644 views/default/layout/objects/gallery.php delete mode 100644 views/default/layout/objects/image_block.php delete mode 100644 views/default/layout/objects/list.php delete mode 100644 views/default/layout/objects/module.php delete mode 100644 views/default/layout/objects/widget.php create mode 100644 views/default/page/components/gallery.php create mode 100644 views/default/page/components/image_block.php create mode 100644 views/default/page/components/list.php create mode 100644 views/default/page/components/module.php create mode 100644 views/default/page/components/widget.php (limited to 'views') diff --git a/views/default/core/river/body.php b/views/default/core/river/body.php index 66fe45f3d..e3c34acda 100644 --- a/views/default/core/river/body.php +++ b/views/default/core/river/body.php @@ -23,7 +23,7 @@ $body = elgg_view($item->getView(), array('item' => $item)); // footer $footer = elgg_view('core/river/footer', $vars); -echo elgg_view('layout/objects/module', array( +echo elgg_view('page/components/module', array( 'header' => $header, 'body' => $body, 'footer' => $footer, diff --git a/views/default/layout/objects/gallery.php b/views/default/layout/objects/gallery.php deleted file mode 100644 index f57cc99ba..000000000 --- a/views/default/layout/objects/gallery.php +++ /dev/null @@ -1,75 +0,0 @@ - $offset, - 'count' => $count, - 'limit' => $limit, - 'offset_key' => $offset_key, - )); -} - -if ($position == 'before' || $position == 'both') { - echo $nav; -} - -?> - -'; - } - $col++; - - echo '"; - - if ($col == $num_columns) { - echo ''; - $col = 0; - } -} - -if ($col > 0) { - echo ''; -} - -?> - - - -$body"; - -if ($image) { - $image = "
$image
"; -} - -if ($alt_image) { - $alt_image = "
$alt_image
"; -} - -echo << - $image$alt_image$body - -HTML; diff --git a/views/default/layout/objects/list.php b/views/default/layout/objects/list.php deleted file mode 100644 index 374922ecd..000000000 --- a/views/default/layout/objects/list.php +++ /dev/null @@ -1,75 +0,0 @@ - element - * @uses $vars['item_class'] Additional CSS class for the
  • elements - */ - -$items = $vars['items']; -$offset = $vars['offset']; -$limit = $vars['limit']; -$count = $vars['count']; -$base_url = $vars['base_url']; -$pagination = elgg_extract('pagination', $vars, true); -$full_view = elgg_extract('full_view', $vars, false); -$offset_key = elgg_extract('offset_key', $vars, 'offset'); -$position = elgg_extract('position', $vars, 'after'); - -$list_class = 'elgg-list'; -if (isset($vars['list_class'])) { - $list_class = "{$vars['list_class']} $list_class"; -} - -$item_class = 'elgg-list-item'; -if (isset($vars['item_class'])) { - $item_class = "{$vars['item_class']} $item_class"; -} - -$html = ""; -$nav = ""; - -if ($pagination && $count) { - $nav .= elgg_view('navigation/pagination', array( - 'baseurl' => $base_url, - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - 'offset_key' => $offset_key, - )); -} - -if (is_array($items) && count($items) > 0) { - $html .= "'; -} - -if ($position == 'before' || $position == 'both') { - $html = $nav . $html; -} - -if ($position == 'after' || $position == 'both') { - $html .= $nav; -} - -echo $html; diff --git a/views/default/layout/objects/module.php b/views/default/layout/objects/module.php deleted file mode 100644 index f7b9da59c..000000000 --- a/views/default/layout/objects/module.php +++ /dev/null @@ -1,52 +0,0 @@ -$header"; - } -} else { - $header = "

    $title

    "; -} - -$body = "
    $body
    "; - -if (isset($vars['footer'])) { - if ($vars['footer']) { - $footer = "
    $footer
    "; - } -} - -$contents = $header . $body . $footer; -if ($show_inner) { - $contents = "
    $contents
    "; -} - -echo "
    $contents
    "; diff --git a/views/default/layout/objects/widget.php b/views/default/layout/objects/widget.php deleted file mode 100644 index d5e2c4ca2..000000000 --- a/views/default/layout/objects/widget.php +++ /dev/null @@ -1,67 +0,0 @@ -handler; - -$title = $widget->getTitle(); - -$edit_area = ''; -$can_edit = $widget->canEdit(); -if ($can_edit) { - $edit_area = elgg_view('layout/objects/widget/settings', array( - 'widget' => $widget, - 'show_access' => $show_access, - )); -} -$controls = elgg_view('layout/objects/widget/controls', array( - 'widget' => $widget, - 'show_edit' => $edit_area != '', -)); - - -if (elgg_view_exists("widgets/$handler/content")) { - $content = elgg_view("widgets/$handler/content", $vars); -} else { - elgg_deprecated_notice("widgets use content as the display view", 1.8); - $content = elgg_view("widgets/$handler/view", $vars); -} - - -$widget_id = "elgg-widget-$widget->guid"; -$widget_instance = "elgg-widget-instance-$handler"; -$widget_class = "elgg-module elgg-module-widget"; -if ($can_edit) { - $widget_class .= " elgg-state-draggable $widget_instance"; -} else { - $widget_class .= " elgg-state-fixed $widget_instance"; -} - -echo << -
    -

    $title

    - $controls -
    -
    - $edit_area -
    - $content -
    -
    - -HTML; diff --git a/views/default/object/widget.php b/views/default/object/widget.php index 1da5897c3..efc8ef9ae 100644 --- a/views/default/object/widget.php +++ b/views/default/object/widget.php @@ -6,4 +6,4 @@ * @subpackage Core */ -echo elgg_view('layout/objects/widget', $vars); +echo elgg_view('page/components/widget', $vars); diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php new file mode 100644 index 000000000..f57cc99ba --- /dev/null +++ b/views/default/page/components/gallery.php @@ -0,0 +1,75 @@ + $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if ($position == 'before' || $position == 'both') { + echo $nav; +} + +?> + +'; + } + $col++; + + echo '"; + + if ($col == $num_columns) { + echo ''; + $col = 0; + } +} + +if ($col > 0) { + echo ''; +} + +?> + + + +$body"; + +if ($image) { + $image = "
    $image
    "; +} + +if ($alt_image) { + $alt_image = "
    $alt_image
    "; +} + +echo << + $image$alt_image$body + +HTML; diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php new file mode 100644 index 000000000..374922ecd --- /dev/null +++ b/views/default/page/components/list.php @@ -0,0 +1,75 @@ + element + * @uses $vars['item_class'] Additional CSS class for the
  • elements + */ + +$items = $vars['items']; +$offset = $vars['offset']; +$limit = $vars['limit']; +$count = $vars['count']; +$base_url = $vars['base_url']; +$pagination = elgg_extract('pagination', $vars, true); +$full_view = elgg_extract('full_view', $vars, false); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +$list_class = 'elgg-list'; +if (isset($vars['list_class'])) { + $list_class = "{$vars['list_class']} $list_class"; +} + +$item_class = 'elgg-list-item'; +if (isset($vars['item_class'])) { + $item_class = "{$vars['item_class']} $item_class"; +} + +$html = ""; +$nav = ""; + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'baseurl' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if (is_array($items) && count($items) > 0) { + $html .= "'; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; diff --git a/views/default/page/components/module.php b/views/default/page/components/module.php new file mode 100644 index 000000000..f7b9da59c --- /dev/null +++ b/views/default/page/components/module.php @@ -0,0 +1,52 @@ +$header"; + } +} else { + $header = "

    $title

    "; +} + +$body = "
    $body
    "; + +if (isset($vars['footer'])) { + if ($vars['footer']) { + $footer = "
    $footer
    "; + } +} + +$contents = $header . $body . $footer; +if ($show_inner) { + $contents = "
    $contents
    "; +} + +echo "
    $contents
    "; diff --git a/views/default/page/components/widget.php b/views/default/page/components/widget.php new file mode 100644 index 000000000..d5e2c4ca2 --- /dev/null +++ b/views/default/page/components/widget.php @@ -0,0 +1,67 @@ +handler; + +$title = $widget->getTitle(); + +$edit_area = ''; +$can_edit = $widget->canEdit(); +if ($can_edit) { + $edit_area = elgg_view('layout/objects/widget/settings', array( + 'widget' => $widget, + 'show_access' => $show_access, + )); +} +$controls = elgg_view('layout/objects/widget/controls', array( + 'widget' => $widget, + 'show_edit' => $edit_area != '', +)); + + +if (elgg_view_exists("widgets/$handler/content")) { + $content = elgg_view("widgets/$handler/content", $vars); +} else { + elgg_deprecated_notice("widgets use content as the display view", 1.8); + $content = elgg_view("widgets/$handler/view", $vars); +} + + +$widget_id = "elgg-widget-$widget->guid"; +$widget_instance = "elgg-widget-instance-$handler"; +$widget_class = "elgg-module elgg-module-widget"; +if ($can_edit) { + $widget_class .= " elgg-state-draggable $widget_instance"; +} else { + $widget_class .= " elgg-state-fixed $widget_instance"; +} + +echo << +
    +

    $title

    + $controls +
    +
    + $edit_area +
    + $content +
    +
    + +HTML; diff --git a/views/default/page/elements/owner_block.php b/views/default/page/elements/owner_block.php index 8cfa2d683..2f9fc8603 100644 --- a/views/default/page/elements/owner_block.php +++ b/views/default/page/elements/owner_block.php @@ -25,7 +25,7 @@ if ($owner instanceof ElggGroup || $body .= elgg_view('page/elements/owner_block/extend', $vars); //@todo elgg-module-owner-block? - echo elgg_view('layout/objects/module', array( + echo elgg_view('page/components/module', array( 'header' => $header, 'body' => $body, 'class' => 'elgg-owner-block', diff --git a/views/default/river/item.php b/views/default/river/item.php index 388c0a79b..1f28bcb76 100644 --- a/views/default/river/item.php +++ b/views/default/river/item.php @@ -8,4 +8,4 @@ $vars = array( 'class' => 'elgg-river-item', ); -echo elgg_view('layout/objects/image_block', $vars); \ No newline at end of file +echo elgg_view('page/components/image_block', $vars); \ No newline at end of file -- cgit v1.2.3