diff options
Diffstat (limited to 'mod/custom_index')
| -rw-r--r-- | mod/custom_index/index.php | 11 | ||||
| -rw-r--r-- | mod/custom_index/manifest.xml | 8 | ||||
| -rw-r--r-- | mod/custom_index/start.php | 11 | ||||
| -rw-r--r-- | mod/custom_index/views/default/custom_index/css.php | 17 | ||||
| -rw-r--r-- | mod/custom_index/views/default/page/layouts/custom_index.php | 21 |
5 files changed, 44 insertions, 24 deletions
diff --git a/mod/custom_index/index.php b/mod/custom_index/index.php index 34a24ba38..05771f576 100644 --- a/mod/custom_index/index.php +++ b/mod/custom_index/index.php @@ -31,8 +31,13 @@ $files = elgg_list_entities($list_params); //get the newest members who have an avatar $newest_members = elgg_list_entities_from_metadata(array( 'metadata_names' => 'icontime', - 'types' => 'user', + 'type' => 'user', 'limit' => 10, + 'full_view' => false, + 'pagination' => false, + 'list_type' => 'gallery', + 'gallery_class' => 'elgg-gallery-users', + 'size' => 'small', )); //newest groups @@ -56,4 +61,8 @@ $params = array( ); $body = elgg_view_layout('custom_index', $params); +// no RSS feed with a "widget" front page +global $autofeed; +$autofeed = FALSE; + echo elgg_view_page('', $body); diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml index 2db898b41..80187efbc 100644 --- a/mod/custom_index/manifest.xml +++ b/mod/custom_index/manifest.xml @@ -3,13 +3,13 @@ <name>Custom Index</name> <author>Core developers</author> <version>1.8</version> + <category>bundled</category> <description>A demonstration of how to create a front page plugin.</description> <website>http://www.elgg.org/</website> <copyright>See COPYRIGHT.txt</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> - <type>elgg_version</type> - <version>2009030702</version> + <type>elgg_release</type> + <version>1.8</version> </requires> - <admin_interface>advanced</admin_interface> </plugin_manifest> diff --git a/mod/custom_index/start.php b/mod/custom_index/start.php index 471a03999..48d03f27b 100644 --- a/mod/custom_index/start.php +++ b/mod/custom_index/start.php @@ -4,7 +4,7 @@ * */ -register_elgg_event_handler('init', 'system', 'custom_index_init'); +elgg_register_event_handler('init', 'system', 'custom_index_init'); function custom_index_init() { @@ -12,10 +12,15 @@ function custom_index_init() { elgg_extend_view('css/elgg', 'custom_index/css'); // Replace the default index page - register_plugin_hook('index', 'system', 'custom_index'); + elgg_register_plugin_hook_handler('index', 'system', 'custom_index'); } -function custom_index() { +function custom_index($hook, $type, $return, $params) { + if ($return == true) { + // another hook has already replaced the front page + return $return; + } + if (!include_once(dirname(__FILE__) . "/index.php")) { return false; } diff --git a/mod/custom_index/views/default/custom_index/css.php b/mod/custom_index/views/default/custom_index/css.php index f21ea72b2..4c780a905 100644 --- a/mod/custom_index/views/default/custom_index/css.php +++ b/mod/custom_index/views/default/custom_index/css.php @@ -8,13 +8,16 @@ /******************************* Custom Index ********************************/ -.custom-index .elgg-module-featured { - box-shadow: 1px 1px 5px #CCC; - -moz-box-shadow: 1px 1px 5px #CCC; +.custom-index { + padding: 10px 0; +} +.elgg-module-highlight { -webkit-box-shadow: 1px 1px 5px #CCC; + -moz-box-shadow: 1px 1px 5px #CCC; + box-shadow: 1px 1px 5px #CCC; } -.custom-index .elgg-module-featured:hover { - box-shadow: 1px 1px 6px #AAA; - -moz-box-shadow: 1px 1px 6px #AAA; +.elgg-module-highlight:hover { -webkit-box-shadow: 1px 1px 6px #AAA; -}
\ No newline at end of file + -moz-box-shadow: 1px 1px 6px #AAA; + box-shadow: 1px 1px 6px #AAA; +} diff --git a/mod/custom_index/views/default/page/layouts/custom_index.php b/mod/custom_index/views/default/page/layouts/custom_index.php index 48039dbd9..1267e19b2 100644 --- a/mod/custom_index/views/default/page/layouts/custom_index.php +++ b/mod/custom_index/views/default/page/layouts/custom_index.php @@ -6,41 +6,44 @@ * Whatever you put in this view will appear on the front page of your site. * */ + +$mod_params = array('class' => 'elgg-module-highlight'); + ?> <div class="custom-index elgg-main elgg-grid clearfix"> <div class="elgg-col elgg-col-1of2"> - <div class="elgg-inner pam"> + <div class="elgg-inner pvm prl"> <?php // left column // Top box for login or welcome message if (elgg_is_logged_in()) { $top_box = "<h2>" . elgg_echo("welcome") . " "; - $top_box .= get_loggedin_user()->name; + $top_box .= elgg_get_logged_in_user_entity()->name; $top_box .= "</h2>"; } else { $top_box = $vars['login']; } -echo elgg_view_module('featured', '', $top_box, array('header' => false)); +echo elgg_view_module('featured', '', $top_box, $mod_params); // a view for plugins to extend echo elgg_view("index/lefthandside"); // files if (elgg_is_active_plugin('file')) { - echo elgg_view_module('featured', elgg_echo("custom:files"), $vars['files']); + echo elgg_view_module('featured', elgg_echo("custom:files"), $vars['files'], $mod_params); } // groups if (elgg_is_active_plugin('groups')) { - echo elgg_view_module('featured', elgg_echo("custom:groups"), $vars['groups']); + echo elgg_view_module('featured', elgg_echo("custom:groups"), $vars['groups'], $mod_params); } ?> </div> </div> <div class="elgg-col elgg-col-1of2"> - <div class="elgg-inner pam"> + <div class="elgg-inner pvm"> <?php // right column @@ -48,16 +51,16 @@ if (elgg_is_active_plugin('groups')) { echo elgg_view("index/righthandside"); // files -echo elgg_view_module('featured', elgg_echo("custom:members"), $vars['members']); +echo elgg_view_module('featured', elgg_echo("custom:members"), $vars['members'], $mod_params); // groups if (elgg_is_active_plugin('blog')) { - echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs']); + echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params); } // files if (elgg_is_active_plugin('bookmarks')) { - echo elgg_view_module('featured', elgg_echo("custom:bookmarks"), $vars['bookmarks']); + echo elgg_view_module('featured', elgg_echo("custom:bookmarks"), $vars['bookmarks'], $mod_params); } ?> </div> |
