diff options
author | Sem <sembrestels@riseup.net> | 2012-11-01 05:27:33 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-11-01 05:27:33 +0100 |
commit | 8764eed20ca4ef4338766dee012bb748295cfb43 (patch) | |
tree | 946f78e02b4ef12e4cd19444f58ae40d25ae5eac /start.php | |
parent | 3c6b153eed554b634b9e85d1dc0cfe42e92094ab (diff) | |
download | saravea_theme-8764eed20ca4ef4338766dee012bb748295cfb43.tar.gz saravea_theme-8764eed20ca4ef4338766dee012bb748295cfb43.tar.bz2 |
Revert "pushing changes"
This reverts commit 3c6b153eed554b634b9e85d1dc0cfe42e92094ab.
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 102 |
1 files changed, 86 insertions, 16 deletions
@@ -1,34 +1,104 @@ <?php
-elgg_register_event_handler('init', 'system', 'cic_theme_init');
+elgg_register_event_handler('init', 'system', 'n1_theme_init');
-function cic_theme_init() {
+function n1_theme_init() {
elgg_unregister_menu_item('topbar','elgg_logo');
$item = new ElggMenuItem('site_logo', elgg_get_site_entity()->name, elgg_get_site_url());
elgg_register_menu_item('topbar', $item);
- elgg_register_plugin_hook_handler('register', 'menu:topbar', 'cic_theme_topbar_menu');
+ elgg_register_plugin_hook_handler('register', 'menu:topbar', 'n1_theme_topbar_menu');
- elgg_register_simplecache_view('cic_theme/landing');
- elgg_register_css('cic:landing_page', elgg_get_simplecache_url('css', 'cic_theme/landing'));
+ elgg_register_simplecache_view('n1_theme/landing');
+ elgg_register_css('n1:landing_page', elgg_get_simplecache_url('css', 'n1_theme/landing'));
- elgg_extend_view('css/elgg', 'cic_theme/css');
- elgg_extend_view('js/elgg', 'cic_theme/js');
- elgg_extend_view('page/elements/title', 'cic_theme/header', 0);
+ elgg_extend_view('css/elgg', 'n1_theme/css');
+ elgg_extend_view('js/elgg', 'n1_theme/js');
+ elgg_extend_view('page/elements/title', 'n1_theme/header', 0);
// custom index widgets
foreach(array("custom_index", "edit_widgets", "index_2rbhh", "index_2rhhb",
"index", "index_2rbms", "index_2rmsb",
"index_1rsss", "index_2rbsm", "index_2rsmb") as $layout) {
- elgg_extend_view('page/layouts/'.$layout, 'cic_theme/landing', 0);
+ elgg_extend_view('page/layouts/'.$layout, 'n1_theme/landing', 0);
}
if (elgg_is_active_plugin('pages')) {
// pages icon url override
- elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'cic_theme_pages_icon_url_override');
+ elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'n1_theme_pages_icon_url_override');
}
}
-function cic_theme_topbar_menu($hook, $type, $returnvalue, $params){
- //var_dump($returnvalue);exit();
+function n1_theme_topbar_menu($hook, $type, $returnvalue, $params){
+ $user = elgg_get_logged_in_user_entity();
+
+ if (elgg_is_active_plugin('groups')) {
+
+ $ia = elgg_set_ignore_access(TRUE);
+ $num_invitations = elgg_get_entities_from_relationship(array(
+ 'relationship' => 'invited',
+ 'relationship_guid' => $user->guid,
+ 'inverse_relationship' => TRUE,
+ 'limit' => 0,
+ 'count' => TRUE,
+ ));
+ elgg_set_ignore_access($ia);
+
+ if ($num_invitations) {
+ $num_invitations = elgg_view('output/url', array(
+ 'text' => "<span class=\"messages-new\">$num_invitations</span>",
+ 'href' => "groups/invitations/$user->username",
+ ));
+ }
+
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'groups',
+ 'href' => "groups/member/$user->username",
+ 'text' => elgg_view_icon('groups') . $num_invitations,
+ 'title' => elgg_echo('groups'),
+ 'priority' => 500,
+ ));
+ }
+
+ if (elgg_is_admin_logged_in()) {
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'administration',
+ 'href' => "admin",
+ 'text' => elgg_view_icon('settings'),
+ 'title' => elgg_echo('admin'),
+ 'priority' => 100,
+ 'section' => 'alt',
+ ));
+ }
+
+ if (elgg_is_active_plugin('dashboard')) {
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'dashboard',
+ 'href' => "dashboard",
+ 'text' => elgg_view_icon('home'),
+ 'title' => elgg_echo('dashboard'),
+ 'priority' => 200,
+ 'section' => 'alt',
+ ));
+ }
+
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'usersettings',
+ 'href' => "settings/user/{$user->username}",
+ 'text' => elgg_view_icon('settings-alt'),
+ 'title' => elgg_echo('settings'),
+ 'priority' => 500,
+ 'section' => 'alt',
+ ));
+
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'logout',
+ 'href' => "action/logout",
+ 'text' => elgg_echo('logout'),
+ 'title' => elgg_echo('logout'),
+ 'is_action' => TRUE,
+ 'priority' => 1000,
+ 'section' => 'alt',
+ ));
+ return $returnvalue;
}
/**
@@ -36,7 +106,7 @@ function cic_theme_topbar_menu($hook, $type, $returnvalue, $params){ *
* @return string Relative URL
*/
-function cic_theme_pages_icon_url_override($hook, $type, $returnvalue, $params) {
+function n1_theme_pages_icon_url_override($hook, $type, $returnvalue, $params) {
$entity = $params['entity'];
if (elgg_instanceof($entity, 'object', 'page_top') ||
elgg_instanceof($entity, 'object', 'page')) {
@@ -50,13 +120,13 @@ function cic_theme_pages_icon_url_override($hook, $type, $returnvalue, $params) switch ($params['size']) {
case 'topbar':
case 'tiny':
- return "mod/cic_theme/_graphics/icons/{$icon}_tiny.gif";
+ return "mod/n1_theme/_graphics/icons/{$icon}_tiny.gif";
break;
case 'small':
- return "mod/cic_theme/_graphics/icons/{$icon}_small.gif";
+ return "mod/n1_theme/_graphics/icons/{$icon}_small.gif";
break;
default:
- return "mod/cic_theme/_graphics/icons/{$icon}_lrg.gif";
+ return "mod/n1_theme/_graphics/icons/{$icon}_lrg.gif";
break;
}
}
|