Skip to content
Snippets Groups Projects
Commit 10d2f23d authored by Seth Meranda's avatar Seth Meranda
Browse files

Added plugin for mobile site!

parent 53b7c3fa
Branches
No related tags found
No related merge requests found
Showing
with 1324 additions and 0 deletions
<?php
/**
* Elgg Message board add form
*
* @package ElggMessageBoard
* @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-2009
* @link http://elgg.com/
*/
?>
<div id="mb_input_wrapper">
<form action="<?php echo $vars['url']; ?>action/messageboard/add" method="post" name="messageboardForm">
<!-- textarea for the contents -->
<textarea name="message_content" value="" class="input_textarea"></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(); ?>" />
<!-- submit messages input -->
<input type="submit" id="submit_mobile" value="<?php echo elgg_echo('messageboard:postit'); ?>">
</form>
</div>
\ No newline at end of file
<?php
/**
* Elgg messageboard group profile view
*
* @package ElggMessageBoard
* @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-2009
* @link http://elgg.com/
*/
// get the groups passed over here
//get the full page owner entity
$entity = $vars['entity'];
$num_display = 10;
?>
<script type="text/JavaScript">
$(document).ready(function(){
$("#postit").click(function(){
//display the ajax loading gif at the start of the function call
//$('#loader').html('<img src="<?php echo $vars['url']; ?>_graphics/ajax_loader.gif" />');
$('#loader').html('<?php echo elgg_view('ajax/loader',array('slashes' => true)); ?>');
//load the results back into the message board contents and remove the loading gif
//remember that the actual div being populated is determined on views/default/messageboard/messageboard.php
$("#messageboard_wrapper").load("<?php echo $vars['url']; ?>mod/messageboard/ajax_endpoint/load.php", {messageboard_content:$("[name=message_content]").val(), pageOwner:$("[name=pageOwner]").val(), numToDisplay:<?php echo $num_display; ?>}, function(){
$('#loader').empty(); // remove the loading gif
$('[name=message_content]').val(''); // clear the input textarea
}); //end
}); // end of the main click function
}); //end of the document .ready function
</script>
<div id="mb_input_wrapper"><!-- start of mb_input_wrapper div -->
<h2><?php echo elgg_echo("messageboard:board"); ?></h2>
<?php
//if not a member don't display the add comment to messageboard
if(is_group_member($entity->guid, $_SESSION['guid'])){
?>
<!-- message textarea -->
<textarea name="message_content" id="testing" value="" class="input_textarea"></textarea>
<!-- the person posting an item on the message board -->
<input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" class="guid" />
<!-- the page owner, this will be the profile owner -->
<input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" class="pageOwner" />
<!-- submit button -->
<input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
<!-- menu options -->
<div id="messageboard_widget_menu">
<a href="<?php echo $vars['url']; ?>pg/messageboard/<?php echo get_entity(page_owner())->username; ?>"><?php echo elgg_echo("messageboard:viewall"); ?></a>
</div>
<!-- loading graphic -->
<div id="loader" class="loading"> </div>
<?php
}
?>
</div><!-- end of mb_input_wrapper div -->
<?php
//this for the first time the page loads, grab the latest 5 messages.
$contents = $entity->getAnnotations('messageboard', $num_display, 0, 'desc');
//as long as there is some content to display, display it
if (!empty($contents)) {
echo elgg_view('messageboard/messageboard',array('annotation' => $contents));
} else {
//put the required div on the page for the first message
echo "<div id=\"messageboard_wrapper\" /></div>";
}
?>
<?php
/**
* Elgg Message board display page
*
* @package ElggMessageBoard
* @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-2009
* @link http://elgg.com/
*/
// 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=\"messageboard_wrapper\">";
//loop through all annotations and display
foreach($vars['annotation'] as $content) {
echo elgg_view("messageboard/messageboard_content", array('annotation' => $content));
}
//close the wrapper div
echo "</div>";
} else {
echo "<div class='contentWrapper'>" . elgg_echo("messageboard:none") . "</div>";
}
?>
\ No newline at end of file
<?php
/**
* Elgg Message board individual item display page
*
* @package ElggMessageBoard
* @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-2009
* @link http://elgg.com/
*/
?>
<div class="messageboard"><!-- start of messageboard div -->
<!-- display the user icon of the user that posted the message -->
<div class="message_sender">
<?php
echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
?>
</div>
<!-- display the user's name who posted and the date/time -->
<p class="message_item_timestamp">
<?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>
</p>
<!-- output the actual comment -->
<div class="message"><?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?></div>
<div class="message_buttons">
<?php
// if the user looking at the comment can edit, show the delete link
if ($vars['annotation']->canEdit()) {
echo "<div class='delete_message'>" . elgg_view("output/confirmlink",array(
'href' => $vars['url'] . "action/messageboard/delete?annotation_id=" . $vars['annotation']->id,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
)) . "</div>";
} //end of can edit if statement
?>
<?php
//if the message being looked at is owned by the current user, don't show the reply
if($vars['annotation']->owner_guid != $_SESSION['guid']){
//get the message owner
$get_entity = get_entity($vars['annotation']->owner_guid);
//create the url to their messageboard
$user_mb = "pg/messageboard/" . $get_entity->username . "?view=mobile";
echo "<a href=\"" . $vars['url'] . $user_mb . "\">".elgg_echo('messageboard:replyon')." " . $get_entity->name . "'s " . elgg_echo('messageboard:messageboard') . "</a> | ";
echo "<a href=\"" . $vars['url'] . "mod/messageboard/history.php?user=" . $get_entity->guid ."\">" . elgg_echo('messageboard:history') . "</a>";
}
?>
</div>
<div class="clearfloat"></div>
</div><!-- end of messageboard div -->
\ No newline at end of file
<?php
/**
* Elgg Messages CSS extender
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*/
?>
/*-------------------------------
MESSAGING PLUGIN
-------------------------------*/
#messages {
margin:0 10px 0 10px;
}
.actiontitle {
font-weight: bold;
font-size: 110%;
margin: 0 0 10px 0;
}
#messages .pagination {
margin:5px 0 5px 0;
}
#messages input[type="checkbox"] {
margin:0;
padding:0;
border:none;
}
.messages_buttonbank {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
margin:5px 10px;
padding:5px;
text-align: right;
}
.messages_buttonbank input {
margin:0 0 0 10px;
}
.messages_buttonbank input[type="button"] {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #4690D6;
background:#dddddd;
border: 1px solid #999999;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
height: 25px;
padding: 2px 6px 2px 6px;
margin:0 0 0 10px;
cursor: pointer;
}
.messages_buttonbank input[type="button"]:hover {
background: #0054a7;
border: 1px solid #0054a7;
color:white;
}
#messages td {
text-align: left;
vertical-align:middle;
padding: 5px;
}
#messages .message_sent {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
margin-bottom: 5px;
background: white;
border:1px solid #cccccc;
}
#messages .message_notread {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
margin-bottom: 5px;
background: #F7DAD8;
border:1px solid #ff6c7c;
}
#messages .message_read {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
margin-bottom: 5px;
background: white;
border:1px solid #cccccc;
}
#messages .message_notread td {
}
#messages .message_read td {
}
#messages .delete_msg a {
display:block;
cursor: pointer;
width:14px;
height:14px;
margin:0;
background: url("<?php echo $vars['url']; ?>_graphics/icon_customise_remove.png") no-repeat right 0;
text-indent: -9000px;
float:right;
}
#messages .delete_msg a:hover {
background-position: right -16px;
}
/* IE6 */
* html #messages .delete_msg a { background-position: right 4px; }
* html #messages .delete_msg a:hover { background-position: right 4px; }
#messages .usericon,
#messages .groupicon {
float: left;
margin: 0 15px 0 0;
}
#messages .msgsender {
color:#666666;
line-height: 1em;
margin:0;
padding:0;
float:left;
}
#messages .msgsender small {
color:#AAAAAA;
}
#messages .msgsubject {
font-size: 120%;
line-height: 100%;
}
.msgsubject {
font-weight:bold;
}
.messages_single_icon {
float: left;
width:110px;
}
.messages_single_icon .usericon,
.messages_single_icon .groupicon {
float: left;
margin: 0 10px 10px 0;
}
/* view and reply to message view */
.message_body {
margin-left: 120px;
}
.message_body .messagebody {
padding:0;
margin:10px 0 10px 0;
font-size: 120%;
border-bottom:1px solid #cccccc;
}
/* drop down message reply form */
#message_reply_form { display:none; }
.new_messages_count {
color:#666666;
}
/* tinyMCE container */
#message_reply_editor #message_tbl {
width:680px !important;
}
/* IE6 */
* html #message_reply_editor #message_tbl { width:676px !important;}
#messages_return {
margin:4px 0 4px 10px;
}
#messages_return p {
margin:0;
}
.messages_single {
background: white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
margin:0 10px 10px 10px;
padding:10px;
}
/* when displaying original msg in reply view */
.previous_message {
background:#dedede;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
padding:10px;
margin:0 0 20px 0;
}
.previous_message p {
padding:0;
margin:0 0 5px 0;
font-size: 100%;
}
#notificationstable td.sitetogglefield {
width:50px;
text-align: center;
vertical-align: middle;
}
#notificationstable td.sitetogglefield input {
margin-right:36px;
margin-top:5px;
}
#notificationstable td.sitetogglefield a {
width:46px;
height:24px;
cursor: pointer;
display: block;
outline: none;
}
#notificationstable td.sitetogglefield a.sitetoggleOff {
background: url(<?php echo $vars['url']; ?>mod/messages/graphics/icon_notifications_site.gif) no-repeat right 2px;
}
#notificationstable td.sitetogglefield a.sitetoggleOn {
background: url(<?php echo $vars['url']; ?>mod/messages/graphics/icon_notifications_site.gif) no-repeat right -36px;
}
<?php
/**
* Elgg error message
* Displays a single error message
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] An error message (string)
*/
?>
<p>
<?php echo elgg_view('output/longtext', array('value' => $vars['object'])); ?>
</p>
\ No newline at end of file
<?php
/**
* Elgg list errors
* Lists error messages
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] An array of error messages
*/
if (!empty($vars['object']) && is_array($vars['object'])) {
?>
<?php
foreach($vars['object'] as $error) {
echo elgg_view('messages/errors/error',array('object' => $error));
}
?>
</div>
<?php
}
\ No newline at end of file
<?php
/**
* Elgg exception
* Displays a single exception
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] An exception
*/
global $CONFIG;
$class = get_class($vars['object']);
$message = elgg_view('output/longtext', array('value' => $vars['object']->getMessage()));
$body = <<< END
<p class="messages-exception">
<span title="$class">
<b>$message</b>
</span>
</p>
END;
if (isset($CONFIG->debug)) {
$details = elgg_view('output/longtext', array('value' => htmlentities(print_r($vars['object'], true), ENT_QUOTES, 'UTF-8')));
$body .= <<< END
<hr />
<p class="messages-exception-detail">
$details
</p>
END;
}
$title = $class;
echo elgg_view_layout("one_column", elgg_view_title($title) . $body);
\ No newline at end of file
<?php
/**
* Elgg send a message page
*
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*
* @uses $vars['friends'] This is an array of a user's friends and is used to populate the list of
* people the user can message
*
*/
//grab the user id to send a message to. This will only happen if a user clicks on the 'send a message'
//link on a user's profile or hover-over menu
$send_to = get_input('send_to');
if ($send_to === "")
$send_to = $_SESSION['msg_to'];
$msg_title = $_SESSION['msg_title'];
$msg_content = $_SESSION['msg_contents'];
// clear sticky form cache in case user browses away from page and comes back
unset($_SESSION['msg_to']);
unset($_SESSION['msg_title']);
unset($_SESSION['msg_contents']);
?>
<div class="contentWrapper">
<form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
<?php
//check to see if the message recipient has already been selected
if($send_to){
//get the user object
$user = get_user($send_to);
//draw it
echo "<label>" . elgg_echo("messages:to") . ":</label><div class=\"messages_single_icon\">" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'tiny')) . $user->username;
echo "</div><br class=\"clearfloat\" />";
//set the hidden input field to the recipients guid
echo "<input type=\"hidden\" name=\"send_to\" value=\"{$send_to}\" />";
}else{
?>
<p><label><?php echo elgg_echo("messages:to"); ?>: </label>
<select name='send_to'>
<?php
//make the first option blank
echo "<option value=''></option>";
foreach($vars['friends'] as $friend){
//populate the send to box with a user's friends
echo "<option value='{$friend->guid}'>" . $friend->name . "</option>";
}
?>
</select></p>
<?php
}//end send_to if statement
?>
<p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' value='<?php echo $msg_title; ?>' class="input-text" /></label></p>
<p class="longtext_editarea"><label><?php echo elgg_echo("messages:message"); ?>: <br />
<?php
echo elgg_view("input/longtext", array(
"internalname" => "message",
"value" => $msg_content,
));
?>
</label></p>
<p><input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" /></p>
</form>
</div>
\ No newline at end of file
<?php
/**
* Elgg reply to a message form
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*
* @uses $vars['entity'] This is the message being replied to
*
*/
// fix for RE: RE: RE: that builds on replies
$reply_title = $vars['entity']->title;
if (strncmp($reply_title, "RE:", 3) != 0) {
$reply_title = "RE: " . $reply_title;
}
?>
<form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
<!-- populate the title space with the orginal message title, inserting re: before it -->
<p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' class="input-text" value='<?php echo $reply_title; ?>' /></label></p>
<p><label><?php echo elgg_echo("messages:message"); ?>: <br /><textarea name='message' value='' class="input-textarea" /></textarea></label></p>
<p>
<?php
//pass across the guid of the message being replied to
echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
//pass along the owner of the message being replied to
echo "<input type='hidden' name='send_to' value='BAAA" . $vars['entity']->fromId . "' />";
?>
<input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" />
</p>
</form>
<?php
//display the message you are replying to
if (isset($vars['entity'])) {
echo "<h3>" . elgg_echo("messages:replying") . "</h3>";
echo $vars['entity']->description;
}
?>
\ No newline at end of file
<?php
$body = elgg_view("messages/view",$vars);
$body .= '<div class="messages_buttonbank">';
$body .= '<input type="hidden" name="type" value="'.$vars['page_view'].'" />';
$body .= '<input type="hidden" name="offset" value="'.$vars['offset'].'" />';
$body .= '<input type="submit" name="submit" value="'.elgg_echo('delete').'" /> ';
$body .= '<input type="submit" name="submit" value="'.elgg_echo('messages:markread').'" /> ';
$body .= '</div>';
echo elgg_view('input/form',array('body' => $body, 'action' => $vars['url'] . 'action/messages/delete', 'method' => 'post'));
?>
\ No newline at end of file
<?php
/**
* Elgg global system message list
* Lists all system messages
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] The array of message registers
*/
if (!empty($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
foreach($vars['object'] as $register => $list ) {
echo elgg_view("messages/{$register}/list", array('object' => $list));
}
}
<?php
/**
* Elgg hoverover extender for messages
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*/
//need to be logged in to send a message
if (isloggedin()) {
?>
<p class="user_menu_messages">
<a href="<?php echo $vars['url']; ?>mod/messages/send.php?send_to=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("messages:sendmessage"); ?></a>
</p>
<?php
}
?>
\ No newline at end of file
<?php
/**
* Elgg messages individual view
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*
*
* @uses $vars['entity'] Optionally, the message to view
* @uses get_input('type') If the user accesses the message from their sentbox, this variable is passed
* and used to make sure the correct icon and name is displayed
*/
// set some variables to use below
if(get_input("type") == "sent"){
// send back to the users sentbox
$url = $vars['url'] . "mod/messages/sent.php";
//this is used on the delete link so we know which type of message it is
$type = "sent";
} else {
//send back to the users inbox
$url = $vars['url'] . "pg/messages/" . $vars['user']->username;
//this is used on the delete link so we know which type of message it is
$type = "inbox";
}
// fix for RE: RE: RE: that builds on replies
$reply_title = $vars['entity']->title;
if (strncmp($reply_title, "RE:", 3) != 0) {
$reply_title = "RE: " . $reply_title;
}
if (isloggedin())
if (isset($vars['entity'])) {
if ($vars['entity']->toID == $vars['user']->guid
|| $vars['entity']->owner_guid == $vars['user']->guid) {
?>
<!-- get the correct return url -->
<div id="messages_return"><!-- start of messages_return div -->
<p><a href="<?php echo $url; ?>">&laquo; <?php echo elgg_echo('messages:back'); ?></a></p>
</div><!-- end of messages_return div -->
<div class="messages_single"><!-- start of the message div -->
<div class="messages_single_icon"><!-- start of the message_user_icon div -->
<!-- get the user icon, name and date -->
<?php
// we need a different user icon and name depending on whether the user is reading the message
// from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent
// the message. If it is the sentbox, the icon and name will be the user the message was sent to
if($type == "sent"){
//get an instance of the user who the message has been sent to so we can access the name and icon
$user_object = get_entity($vars['entity']->toId);
//get the icon
echo " " . elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
//get the name
echo "<br class=\"clearfloat\" /><p>".elgg_echo('messages:to').": <b>" . $user_object->name . "</b><br />";
}else{
//get the icon
echo " " . elgg_view("profile/icon",array('entity' => get_entity($vars['entity']->fromId), 'size' => 'tiny'));
//get the name
echo "<br class=\"clearfloat\" /><p>".elgg_echo('messages:from').": <b>" . get_entity($vars['entity']->fromId)->name . "</b><br />";
}
?>
<!-- get the time the message was sent -->
<small><?php echo friendly_time($vars['entity']->time_created); ?></small>
</p>
</div><!-- end of the message_user_icon div -->
<div class="message_body"><!-- start of div message_body -->
<?php
//if the message is a reply, display the message the reply was for
//I need to figure out how to get the description out using -> (anyone?)
if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){
if($type == "sent"){
echo "<div class='previous_message'><h3>".elgg_echo('messages:original').":</h3><p>";
}else{
echo "<div class='previous_message'><h3>".elgg_echo('messages:yours').":</h3><p>";
}
echo $main_message[0][description] . "</p></div>";
}
?>
<!-- display the title -->
<div class="actiontitle">
<h3><?php echo $vars['entity']->title; ?></h3>
</div>
<!-- display the message -->
<div class="messagebody">
<p><?php echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); ?></p>
</div>
<!-- display the edit options, reply and delete -->
<div class="message_options"><!-- start of the message_options div -->
<p><?php if($type != "sent")echo elgg_view("output/confirmlink", array(
'href' => $vars['url'] . "action/messages/delete?message_id=" . $vars['entity']->getGUID() . "&type={$type}&submit=" . elgg_echo('delete'),
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
)); ?>
</p>
</div><!-- end of the message_options div -->
</div><!-- end of div message_body -->
<h3> Reply </h3>
<form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
<!-- populate the title space with the orginal message title, inserting re: before it -->
<p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' class="input-text" value='<?php echo $reply_title; ?>' /></label></p>
<p class="longtext_editarea"><label><?php echo elgg_echo("messages:message"); ?>:</label></p>
<div id="message_reply_editor">
<?php
echo elgg_view("input/longtext", array(
"internalname" => "message",
"value" => '',
));
?></div>
<p>
<?php
//pass across the guid of the message being replied to
echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
//pass along the owner of the message being replied to
echo "<input type='hidden' name='send_to' value='" . $vars['entity']->fromId . "' />";
?>
<input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" />
</p>
</form>
</div><!-- end of the message div -->
<?php
}
}
?>
\ No newline at end of file
<?php
/**
* Elgg list system messages
* Lists system messages
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] An array of system messages
*/
if (!empty($vars['object']) && is_array($vars['object'])) {
?>
<div class="messages">
<?php
foreach($vars['object'] as $message) {
echo elgg_view('messages/messages/message',array('object' => $message));
}
?>
</div>
<?php
}
<?php
/**
* Elgg standard message
* Displays a single Elgg system message
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['object'] A system message (string)
*/
?>
<p>
<?php echo elgg_view('output/longtext', array('value' => $vars['object'])); ?>
</p>
\ No newline at end of file
<?php
/**
* Elgg Mobile
* A Mobile Client For Elgg
*
* @package Elgg
* @subpackage Core
* @author Mark Harding
* @link http://maestrozone.com
*
*/
//need to be logged in to send a message
gatekeeper();
//get unread messages
$num_messages = count_unread_messages();
if($num_messages){
$num = $num_messages;
} else {
$num = 0;
}
if($num == 0){
?>
<a href="<?php echo $vars['url']; ?>pg/messages/<?php echo $_SESSION['user']->username; ?>" class="privatemessages" >&nbsp;</a>
<?php
}else{
?>
<a href="<?php echo $vars['url']; ?>pg/messages/<?php echo $_SESSION['user']->username; ?>" class="privatemessages_new" >[<?php echo $num; ?>]</a>
<?php
}
?>
\ No newline at end of file
<?php
/**
* Elgg messages view page
*
* @package ElggMessages
* @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-2009
* @link http://elgg.com/
*
* @uses $vars['entity'] An array of messages to view
* @uses $vars['page_view'] This is the page the messages are being accessed from; inbox or sentbox
*
*/
$limit = $vars['limit']; if (empty($limit)) $limit = 10;
$offset = $vars['offset']; if (!isset($offset)) $offset = 0;
// If there are any messages to view, view them
if (isloggedin())
if (is_array($vars['entity']) && sizeof($vars['entity']) > 0) {
?>
<div id="messages" /><!-- start the main messages wrapper div -->
<?php
// get the correct display for the inbox view
if($vars['page_view'] == "inbox") {
$counter = 0;
foreach($vars['entity'] as $message) {
if ($message->owner_guid == $vars['user']->guid
|| $message->toID == $vars['user']->guid) {
//make sure to only display the messages that have not been 'deleted' (1 = deleted)
if($message->hiddenFrom != 1){
// check to see if the message has been read, if so, get the correct background color
if($message->readYet == 1){
echo "<div class=\"message_read\" />";
}else{
echo "<div class=\"message_notread\" />";
}
//set the table
echo "<table width=\"100%\" cellspacing='0'><tr>";
//get the icon of the user who owns the message
$from = get_entity($message->fromId);
echo "<td width='75px'>" . elgg_view("profile/icon",array('entity' => $from, 'size' => 'tiny')) . "<div class='msgsender'><b>" . $from->name . "</b><br /><small>" . friendly_time($message->time_created) . "</small></div></td>";
//display the message title
echo "<td><div class='msgsubject'>";
echo "<input type=\"checkbox\" name=\"message_id[]\" value=\"{$message->guid}\" /> ";
echo "<a href=\"{$message->getURL()}\">" . $message->title . "</a></div></td>";
//display the link to 'delete'
echo "<td width='70px'>";
echo "<div class='delete_msg'>" . elgg_view("output/confirmlink", array(
'href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=inbox&submit=" . urlencode(elgg_echo('delete')),
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
)) . "</div>";
echo "</td></tr></table>";
echo "</div>"; // close the message background div
}//end of hiddenFrom if statement
} // end of user check
$counter++;
if ($counter == $limit) break;
}//end of for each loop
}//end of inbox if statement
// get the correct display for the sentbox view
if($vars['page_view'] == "sent") {
$counter = 0;
foreach($vars['entity'] as $message) {
//make sure to only display the messages that have not been 'deleted' (1 = deleted)
if($message->hiddenTo != 1){
//get the correct user entity
$user = get_entity($message->toID);
echo "<div class=\"message_sent\" />";
echo "<table width=\"100%\" cellspacing='0'><tr>";
//get the icon for the user the message was sent to
echo "<tr><td width='200px'>" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'tiny')) . "<div class='msgsender'><b>" . $user->name . "</b><br /><small>" . friendly_time($message->time_created) . "</small></div></td>";
//display the message title
echo "<td><div class='msgsubject'>";
echo "<input type=\"checkbox\" name=\"message_id[]\" value=\"{$message->guid}\" /> ";
echo "<a href=\"{$message->getURL()}?type=sent\">" . $message->title . "</a></div></td>";
//display the link to 'delete'
echo "<td width='70px'>";
echo "<div class='delete_msg'>" . elgg_view("output/confirmlink", array(
'href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=sent&submit=" . urlencode(elgg_echo('delete')),
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
)) . "</div>";
echo "</td></tr></table></div>";
}//close hiddeTo if statement
$counter++;
if ($counter == $limit) break;
}//close foreach
}//close page_view sent if statement
$baseurl = $_SERVER['REQUEST_URI'];
$baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
$nav = '';
if (sizeof($vars['entity']) > $limit) {
$newoffset = $offset + $limit;
$urladdition = 'offset='.$newoffset;
if (substr_count($baseurl,'?')) $nexturl=$baseurl . '&' . $urladdition; else $nexturl=$baseurl . '?' . $urladdition;
$nav .= '<a class="pagination_previous" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
}
if ($offset > 0) {
$newoffset = $offset - $limit;
if ($newoffset < 0) $newoffset = 0;
$urladdition = 'offset='.$newoffset;
if (substr_count($baseurl,'?')) $prevurl=$baseurl . '&' . $urladdition; else $prevurl=$baseurl . '?' . $urladdition;
$nav .= '<a class="pagination_next" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
}
if (!empty($nav)) {
echo '<div class="pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>';
}
echo "</div>"; // close the main messages wrapper div
} else {
echo "<div class=\"contentWrapper\"><p class='messages_nomessage_message'>" . elgg_echo("messages:nomessages") . "</p></div>";
}//end of the first if statement
?>
\ No newline at end of file
<?php
/**
* Elgg pagination
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
*/
if (!isset($vars['offset'])) {
$offset = 0;
} else {
$offset = $vars['offset'];
}
if ((!isset($vars['limit'])) || (!$vars['limit'])) {
$limit = 10;
} else {
$limit = (int)$vars['limit'];
}
if (!isset($vars['count'])) {
$count = 0;
} else {
$count = $vars['count'];
}
if (!isset($vars['word'])) {
$word = "offset";
} else {
$word = $vars['word'];
}
if (isset($vars['nonefound'])) {
$nonefound = $vars['nonefound'];
} else {
$nonefound = true;
}
$totalpages = ceil($count / $limit);
$currentpage = ceil($offset / $limit) + 1;
$baseurl = preg_replace('/[\&\?]'.$word.'\=[0-9]*/',"",$vars['baseurl']);
//only display if there is content to paginate through or if we already have an offset
if (($count > $limit || $offset > 0) && get_context() != 'widget') {
?>
<div class="pagination">
<?php
if ($offset > 0) {
$prevoffset = $offset - $limit;
if ($prevoffset < 0) $prevoffset = 0;
$prevurl = $baseurl;
if (substr_count($baseurl,'?')) {
$prevurl .= "&{$word}=" . $prevoffset;
} else {
$prevurl .= "?{$word}=" . $prevoffset;
}
echo "<a href=\"{$prevurl}\" class=\"pagination_previous\">&laquo; ". elgg_echo("previous") ."</a> ";
}
if ($offset > 0 || $offset < ($count - $limit)) {
$currentpage = round($offset / $limit) + 1;
$allpages = ceil($count / $limit);
$i = 1;
$pagesarray = array();
while ($i <= $allpages && $i <= 4) {
$pagesarray[] = $i;
$i++;
}
$i = $currentpage - 2;
while ($i <= $allpages && $i <= ($currentpage + 2)) {
if ($i > 0 && !in_array($i,$pagesarray)) {
$pagesarray[] = $i;
}
$i++;
}
$i = $allpages - 3;
while ($i <= $allpages) {
if ($i > 0 && !in_array($i,$pagesarray)) {
$pagesarray[] = $i;
}
$i++;
}
sort($pagesarray);
$prev = 0;
foreach($pagesarray as $i) {
if (($i - $prev) > 1) {
echo "<span class=\"pagination_more\">...</span>";
}
$counturl = $baseurl;
$curoffset = (($i - 1) * $limit);
if (substr_count($baseurl,'?')) {
$counturl .= "&{$word}=" . $curoffset;
} else {
$counturl .= "?{$word}=" . $curoffset;
}
if ($curoffset != $offset) {
echo " <a href=\"{$counturl}\" class=\"pagination_number\">{$i}</a> ";
} else {
echo "<span class=\"pagination_currentpage\"> {$i} </span>";
}
$prev = $i;
}
}
if ($offset < ($count - $limit)) {
$nextoffset = $offset + $limit;
if ($nextoffset >= $count) {
$nextoffset--;
}
$nexturl = $baseurl;
if (substr_count($baseurl,'?')) {
$nexturl .= "&{$word}=" . $nextoffset;
} else {
$nexturl .= "?{$word}=" . $nextoffset;
}
echo " <a href=\"{$nexturl}\" class=\"pagination_next\">" . elgg_echo("next") . " &raquo;</a>";
}
?>
<div class="clearfloat"></div>
</div>
<?php
} // end of pagination check if statement
\ No newline at end of file
<?php
/**
* Elgg standard tools drop down
* This will be populated depending on the plugins active - only plugin navigation will appear here
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
*/
$menu = get_register('menu');
//var_export($menu);
if (is_array($menu) && sizeof($menu) > 0) {
$alphamenu = array();
foreach($menu as $item) {
$alphamenu[$item->name] = $item;
}
ksort($alphamenu);
?>
<ul class="topbardropdownmenu">
<li class="drop"><a href="#" class="menuitemtools"><?php echo(elgg_echo('tools')); ?></a>
<ul>
<?php
foreach($alphamenu as $item) {
echo "<li><a href=\"{$item->value}\">" . $item->name . "</a></li>";
}
?>
</ul>
</li>
</ul>
<script type="text/javascript">
$(function() {
$('ul.topbardropdownmenu').elgg_topbardropdownmenu();
});
</script>
<?php
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment