From 5041c6c48153453ed597206d08eeff37cf20e676 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:46:48 -0300 Subject: Squashed 'mod/cool_theme/' content from commit a26f7df git-subtree-dir: mod/cool_theme git-subtree-split: a26f7df43a266f7d1ff04847da330d15f6041e9b --- _graphics/ajax_loader.gif | Bin 0 -> 1928 bytes _graphics/ajax_loader_bw.gif | Bin 0 -> 1928 bytes _graphics/elgg_sprites.png | Bin 0 -> 37873 bytes _graphics/favicon.ico | Bin 0 -> 182449 bytes documentation/documention.html | 12 + languages/en.php | 50 ++ languages/es.php | 47 ++ languages/fr.php | 36 ++ manifest.xml | 54 ++ pages/credits.php | 15 + pages/dashboard.php | 29 + pages/groups/info.php | 27 + pages/groups/wall.php | 35 ++ pages/profile/info.php | 9 + pages/profile/wall.php | 32 + readme.md | 8 + screenshot.png | Bin 0 -> 121345 bytes start.php | 676 +++++++++++++++++++++ views/default/annotation/generic_comment.php | 72 +++ views/default/blog/composer.php | 10 + views/default/bookmarks/composer.php | 3 + views/default/cool_theme/css.php | 11 + views/default/core/account/login_box.php | 21 + views/default/core/account/login_dropdown.php | 27 + views/default/core/settings/account.php | 9 + .../core/settings/account/default_access.php | 25 + views/default/core/settings/account/email.php | 19 + views/default/core/settings/account/language.php | 20 + views/default/core/settings/account/name.php | 21 + .../core/settings/account/notifications.php | 44 ++ views/default/core/settings/account/password.php | 33 + views/default/core/settings/statistics.php | 6 + .../core/settings/statistics/numentities.php | 44 ++ views/default/core/settings/statistics/online.php | 49 ++ views/default/core/settings/tools.php | 34 ++ views/default/core/walled_garden/login.php | 38 ++ views/default/css/elements/buttons.php | 13 + views/default/css/elements/chrome.php | 15 + views/default/css/elements/components.php | 58 ++ views/default/css/elements/forms.php | 21 + views/default/css/elements/icons.php | 18 + views/default/css/elements/layout.php | 26 + views/default/css/elements/modules.php | 12 + views/default/css/elements/navigation.php | 85 +++ views/default/css/elements/typography.php | 17 + views/default/css/walled_garden.php | 74 +++ views/default/discussion/river_footer.php | 51 ++ views/default/file/composer.php | 8 + views/default/forms/comments/add.php | 39 ++ views/default/forms/discussion/reply/save.php | 28 + views/default/forms/profile/edit.php | 67 ++ views/default/forms/profile/fields/add.php | 29 + views/default/forms/profile/fields/reset.php | 12 + views/default/group/default/river.php | 23 + views/default/groups/profile/fields.php | 36 ++ views/default/groups/profile/profile_block.php | 69 +++ views/default/groups/profile/stats.php | 19 + views/default/groups/profile/summary.php | 17 + views/default/input/access.php | 38 ++ views/default/input/autocomplete.php | 49 ++ views/default/input/button.php | 40 ++ views/default/input/calendar.php | 6 + views/default/input/captcha.php | 8 + views/default/input/checkbox.php | 39 ++ views/default/input/checkboxes.php | 90 +++ views/default/input/date.php | 56 ++ views/default/input/datepicker.php | 6 + views/default/input/dropdown.php | 71 +++ views/default/input/email.php | 26 + views/default/input/file.php | 31 + views/default/input/form.php | 44 ++ views/default/input/friendspicker.php | 319 ++++++++++ views/default/input/hidden.php | 12 + views/default/input/location.php | 27 + views/default/input/longtext.php | 40 ++ views/default/input/password.php | 28 + views/default/input/plaintext.php | 35 ++ views/default/input/pulldown.php | 9 + views/default/input/radio.php | 76 +++ views/default/input/reset.php | 14 + views/default/input/securitytoken.php | 15 + views/default/input/submit.php | 14 + views/default/input/tag.php | 25 + views/default/input/tags.php | 45 ++ views/default/input/text.php | 27 + views/default/input/url.php | 27 + views/default/input/urlshortener.php | 8 + views/default/input/userpicker.php | 73 +++ views/default/js/tobar2.php | 100 +++ views/default/js/topbar.php | 3 + views/default/likes/river_footer.php | 71 +++ views/default/messageboard/composer.php | 6 + views/default/object/blog/river.php | 17 + views/default/object/bookmarks/river.php | 19 + views/default/object/file/river.php | 17 + views/default/object/groupforumtopic/river.php | 17 + views/default/object/page/river.php | 15 + views/default/page/components/gallery.php | 77 +++ views/default/page/components/image_block.php | 52 ++ views/default/page/components/list.php | 75 +++ views/default/page/components/module.php | 48 ++ views/default/page/components/summary.php | 4 + views/default/page/default.php | 73 +++ views/default/page/elements/composer.php | 7 + views/default/page/elements/footer.php | 36 ++ views/default/page/elements/head.php | 68 +++ views/default/page/elements/header.php | 12 + views/default/page/elements/owner_block.php | 30 + views/default/page/elements/shortcut_icon.php | 6 + views/default/page/elements/sidebar.php | 31 + views/default/page/elements/sidebar_alt.php | 12 + views/default/page/elements/title.php | 21 + views/default/page/layouts/content.php | 45 ++ views/default/page/layouts/content/sidebar_alt.php | 0 views/default/page/layouts/two_sidebar.php | 46 ++ views/default/profile/details.php | 41 ++ views/default/river/elements/attachment.php | 25 + views/default/river/elements/body.php | 68 +++ views/default/river/elements/responses.php | 49 ++ views/default/river/group/create.php | 25 + views/default/river/object/blog/create.php | 11 + views/default/river/object/bookmarks/create.php | 14 + views/default/river/object/file/create.php | 13 + .../river/object/groupforumtopic/create.php | 11 + views/default/river/object/messageboard/create.php | 11 + views/default/river/object/page/create.php | 11 + .../river/user/default/profileiconupdate.php | 24 + views/default/river/user/default/profileupdate.php | 20 + views/default/search/css.php | 11 + views/default/search/entity.php | 57 ++ views/default/search/search_box.php | 27 + views/default/thewire/composer.php | 2 + 132 files changed, 4879 insertions(+) create mode 100644 _graphics/ajax_loader.gif create mode 100644 _graphics/ajax_loader_bw.gif create mode 100644 _graphics/elgg_sprites.png create mode 100644 _graphics/favicon.ico create mode 100644 documentation/documention.html create mode 100644 languages/en.php create mode 100644 languages/es.php create mode 100644 languages/fr.php create mode 100644 manifest.xml create mode 100644 pages/credits.php create mode 100644 pages/dashboard.php create mode 100644 pages/groups/info.php create mode 100644 pages/groups/wall.php create mode 100644 pages/profile/info.php create mode 100644 pages/profile/wall.php create mode 100644 readme.md create mode 100644 screenshot.png create mode 100644 start.php create mode 100644 views/default/annotation/generic_comment.php create mode 100644 views/default/blog/composer.php create mode 100644 views/default/bookmarks/composer.php create mode 100644 views/default/cool_theme/css.php create mode 100644 views/default/core/account/login_box.php create mode 100644 views/default/core/account/login_dropdown.php create mode 100644 views/default/core/settings/account.php create mode 100644 views/default/core/settings/account/default_access.php create mode 100644 views/default/core/settings/account/email.php create mode 100644 views/default/core/settings/account/language.php create mode 100644 views/default/core/settings/account/name.php create mode 100644 views/default/core/settings/account/notifications.php create mode 100644 views/default/core/settings/account/password.php create mode 100644 views/default/core/settings/statistics.php create mode 100644 views/default/core/settings/statistics/numentities.php create mode 100644 views/default/core/settings/statistics/online.php create mode 100644 views/default/core/settings/tools.php create mode 100644 views/default/core/walled_garden/login.php create mode 100644 views/default/css/elements/buttons.php create mode 100644 views/default/css/elements/chrome.php create mode 100644 views/default/css/elements/components.php create mode 100644 views/default/css/elements/forms.php create mode 100644 views/default/css/elements/icons.php create mode 100644 views/default/css/elements/layout.php create mode 100644 views/default/css/elements/modules.php create mode 100644 views/default/css/elements/navigation.php create mode 100644 views/default/css/elements/typography.php create mode 100644 views/default/css/walled_garden.php create mode 100644 views/default/discussion/river_footer.php create mode 100644 views/default/file/composer.php create mode 100644 views/default/forms/comments/add.php create mode 100644 views/default/forms/discussion/reply/save.php create mode 100644 views/default/forms/profile/edit.php create mode 100644 views/default/forms/profile/fields/add.php create mode 100644 views/default/forms/profile/fields/reset.php create mode 100644 views/default/group/default/river.php create mode 100644 views/default/groups/profile/fields.php create mode 100644 views/default/groups/profile/profile_block.php create mode 100644 views/default/groups/profile/stats.php create mode 100644 views/default/groups/profile/summary.php create mode 100644 views/default/input/access.php create mode 100644 views/default/input/autocomplete.php create mode 100644 views/default/input/button.php create mode 100644 views/default/input/calendar.php create mode 100644 views/default/input/captcha.php create mode 100644 views/default/input/checkbox.php create mode 100644 views/default/input/checkboxes.php create mode 100644 views/default/input/date.php create mode 100644 views/default/input/datepicker.php create mode 100644 views/default/input/dropdown.php create mode 100644 views/default/input/email.php create mode 100644 views/default/input/file.php create mode 100644 views/default/input/form.php create mode 100644 views/default/input/friendspicker.php create mode 100644 views/default/input/hidden.php create mode 100644 views/default/input/location.php create mode 100644 views/default/input/longtext.php create mode 100644 views/default/input/password.php create mode 100644 views/default/input/plaintext.php create mode 100644 views/default/input/pulldown.php create mode 100644 views/default/input/radio.php create mode 100644 views/default/input/reset.php create mode 100644 views/default/input/securitytoken.php create mode 100644 views/default/input/submit.php create mode 100644 views/default/input/tag.php create mode 100644 views/default/input/tags.php create mode 100644 views/default/input/text.php create mode 100644 views/default/input/url.php create mode 100644 views/default/input/urlshortener.php create mode 100644 views/default/input/userpicker.php create mode 100644 views/default/js/tobar2.php create mode 100644 views/default/js/topbar.php create mode 100644 views/default/likes/river_footer.php create mode 100644 views/default/messageboard/composer.php create mode 100644 views/default/object/blog/river.php create mode 100644 views/default/object/bookmarks/river.php create mode 100644 views/default/object/file/river.php create mode 100644 views/default/object/groupforumtopic/river.php create mode 100644 views/default/object/page/river.php create mode 100644 views/default/page/components/gallery.php create mode 100644 views/default/page/components/image_block.php create mode 100644 views/default/page/components/list.php create mode 100644 views/default/page/components/module.php create mode 100644 views/default/page/components/summary.php create mode 100644 views/default/page/default.php create mode 100644 views/default/page/elements/composer.php create mode 100644 views/default/page/elements/footer.php create mode 100644 views/default/page/elements/head.php create mode 100644 views/default/page/elements/header.php create mode 100644 views/default/page/elements/owner_block.php create mode 100644 views/default/page/elements/shortcut_icon.php create mode 100644 views/default/page/elements/sidebar.php create mode 100644 views/default/page/elements/sidebar_alt.php create mode 100644 views/default/page/elements/title.php create mode 100644 views/default/page/layouts/content.php create mode 100644 views/default/page/layouts/content/sidebar_alt.php create mode 100644 views/default/page/layouts/two_sidebar.php create mode 100644 views/default/profile/details.php create mode 100644 views/default/river/elements/attachment.php create mode 100644 views/default/river/elements/body.php create mode 100644 views/default/river/elements/responses.php create mode 100644 views/default/river/group/create.php create mode 100644 views/default/river/object/blog/create.php create mode 100644 views/default/river/object/bookmarks/create.php create mode 100644 views/default/river/object/file/create.php create mode 100644 views/default/river/object/groupforumtopic/create.php create mode 100644 views/default/river/object/messageboard/create.php create mode 100644 views/default/river/object/page/create.php create mode 100644 views/default/river/user/default/profileiconupdate.php create mode 100644 views/default/river/user/default/profileupdate.php create mode 100644 views/default/search/css.php create mode 100644 views/default/search/entity.php create mode 100644 views/default/search/search_box.php create mode 100644 views/default/thewire/composer.php diff --git a/_graphics/ajax_loader.gif b/_graphics/ajax_loader.gif new file mode 100644 index 000000000..521a291d7 Binary files /dev/null and b/_graphics/ajax_loader.gif differ diff --git a/_graphics/ajax_loader_bw.gif b/_graphics/ajax_loader_bw.gif new file mode 100644 index 000000000..521a291d7 Binary files /dev/null and b/_graphics/ajax_loader_bw.gif differ diff --git a/_graphics/elgg_sprites.png b/_graphics/elgg_sprites.png new file mode 100644 index 000000000..c87c1b0cd Binary files /dev/null and b/_graphics/elgg_sprites.png differ diff --git a/_graphics/favicon.ico b/_graphics/favicon.ico new file mode 100644 index 000000000..495a0ca5a Binary files /dev/null and b/_graphics/favicon.ico differ diff --git a/documentation/documention.html b/documentation/documention.html new file mode 100644 index 000000000..77538e578 --- /dev/null +++ b/documentation/documention.html @@ -0,0 +1,12 @@ +Documentation + + + + + + + + + + + \ No newline at end of file diff --git a/languages/en.php b/languages/en.php new file mode 100644 index 000000000..6e25bf14f --- /dev/null +++ b/languages/en.php @@ -0,0 +1,50 @@ + 'Leave a reply...', + 'annotation:generic_comment:value:placeholder' => 'Leave a comment...', + + 'composer:object:thewire' => "Status", + 'composer:object:bookmarks' => "Bookmark", + 'composer:object:blog' => "Blog", + 'composer:annotation:messageboard' => "Post", + 'composer:object:file' => 'File', + 'composer:prompt' => 'Share', + + 'file:river:create' => 'uploaded a file', + 'files' => 'Files', + + 'friend:user:add' => "Add %s as Friend", + + 'groups:add' => 'Create Group...', + 'thanks' => 'Thanks', + 'thanks_body' => 'Special thanks to all the Elgg staff!

', + 'home' => 'Home', + 'WISB:footer_wisb' => 'WISB', + 'WISB:footer_developers' => 'Developers', + 'WISB:footer_wisblog' => 'WISBlog', + 'newsfeed' => 'News Feed', + + 'profile:wall' => "Board", + 'profile:info' => "Info", + 'profile:activity:none' => "No activity to display", + + 'likes:likethis' => 'Like', + 'likes:remove' => 'Unlike', + + 'notifications:personal' => "Notifications", + + 'pages:river:create' => 'created a page', + + 'river:comment:object:thewire' => '', + 'river:comments:all' => 'View all %d comments', + 'river:messageboard:group:default' => '', + 'river:replies:all' => 'View all %d replies', + 'river:to' => '%s ▶ %s', + + 'rss:subscribe' => 'Subscribe via RSS', + + 'see:all' => 'See all', + + 'settings:user' => 'Account Settings', + +)); diff --git a/languages/es.php b/languages/es.php new file mode 100644 index 000000000..41960388f --- /dev/null +++ b/languages/es.php @@ -0,0 +1,47 @@ + 'Responder...', + 'annotation:generic_comment:value:placeholder' => 'Comentar...', + + 'composer:object:thewire' => "Estado", + 'composer:object:bookmarks' => "Favoritos", + 'composer:object:blog' => "Blog", + 'composer:annotation:messageboard' => "Post", + 'composer:object:file' => 'Archivo', + 'composer:prompt' => 'Accion', + + 'file:river:create' => 'Archivo subido', + 'files' => 'Archivos', + + 'friend:user:add' => "Agregar %s como Amigo", + + 'groups:add' => 'Crear Grupo...', + + 'home' => 'Inicio', + + 'newsfeed' => 'Noticias RSS', + + 'profile:wall' => "Muro", + 'profile:info' => "Info", + 'profile:activity:none' => "No hay actividad para mostrar", + + 'likes:likethis' => 'Me gusta', + 'likes:remove' => 'Quitar Me gusta', + + 'notifications:personal' => "Notificaciones", + + 'pages:river:create' => 'Página creada', + + 'river:comment:object:thewire' => '', + 'river:comments:all' => 'Ver todos %d los comentarios', + 'river:messageboard:group:default' => '', + 'river:replies:all' => 'Ver todas %d las respuestas', + 'river:to' => '%s ▶ %s', + + 'rss:subscribe' => 'Subscribete via RSS', + + 'see:all' => 'Ver todo', + + 'settings:user' => 'Configuracion de la cuenta', + +)); \ No newline at end of file diff --git a/languages/fr.php b/languages/fr.php new file mode 100644 index 000000000..a1fd4a173 --- /dev/null +++ b/languages/fr.php @@ -0,0 +1,36 @@ + 'Laisser une réponse...', + 'annotation:generic_comment:value:placeholder' => 'Laisser un commentaire...', + 'composer:object:thewire' => "Statut", + 'composer:object:bookmarks' => "Lien", + 'composer:object:blog' => "Blog", + 'composer:annotation:messageboard' => "Post", + 'composer:object:file' => 'Fichier', + 'composer:prompt' => 'Partager', + 'friend:user:add' => "Ajouter %s à mes amis", + 'file:river:create' => 'a envoyé un fichier', + 'file:group' => "Fichiers", + 'bookmarks:group' => 'Liens', + 'blog:group' => "Blog", + 'pages:group' => 'Pages', + 'questions:group' => "Questions", + 'discussion:group' => 'Discussion', + 'groups:activity' => "Activité", + 'profile:wall' => "Mur", + 'profile:info' => "Info", + 'pages:river:create' => 'a créé une page', + 'composer:prompt' => 'Partager', + 'likes:likethis' => "J'aime", + 'likes:remove' => "Je n'aime plus", + 'river:comments:all' => 'Afficher les %d commentaires', + 'pages:river:create' => 'a créé une page', + 'newsfeed' => 'Fil d\'actualité', + 'friend:user:add' => "Ajouter %s à mes amis", + 'river:to' => '%s ▶ %s', + 'files' => 'Fichiers', + 'river:comment:object:thewire' => '', + 'groups:add' => 'Créer un groupe...', + 'home' => 'Accueil', + 'see:all' => 'Voir tous', +)); diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 000000000..32f3ad287 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,54 @@ + + + Ultimate Cool Theme + Stan Larroque + 2.1 + theme + + I just made my best for this cool theme. Keep an eye on http://github.com/WISB for further stuff. + + https://developers.wisb.me/elgg/ + (C) 2012 Stan Larroque + GNU Public License version 2 + + + elgg_release + 1.8.3 + + + priority + after + groups + + + priority + after + messageboard + + + priority + after + messages + + + priority + after + profile + + + priority + after + search + + + priority + after + thewire + + + + plugin + profile + 1.8 + + diff --git a/pages/credits.php b/pages/credits.php new file mode 100644 index 000000000..507211f0e --- /dev/null +++ b/pages/credits.php @@ -0,0 +1,15 @@ +guid); + +$title = elgg_echo('thanks'); +elgg_set_page_owner_guid(1); +$content = elgg_view_layout('two_sidebar', array( + 'title' => $title, + 'content' => elgg_echo('thanks_body'), +)); + +echo elgg_view_page($title, $content); \ No newline at end of file diff --git a/pages/dashboard.php b/pages/dashboard.php new file mode 100644 index 000000000..12bfeca64 --- /dev/null +++ b/pages/dashboard.php @@ -0,0 +1,29 @@ +guid); + +$title = elgg_echo('newsfeed'); + +$composer = elgg_view('page/elements/composer', array('entity' => $user)); + + +$db_prefix = elgg_get_config('dbprefix'); +$activity = elgg_list_river(array( + 'joins' => array("JOIN {$db_prefix}entities object ON object.guid = rv.object_guid"), + 'wheres' => array(" + rv.subject_guid = $user->guid + OR rv.subject_guid IN (SELECT guid_two FROM {$db_prefix}entity_relationships WHERE guid_one=$user->guid AND relationship='follower') + OR rv.subject_guid IN (SELECT guid_one FROM {$db_prefix}entity_relationships WHERE guid_two=$user->guid AND relationship='friend') + "), +)); + +elgg_set_page_owner_guid(1); +$content = elgg_view_layout('two_sidebar', array( + 'title' => $title, + 'content' => $composer . $activity, +)); + +echo elgg_view_page($title, $content); \ No newline at end of file diff --git a/pages/groups/info.php b/pages/groups/info.php new file mode 100644 index 000000000..cdf84d052 --- /dev/null +++ b/pages/groups/info.php @@ -0,0 +1,27 @@ + $group)); +if (group_gatekeeper(false)) { + $sidebar = elgg_view('groups/sidebar/members', array('entity' => $group)); +} else { + $sidebar = ''; +} + +$body = elgg_view_layout('two_sidebar', array( + 'content' => $content, + 'sidebar_alt' => $sidebar, + 'title' => $group->name, +)); + +echo elgg_view_page($group->name, $body); \ No newline at end of file diff --git a/pages/groups/wall.php b/pages/groups/wall.php new file mode 100644 index 000000000..9a273e262 --- /dev/null +++ b/pages/groups/wall.php @@ -0,0 +1,35 @@ +name; + +$composer = ''; +if (elgg_is_logged_in()) { + $composer = elgg_view('page/elements/composer', array('entity' => $group)); +} + +$db_prefix = elgg_get_config('dbprefix'); +$activity = elgg_list_river(array( + 'joins' => array("JOIN {$db_prefix}entities e ON e.guid = rv.object_guid"), + 'wheres' => array("e.container_guid = $group->guid OR rv.object_guid = $group->guid"), +)); + +if (!$activity) { + $activity = elgg_view('output/longtext', array('value' => elgg_echo('group:activity:none'))); +} + +$body = elgg_view_layout('two_sidebar', array( + 'title' => $title, + 'content' => $composer . $activity, +)); + +echo elgg_view_page($title, $body); diff --git a/pages/profile/info.php b/pages/profile/info.php new file mode 100644 index 000000000..9dc40c4c7 --- /dev/null +++ b/pages/profile/info.php @@ -0,0 +1,9 @@ + $user->name, + 'content' => elgg_view('profile/details'), +)); + +echo elgg_view_page($title, $body); \ No newline at end of file diff --git a/pages/profile/wall.php b/pages/profile/wall.php new file mode 100644 index 000000000..48d3b8646 --- /dev/null +++ b/pages/profile/wall.php @@ -0,0 +1,32 @@ +name; + +$composer = ''; +if (elgg_is_logged_in()) { + $composer = elgg_view('page/elements/composer', array('entity' => $user)); +} + +$db_prefix = elgg_get_config('dbprefix'); +$activity = elgg_list_river(array( + 'joins' => array("JOIN {$db_prefix}entities e ON e.guid = rv.object_guid"), + 'wheres' => array("e.container_guid = $user->guid OR rv.object_guid = $user->guid") +)); + +if (!$activity) { + $activity = elgg_view('output/longtext', array('value' => elgg_echo('profile:activity:none'))); +} + +$body = elgg_view_layout('two_sidebar', array( + 'content' => $composer . $activity, + 'title' => $title, +)); + +echo elgg_view_page($title, $body); diff --git a/readme.md b/readme.md new file mode 100644 index 000000000..2e64f94e5 --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +Upgrade from cool_theme 1.0 : +------------- + +1. Deactivate your cool_theme version +2. Delete it from your server +3. Upload this version to your mod/ directory +4. Activate cool_theme... +Easy :-) \ No newline at end of file diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 000000000..efcadc7c7 Binary files /dev/null and b/screenshot.png differ diff --git a/start.php b/start.php new file mode 100644 index 000000000..b3876fa0d --- /dev/null +++ b/start.php @@ -0,0 +1,676 @@ +pagehandler['groups']; + elgg_register_page_handler('groups', 'facebook_theme_groups_page_handler'); + + elgg_register_ajax_view('thewire/composer'); + elgg_register_ajax_view('messageboard/composer'); + elgg_register_ajax_view('blog/composer'); + elgg_register_ajax_view('file/composer'); + elgg_register_ajax_view('bookmarks/composer'); + + /** + * Customize menus + */ + elgg_unregister_plugin_hook_handler('register', 'menu:river', 'likes_river_menu_setup'); + elgg_unregister_plugin_hook_handler('register', 'menu:river', 'elgg_river_menu_setup'); + + elgg_register_plugin_hook_handler('register', 'menu:river', 'facebook_theme_river_menu_handler'); + elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'facebook_theme_owner_block_menu_handler', 600); + elgg_register_plugin_hook_handler('register', 'menu:composer', 'facebook_theme_composer_menu_handler'); + + elgg_register_event_handler('pagesetup', 'system', 'facebook_theme_pagesetup_handler', 1000); + + /** + * Customize permissions + */ + elgg_register_plugin_hook_handler('permissions_check:annotate', 'all', 'facebook_theme_annotation_permissions_handler'); + elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'facebook_theme_container_permissions_handler'); + + /** + * Miscellaneous customizations + */ + //Small "correction" to groups profile -- brief description makes more sense to come first! + elgg_register_plugin_hook_handler('profile:fields', 'group', 'facebook_theme_group_profile_fields', 1); + + //@todo report some of the extra patterns to be included in Elgg core + elgg_extend_view('css/elgg', 'cool_theme/css'); + elgg_extend_view('js/elgg', 'js/topbar'); + + //Likes summary bar -- "You, John, and 3 others like this" + if (elgg_is_active_plugin('likes')) { + elgg_extend_view('river/elements/responses', 'likes/river_footer', 1); + } + + elgg_extend_view('river/elements/responses', 'discussion/river_footer'); + + //Elgg only includes the search bar in the header by default, + //but we usually don't show the header when the user is logged in + if (elgg_is_active_plugin('search')) { + elgg_extend_view('page/elements/topbar', 'search/search_box'); + elgg_unextend_view('page/elements/header', 'search/search_box'); + + if (!elgg_is_logged_in()) { + elgg_unextend_view('page/elements/header', 'search/header'); + } + } +} +function friends_hack_pagesetup_handler() { +elgg_unregister_menu_item('topbar', 'friends'); + +} +function facebook_theme_groups_page_handler($segments, $handle) { + $pages_dir = dirname(__FILE__) . '/pages'; + + switch ($segments[0]) { + case 'profile': + elgg_set_page_owner_guid($segments[1]); + require_once "$pages_dir/groups/wall.php"; + break; + + case 'info': + elgg_set_page_owner_guid($segments[1]); + require_once "$pages_dir/groups/info.php"; + break; + + case 'discussion': + elgg_set_page_owner_guid($segments[1]); + require_once "$pages_dir/groups/discussion.php"; + break; + + default: + global $facebook_theme_original_groups_page_handler; + return call_user_func($facebook_theme_original_groups_page_handler, $segments, $handle); + } + return true; +} + +function facebook_theme_pagesetup_handler() { + $owner = elgg_get_page_owner_entity(); + + if (elgg_is_logged_in()) { + $user = elgg_get_logged_in_user_entity(); + elgg_register_menu_item('page', array( + 'name' => 'news', + 'text' => elgg_view_icon('newsfeed') . elgg_echo('newsfeed'), + 'href' => '/dashboard', + 'priority' => 100, + 'contexts' => array('dashboard'), + )); + if (elgg_is_active_plugin('message')) { + elgg_register_menu_item('page', array( + 'name' => 'Inbox', + 'text' => elgg_view_icon('messages') . elgg_echo('Inbox'), + 'href' => "/messages/", + 'contexts' => array('dashboard'), + )); + } + + elgg_register_menu_item('page', array( + 'name' => 'friends', + 'text' => elgg_view_icon('friends') . elgg_echo('friends'), + 'href' => "/friends/$user->username", + 'priority' => 500, + 'contexts' => array('dashboard'), + )); + + if ($owner instanceof ElggUser && $owner->guid != $user->guid) { + + if (check_entity_relationship($user->guid, 'friend', $owner->guid)) { + elgg_register_menu_item('extras', array( + 'name' => 'removefriend', + 'text' => elgg_echo('friend:remove'), + 'href' => "/action/friends/remove?friend=$owner->guid", + 'is_action' => TRUE, + 'contexts' => array('profile'), + )); + } else { + elgg_register_menu_item('title', array( + 'name' => 'addfriend', + 'text' => elgg_view_icon('addfriend') . elgg_echo('friend:add'), + 'href' => "/action/friends/add?friend=$owner->guid", + 'is_action' => TRUE, + 'link_class' => 'elgg-button elgg-button-special', + 'contexts' => array('profile'), + 'priority' => 1, + )); + } + + if (elgg_is_active_plugin('messages')) { + elgg_register_menu_item('title', array( + 'name' => 'message', + 'text' => elgg_view_icon('messages') . elgg_echo('messages:message'), + 'href' => "/messages/compose?send_to=$owner->guid", + 'link_class' => 'elgg-button elgg-button-action', + 'contexts' => array('profile'), + )); + } + } + + if ($owner->guid == $user->guid) { + elgg_register_menu_item('title', array( + 'name' => 'editprofile', + 'href' => "/profile/$user->username/edit", + 'text' => elgg_echo('profile:edit'), + 'link_class' => 'elgg-button elgg-button-action', + 'contexts' => array('profile'), + )); + } + + if (elgg_is_active_plugin('groups')) { + $groups = $user->getGroups('', 4); + + foreach ($groups as $group) { + elgg_register_menu_item('page', array( + 'section' => 'groups', + 'name' => "group-$group->guid", + 'text' => elgg_view_icon('users') . $group->name, + 'href' => $group->getURL(), + 'contexts' => array('dashboard'), + )); + } + + elgg_register_menu_item('page', array( + 'name' => 'groups-add', + 'section' => 'groups', + 'text' => elgg_view_icon('addgroup') . elgg_echo('groups:add'), + 'href' => "/groups/add", + 'contexts' => array('dashboard'), + 'priority' => 499, + )); + + elgg_register_menu_item('page', array( + 'section' => 'groups', + 'name' => 'groups', + 'text' => elgg_echo('see:all'), + 'href' => "/groups/member/$user->username", + 'contexts' => array('dashboard'), + 'priority' => 500, + )); + } + + if (elgg_is_active_plugin('tidypics')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'photos', + 'text' => elgg_view_icon('photo') . elgg_echo("photos"), + 'href' => "/photos/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + if (elgg_is_active_plugin('bookmarks')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'bookmarks', + 'text' => elgg_view_icon('push-pin') . elgg_echo('bookmarks'), + 'href' => "/bookmarks/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + if (elgg_is_active_plugin('blog')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'blog', + 'text' => elgg_view_icon('speech-bubble-alt') . elgg_echo('blog'), + 'href' => "/blog/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + if (elgg_is_active_plugin('pages')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'pages', + 'text' => elgg_view_icon('list') . elgg_echo('pages'), + 'href' => "/pages/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + if (elgg_is_active_plugin('file')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'files', + 'text' => elgg_view_icon('clip') . elgg_echo('files'), + 'href' => "/file/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + if (elgg_is_active_plugin('thewire')) { + elgg_register_menu_item('page', array( + 'section' => 'more', + 'name' => 'thewire', + 'text' => elgg_view_icon('share') . elgg_echo('thewire'), + 'href' => "/thewire/friends/$user->username", + 'contexts' => array('dashboard'), + )); + } + + $address = urlencode(current_page_url()); + + if (elgg_is_active_plugin('bookmarks')) { + elgg_register_menu_item('extras', array( + 'name' => 'bookmark', + 'text' => elgg_view_icon('link') . elgg_echo('bookmarks:this'), + 'href' => "bookmarks/add/$user->guid?address=$address", + 'title' => elgg_echo('bookmarks:this'), + 'rel' => 'nofollow', + )); + } + + if (elgg_is_active_plugin('reportedcontent')) { + elgg_unregister_menu_item('footer', 'report_this'); + + $href = "javascript:elgg.forward('reportedcontent/add'"; + $href .= "+'?address='+encodeURIComponent(location.href)"; + $href .= "+'&title='+encodeURIComponent(document.title));"; + + elgg_register_menu_item('extras', array( + 'name' => 'report_this', + 'href' => $href, + 'text' => elgg_view_icon('report-this') . elgg_echo('reportedcontent:this'), + 'title' => elgg_echo('reportedcontent:this:tooltip'), + 'priority' => 500, + )); + } + + /** + * TOPBAR customizations + */ + //Want our logo present, not Elgg's + $site = elgg_get_site_entity(); + elgg_unregister_menu_item('topbar', 'elgg_logo'); + elgg_register_menu_item('topbar', array( + 'href' => '/', + 'name' => 'logo', + 'priority' => 1, + 'text' => "

$site->name

", + )); + + elgg_register_menu_item('topbar', array( + 'href' => '/dashboard', + 'name' => 'home', + 'priority' => 2, + 'section' => 'alt', + 'text' => elgg_echo('home'), + )); + + if (elgg_is_active_plugin('profile')) { + elgg_unregister_menu_item('topbar', 'profile'); + elgg_register_menu_item('topbar', array( + 'name' => 'profile', + 'section' => 'alt', + 'text' => "getIconURL('topbar')}\" class=\"elgg-icon elgg-inline-block\" alt=\"$user->name\"/>" . $user->name, + 'href' => "/profile/$user->username", + 'priority' => 1, + )); + } + + elgg_register_menu_item('topbar', array( + 'href' => "#", + 'name' => 'account', + 'priority' => 1000, + 'section' => 'alt', + 'text' => '', + 'data-toggle' => 'dropdown', + )); + + elgg_unregister_menu_item('topbar', 'usersettings'); + elgg_register_menu_item('topbar', array( + 'href' => "/settings/user/$user->username", + 'name' => 'usersettings', + 'parent_name' => 'account', + 'section' => 'alt', + 'text' => elgg_echo('settings:user'), + )); + + if (elgg_is_active_plugin('notifications')) { + elgg_register_menu_item('topbar', array( + 'href' => "/notifications/personal", + 'name' => 'notifications', + 'parent_name' => 'account', + 'section' => 'alt', + 'text' => elgg_echo('notifications:personal'), + )); + } + + elgg_unregister_menu_item('topbar', 'logout'); + elgg_register_menu_item('topbar', array( + 'href' => '/action/logout', + 'is_action' => TRUE, + 'name' => 'logout', + 'parent_name' => 'account', + 'priority' => 1000, //want this to be at the bottom of the list no matter what + 'section' => 'alt', + 'text' => elgg_echo('logout'), + )); + } + +} + +function facebook_theme_dashboard_handler() { + require_once dirname(__FILE__) . '/pages/dashboard.php'; + return true; +} +function cool_theme_credits_handler() { + require_once dirname(__FILE__) . '/pages/credits.php'; + return true; +} +function facebook_theme_index_handler() { + if (elgg_is_logged_in()) { + forward('/dashboard'); + } +} + +function facebook_theme_container_permissions_handler($hook, $type, $result, $params) { + $container = $params['container']; + $subtype = $params['subtype']; + + if ($container instanceof ElggGroup) { + if ($subtype == 'thewire') { + return false; + } + } +} + +function facebook_theme_annotation_permissions_handler($hook, $type, $result, $params) { + $entity = $params['entity']; + $user = $params['user']; + $annotation_name = $params['annotation_name']; + + //Users should not be able to post on their own message board + if ($annotation_name == 'messageboard' && $user->guid == $entity->guid) { + return false; + } + + //No "commenting" on users, must use messageboard + if ($annotation_name == 'generic_comment' && $entity instanceof ElggUser) { + return false; + } + + //No "commenting" on forum topics, must use special "reply" annotation + if ($annotation_name == 'generic_comment' && elgg_instanceof($entity, 'object', 'groupforumtopic')) { + return false; + } + + //Definitely should be able to "like" a forum topic! + if ($annotation_name == 'likes' && elgg_instanceof($entity, 'object', 'groupforumtopic')) { + return true; + } + + if ($annotation_name == 'group_topic_post' && !elgg_instanceof($entity, 'object', 'groupforumtopic')) { + return false; + } +} + +/** + * Adds menu items to the "composer" at the top of the "wall". Need to also add + * the forms that these items point to. + * + * @todo Get the composer concept integrated into core + */ +function facebook_theme_composer_menu_handler($hook, $type, $items, $params) { + $entity = $params['entity']; + + $pageowner = elgg_get_page_owner_entity(); + + if (elgg_is_active_plugin('thewire') && $entity->canWriteToContainer(0, 'object', 'thewire') && $pageowner->username == $_SESSION['user']->username) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'thewire', + 'href' => "/ajax/view/thewire/composer?container_guid=$entity->guid", + 'text' => elgg_view_icon('share') . elgg_echo("composer:object:thewire"), + 'priority' => 100, + )); + + + //trigger any javascript loads that we might need + elgg_view('thewire/composer'); + } + + if (elgg_is_active_plugin('messageboard') && $entity->canAnnotate(0, 'messageboard')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'messageboard', + 'href' => "/ajax/view/messageboard/composer?entity_guid=$entity->guid", + 'text' => elgg_view_icon('speech-bubble-alt') . elgg_echo("composer:annotation:messageboard"), + 'priority' => 200, + )); + + //trigger any javascript loads that we might need + elgg_view('messageboard/composer'); + } + + if (elgg_is_active_plugin('bookmarks') && $entity->canWriteToContainer(0, 'object', 'bookmarks')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'bookmarks', + 'href' => "/ajax/view/bookmarks/composer?container_guid=$entity->guid", + 'text' => elgg_view_icon('push-pin') . elgg_echo("composer:object:bookmarks"), + 'priority' => 300, + )); + + //trigger any javascript loads that we might need + elgg_view('bookmarks/composer'); + } + + if (elgg_is_active_plugin('blog') && $entity->canWriteToContainer(0, 'object', 'blog')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'blog', + 'href' => "/ajax/view/blog/composer?container_guid=$entity->guid", + 'text' => elgg_view_icon('speech-bubble') . elgg_echo("composer:object:blog"), + 'priority' => 600, + )); + + //trigger any javascript loads that we might need + elgg_view('blog/composer'); + } + + if (elgg_is_active_plugin('file') && $entity->canWriteToContainer(0, 'object', 'file')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'file', + 'href' => "/ajax/view/file/composer?container_guid=$entity->guid", + 'text' => elgg_view_icon('clip') . elgg_echo("composer:object:file"), + 'priority' => 700, + )); + + //trigger any javascript loads that we might need + elgg_view('file/composer'); + } + + return $items; +} + +function facebook_theme_group_profile_fields($hook, $type, $fields, $params) { + return array( + 'briefdescription' => 'text', + 'description' => 'longtext', + 'interests' => 'tags', + ); +} + +function facebook_theme_owner_block_menu_handler($hook, $type, $items, $params) { + $owner = elgg_get_page_owner_entity(); + + if ($owner instanceof ElggGroup) { + $items['info'] = ElggMenuItem::factory(array( + 'name' => 'info', + 'text' => elgg_view_icon('info') . elgg_echo('profile:info'), + 'href' => "/groups/info/$owner->guid/" . elgg_get_friendly_title($owner->name), + 'priority' => 2, + )); + + $items['profile'] = ElggMenuItem::factory(array( + 'name' => 'profile', + 'text' => elgg_view_icon('userwall') . elgg_echo('profile:wall'), + 'href' => "/groups/profile/$owner->guid/" . elgg_get_friendly_title($owner->name), + 'priority' => 1, + )); + } + + if ($owner instanceof ElggUser) { + $items['info'] = ElggMenuItem::factory(array( + 'name' => 'info', + 'text' => elgg_view_icon('info') . elgg_echo('profile:info'), + 'href' => "/profile/$owner->username/info", + 'priority' => 2, + )); + + $items['profile'] = ElggMenuItem::factory(array( + 'name' => 'profile', + 'text' => elgg_view_icon('userwall') . elgg_echo('profile:wall'), + 'href' => "/profile/$owner->username", + 'priority' => 1, + )); + + $items['friends'] = ElggMenuItem::factory(array( + 'name' => 'friends', + 'text' => elgg_view_icon('friends') . elgg_echo('friends'), + 'href' => "/friends/$owner->username" + )); + } + $top_level_pages = elgg_get_entities(array( + 'type' => 'object', + 'subtype' => 'page_top', + 'container_guid' => $owner->guid, + 'limit' => 0, + )); + + foreach ($top_level_pages as $page) { + $items["pages-$page->guid"] = ElggMenuItem::factory(array( + 'name' => "pages-$page->guid", + 'href' => $page->getURL(), + 'text' => elgg_view_icon('page') . elgg_view('output/text', array('value' => $page->title)), + )); + } + + return $items; + +} + +function facebook_theme_river_menu_handler($hook, $type, $items, $params) { + $item = $params['item']; + + $object = $item->getObjectEntity(); + if (!elgg_in_context('widgets') && !$item->annotation_id && $object instanceof ElggEntity) { + if (elgg_is_active_plugin('likes') && $object->canAnnotate(0, 'likes')) { + if (!elgg_annotation_exists($object->getGUID(), 'likes')) { + $options = array( + 'name' => 'like', + 'href' => "action/likes/add?guid={$object->guid}", + 'text' => elgg_echo('likes:likethis'), + 'is_action' => true, + 'priority' => 100, + ); + } else { + $options = array( + 'name' => 'like', + 'href' => "action/likes/delete?guid={$object->guid}", + 'text' => elgg_echo('likes:remove'), + 'is_action' => true, + 'priority' => 100, + ); + } + + $items[] = ElggMenuItem::factory($options); + } + + if ($object->canAnnotate(0, 'generic_comment')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'comment', + 'href' => "#comments-add-$object->guid", + 'text' => elgg_echo('comment'), + 'title' => elgg_echo('comment:this'), + 'rel' => "toggle", + 'priority' => 50, + )); + } + + if ($object instanceof ElggUser && !$object->isFriend() && $owner->guid != $user->guid) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'addfriend', + 'href' => "/action/friends/add?friend=$object->guid", + 'text' => elgg_view_icon('addfriend') . elgg_echo('friend:user:add', array($object->name)), + 'is_action' => TRUE, + )); + } + if (elgg_instanceof($object, 'object', 'groupforumtopic')) { + $items[] = ElggMenuItem::factory(array( + 'name' => 'reply', + 'href' => "#groups-reply-$object->guid", + 'title' => elgg_echo('reply:this'), + 'text' => elgg_echo('reply'), + )); + } + } + + return $items; +} + +/** + * Profile page handler + * + * @param array $page Array of page elements, forwarded by the page handling mechanism + */ +function facebook_theme_profile_page_handler($page) { + if (isset($page[0])) { + $username = $page[0]; + $user = get_user_by_username($username); + elgg_set_page_owner_guid($user->guid); + } + + // short circuit if invalid or banned username + if (!$user || ($user->isBanned() && !elgg_is_admin_logged_in())) { + register_error(elgg_echo('profile:notfound')); + forward(); + } + + $action = NULL; + if (isset($page[1])) { + $action = $page[1]; + } + + switch ($action) { + case 'edit': + // use for the core profile edit page + global $CONFIG; + global $autofeed; + $autofeed = false; + require $CONFIG->path . 'pages/profile/edit.php'; + break; + + case 'info': + require dirname(__FILE__) . '/pages/profile/info.php'; + break; + + case 'wall': + require dirname(__FILE__) . '/pages/profile/wall.php'; + break; + + default: + if (elgg_is_logged_in()) { + require dirname(__FILE__) . '/pages/profile/wall.php'; + } else { + require dirname(__FILE__) . '/pages/profile/info.php'; + } + break; + } + + return true; +} + +elgg_register_event_handler('init', 'system', 'cool_theme_init'); \ No newline at end of file diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php new file mode 100644 index 000000000..d15ae2325 --- /dev/null +++ b/views/default/annotation/generic_comment.php @@ -0,0 +1,72 @@ +entity_guid); +$commenter = get_user($comment->owner_guid); +if (!$entity || !$commenter) { + return true; +} + +$friendlytime = elgg_view_friendly_time($comment->time_created); + +$commenter_icon = elgg_view_entity_icon($commenter, 'tiny'); +$commenter_link = "getURL()}\" class=\"elgg-river-subject\">$commenter->name"; + +$entity_title = $entity->title ? $entity->title : elgg_echo('untitled'); +$entity_link = "getURL()}\">$entity_title"; + +if ($full_view) { + + $delete_button = ''; + if ($comment->canEdit()) { + $url = "action/comments/delete?annotation_id=$comment->id"; + $delete_button = elgg_view("output/confirmlink", array( + 'href' => $url, + 'class' => 'right', + 'text' => elgg_view_icon('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + 'text_encode' => false, + )); + } + + $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); + + $body = << + $friendlytime + +HTML; + + echo elgg_view_image_block($commenter_icon, $body); + +} else { + // brief view + + //@todo need link to actual comment! + + $on = elgg_echo('on'); + + $body = << + $commenter_link $on $entity_link ($friendlytime) + +HTML; + + echo elgg_view_image_block($commenter_icon, $body); +} \ No newline at end of file diff --git a/views/default/blog/composer.php b/views/default/blog/composer.php new file mode 100644 index 000000000..135e70015 --- /dev/null +++ b/views/default/blog/composer.php @@ -0,0 +1,10 @@ + +/*