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/bookmarks/actions/add.php | 72 +++++++ mod/bookmarks/actions/delete.php | 32 +++ mod/bookmarks/add.php | 46 +++++ mod/bookmarks/bookmarklet.php | 35 ++++ mod/bookmarks/everyone.php | 35 ++++ mod/bookmarks/friends.php | 28 +++ mod/bookmarks/inbox.php | 28 +++ mod/bookmarks/index.php | 36 ++++ mod/bookmarks/languages/en.php | 79 ++++++++ mod/bookmarks/manifest.xml | 10 + mod/bookmarks/start.php | 214 +++++++++++++++++++++ .../views/default/bookmarks/bookmarklet.php | 32 +++ mod/bookmarks/views/default/bookmarks/css.php | 125 ++++++++++++ mod/bookmarks/views/default/bookmarks/form.php | 139 +++++++++++++ .../views/default/bookmarks/owner_block.php | 9 + mod/bookmarks/views/default/bookmarks/sharing.php | 80 ++++++++ mod/bookmarks/views/default/object/bookmarks.php | 145 ++++++++++++++ .../default/river/object/bookmarks/annotate.php | 13 ++ .../default/river/object/bookmarks/create.php | 15 ++ .../views/default/widgets/bookmarks/edit.php | 18 ++ .../views/default/widgets/bookmarks/view.php | 65 +++++++ mod/bookmarks/views/rss/object/bookmarks.php | 18 ++ 22 files changed, 1274 insertions(+) create mode 100644 mod/bookmarks/actions/add.php create mode 100644 mod/bookmarks/actions/delete.php create mode 100644 mod/bookmarks/add.php create mode 100644 mod/bookmarks/bookmarklet.php create mode 100644 mod/bookmarks/everyone.php create mode 100644 mod/bookmarks/friends.php create mode 100644 mod/bookmarks/inbox.php create mode 100644 mod/bookmarks/index.php create mode 100644 mod/bookmarks/languages/en.php create mode 100644 mod/bookmarks/manifest.xml create mode 100644 mod/bookmarks/start.php create mode 100644 mod/bookmarks/views/default/bookmarks/bookmarklet.php create mode 100644 mod/bookmarks/views/default/bookmarks/css.php create mode 100644 mod/bookmarks/views/default/bookmarks/form.php create mode 100644 mod/bookmarks/views/default/bookmarks/owner_block.php create mode 100644 mod/bookmarks/views/default/bookmarks/sharing.php create mode 100644 mod/bookmarks/views/default/object/bookmarks.php create mode 100644 mod/bookmarks/views/default/river/object/bookmarks/annotate.php create mode 100644 mod/bookmarks/views/default/river/object/bookmarks/create.php create mode 100644 mod/bookmarks/views/default/widgets/bookmarks/edit.php create mode 100644 mod/bookmarks/views/default/widgets/bookmarks/view.php create mode 100644 mod/bookmarks/views/rss/object/bookmarks.php (limited to 'mod/bookmarks') diff --git a/mod/bookmarks/actions/add.php b/mod/bookmarks/actions/add.php new file mode 100644 index 000000000..a074719b1 --- /dev/null +++ b/mod/bookmarks/actions/add.php @@ -0,0 +1,72 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + gatekeeper(); + + $title = get_input('title'); + $guid = get_input('bookmark_guid',0); + $description = get_input('description'); + $address = get_input('address'); + $access = get_input('access'); + $shares = get_input('shares',array()); + + $tags = get_input('tags'); + $tagarray = string_to_tag_array($tags); + + if ($guid == 0) { + + $entity = new ElggObject; + $entity->subtype = "bookmarks"; + $entity->owner_guid = $_SESSION['user']->getGUID(); + $entity->container_guid = (int)get_input('container_guid', $_SESSION['user']->getGUID()); + + } else { + + $canedit = false; + if ($entity = get_entity($guid)) { + if ($entity->canEdit()) { + $canedit = true; + } + } + if (!$canedit) { + system_message(elgg_echo('notfound')); + forward("pg/bookmarks"); + } + + } + + $entity->title = $title; + $entity->address = $address; + $entity->description = $description; + $entity->access_id = $access; + $entity->tags = $tagarray; + + if ($entity->save()) { + $entity->clearRelationships(); + $entity->shares = $shares; + + if (is_array($shares) && sizeof($shares) > 0) { + foreach($shares as $share) { + $share = (int) $share; + add_entity_relationship($entity->getGUID(),'share',$share); + } + } + system_message(elgg_echo('bookmarks:save:success')); + //add to river + add_to_river('river/object/bookmarks/create','create',$_SESSION['user']->guid,$entity->guid); + forward($entity->getURL()); + } else { + register_error(elgg_echo('bookmarks:save:failed')); + forward("pg/bookmarks"); + } + +?> diff --git a/mod/bookmarks/actions/delete.php b/mod/bookmarks/actions/delete.php new file mode 100644 index 000000000..217197b24 --- /dev/null +++ b/mod/bookmarks/actions/delete.php @@ -0,0 +1,32 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + $guid = get_input('bookmark_guid',0); + if ($entity = get_entity($guid)) { + + if ($entity->canEdit()) { + + if ($entity->delete()) { + + system_message(elgg_echo("bookmarks:delete:success")); + forward("pg/bookmarks/"); + + } + + } + + } + + register_error(elgg_echo("bookmarks:delete:failed")); + forward("pg/bookmarks/"); + +?> \ No newline at end of file diff --git a/mod/bookmarks/add.php b/mod/bookmarks/add.php new file mode 100644 index 000000000..030cec450 --- /dev/null +++ b/mod/bookmarks/add.php @@ -0,0 +1,46 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // You need to be logged in for this one + gatekeeper(); + + // Get the current page's owner + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); + } + if ($page_owner instanceof ElggGroup) + $container = $page_owner->guid; + + $area2 .= elgg_view_title(elgg_echo('bookmarks:this'), false); + + // If we've been given a bookmark to edit, grab it + if ($this_guid = get_input('bookmark',0)) { + $entity = get_entity($this_guid); + if ($entity->canEdit()) { + $area2 .= elgg_view('bookmarks/form',array('entity' => $entity, 'container_guid' => $container)); + } + } else { + $area2 .= elgg_view('bookmarks/form', array('container_guid' => $container)); + } + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw(elgg_echo('bookmarks:add'),$body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php new file mode 100644 index 000000000..7e24a55c6 --- /dev/null +++ b/mod/bookmarks/bookmarklet.php @@ -0,0 +1,35 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + gatekeeper(); + + // Get the current page's owner + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner) && ($_SESSION['user'])) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); + } + + // List bookmarks + $area2 = elgg_view_title(elgg_echo('bookmarks:bookmarklet')); + $area2 .= elgg_view('bookmarks/bookmarklet', array('pg_owner' => $page_owner)); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw(elgg_echo('bookmarks:bookmarklet'),$body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/everyone.php b/mod/bookmarks/everyone.php new file mode 100644 index 000000000..70e60da2c --- /dev/null +++ b/mod/bookmarks/everyone.php @@ -0,0 +1,35 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // Get the current page's owner + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($_SESSION['guid']); + } + + // List bookmarks + $area2 = elgg_view_title(elgg_echo('bookmarks:everyone')); + set_context('search'); + $area2 .= elgg_list_entities(array('type' => 'object', 'subtype' => 'bookmarks', 'limit' => 10, 'full_view' => FALSE, 'view_toggle_type' => FALSE)); + set_context('bookmarks'); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw(elgg_echo('bookmarks:everyone'),$body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/friends.php b/mod/bookmarks/friends.php new file mode 100644 index 000000000..8d61f47d2 --- /dev/null +++ b/mod/bookmarks/friends.php @@ -0,0 +1,28 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // List bookmarks + $area2 = elgg_view_title(elgg_echo('bookmarks:friends')); + set_context('search'); + $area2 .= list_user_friends_objects(page_owner(),'bookmarks',10,false,false); + set_context('bookmarks'); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw(elgg_echo('bookmarks:friends'),$body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/inbox.php b/mod/bookmarks/inbox.php new file mode 100644 index 000000000..061a51e18 --- /dev/null +++ b/mod/bookmarks/inbox.php @@ -0,0 +1,28 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // List bookmarks + $area2 = elgg_view_title(elgg_echo('bookmarks:inbox')); + set_context('search'); + $area2 .= list_entities_from_relationship('share',page_owner(),true,'object','bookmarks'); + set_context('bookmarks'); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw(elgg_echo('bookmarks:inbox'),$body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/index.php b/mod/bookmarks/index.php new file mode 100644 index 000000000..195327ebe --- /dev/null +++ b/mod/bookmarks/index.php @@ -0,0 +1,36 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); + } + + $title = sprintf(elgg_echo('bookmarks:read'), $page_owner->name); + + // List bookmarks + $area2 = elgg_view_title($title); + set_context('search'); + $area2 .= elgg_list_entities(array('type' => 'object', 'subtype' => 'bookmarks', 'container_guid' => page_owner(), 'limit' => 10, 'full_view' => FALSE, 'view_type_toggle' => FALSE)); + set_context('bookmarks'); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + // Draw it + page_draw($title, $body); + +?> \ No newline at end of file diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php new file mode 100644 index 000000000..da8476aa2 --- /dev/null +++ b/mod/bookmarks/languages/en.php @@ -0,0 +1,79 @@ + "Bookmarks", + 'bookmarks:add' => "Add bookmark", + 'bookmarks:read' => "%s's bookmarked items", + 'bookmarks:friends' => "Friends' bookmarks", + 'bookmarks:everyone' => "All site bookmarks", + 'bookmarks:this' => "Bookmark this", + 'bookmarks:this:group' => "Bookmark in %s", + 'bookmarks:bookmarklet' => "Get bookmarklet", + 'bookmarks:bookmarklet:group' => "Get group bookmarklet", + 'bookmarks:inbox' => "Bookmarks inbox", + 'bookmarks:more' => "More", + 'bookmarks:shareditem' => "Bookmarked item", + 'bookmarks:with' => "Share with", + 'bookmarks:new' => "A new bookmarked item", + 'bookmarks:via' => "via bookmarks", + 'bookmarks:address' => "Address of the resource to bookmark", + + 'bookmarks:delete:confirm' => "Are you sure you want to delete this resource?", + + 'bookmarks:numbertodisplay' => 'Number of bookmarked items to display', + + 'bookmarks:shared' => "Bookmarked", + 'bookmarks:visit' => "Visit resource", + 'bookmarks:recent' => "Recent bookmarks", + + 'bookmarks:river:created' => '%s bookmarked', + 'bookmarks:river:annotate' => 'a comment on this bookmarked item', + 'bookmarks:river:item' => 'an item', + + 'item:object:bookmarks' => 'Bookmarked items', + + 'bookmarks:group' => 'Group bookmarks', + 'bookmarks:enablebookmarks' => 'Enable group bookmarks', + + + /** + * More text + */ + + 'bookmarks:widget:description' => + "This widget is designed for your dashboard and will show you the latest items in your bookmarks inbox.", + + 'bookmarks:bookmarklet:description' => + "The bookmarks bookmarklet allows you to share any resource you find on the web with your friends, or just bookmark it for yourself. To use it, simply drag the following button to your browser's links bar:", + + 'bookmarks:bookmarklet:descriptionie' => + "If you are using Internet Explorer, you will need to right click on the bookmarklet icon, select 'add to favorites', and then the Links bar.", + + 'bookmarks:bookmarklet:description:conclusion' => + "You can then save any page you visit by clicking it at any time.", + + /** + * Status messages + */ + + 'bookmarks:save:success' => "Your item was successfully bookmarked.", + 'bookmarks:delete:success' => "Your bookmarked item was successfully deleted.", + + /** + * Error messages + */ + + 'bookmarks:save:failed' => "Your bookmarked item could not be saved. Please try again.", + 'bookmarks:delete:failed' => "Your bookmarked item could not be deleted. Please try again.", + + + ); + + add_translation("en",$english); + +?> \ No newline at end of file diff --git a/mod/bookmarks/manifest.xml b/mod/bookmarks/manifest.xml new file mode 100644 index 000000000..687b62a7e --- /dev/null +++ b/mod/bookmarks/manifest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php new file mode 100644 index 000000000..9b7e1566b --- /dev/null +++ b/mod/bookmarks/start.php @@ -0,0 +1,214 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +// Bookmarks initialisation function +function bookmarks_init() { + + // Grab the config global + global $CONFIG; + + //add a tools menu option + if (isloggedin()) { + add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . '/items'); + + // add "bookmark this" to owner block + elgg_extend_view('owner_block/extend', 'bookmarks/owner_block'); + } + + // Register a page handler, so we can have nice URLs + register_page_handler('bookmarks','bookmarks_page_handler'); + + // Add our CSS + elgg_extend_view('css','bookmarks/css'); + + // Register granular notification for this type + if (is_callable('register_notification_object')) { + register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new')); + } + + // Listen to notification events and supply a more useful message + register_plugin_hook('notify:entity:message', 'object', 'bookmarks_notify_message'); + + // Register a URL handler for shared items + register_entity_url_handler('bookmark_url','object','bookmarks'); + + // Shares widget + add_widget_type('bookmarks',elgg_echo("bookmarks:recent"),elgg_echo("bookmarks:widget:description")); + + // Register entity type + register_entity_type('object','bookmarks'); + + // Add group menu option + add_group_tool_option('bookmarks',elgg_echo('bookmarks:enablebookmarks'),true); + +} + +/** + * Sidebar menu for bookmarks + * + */ +function bookmarks_pagesetup() { + global $CONFIG; + + $page_owner = page_owner_entity(); + + //add submenu options + if (get_context() == "bookmarks") { + + if (isloggedin()) { + // link to add bookmark form + if ($page_owner instanceof ElggGroup) { + if ($page_owner->isMember(get_loggedin_user())) { + add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/" . $page_owner->username . "/add"); + } + } else { + add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/" . $_SESSION['user']->username . "/add"); + add_submenu_item(elgg_echo('bookmarks:inbox'),$CONFIG->wwwroot."pg/bookmarks/" . $_SESSION['user']->username . "/inbox"); + } + if (page_owner()) { + add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name),$CONFIG->wwwroot."pg/bookmarks/" . $page_owner->username . "/items"); + } + if (!$page_owner instanceof ElggGroup) { + add_submenu_item(elgg_echo('bookmarks:friends'),$CONFIG->wwwroot."pg/bookmarks/" . $_SESSION['user']->username . "/friends"); + } + } + + if (!$page_owner instanceof ElggGroup) { + add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."mod/bookmarks/everyone.php"); + } + + // Bookmarklet + if ((isloggedin()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { + + $bmtext = elgg_echo('bookmarks:bookmarklet'); + if ($page_owner instanceof ElggGroup) { + $bmtext = elgg_echo('bookmarks:bookmarklet:group'); + } + add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet"); + } + + } + + if ($page_owner instanceof ElggGroup && get_context() == 'groups') { + if ($page_owner->bookmarks_enable != "no") { + add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items'); + } + } + +} + +/** + * Bookmarks page handler; allows the use of fancy URLs + * + * @param array $page From the page_handler function + * @return true|false Depending on success + */ +function bookmarks_page_handler($page) { + + // The first component of a bookmarks URL is the username + if (isset($page[0])) { + set_input('username',$page[0]); + } + + // The second part dictates what we're doing + if (isset($page[1])) { + switch($page[1]) { + case "read": set_input('guid',$page[2]); + require(dirname(dirname(dirname(__FILE__))) . "/entities/index.php"); + return true; + break; + case "friends": include(dirname(__FILE__) . "/friends.php"); + return true; + break; + case "inbox": include(dirname(__FILE__) . "/inbox.php"); + return true; + break; + case "items": include(dirname(__FILE__) . "/index.php"); + return true; + break; + case "add": include(dirname(__FILE__) . "/add.php"); + return true; + break; + case "bookmarklet": include(dirname(__FILE__) . "/bookmarklet.php"); + return true; + break; + } + // If the URL is just 'bookmarks/username', or just 'bookmarks/', load the standard bookmarks index + } else { + include(dirname(__FILE__) . "/index.php"); + return true; + } + + return false; + +} + +/** + * Populates the ->getUrl() method for bookmarked objects + * + * @param ElggEntity $entity The bookmarked object + * @return string bookmarked item URL + */ +function bookmark_url($entity) { + + global $CONFIG; + $title = $entity->title; + $title = friendly_title($title); + return $CONFIG->url . "pg/bookmarks/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title; + +} + +/** + * Returns a more meaningful message + * + * @param unknown_type $hook + * @param unknown_type $entity_type + * @param unknown_type $returnvalue + * @param unknown_type $params + */ +function bookmarks_notify_message($hook, $entity_type, $returnvalue, $params) { + $entity = $params['entity']; + $to_entity = $params['to_entity']; + $method = $params['method']; + if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'bookmarks')) { + $descr = $entity->description; + $title = $entity->title; + global $CONFIG; + $url = $CONFIG->wwwroot . "pg/view/" . $entity->guid; + if ($method == 'sms') { + $owner = $entity->getOwnerEntity(); + return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $url . ' (' . $title . ')'; + } + if ($method == 'email') { + $owner = $entity->getOwnerEntity(); + return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL(); + } + if ($method == 'web') { + $owner = $entity->getOwnerEntity(); + return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL(); + } + + } + return null; +} + + +// Make sure the initialisation function is called on initialisation +register_elgg_event_handler('init','system','bookmarks_init'); +register_elgg_event_handler('pagesetup','system','bookmarks_pagesetup'); + +// Register actions +global $CONFIG; +register_action('bookmarks/add',false,$CONFIG->pluginspath . "bookmarks/actions/add.php"); +register_action('bookmarks/delete',false,$CONFIG->pluginspath . "bookmarks/actions/delete.php"); + +?> \ No newline at end of file diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php new file mode 100644 index 000000000..b7a4757f6 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -0,0 +1,32 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + $page_owner = $vars['pg_owner']; + + $bookmarktext = elgg_echo("bookmarks:this"); + if ($page_owner instanceof ElggGroup) + $bookmarktext = sprintf(elgg_echo("bookmarks:this:group"), $page_owner->name) +?> +
+

+ +

+ +

+ +

+

+ +

+
\ No newline at end of file diff --git a/mod/bookmarks/views/default/bookmarks/css.php b/mod/bookmarks/views/default/bookmarks/css.php new file mode 100644 index 000000000..71d2d9ed6 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/css.php @@ -0,0 +1,125 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +?> + +.sharing_item { + +} + +.sharing_item_owner { + font-size: 90%; + margin: 10px 0 0 0; + color:#666666; +} + +.sharing_item_owner .icon { + float: left; + margin-right: 5px; + +} +.sharing_item_title h3 { + font-size: 150%; + margin-bottom: 5px; +} +.sharing_item_title h3 a { + text-decoration: none; +} +.sharing_item_description p { + margin:0; + padding:0 0 5px 0; +} +.sharing_item_tags { + background:transparent url(_graphics/icon_tag.gif) no-repeat scroll left 2px; + margin:0; + padding:0 0 0 14px; +} + +.sharing_item_address a { + font: 12px/100% Arial, Helvetica, sans-serif; + font-weight: bold; + color: #ffffff; + background:#4690d6; + border: 1px solid #4690d6; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + width: auto; + height: 25px; + padding: 2px 6px 2px 6px; + margin:10px 0 10px 0; + cursor: pointer; +} +.sharing_item_address a:hover { + background: #0054a7; + border: 1px solid #0054a7; + text-decoration: none; +} +.sharing_item_controls p { + margin:0; +} + + + +/* SHARES WIDGET VIEW */ +.shares_widget_wrapper { + background-color: white; + margin:0 10px 5px 10px; + padding:5px; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; +} +.shares_widget_icon { + float: left; + margin-right: 10px; +} +.shares_timestamp { + color:#666666; + margin:0; +} +.share_desc { + display:none; + line-height: 1.2em; +} +.shares_widget_content { + margin-left: 35px; +} +.shares_title { + margin:0; + line-height: 1.2em; +} + +/* timestamp and user info in gallery and list view */ +.search_listing_info .shares_gallery_user, +.share_gallery_info .shares_gallery_user, +.share_gallery_info .shares_gallery_comments { + color:#666666; + margin:0; + font-size: 90%; +} + + +/* *************************************** +PAGE-OWNER BLOCK +*************************************** */ +#owner_block_bookmark_this { + padding:5px 0 0 0; +} +#owner_block_bookmark_this a { + font-size: 90%; + color:#999999; + padding:0 0 4px 20px; + background: url(_graphics/icon_bookmarkthis.gif) no-repeat left top; +} +#owner_block_bookmark_this a:hover { + color: #0054a7; +} + diff --git a/mod/bookmarks/views/default/bookmarks/form.php b/mod/bookmarks/views/default/bookmarks/form.php new file mode 100644 index 000000000..94897d0b0 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/form.php @@ -0,0 +1,139 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Have we been supplied with an entity? + if (isset($vars['entity'])) { + + $guid = $vars['entity']->getGUID(); + $title = $vars['entity']->title; + $description = $vars['entity']->description; + $address = $vars['entity']->address; + $tags = $vars['entity']->tags; + $access_id = $vars['entity']->access_id; + $shares = $vars['entity']->shares; + $owner = $vars['entity']->getOwnerEntity(); + $highlight = 'default'; + + } else { + + $guid = 0; + $title = get_input('title',""); + $description = ""; + $address = get_input('address',""); + $highlight = 'all'; + + if ($address == "previous") + $address = $_SERVER['HTTP_REFERER']; + $tags = array(); + + if (defined('ACCESS_DEFAULT')) + $access_id = ACCESS_DEFAULT; + else + $access_id = 0; + $shares = array(); + $owner = $vars['user']; + + } + +?> +
+
+ +

+ +

+

+ +

+

+ +

+

+ +

+ $shares, 'owner' => $owner)); + if ($friends = elgg_get_entities_from_relationship(array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) { +?> +

+
+ $friends, 'internalname' => 'shares', 'highlight' => $highlight)); +?> +

+ +

+ +

+

+ 'container_guid', 'value' => $vars['container_guid'])) : ""; ?> + + +

+ +
+
\ No newline at end of file diff --git a/mod/bookmarks/views/default/bookmarks/owner_block.php b/mod/bookmarks/views/default/bookmarks/owner_block.php new file mode 100644 index 000000000..2cc8f6118 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/owner_block.php @@ -0,0 +1,9 @@ + +
+ +
diff --git a/mod/bookmarks/views/default/bookmarks/sharing.php b/mod/bookmarks/views/default/bookmarks/sharing.php new file mode 100644 index 000000000..63738d94d --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/sharing.php @@ -0,0 +1,80 @@ + 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) { + +?> + + + +"; + + $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny')); + $options[$label] = $friend->getGUID(); + +?> + + + + + +"; + + } + + + } + if ($col != 3) { + echo ""; + } + + +?> + +
+ + + + + +
+ +
+
+ name; + + ?> +
+ + 'shares', + 'options' => $options, + 'value' => $vars['shares'], + + )); */ + + } + +?> \ No newline at end of file diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php new file mode 100644 index 000000000..45ed46769 --- /dev/null +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -0,0 +1,145 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + + if (get_context() == "search") { + + if (get_input('search_viewtype') == "gallery") { + + $parsed_url = parse_url($vars['entity']->address); + $faviconurl = $parsed_url['scheme'] . "://" . $parsed_url['host'] . "/favicon.ico"; + + $info = ""; + $info .= ""; + $numcomments = elgg_count_comments($vars['entity']); + if ($numcomments) + $info .= ""; + + //display + echo ""; + + + } else { + + $parsed_url = parse_url($vars['entity']->address); + $faviconurl = $parsed_url['scheme'] . "://" . $parsed_url['host'] . "/favicon.ico"; + if (@file_exists($faviconurl)) { + $icon = ""; + } else { + $icon = elgg_view( + "profile/icon", array( + 'entity' => $owner, + 'size' => 'small', + ) + ); + } + + $info = ""; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $numcomments = elgg_count_comments($vars['entity']); + if ($numcomments) + $info .= ", getURL()}\">".sprintf(elgg_echo("comments")). " (" . $numcomments . ")"; + $info .= "

"; + echo elgg_view_listing($icon, $info); + + } + + } else { + +?> + +
+ +
+ + + \ No newline at end of file diff --git a/mod/bookmarks/views/default/river/object/bookmarks/annotate.php b/mod/bookmarks/views/default/river/object/bookmarks/annotate.php new file mode 100644 index 000000000..ce3945a2d --- /dev/null +++ b/mod/bookmarks/views/default/river/object/bookmarks/annotate.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("bookmarks:river:annotate"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("bookmarks:river:item") . ""; + +?> + + \ No newline at end of file diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php new file mode 100644 index 000000000..9e89a95de --- /dev/null +++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php @@ -0,0 +1,15 @@ +subject_guid); // $statement->getSubject(); + $object = get_entity($vars['item']->object_guid); + $url = $object->getURL(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("bookmarks:river:created"),$url) . " "; + $string .= "getURL() . "\">" . $object->title . ""; //elgg_echo("bookmarks:river:item") . ""; + +?> + + \ No newline at end of file diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php new file mode 100644 index 000000000..c399fd6d1 --- /dev/null +++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php @@ -0,0 +1,18 @@ + +

+ : + +

\ No newline at end of file diff --git a/mod/bookmarks/views/default/widgets/bookmarks/view.php b/mod/bookmarks/views/default/widgets/bookmarks/view.php new file mode 100644 index 000000000..b7c35d2b8 --- /dev/null +++ b/mod/bookmarks/views/default/widgets/bookmarks/view.php @@ -0,0 +1,65 @@ + + + + num_display; + + //if no number has been set, default to 4 + if(!$num) + $num = 4; + + //grab the users bookmarked items + $shares = elgg_get_entities(array('types' => 'object', 'subtypes' => 'bookmarks', 'container_guid' => $vars['entity']->owner_guid, 'limit' => $num, 'offset' => 0)); + + if($shares){ + + foreach($shares as $s){ + + //get the owner + $owner = $s->getOwnerEntity(); + + //get the time + $friendlytime = friendly_time($s->time_created); + + //get the user icon + $icon = elgg_view( + "profile/icon", array( + 'entity' => $owner, + 'size' => 'tiny', + ) + ); + + //get the bookmark title + $info = "

getURL()}\">{$s->title}

"; + + //get the user details + $info .= "

getURL()}\">{$owner->name} {$friendlytime}

"; + + //get the bookmark description + if($s->description) + $info .= "".elgg_echo('bookmarks:more')."

{$s->description}

"; + + //display + echo "
"; + echo "
" . $icon . "
"; + echo "
" . $info . "
"; + echo "
"; + + } + + $user_inbox = $vars['url'] . "pg/bookmarks/" . page_owner_entity()->username . "/inbox"; + echo "
".elgg_echo('bookmarks:inbox')."
"; + + } + + + ?> \ No newline at end of file diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php new file mode 100644 index 000000000..0dc38186e --- /dev/null +++ b/mod/bookmarks/views/rss/object/bookmarks.php @@ -0,0 +1,18 @@ +title; + if (empty($title)) { + $title = substr($vars['entity']->description,0,32); + if (strlen($vars['entity']->description) > 32) + $title .= " ..."; + } + +?> + + + getURL(); ?> + time_created) ?> + address; ?> + <![CDATA[<?php echo $title; ?>]]> + description)); ?>]]> + -- cgit v1.2.3