aboutsummaryrefslogtreecommitdiff
path: root/mod/developers
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-16 14:46:11 +0200
committerSem <sembrestels@riseup.net>2012-08-16 14:46:11 +0200
commit4cac1871f1c83d1cb40134b511125987f92f2c46 (patch)
tree804f80164271fc4f0385ebf05f5f90ceb35320a9 /mod/developers
parent13ac8fcc40c9446c51e717ddcfe32cfcc45e3fd2 (diff)
downloadelgg-4cac1871f1c83d1cb40134b511125987f92f2c46.tar.gz
elgg-4cac1871f1c83d1cb40134b511125987f92f2c46.tar.bz2
Fixed theme preview.
Diffstat (limited to 'mod/developers')
-rw-r--r--mod/developers/views/default/theme_preview/buttons.php41
-rw-r--r--mod/developers/views/default/theme_preview/components/image_block.php6
-rw-r--r--mod/developers/views/default/theme_preview/components/list.php19
-rw-r--r--mod/developers/views/default/theme_preview/components/messages.php5
-rw-r--r--mod/developers/views/default/theme_preview/components/table.php12
-rw-r--r--mod/developers/views/default/theme_preview/forms.php138
-rw-r--r--mod/developers/views/default/theme_preview/icons.php10
-rw-r--r--mod/developers/views/default/theme_preview/icons/avatars.php36
-rw-r--r--mod/developers/views/default/theme_preview/icons/loader.php1
-rw-r--r--mod/developers/views/default/theme_preview/icons/sprites.php61
-rw-r--r--mod/developers/views/default/theme_preview/modules.php6
-rw-r--r--mod/developers/views/default/theme_preview/modules/modules.php23
-rw-r--r--mod/developers/views/default/theme_preview/modules/widgets.php64
-rw-r--r--mod/developers/views/default/theme_preview/navigation/pagination.php8
-rw-r--r--mod/developers/views/default/theme_preview/typography/headings.php6
-rw-r--r--mod/developers/views/default/theme_preview/typography/misc.php16
-rw-r--r--mod/developers/views/default/theme_preview/typography/paragraph.php19
17 files changed, 471 insertions, 0 deletions
diff --git a/mod/developers/views/default/theme_preview/buttons.php b/mod/developers/views/default/theme_preview/buttons.php
new file mode 100644
index 000000000..718d88617
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/buttons.php
@@ -0,0 +1,41 @@
+<table class="elgg-table">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Default</th>
+ <th>Disabled (.elgg-state-disabled)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>Base (.elgg-button)</th>
+ <td><a href="#" class="elgg-button">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-state-disabled">anchor</a></td>
+ </tr>
+ <tr>
+ <th>Action (.elgg-button-action)</th>
+ <td><a href="#" class="elgg-button elgg-button-action">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-button-action elgg-state-disabled">anchor</a></td>
+ </tr>
+ <tr>
+ <th>Cancel (.elgg-button-cancel)</th>
+ <td><a href="#" class="elgg-button elgg-button-cancel">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-button-cancel elgg-state-disabled">anchor</a></td>
+ </tr>
+ <tr>
+ <th>Submit (.elgg-button-submit)</th>
+ <td><a href="#" class="elgg-button elgg-button-submit">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-button-submit elgg-state-disabled">anchor</a></td>
+ </tr>
+ <tr>
+ <th>Special (.elgg-button-special)</th>
+ <td><a href="#" class="elgg-button elgg-button-special">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-button-special elgg-state-disabled">anchor</a></td>
+ </tr>
+ <tr>
+ <th>Delete (.elgg-button-delete)</th>
+ <td><a href="#" class="elgg-button elgg-button-delete">anchor</a></td>
+ <td><a href="#" class="elgg-button elgg-button-delete elgg-state-disabled">anchor</a></td>
+ </tr>
+ </tbody>
+</table> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/components/image_block.php b/mod/developers/views/default/theme_preview/components/image_block.php
new file mode 100644
index 000000000..0bb16428b
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/components/image_block.php
@@ -0,0 +1,6 @@
+<?php
+$ipsum = elgg_view('developers/ipsum');
+
+$user = new ElggUser();
+$image = elgg_view_entity_icon($user, 'small');
+echo elgg_view_image_block($image, "$ipsum $ipsum $ipsum $ipsum $ipsum $ipsum $ipsum");
diff --git a/mod/developers/views/default/theme_preview/components/list.php b/mod/developers/views/default/theme_preview/components/list.php
new file mode 100644
index 000000000..8096bda04
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/components/list.php
@@ -0,0 +1,19 @@
+<?php
+
+$obj1 = new ElggObject();
+$obj1->title = "Object 1";
+$obj1->description = $ipsum;
+
+$obj2 = new ElggObject();
+$obj2->title = "Object 2";
+$obj2->description = $ipsum;
+
+$obj3 = new ElggObject();
+$obj3->title = "Object 3";
+$obj3->description = $ipsum;
+
+$obj4 = new ElggObject();
+$obj4->title = "Object 4";
+$obj4->description = $ipsum;
+
+echo elgg_view('page/components/list', array('items' => array($obj1, $obj2, $obj3, $obj4)));
diff --git a/mod/developers/views/default/theme_preview/components/messages.php b/mod/developers/views/default/theme_preview/components/messages.php
new file mode 100644
index 000000000..ac4d2bfd7
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/components/messages.php
@@ -0,0 +1,5 @@
+<ul>
+ <li class="elgg-message elgg-state-success mas">Success message (.elgg-state-success)</li>
+ <li class="elgg-message elgg-state-error mas">Error message (.elgg-state-error)</li>
+ <li class="elgg-message elgg-state-notice mas">Notice message (.elgg-state-notice)</li>
+</ul>
diff --git a/mod/developers/views/default/theme_preview/components/table.php b/mod/developers/views/default/theme_preview/components/table.php
new file mode 100644
index 000000000..8b8b13e76
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/components/table.php
@@ -0,0 +1,12 @@
+<table class="<?php echo $vars['class']; ?>">
+<?php
+ echo "<thead><tr><th>column 1</th><th>column 2</th></tr></thead>";
+ for ($i = 1; $i < 5; $i++) {
+ echo '<tr>';
+ for ($j = 1; $j < 3; $j++) {
+ echo "<td>value $j</td>";
+ }
+ echo '</tr>';
+ }
+?>
+</table> \ 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..ffb77f3a9
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/forms.php
@@ -0,0 +1,138 @@
+<form action="#">
+ <fieldset>
+ <legend>Fieldset Legend</legend>
+ <div>
+ <label for="f1">Text input (.elgg-input-text):</label>
+ <?php echo elgg_view('input/text', array(
+ 'name' => 'f1',
+ 'id' => 'f1',
+ 'value' => 'input text',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f2">Password input (.elgg-input-password):</label>
+ <?php echo elgg_view('input/password', array(
+ 'name' => 'f2',
+ 'id' => 'f2',
+ 'value' => 'password',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f3">Radio input (.elgg-input-radios):</label><br />
+ <?php echo elgg_view('input/radio', array(
+ 'name' => 'f3',
+ 'id' => 'f3',
+ 'options' => array('a (.elgg-input-radio)' => 1, 'b (.elgg-input-radio)' => 2),
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f4">Checkboxes input (.elgg-input-checkboxes):</label><br />
+ <?php echo elgg_view('input/checkboxes', array(
+ 'name' => 'f4',
+ 'id' => 'f4',
+ 'options' => array('a (.elgg-input-checkbox)' => 1, 'b (.elgg-input-checkbox)' => 2),
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f5">Dropdown input (.elgg-input-dropdown):</label><br />
+ <?php echo elgg_view('input/dropdown', array(
+ 'name' => 'f5',
+ 'id' => 'f5',
+ 'options' => array('option 1', 'option 2'),
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f6">Access input (.elgg-input-access):</label><br />
+ <?php echo elgg_view('input/access', array(
+ 'name' => 'f6',
+ 'id' => 'f6',
+ 'value' => ACCESS_PUBLIC,
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f7">File input (.elgg-input-file):</label>
+ <?php echo elgg_view('input/file', array(
+ 'name' => 'f7',
+ 'id' => 'f7',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f8">URL input (.elgg-input-url):</label>
+ <?php echo elgg_view('input/url', array(
+ 'name' => 'f8',
+ 'id' => 'f8',
+ 'value' => 'http://elgg.org/',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f9">Tags input (.elgg-input-tags):</label>
+ <?php echo elgg_view('input/tags', array(
+ 'name' => 'f9',
+ 'id' => 'f9',
+ 'value' => 'one, two, three',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f10">Email input (.elgg-input-email):</label>
+ <?php echo elgg_view('input/email', array(
+ 'name' => 'f10',
+ 'id' => 'f10',
+ 'value' => 'noone@elgg.org',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f11">Autocomplete input (.elgg-input-autocomplete):</label>
+ <?php echo elgg_view('input/autocomplete', array(
+ 'name' => 'f11',
+ 'id' => 'f11',
+ 'match_on' => 'users',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f12">Date input (.elgg-input-date):</label>
+ <?php echo elgg_view('input/date', array(
+ 'name' => 'f12',
+ 'id' => 'f12',
+ 'value' => '2012-12-31',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f13">User picker input (.elgg-user-picker):</label>
+ <?php echo elgg_view('input/userpicker', array(
+ 'name' => 'f13',
+ 'id' => 'f13',
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f15">Plain textarea input (.elgg-input-plaintext):</label>
+ <?php echo elgg_view('input/plaintext', array(
+ 'name' => 'f15',
+ 'id' => 'f15',
+ 'value' => $ipsum,
+ ));
+ ?>
+ </div>
+ <div>
+ <label for="f14">Long textarea input (.elgg-input-longtext):</label>
+ <?php echo elgg_view('input/longtext', array(
+ 'name' => 'f14',
+ 'id' => 'f14',
+ 'value' => $ipsum,
+ ));
+ ?>
+ </div>
+ </fieldset>
+</form> \ No newline at end of file
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..e1684c110
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/icons.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Icons CSS
+ */
+
+echo elgg_view_module('info', 'Icon Sprites (.elgg-icon)', elgg_view('theme_preview/icons/sprites'));
+
+echo elgg_view_module('info', 'Ajax Loader (.elgg-ajax-loader)', elgg_view('theme_preview/icons/loader'));
+
+echo elgg_view_module('info', 'Avatars (.elgg-avatar)', elgg_view('theme_preview/icons/avatars'));
diff --git a/mod/developers/views/default/theme_preview/icons/avatars.php b/mod/developers/views/default/theme_preview/icons/avatars.php
new file mode 100644
index 000000000..f50a6b70d
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/icons/avatars.php
@@ -0,0 +1,36 @@
+<?php
+ $user = new ElggUser();
+ $group = new ElggGroup();
+
+ $sizes = array('large', 'medium', 'small', 'tiny');
+?>
+<table class="elgg-table">
+ <tr>
+ <th></th>
+ <?php
+ foreach ($sizes as $size) {
+ echo "<th>$size</th>";
+ }
+ ?>
+ </tr>
+ <tr>
+ <th>User</th>
+ <?php
+ foreach ($sizes as $size) {
+ echo '<td>';
+ echo elgg_view_entity_icon($user, $size, array('use_hover' => false));
+ echo '</td>';
+ }
+ ?>
+ </tr>
+ <tr>
+ <th>Group</th>
+ <?php
+ foreach ($sizes as $size) {
+ echo '<td>';
+ echo elgg_view_entity_icon($group, $size, array('use_hover' => false));
+ echo '</td>';
+ }
+ ?>
+ </tr>
+</table>
diff --git a/mod/developers/views/default/theme_preview/icons/loader.php b/mod/developers/views/default/theme_preview/icons/loader.php
new file mode 100644
index 000000000..e542da27c
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/icons/loader.php
@@ -0,0 +1 @@
+<?php echo elgg_view('graphics/ajax_loader', array('hidden' => false)); ?> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/icons/sprites.php b/mod/developers/views/default/theme_preview/icons/sprites.php
new file mode 100644
index 000000000..134dd9aca
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/icons/sprites.php
@@ -0,0 +1,61 @@
+<?php
+$icons = array(
+ 'arrow-left',
+ 'arrow-right',
+ 'arrow-two-head',
+ 'calendar',
+ 'checkmark',
+ 'clip',
+ 'cursor-drag-arrow',
+ 'delete-alt',
+ 'delete',
+ 'download',
+ 'facebook',
+ 'home',
+ 'hover-menu',
+ 'link',
+ 'mail-alt',
+ 'mail',
+ 'print-alt',
+ 'print',
+ 'push-pin-alt',
+ 'push-pin',
+ 'redo',
+ 'refresh',
+ 'round-arrow-left',
+ 'round-arrow-right',
+ 'round-checkmark',
+ 'round-minus',
+ 'round-plus',
+ 'rss',
+ 'search-focus',
+ 'search',
+ 'settings-alt',
+ 'settings',
+ 'share',
+ 'shop-cart',
+ 'speech-bubble-alt',
+ 'speech-bubble',
+ 'star-alt',
+ 'star-empty',
+ 'star',
+ 'tag',
+ 'thumbs-down-alt',
+ 'thumbs-down',
+ 'thumbs-up-alt',
+ 'thumbs-up',
+ 'trash',
+ 'twitter',
+ 'undo',
+ 'user',
+ 'users',
+);
+?>
+
+<ul class="elgg-gallery">
+<?php
+ foreach ($icons as $icon) {
+ echo "<li title=\".elgg-icon-$icon\" style=\"margin:10px\">" . elgg_view_icon($icon) . "</li>";
+ }
+?>
+</ul> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/modules.php b/mod/developers/views/default/theme_preview/modules.php
new file mode 100644
index 000000000..3e0acb3a5
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/modules.php
@@ -0,0 +1,6 @@
+<?php
+
+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'));
+
diff --git a/mod/developers/views/default/theme_preview/modules/modules.php b/mod/developers/views/default/theme_preview/modules/modules.php
new file mode 100644
index 000000000..e0d39c0da
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/modules/modules.php
@@ -0,0 +1,23 @@
+<?php
+
+$ipsum = elgg_view('developers/ipsum');
+
+?>
+<div class="elgg-grid">
+ <div class="elgg-col elgg-col-1of2">
+ <div class="pam">
+ <?php
+ echo elgg_view_module('aside', 'Aside (.elgg-module-aside)', $ipsum);
+ echo elgg_view_module('popup', 'Popup (.elgg-module-popup)', $ipsum);
+ ?>
+ </div>
+ </div>
+ <div class="elgg-col elgg-col-1of2">
+ <div class="pam">
+ <?php
+ echo elgg_view_module('info', 'Info (.elgg-module-info)', $ipsum);
+ echo elgg_view_module('featured', 'Featured (.elgg-module-featured)', $ipsum);
+ ?>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/modules/widgets.php b/mod/developers/views/default/theme_preview/modules/widgets.php
new file mode 100644
index 000000000..8c9fd6483
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/modules/widgets.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Widgets CSS
+ */
+
+$url = current_page_url();
+
+elgg_register_plugin_hook_handler('view', 'widgets/friends/content', 'css_widget_content');
+elgg_register_plugin_hook_handler('view', 'widgets/friends/edit', 'css_widget_content');
+elgg_register_plugin_hook_handler('permissions_check', 'all', 'css_permissions_override');
+
+function css_widget_content() {
+ return $ipsum = elgg_view('developers/ipsum');
+}
+
+function css_permissions_override() {
+ return true;
+}
+
+
+?>
+<div class="elgg-body mal">
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
+<?php
+$w = array();
+for ($i=1; $i<=6; $i++) {
+ $obj = new ElggWidget();
+ $obj->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 "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">";
+ if (is_array($column_widgets) && sizeof($column_widgets) > 0) {
+ foreach ($column_widgets as $widget) {
+ echo elgg_view_entity($widget);
+ }
+ }
+ echo '</div>';
+}
+?>
+</div>
+<script type="text/javascript">
+ // widgets do not have guids so we override the edit toggle and delete button
+ $(function() {
+ $('.elgg-widget-edit-button').unbind('click');
+ $('.elgg-widget-edit-button').click(function() {
+ $(this).closest('.elgg-module-widget').find('.elgg-widget-edit').slideToggle('medium');
+ return false;
+ });
+ $('.elgg-widget-delete-button').click(function() {
+ $(this).closest('.elgg-module-widget').remove();
+ return false;
+ });
+ });
+</script>
diff --git a/mod/developers/views/default/theme_preview/navigation/pagination.php b/mod/developers/views/default/theme_preview/navigation/pagination.php
new file mode 100644
index 000000000..90ae48edf
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/navigation/pagination.php
@@ -0,0 +1,8 @@
+<?php
+$params = array(
+ 'count' => 1000,
+ 'limit' => 10,
+ 'offset' => 230,
+);
+
+echo elgg_view('navigation/pagination', $params); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/typography/headings.php b/mod/developers/views/default/theme_preview/typography/headings.php
new file mode 100644
index 000000000..1eb96c75c
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/typography/headings.php
@@ -0,0 +1,6 @@
+<h1>Level 1 heading</h1>
+<h2>Level 2 heading</h2>
+<h3>Level 3 heading</h3>
+<h4>Level 4 heading</h4>
+<h5>Level 5 heading</h5>
+<h6>Level 6 heading</h6> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/typography/misc.php b/mod/developers/views/default/theme_preview/typography/misc.php
new file mode 100644
index 000000000..93a279c36
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/typography/misc.php
@@ -0,0 +1,16 @@
+<ul>
+ <li>I am <a href="?abc123">the a tag</a> example</li>
+ <li>I am <abbr title="test">the abbr tag</abbr> example</li>
+ <li>I am <acronym>the acronym tag</acronym> example</li>
+ <li>I am <b>the b tag</b> example</li>
+ <li>I am <code>the code tag</code> example</li>
+ <li>I am <del>the del tag</del> example</li>
+ <li>I am <em>the em tag</em> example</li>
+ <li>I am <i>the i tag</i> example</li>
+ <li>I am <strong>the strong tag</strong> example</li>
+</ul>
+<blockquote><p>Paragraph inside Blockquote: <?php echo $ipsum; ?></p></blockquote>
+<pre>
+ <strong>Preformated:</strong>Testing one row
+ and another
+</pre>
diff --git a/mod/developers/views/default/theme_preview/typography/paragraph.php b/mod/developers/views/default/theme_preview/typography/paragraph.php
new file mode 100644
index 000000000..54d548f46
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/typography/paragraph.php
@@ -0,0 +1,19 @@
+<p>Lorem ipsum dolor sit amet, <a href="#" title="test link">test link</a>
+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 <strong>strong</strong>, 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.</p>
+
+<p>Lorem ipsum dolor sit amet, <em>emphasis</em> 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.</p> \ No newline at end of file