From 4766f36a4d74924f21ff329c4318ce4e069ffa04 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 3 Mar 2010 17:53:05 +0000 Subject: Pulled in the interface changes. git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/custom_index/index.php | 36 ++++++ mod/custom_index/languages/en.php | 17 +++ mod/custom_index/manifest.xml | 10 ++ mod/custom_index/start.php | 36 ++++++ .../views/default/canvas/layouts/new_index.php | 131 +++++++++++++++++++++ .../views/default/custom_index/css.php | 86 ++++++++++++++ 6 files changed, 316 insertions(+) create mode 100644 mod/custom_index/index.php create mode 100644 mod/custom_index/languages/en.php create mode 100644 mod/custom_index/manifest.xml create mode 100644 mod/custom_index/start.php create mode 100644 mod/custom_index/views/default/canvas/layouts/new_index.php create mode 100644 mod/custom_index/views/default/custom_index/css.php (limited to 'mod/custom_index') diff --git a/mod/custom_index/index.php b/mod/custom_index/index.php new file mode 100644 index 000000000..953e2a85b --- /dev/null +++ b/mod/custom_index/index.php @@ -0,0 +1,36 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + // Get the Elgg engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + //get required data + set_context('search');//display results in search mode, which is list view + //grab the latest 4 blog posts. to display more, change 4 to something else + $blogs = elgg_list_entities(array('type' => 'object', 'subtype' => 'blog', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => FALSE)); + //grab the latest bookmarks + $bookmarks = elgg_list_entities(array('type' => 'object', 'subtype' => 'bookmarks', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => FALSE)); + //grab the latest files + $files = elgg_list_entities(array('type' => 'object', 'subtype' => 'file', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => FALSE)); + //get the newest members who have an avatar + $newest_members = elgg_get_entities_from_metadata(array('metadata_names' => 'icontime', 'types' => 'user', 'limit' => 10)); + //newest groups + $groups = elgg_list_entities(array(type => 'group', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => FALSE)); + //grab the login form + $login = elgg_view("account/forms/login"); + + //display the contents in our new canvas layout + $body = elgg_view_layout('new_index',$login, $files, $newest_members, $blogs, $groups, $bookmarks); + + page_draw($title, $body); + +?> \ No newline at end of file diff --git a/mod/custom_index/languages/en.php b/mod/custom_index/languages/en.php new file mode 100644 index 000000000..452bcf2e5 --- /dev/null +++ b/mod/custom_index/languages/en.php @@ -0,0 +1,17 @@ + "Latest bookmarks", + 'custom:groups' => "Latest groups", + 'custom:files' => "Latest files", + 'custom:blogs' => "Latest blog posts", + 'custom:members' => "Newest members", + 'custom:nofiles' => "There are no files yet", + 'custom:nogroups' => "There are no files yet", + + ); + + add_translation("en",$english); + +?> \ No newline at end of file diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml new file mode 100644 index 000000000..2fb36cf22 --- /dev/null +++ b/mod/custom_index/manifest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/mod/custom_index/start.php b/mod/custom_index/start.php new file mode 100644 index 000000000..16d277a10 --- /dev/null +++ b/mod/custom_index/start.php @@ -0,0 +1,36 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + + function indexCustom_init() { + + // Extend system CSS with our own styles + elgg_extend_view('css','custom_index/css'); + + // Replace the default index page + register_plugin_hook('index','system','custom_index'); + + + } + + function custom_index() { + + if (!include_once(dirname(__FILE__) . "/index.php")) return false; + return true; + + } + + + // Make sure the + register_elgg_event_handler('init','system','indexCustom_init'); + +?> \ No newline at end of file diff --git a/mod/custom_index/views/default/canvas/layouts/new_index.php b/mod/custom_index/views/default/canvas/layouts/new_index.php new file mode 100644 index 000000000..e1b48ec0c --- /dev/null +++ b/mod/custom_index/views/default/canvas/layouts/new_index.php @@ -0,0 +1,131 @@ + + +
+ + +
+ +
+ " . elgg_echo("welcome") . " "; + echo $vars['user']->name; + echo ""; + } + ?> + +
"; + } + ?> +
+ + +
+

+

"; + } + ?> +
+ + +
+

+ .

"; + } + ?> +
+ +
+ + +
+ + + +
+

+
+ "; + echo elgg_view("profile/icon",array('entity' => $members, 'size' => 'small')); + echo "
"; + } + } + ?> +
+
+
+ + +
+

+ +
+ + +
+

+ +
+ + +
+ \ No newline at end of file diff --git a/mod/custom_index/views/default/custom_index/css.php b/mod/custom_index/views/default/custom_index/css.php new file mode 100644 index 000000000..9c35aaa27 --- /dev/null +++ b/mod/custom_index/views/default/custom_index/css.php @@ -0,0 +1,86 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ +?> + +#custom_index { + margin:10px; +} +#index_left { + width:442px; + float:left; + margin:0 0 30px 0; + padding:0 0 20px 0px; +} +#index_right { + width:442px; + float:right; + margin:0 0 30px 0; + padding:0 0px 20px 0; +} +#index_welcome { + padding:5px 10px 5px 10px; + margin:0 0 20px 0; + border:1px solid silver; + background: white; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; +} +#index_welcome #login-box { + margin:5px 0 10px 0; + padding:0 0 10px 0; + background: #dedede; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + width:240px; +} +#index_welcome #login-box form { + margin:0 10px 0 10px; + padding:0 10px 4px 10px; + background: white; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + width:200px; +} +#index_welcome #login-box h2, +.index_box h2 { + color:#0054A7; + font-size:1.35em; + line-height:1.2em; + margin:0 0 0 8px; + padding:5px; +} +#index_welcome #login-box h2 { + padding-bottom:5px; +} + +.index_box { + margin:0 0 20px 0; + background: #dedede; + padding:0 0 5px 0; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; +} + +.index_box .search_listing { + +} +.index_box .index_members { + float:left; + margin:2pt 5px 3px 0pt; +} +#persistent_login { + float:right; + display:block; + margin-top:-34px; +} + + + -- cgit v1.2.3