From d3c49d7ee73a6f0bc680868147cc68cccba611a9 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 14 Feb 2011 00:10:03 +0000 Subject: Refs #2903 moving theme preview into developers plugin - navigation and titles are broken git-svn-id: http://code.elgg.org/elgg/trunk@8214 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/developers/start.php | 18 ++ .../views/default/page/shells/theme_preview.php | 41 ++++ .../views/default/theme_preview/forms.php | 209 +++++++++++++++++++++ .../views/default/theme_preview/general.php | 62 ++++++ .../views/default/theme_preview/grid.php | 84 +++++++++ .../views/default/theme_preview/icons.php | 54 ++++++ .../views/default/theme_preview/index.php | 22 +++ mod/developers/views/default/theme_preview/nav.php | 70 +++++++ .../views/default/theme_preview/objects.php | 79 ++++++++ .../views/default/theme_preview/widgets.php | 70 +++++++ 10 files changed, 709 insertions(+) create mode 100644 mod/developers/views/default/page/shells/theme_preview.php create mode 100644 mod/developers/views/default/theme_preview/forms.php create mode 100644 mod/developers/views/default/theme_preview/general.php create mode 100644 mod/developers/views/default/theme_preview/grid.php create mode 100644 mod/developers/views/default/theme_preview/icons.php create mode 100644 mod/developers/views/default/theme_preview/index.php create mode 100644 mod/developers/views/default/theme_preview/nav.php create mode 100644 mod/developers/views/default/theme_preview/objects.php create mode 100644 mod/developers/views/default/theme_preview/widgets.php (limited to 'mod') diff --git a/mod/developers/start.php b/mod/developers/start.php index 46cdd8bc2..5763d5d34 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -10,6 +10,8 @@ function developers_init() { elgg_extend_view('css/admin', 'developers/css'); + register_page_handler('theme_preview', 'developers_theme_preview_controller'); + $action_base = elgg_get_plugins_path() . 'developers/actions/developers'; elgg_register_action('developers/settings', "$action_base/settings.php", 'admin'); } @@ -20,4 +22,20 @@ function developers_setup_menu() { elgg_add_admin_menu_item('settings', elgg_echo('admin:developers:settings'), 'developers'); elgg_add_admin_menu_item('preview', elgg_echo('admin:developers:preview'), 'developers'); } +} + +/** + * Serve the theme preview pages + * + * @param array $page + */ +function developers_theme_preview_controller($page) { + if (!isset($page[0])) { + $page[0] = 'index'; + } + + $title = elgg_echo("theme_preview:{$page[0]}"); + $page = elgg_view("theme_preview/{$page[0]}"); + + echo elgg_view_page($title, $page, 'theme_preview'); } \ No newline at end of file diff --git a/mod/developers/views/default/page/shells/theme_preview.php b/mod/developers/views/default/page/shells/theme_preview.php new file mode 100644 index 000000000..79dfed60d --- /dev/null +++ b/mod/developers/views/default/page/shells/theme_preview.php @@ -0,0 +1,41 @@ + + + + + + <?php echo $vars['title']; ?> + + + + + + + + + + + + + \ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/forms.php b/mod/developers/views/default/theme_preview/forms.php new file mode 100644 index 000000000..90cc5dcc8 --- /dev/null +++ b/mod/developers/views/default/theme_preview/forms.php @@ -0,0 +1,209 @@ + +
+

+ Index > +

+ +

Form

+
+
+ Form legend +

+ + 'f1', + 'internalid' => 'f1', + 'value' => 'input text', + )); + ?> +

+

+ + 'f2', + 'internalid' => 'f2', + 'value' => 'password', + )); + ?> +

+

+
+ 'f3', + 'internalid' => 'f3', + 'options' => array(1, 2), + )); + ?> +

+

+
+ 'f4', + 'internalid' => 'f4', + 'options' => array(1, 2), + )); + ?> +

+

+
+ 'f5', + 'internalid' => 'f5', + 'options' => array('option 1', 'option 2'), + )); + ?> +

+

+ + 'f6', + 'internalid' => 'f6', + 'value' => ACCESS_PUBLIC, + )); + ?> +

+

+ + 'f7', + 'internalid' => 'f7', + )); + ?> +

+

+ + 'f8', + 'internalid' => 'f8', + 'value' => 'http://elgg.org/', + )); + ?> +

+

+ + 'f9', + 'internalid' => 'f9', + 'value' => 'one, two, three', + )); + ?> +

+

+ + 'f10', + 'internalid' => 'f10', + 'value' => 'noone@elgg.org', + )); + ?> +

+

+ + 'f11', + 'internalid' => 'f11', + 'match_on' => 'users', + )); + ?> +

+

+ + 'f12', + 'internalid' => 'f12', + )); + ?> +

+

+ + 'f13', + 'internalid' => 'f13', + )); + ?> +

+

+ + 'f14', + 'internalid' => 'f14', + 'value' => $ipsum, + )); + ?> +

+

+ + 'f15', + 'internalid' => 'f15', + 'value' => $ipsum, + )); + ?> +

+
+
+ +
+

Buttons

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AnchorsDefaultHoverFocusActiveDisabledSelected
Defaultanchoranchoranchoranchoranchoranchor
Actionanchoranchoranchoranchoranchoranchor
Defaultanchoranchoranchoranchoranchoranchor
Defaultanchoranchoranchoranchoranchoranchor
+
+
diff --git a/mod/developers/views/default/theme_preview/general.php b/mod/developers/views/default/theme_preview/general.php new file mode 100644 index 000000000..e64a60748 --- /dev/null +++ b/mod/developers/views/default/theme_preview/general.php @@ -0,0 +1,62 @@ + + +
+

+ Index > +

+
+ < previous  next > +
+

Headings

+
+

Level 1 heading

+

Level 2 heading

+

Level 3 heading

+

Level 4 heading

+
Level 5 heading
+
Level 6 heading
+
+

Paragraph

+
+

Lorem ipsum dolor sit amet, test link + adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec + faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero + nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent + mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu + volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus + eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, + consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue + quis tellus.

+ +

Lorem ipsum dolor sit amet, emphasis + consectetuer + adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec + faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero + nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent + mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu + volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus + eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, + consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue + quis tellus.

+
+

Misc

+

+ I am the a tag example
+ I am the abbr tag example
+ I am the acronym tag example
+ I am the b tag example
+ I am the code tag example
+ I am the del tag example
+ I am the em tag example
+ I am the i tag example
+ I am the strong tag example
+

+

Paragraph inside Blockquote:

+
Preformated:Testing one row
+			 and another
+
diff --git a/mod/developers/views/default/theme_preview/grid.php b/mod/developers/views/default/theme_preview/grid.php new file mode 100644 index 000000000..8e85d5c72 --- /dev/null +++ b/mod/developers/views/default/theme_preview/grid.php @@ -0,0 +1,84 @@ + +
+

+ Index > +

+ + + + +
+
+

1/5

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

3/5

+
+
+

1/2

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

1/2

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

1/3

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

2/3

+
+
+

1/2

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

1/2

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+

1

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+
+
+
+
+
+
+

1/5

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+ +
diff --git a/mod/developers/views/default/theme_preview/icons.php b/mod/developers/views/default/theme_preview/icons.php new file mode 100644 index 000000000..792818e31 --- /dev/null +++ b/mod/developers/views/default/theme_preview/icons.php @@ -0,0 +1,54 @@ + + +
+

+ Index > +

+
+ < previous  next > +
+

Icon Sprites

+ +

Ajax loader

+
+ false)); ?> +
+

Avatars

+
+ '; + echo ''; + foreach ($sizes as $size) { + echo "

$size

"; + } + echo ''; + echo ''; + foreach ($sizes as $size) { + echo ''; + echo elgg_view_entity_icon($user, $size, array('hover' => false)); + echo ''; + } + echo ''; + echo ''; + ?> +
+
diff --git a/mod/developers/views/default/theme_preview/index.php b/mod/developers/views/default/theme_preview/index.php new file mode 100644 index 000000000..5bb554d06 --- /dev/null +++ b/mod/developers/views/default/theme_preview/index.php @@ -0,0 +1,22 @@ + +

Index

+ + +HTML; diff --git a/mod/developers/views/default/theme_preview/nav.php b/mod/developers/views/default/theme_preview/nav.php new file mode 100644 index 000000000..7fdf49a8e --- /dev/null +++ b/mod/developers/views/default/theme_preview/nav.php @@ -0,0 +1,70 @@ + +
+

+ Index > +

+ +

Breadcrumbs

+
+ +
+

Tabs

+
+ 'First', 'url' => "$url#"), + array('title' => 'Second', 'url' => "$url#", 'selected' => true), + array('title' => 'Third', 'url' => "$url#"), + ); + echo elgg_view('navigation/tabs', array('tabs' => $tabs)); + ?> +
+

Pagination

+
+ 1000, + 'limit' => 10, + 'offset' => 230, + ); + echo elgg_view('navigation/pagination', $params); + ?> +
+

Site Menu

+
+
+ setSelected(true); + echo elgg_view('navigation/menu/site', $params); + ?> +
+
+

Page Menu

+
+ setParent($params['menu']['default'][1]); + $params['menu']['default'][1]->addChild($m); + echo elgg_view('navigation/menu/page', $params); + ?> +
+
diff --git a/mod/developers/views/default/theme_preview/objects.php b/mod/developers/views/default/theme_preview/objects.php new file mode 100644 index 000000000..fc773afb9 --- /dev/null +++ b/mod/developers/views/default/theme_preview/objects.php @@ -0,0 +1,79 @@ + + +
+

+ Index > +

+ +

Modules

+
+
+
+ +
+
+
+
+ +
+
+
+

Image Block

+
+ +
+

List

+
+ title = "Object 1"; + $obj1->description = $ipsum; + $obj2 = new ElggObject(); + $obj2->title = "Object 2"; + $obj2->description = $ipsum; + echo elgg_view('layout/objects/list', array('items' => array($obj1, $obj2))); + ?> +
+

Table

+
+ + "; + for ($i = 1; $i < 5; $i++) { + echo ''; + for ($j = 1; $j < 3; $j++) { + echo ""; + } + echo ''; + } + ?> +
column 1column 2
value $j
+
+

Messages

+
+
    +
  • Success message
  • +
  • Error message
  • +
  • Notice message
  • +
+
+
diff --git a/mod/developers/views/default/theme_preview/widgets.php b/mod/developers/views/default/theme_preview/widgets.php new file mode 100644 index 000000000..7f3fc938c --- /dev/null +++ b/mod/developers/views/default/theme_preview/widgets.php @@ -0,0 +1,70 @@ + +
+

+ Index > +

+ +handler = 'friends'; + $obj->title = "Widget $i"; + $w[] = $obj; +} +$column1 = array($w[0], $w[1]); +$column2 = array($w[2], $w[3]); +$column3 = array($w[4], $w[5]); +$widgets = array(1 => $column1, 2 => $column2, 3 => $column3); +$num_columns = 3; +$widget_class = "elgg-col-1of{$num_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 '
'; +} +?> +
+ -- cgit v1.2.3