-<?php\r
-/**\r
- * Elgg profile commentwall: add message action\r
- */\r
-\r
-// Make sure we're logged in; forward to the front page if not\r
-if (!isloggedin()) forward();\r
- \r
-// Get input\r
-$message_content = get_input('message_content'); // the actual message\r
-$page_owner = get_input("pageOwner"); // the message board owner\r
-$message_owner = get_input("guid"); // the user posting the message\r
-$user = get_entity($page_owner); // the commentwall owner details\r
- \r
-// Let's see if we can get a user entity from the specified page_owner\r
-if ($user && !empty($message_content)) {\r
- \r
- // If posting the comment was successful, say so\r
- if ($user->annotate('commentwall',$message_content,$user->access_id, $_SESSION['user']->getGUID())) {\r
- \r
- global $CONFIG;\r
- \r
- if ($user->getGUID() != $_SESSION['user']->getGUID())\r
- notify_user($user->getGUID(), $_SESSION['user']->getGUID(), elgg_echo('profile:comment:subject'), \r
- sprintf(\r
- elgg_echo('profile:comment:body'),\r
- $_SESSION['user']->name,\r
- $message_content,\r
- $CONFIG->wwwroot . "pg/profile/" . $user->username,\r
- $_SESSION['user']->name,\r
- $_SESSION['user']->getURL()\r
- )\r
- ); \r
- \r
- system_message(elgg_echo("profile:commentwall:posted"));\r
- // add to river\r
- add_to_river('river/object/profile/commentwall/create','commentwall',$_SESSION['user']->guid,$user->guid);\r
- \r
- } else {\r
- register_error(elgg_echo("profile:commentwall:failure"));\r
- }\r
- \r
-} else {\r
- register_error(elgg_echo("profile:commentwall:blank"));\r
-}\r
- \r
-// Forward back to the messageboard\r
+<?php
+/**
+ * Elgg profile commentwall: add message action
+ */
+
+// Make sure we're logged in; forward to the front page if not
+if (!isloggedin()) forward();
+
+// Get input
+$message_content = get_input('message_content'); // the actual message
+$page_owner = get_input("pageOwner"); // the message board owner
+$message_owner = get_input("guid"); // the user posting the message
+$user = get_entity($page_owner); // the commentwall owner details
+
+// Let's see if we can get a user entity from the specified page_owner
+if ($user && !empty($message_content)) {
+
+ // If posting the comment was successful, say so
+ if ($user->annotate('commentwall',$message_content,$user->access_id, $_SESSION['user']->getGUID())) {
+
+ global $CONFIG;
+
+ if ($user->getGUID() != $_SESSION['user']->getGUID())
+ notify_user($user->getGUID(), $_SESSION['user']->getGUID(), elgg_echo('profile:comment:subject'),
+ sprintf(
+ elgg_echo('profile:comment:body'),
+ $_SESSION['user']->name,
+ $message_content,
+ $CONFIG->wwwroot . "pg/profile/" . $user->username,
+ $_SESSION['user']->name,
+ $_SESSION['user']->getURL()
+ )
+ );
+
+ system_message(elgg_echo("profile:commentwall:posted"));
+ // add to river
+ add_to_river('river/object/profile/commentwall/create','commentwall',$_SESSION['user']->guid,$user->guid);
+
+ } else {
+ register_error(elgg_echo("profile:commentwall:failure"));
+ }
+
+} else {
+ register_error(elgg_echo("profile:commentwall:blank"));
+}
+
+// Forward back to the messageboard
forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file
-<?php\r
-/**\r
- * Elgg profile commentwall: delete message action\r
- */\r
-\r
-// Ensure we're logged in\r
-if (!isloggedin()) forward();\r
- \r
-// Make sure we can get the comment in question\r
-$annotation_id = (int) get_input('annotation_id');\r
- \r
-//make sure that there is a message on the commentwall matching the passed id\r
-if ($message = get_annotation($annotation_id)) {\r
- //grab the user or group entity\r
- $entity = get_entity($message->entity_guid);\r
- //check to make sure the current user can actually edit the commentwall\r
- if ($message->canEdit()) {\r
- //delete the comment\r
- $message->delete();\r
- //display message\r
- system_message(elgg_echo("profile:commentwall:deleted"));\r
- forward($_SERVER['HTTP_REFERER']);\r
- }\r
- \r
-} else {\r
- system_message(elgg_echo("profile:commentwall:notdeleted"));\r
-}\r
- \r
+<?php
+/**
+ * Elgg profile commentwall: delete message action
+ */
+
+// Ensure we're logged in
+if (!isloggedin()) forward();
+
+// Make sure we can get the comment in question
+$annotation_id = (int) get_input('annotation_id');
+
+//make sure that there is a message on the commentwall matching the passed id
+if ($message = get_annotation($annotation_id)) {
+ //grab the user or group entity
+ $entity = get_entity($message->entity_guid);
+ //check to make sure the current user can actually edit the commentwall
+ if ($message->canEdit()) {
+ //delete the comment
+ $message->delete();
+ //display message
+ system_message(elgg_echo("profile:commentwall:deleted"));
+ forward($_SERVER['HTTP_REFERER']);
+ }
+
+} else {
+ system_message(elgg_echo("profile:commentwall:notdeleted"));
+}
+
forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file
-<?php\r
-/**\r
- * Elgg profile plugin edit default profile action\r
- *\r
- * @package ElggProfile\r
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
- * @author Curverider Ltd <info@elgg.com>\r
- * @copyright Curverider Ltd 2008-2010\r
- * @link http://elgg.com/\r
- */\r
-\r
-admin_gatekeeper();\r
-\r
-$field = get_input('field');\r
-$text = get_input('value');\r
-\r
-set_plugin_setting("admin_defined_profile_{$field}",$text,'profile');\r
-\r
-echo $text;\r
-\r
+<?php
+/**
+ * Elgg profile plugin edit default profile action
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+admin_gatekeeper();
+
+$field = get_input('field');
+$text = get_input('value');
+
+set_plugin_setting("admin_defined_profile_{$field}",$text,'profile');
+
+echo $text;
+
exit;
\ No newline at end of file
-<?php\r
-/**\r
- * Elgg profile plugin reorder fields\r
- *\r
- * @package ElggProfile\r
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
- * @author Curverider Ltd <info@elgg.com>\r
- * @copyright Curverider Ltd 2008-2010\r
- * @link http://elgg.com/\r
- */\r
-\r
-admin_gatekeeper();\r
-$ordering = get_input('fieldorder');\r
-//if (!empty($ordering))\r
-$result = set_plugin_setting('user_defined_fields',$ordering,'profile');\r
-\r
+<?php
+/**
+ * Elgg profile plugin reorder fields
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+admin_gatekeeper();
+$ordering = get_input('fieldorder');
+//if (!empty($ordering))
+$result = set_plugin_setting('user_defined_fields',$ordering,'profile');
+
exit;
\ No newline at end of file
-<?php\r
-/**\r
- * Elgg Commentwall display page\r
- */\r
- \r
-// If there is any content to view, view it\r
-if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) {\r
- \r
- //start the div which will wrap all the message board contents\r
- echo "<div id='comment_wall_display'>";\r
- \r
- //loop through all annotations and display\r
- foreach($vars['annotation'] as $content) {\r
- echo elgg_view("profile/commentwall/commentwall_content", array('annotation' => $content));\r
- }\r
- \r
- //close the wrapper div\r
- echo "</div>";\r
- \r
-} else {\r
- echo "<p class='margin_top'>" . elgg_echo("profile:commentwall:none") . "</p>";\r
+<?php
+/**
+ * Elgg Commentwall display page
+ */
+
+// If there is any content to view, view it
+if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) {
+
+ //start the div which will wrap all the message board contents
+ echo "<div id='comment_wall_display'>";
+
+ //loop through all annotations and display
+ foreach($vars['annotation'] as $content) {
+ echo elgg_view("profile/commentwall/commentwall_content", array('annotation' => $content));
+ }
+
+ //close the wrapper div
+ echo "</div>";
+
+} else {
+ echo "<p class='margin_top'>" . elgg_echo("profile:commentwall:none") . "</p>";
}
\ No newline at end of file
-<?php\r
-/**\r
-* Elgg Message board individual item display page\r
- */\r
-?>\r
-<div class="entity_listing clearfloat">\r
- <!-- display the user icon of the user that posted the message -->\r
- <div class="entity_listing_icon"> \r
- <?php\r
- echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));\r
- ?>\r
- </div>\r
- \r
- <div class="entity_listing_info">\r
- <?php\r
- // if the user looking at the comment can edit, show the delete link\r
- if ($vars['annotation']->canEdit()) {\r
- echo "<div class='entity_metadata'><span class='delete_button'>" . elgg_view("output/confirmlink",array(\r
- 'href' => $vars['url'] . "action/profile/deletecomment?annotation_id=" . $vars['annotation']->id,\r
- 'text' => elgg_echo('delete'),\r
- 'confirm' => elgg_echo('deleteconfirm'),\r
- )) . "</span></div>";\r
- } //end of can edit if statement\r
- ?>\r
- <!-- display the user's name who posted and the date/time -->\r
- <p class="entity_subtext">\r
- <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>\r
- </p> \r
- <!-- output the actual comment -->\r
- <?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?> \r
- </div>\r
-</div>\r
+<?php
+/**
+* Elgg Message board individual item display page
+ */
+?>
+<div class="entity_listing clearfloat">
+ <!-- display the user icon of the user that posted the message -->
+ <div class="entity_listing_icon">
+ <?php
+ echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
+ ?>
+ </div>
+
+ <div class="entity_listing_info">
+ <?php
+ // if the user looking at the comment can edit, show the delete link
+ if ($vars['annotation']->canEdit()) {
+ echo "<div class='entity_metadata'><span class='delete_button'>" . elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/profile/deletecomment?annotation_id=" . $vars['annotation']->id,
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</span></div>";
+ } //end of can edit if statement
+ ?>
+ <!-- display the user's name who posted and the date/time -->
+ <p class="entity_subtext">
+ <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>
+ </p>
+ <!-- output the actual comment -->
+ <?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?>
+ </div>
+</div>
-<?php\r
-/**\r
- * Elgg profile comment wall add\r
- */ \r
-?>\r
-<div id="comment_wall_add">\r
-<form action="<?php echo $vars['url']; ?>action/profile/addcomment" method="post" name="messageboardForm">\r
- <!-- textarea for the contents -->\r
- <textarea name="message_content" value="" class="commentwall"></textarea><br />\r
- <!-- the person posting an item on the message board -->\r
- <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" />\r
- <!-- the page owner, this will be the profile owner -->\r
- <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" />\r
- <?php echo elgg_view('input/securitytoken'); ?>\r
- <!-- submit messages input -->\r
- <input type="submit" id="postit" value="<?php echo elgg_echo('profile:commentwall:add'); ?>">\r
-</form>\r
-</div>\r
+<?php
+/**
+ * Elgg profile comment wall add
+ */
+?>
+<div id="comment_wall_add">
+<form action="<?php echo $vars['url']; ?>action/profile/addcomment" method="post" name="messageboardForm">
+ <!-- textarea for the contents -->
+ <textarea name="message_content" value="" class="commentwall"></textarea><br />
+ <!-- the person posting an item on the message board -->
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" />
+ <!-- the page owner, this will be the profile owner -->
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" />
+ <?php echo elgg_view('input/securitytoken'); ?>
+ <!-- submit messages input -->
+ <input type="submit" id="postit" value="<?php echo elgg_echo('profile:commentwall:add'); ?>">
+</form>
+</div>
-<script language="javascript" type="text/javascript" src="<?php echo $vars['url']?>mod/profile/vendor/jquery.jeditable.mini.js"></script>\r
-<script language="javascript" type="text/javascript">\r
-var reorderURL = '<?php echo elgg_add_action_tokens_to_url($vars['url'] . 'action/profile/editdefault/reorder', FALSE); ?>';\r
-function sortCallback(event, ui) {\r
- var orderArr = $('#sortableList').sortable('toArray');\r
- var orderStr = orderArr.join(',');\r
- console.log(orderArr);\r
- console.log(orderStr);\r
- jQuery.post(reorderURL, {'fieldorder': orderStr});\r
-}\r
-\r
-$(document).ready(function() {\r
- $('#sortableList').sortable({\r
- items: 'li',\r
- handle: '.handle',\r
- stop: sortCallback\r
- });\r
-});\r
-\r
-</script>\r
-<script language="javascript" type="text/javascript" src="<?php echo $vars['url']; ?>mod/multiadmin/vendors/js/jquery.jeditable.js" ></script>\r
-\r
-<div id="list">\r
- <ul id="sortableList">\r
-<?php\r
-\r
- $save = elgg_echo('save');\r
- $cancel = elgg_echo('cancel');\r
- $edit_url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/editfield", FALSE);\r
-\r
- foreach($vars['items'] as $item) {\r
- echo <<< END\r
-\r
-<script language="javascript" type="text/javascript">\r
-\r
- $(function() {\r
- $(".{$item->shortname}_editable").editable("$edit_url ", {\r
- type : 'text',\r
- submitdata: { _method: "post", 'field': '{$item->shortname}' },\r
- onblur: 'submit',\r
- width:'300px',\r
- height:'none',\r
- style:'display:inline;',\r
- tooltip:'Click to edit label'\r
- });\r
- });\r
-\r
-</script>\r
-\r
-END;\r
-\r
- echo elgg_view("profile/", array('value' => $item->translation));\r
-\r
- //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';\r
- $url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/delete?id={$item->shortname}");\r
- echo "<li id=\"{$item->shortname}\"><div class=\"delete_note\" style=\"float:right\"><a href=\"$url\">" . elgg_echo('delete') . "</a></div>";\r
- echo "<img width='16' height='16' class='handle' alt='move' title='Drag here to reorder this item' src='{$vars['url']}mod/profile/graphics/drag_handle.png'/>";\r
- echo "<b class=\"profile_field_editable\"><span class=\"{$item->shortname}_editable\">$item->translation</span></b>: [".elgg_echo($item->type)."]";\r
- echo "</li>";\r
-\r
- }\r
-\r
-?>\r
- </ul>\r
-</div>\r
-<div id="tempList"></div>\r
-\r
-<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $vars['fieldlist']; ?>" />\r
+<script language="javascript" type="text/javascript" src="<?php echo $vars['url']?>mod/profile/vendor/jquery.jeditable.mini.js"></script>
+<script language="javascript" type="text/javascript">
+var reorderURL = '<?php echo elgg_add_action_tokens_to_url($vars['url'] . 'action/profile/editdefault/reorder', FALSE); ?>';
+function sortCallback(event, ui) {
+ var orderArr = $('#sortableList').sortable('toArray');
+ var orderStr = orderArr.join(',');
+ console.log(orderArr);
+ console.log(orderStr);
+ jQuery.post(reorderURL, {'fieldorder': orderStr});
+}
+
+$(document).ready(function() {
+ $('#sortableList').sortable({
+ items: 'li',
+ handle: '.handle',
+ stop: sortCallback
+ });
+});
+
+</script>
+<script language="javascript" type="text/javascript" src="<?php echo $vars['url']; ?>mod/multiadmin/vendors/js/jquery.jeditable.js" ></script>
+
+<div id="list">
+ <ul id="sortableList">
+<?php
+
+ $save = elgg_echo('save');
+ $cancel = elgg_echo('cancel');
+ $edit_url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/editfield", FALSE);
+
+ foreach($vars['items'] as $item) {
+ echo <<< END
+
+<script language="javascript" type="text/javascript">
+
+ $(function() {
+ $(".{$item->shortname}_editable").editable("$edit_url ", {
+ type : 'text',
+ submitdata: { _method: "post", 'field': '{$item->shortname}' },
+ onblur: 'submit',
+ width:'300px',
+ height:'none',
+ style:'display:inline;',
+ tooltip:'Click to edit label'
+ });
+ });
+
+</script>
+
+END;
+
+ echo elgg_view("profile/", array('value' => $item->translation));
+
+ //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+ $url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/delete?id={$item->shortname}");
+ echo "<li id=\"{$item->shortname}\"><div class=\"delete_note\" style=\"float:right\"><a href=\"$url\">" . elgg_echo('delete') . "</a></div>";
+ echo "<img width='16' height='16' class='handle' alt='move' title='Drag here to reorder this item' src='{$vars['url']}mod/profile/graphics/drag_handle.png'/>";
+ echo "<b class=\"profile_field_editable\"><span class=\"{$item->shortname}_editable\">$item->translation</span></b>: [".elgg_echo($item->type)."]";
+ echo "</li>";
+
+ }
+
+?>
+ </ul>
+</div>
+<div id="tempList"></div>
+
+<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $vars['fieldlist']; ?>" />
-<?php\r
-/**\r
- * Elgg profile comment wall\r
- */\r
-?>\r
-<div id="profile_content">\r
-<?php\r
-if(isloggedin()){\r
- echo elgg_view("profile/commentwall/commentwalladd");\r
-}\r
-echo elgg_view("profile/commentwall/commentwall", array('annotation' => $vars['comments']));\r
-?>\r
+<?php
+/**
+ * Elgg profile comment wall
+ */
+?>
+<div id="profile_content">
+<?php
+if(isloggedin()){
+ echo elgg_view("profile/commentwall/commentwalladd");
+}
+echo elgg_view("profile/commentwall/commentwall", array('annotation' => $vars['comments']));
+?>
</div>
\ No newline at end of file