aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views/default/theme_preview
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2013-01-04 14:44:55 -0500
committerBrett Profitt <brett.profitt@gmail.com>2013-01-04 14:45:15 -0500
commitf17c0c674f084c48a0b2919ac8fe7136a819859f (patch)
treebb58d40698234ee934a18d64d1f5d7688aa7ab45 /mod/developers/views/default/theme_preview
parent5d762eaf47cef4785d9f051c387d6971b59bdd68 (diff)
downloadelgg-f17c0c674f084c48a0b2919ac8fe7136a819859f.tar.gz
elgg-f17c0c674f084c48a0b2919ac8fe7136a819859f.tar.bz2
Refs #3617. Added misc section for developer's theme preview.
Diffstat (limited to 'mod/developers/views/default/theme_preview')
-rw-r--r--mod/developers/views/default/theme_preview/components.php2
-rw-r--r--mod/developers/views/default/theme_preview/general.php23
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous.php22
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/lightbox.php19
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/popup.php15
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/site_menu.php15
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/system_messages.php35
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/toggle.php15
-rw-r--r--mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php16
-rw-r--r--mod/developers/views/default/theme_preview/modules.php2
10 files changed, 162 insertions, 2 deletions
diff --git a/mod/developers/views/default/theme_preview/components.php b/mod/developers/views/default/theme_preview/components.php
index 2f414cd88..50c155b14 100644
--- a/mod/developers/views/default/theme_preview/components.php
+++ b/mod/developers/views/default/theme_preview/components.php
@@ -22,4 +22,4 @@ $body = elgg_view('theme_preview/components/tags');
echo elgg_view_module('info', 'Tags (.elgg-tag)', $body);
$body = elgg_view('theme_preview/components/messages');
-echo elgg_view_module('info', 'Messages (.elgg-message)', $body);
+echo elgg_view_module('info', 'Messages (.elgg-message)', $body); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/general.php b/mod/developers/views/default/theme_preview/general.php
index 629462873..7d98d4443 100644
--- a/mod/developers/views/default/theme_preview/general.php
+++ b/mod/developers/views/default/theme_preview/general.php
@@ -11,6 +11,29 @@
The preview is divided into sections that are listed in the page menu
(usually in the sidebar but depends on your current theme).
</p>
+<?php
+$simple_cache = elgg_get_config('simplecache_enabled');
+$system_cache = elgg_get_config('system_cache_enabled');
+
+if ($simple_cache || $system_cache) {
+ $advanced = elgg_view('output/url', array(
+ 'text' => 'Advanced Settings',
+ 'href' => 'admin/settings/advanced',
+ 'is_trusted' => true
+ ));
+ $developers = elgg_view('output/url', array(
+ 'text' => 'Developers\' Plugin Settings',
+ 'href' => 'admin/developers/settings',
+ 'is_trusted' => true
+ ));
+
+ $body = "Caches are enabled. Changes you make to CSS and views might not appear. It is
+ always recommended to disable caches while developing themes and plugins. To
+ disable caches, visit the $advanced or $developers pages.";
+
+ echo elgg_view_module('info', 'Warning', $body);
+}
+?>
<p>
<?php
echo elgg_view('output/url', array(
diff --git a/mod/developers/views/default/theme_preview/miscellaneous.php b/mod/developers/views/default/theme_preview/miscellaneous.php
new file mode 100644
index 000000000..2f4ee4acd
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Miscellaneous and complex components
+ */
+
+$body = elgg_view('theme_preview/miscellaneous/lightbox');
+echo elgg_view_module('info', 'Lightbox (.elgg-lightbox)', $body);
+
+$body = elgg_view('theme_preview/miscellaneous/popup');
+echo elgg_view_module('info', 'Popup (rel=popup)', $body);
+
+$body = elgg_view('theme_preview/miscellaneous/toggle');
+echo elgg_view_module('info', 'Toggle (rel=toggle)', $body);
+
+$body = elgg_view('theme_preview/miscellaneous/system_messages');
+echo elgg_view_module('info', 'System Messages and Errors', $body);
+
+$body = elgg_view('theme_preview/miscellaneous/site_menu');
+echo elgg_view_module('info', 'Site Menu', $body);
+
+$body = elgg_view('theme_preview/miscellaneous/user_hover_menu');
+echo elgg_view_module('info', 'User Icon with Hover Menu', $body); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php b/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php
new file mode 100644
index 000000000..b673c4ee0
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php
@@ -0,0 +1,19 @@
+<?php
+
+elgg_load_js('lightbox');
+elgg_load_css('lightbox');
+
+$ipsum = elgg_view('developers/ipsum');
+
+$link = elgg_view('output/url', array(
+ 'text' => 'Open lighbox',
+ 'href' => "#elgg-lightbox-test",
+ 'class' => 'elgg-lightbox'
+));
+
+echo $link;
+echo '<div class="hidden">';
+echo elgg_view_module('aside', 'Lightbox Test', $ipsum, array(
+ 'id' => 'elgg-lightbox-test'
+));
+echo '</div>'; \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/popup.php b/mod/developers/views/default/theme_preview/miscellaneous/popup.php
new file mode 100644
index 000000000..b711bb7cc
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/popup.php
@@ -0,0 +1,15 @@
+<?php
+
+$ipsum = elgg_view('developers/ipsum');
+
+$link = elgg_view('output/url', array(
+ 'text' => 'Popup content',
+ 'href' => "#elgg-popup-test",
+ 'rel' => 'popup'
+));
+
+echo $link;
+echo elgg_view_module('popup', 'Popup Test', $ipsum, array(
+ 'id' => 'elgg-popup-test',
+ 'class' => 'hidden clearfix developers-content-thin',
+)); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php b/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php
new file mode 100644
index 000000000..e2384b9f7
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php
@@ -0,0 +1,15 @@
+<?php
+
+if (!get_input('site_menu')) {
+ echo elgg_view('output/url', array(
+ 'text' => 'Show Site Menu',
+ 'href' => elgg_http_add_url_query_elements(current_page_url(), array('site_menu' => 1)),
+ 'is_trusted' => true
+ ));
+} else {
+ echo elgg_view('output/url', array(
+ 'text' => 'Hide Site Menu',
+ 'href' => elgg_http_remove_url_query_element(current_page_url(), 'site_menu'),
+ 'is_trusted' => true
+ ));
+} \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php b/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php
new file mode 100644
index 000000000..a6663a3dc
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php
@@ -0,0 +1,35 @@
+<?php
+
+// can't use the ipsum because it includes html when wrapping views.
+$message = elgg_view('output/url', array(
+ 'text' => 'Show system message (system_message())',
+ 'is_trusted' => true,
+ 'href' => '#',
+ 'id' => 'developers-system-message',
+// 'onclick' => "elgg.system_message('Elgg System Message');"
+));
+
+$error = elgg_view('output/url', array(
+ 'text' => 'Show error message (register_error())',
+ 'is_trusted' => true,
+ 'href' => '#',
+ 'id' => 'developers-error-message',
+));
+
+?>
+<script type="text/javascript">
+ $(function() {
+ $('#developers-system-message').click(function() {
+ elgg.system_message('Elgg System Message');
+ })
+
+ $('#developers-error-message').click(function() {
+ elgg.register_error('Elgg Error Message');
+ })
+ });
+</script>
+
+<ul>
+ <li><?php echo $message; ?></li>
+ <li><?php echo $error; ?></li>
+</ul> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/toggle.php b/mod/developers/views/default/theme_preview/miscellaneous/toggle.php
new file mode 100644
index 000000000..abe39ddd8
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/toggle.php
@@ -0,0 +1,15 @@
+<?php
+
+$ipsum = elgg_view('developers/ipsum');
+
+$link = elgg_view('output/url', array(
+ 'text' => 'Toggle content',
+ 'href' => "#elgg-toggle-test",
+ 'rel' => 'toggle'
+));
+
+echo $link;
+echo elgg_view_module('featured', 'Toggle Test', $ipsum, array(
+ 'id' => 'elgg-toggle-test',
+ 'class' => 'hidden clearfix developers-content-thin',
+)); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php b/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php
new file mode 100644
index 000000000..45331b6e0
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php
@@ -0,0 +1,16 @@
+<?php
+
+$me = elgg_get_logged_in_user_entity();
+echo elgg_view_entity_icon($me);
+
+// show another user if available
+$users = elgg_get_entities(array(
+ 'type' => 'user',
+ 'wheres' => array("guid != {$me->getGUID()}"),
+ 'limit' => 1
+));
+
+if (is_array($users) && count($users) > 0) {
+ echo elgg_view_entity_icon($users[0]);
+}
+
diff --git a/mod/developers/views/default/theme_preview/modules.php b/mod/developers/views/default/theme_preview/modules.php
index 3e0acb3a5..c46c94296 100644
--- a/mod/developers/views/default/theme_preview/modules.php
+++ b/mod/developers/views/default/theme_preview/modules.php
@@ -2,5 +2,5 @@
echo elgg_view_module('info', 'Modules (.elgg-module)', elgg_view('theme_preview/modules/modules'));
-echo elgg_view_module('info', 'Widgets (.elgg-widget)', elgg_view('theme_preview/modules/widgets'));
+echo elgg_view_module('info', 'Widgets (.elgg-module-widget)', elgg_view('theme_preview/modules/widgets'));