Skip to content
Snippets Groups Projects
Commit aeecfc28 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Update plugins/mobile to version 1.6

parent d82c0b66
No related branches found
No related tags found
No related merge requests found
Showing
with 763 additions and 0 deletions
CHANGES FROM 1.5 to 1.6) MAJOR Bug Fixes, Fixed message board, Now users can switch between desktop and mobile versions,
\ No newline at end of file
Installation
Extract into the mod folder. Enable in plugin tools and then run upgrade.php.
Donations
Donating to this plugin will improve development.
<?php
define('externalpage',true);
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
global $CONFIG;
session_start();
$_SESSION['desktop'] = 1;
$siteroot = $vars['url'];
$lastpage = $_GET['elp'];
header("Location: $siteroot/index.php");
?>
<?php
define('externalpage',true);
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
global $CONFIG;
unset($_SESSION['desktop']);
$siteroot = $vars['url'];
$lastpage = $_GET['elp'];
header("Location: $siteroot/index.php");
?>
plugins/mobile/graphics/elgg_toolbar_logo.gif

677 B

plugins/mobile/graphics/toptoolbar_background.gif

149 B

<?php
/**
* Elgg Mobile
* A Mobile Client For Elgg
*
* @package Elgg
* @subpackage Core
* @author Mark Harding
* @link http://maestrozone.com
*
*/
/**
* Start the Elgg engine
*/
define('externalpage',true);
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
//Load the front page
global $CONFIG;
set_input('view', 'mobile');
$content = elgg_view_layout('two_column_left_sidebar', elgg_view("account/forms/login"));
page_draw(null, $content);
?>
<?php
$english = array(
/**
* Menu items and titles
*/
'mobile:river:what' => "What's on your mind?",
'mobile:river:title' => "Activity Stream",
'mobile:profile:activity' => "Activity",
'mobile:profile:info' => "Info",
'mobile:needaccount' => "Need an account?",
'mobile:signup' => "Sign up here.",
'mobile:full' => "Full Site",
'mobile:mobile' => "Mobile",
'Share!' => "Share!"
);
add_translation("en",$english);
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest>
<field key="author" value="Mark Harding" />
<field key="version" value="1.4" />
<field key="description" value="Elgg Mobile" />
<field key="website" value="http://www.marksmusiconline.co.uk/" />
<field key="copyright" value="(C) Mark Harding 2010" />
<field key="licence" value="GNU Public License version 2" />
<field key="elgg_version" value="2009072201" />
</plugin_manifest>
\ 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
*
*/
function mobile_init(){
extend_view('metatags','mobile/metatags');
// Close the mobile_init
}
// Initialise log browser
register_elgg_event_handler('init','system','mobile_init');
//elgg_register_simplecache_view(mobile);
register_action("mobile/login",false,$CONFIG->pluginspath . "mobile/actions/login.php", true);
?>
1.6
\ 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
*
*/
$desktop = $_SESSION['desktop'];
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$current = curPageURL();
$useragent=$_SERVER['HTTP_USER_AGENT'];
if(preg_match('/android|avantgo|blackberry|blazer|elaine|hiptop|ip(hone|od)|kindle|midp|mmp|mobile|o2|opera mini|palm( os)?|pda|plucker|pocket|psp|smartphone|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce; (iemobile|ppc)|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){
if (!$desktop == 1){
if (isloggedin()) {
header("Location: ?view=mobile"); }
else {
$siteroot = $vars['url'];
header("Location: $siteroot/mod/mobile/index.php?view=mobile");}}?>
<div align="center" style="min-width:998px;width:100%; background-color:#666; height:20px; margin:auto;"> <a href="/mod/mobile/desktop_unset.php"> <?php echo elgg_echo("mobile:mobile"); ?></a> | <?php echo elgg_echo("mobile:full"); ?></div>
<?php }?>
\ No newline at end of file
<?php
$current_version = file_get_contents($vars['url'].'mod/mobile/version.txt');
$version = file_get_contents('http://www.marksmusiconline.co.uk/dev/mobile/version.txt');
if ($current_version == $version){?>
<p>You are running the latest version of the mobile plugin. </p>
<?php } else { ?>
<p>You are running an out of date version of elgg mobile. Please update this plugin to the latest version <b><?php echo $version; ?></b> by <a href="http://community.elgg.org/mod/plugins/read.php?guid=387453">clicking here</a>. <p>
<?php }?>
<p>
<b>RiverView</b>
<select name="params[mobileriverview]">
<option value="friend" <?php if ($vars['entity']->mobileriverview == 'friend') echo " selected=\"yes\" "; ?>>Friends</option>
<option value="" <?php if ($vars['entity']->mobileriverview != 'friend') echo " selected=\"yes\" "; ?>>Everyone</option>
</select>
</p>
<p>
<b>Display the photos tab?</b>
<select name="params[photostab]">
<option value="no" <?php if ($vars['entity']->photostab == 'no') echo " selected=\"yes\" "; ?>>No</option>
<option value="" <?php if ($vars['entity']->photostab != 'no') echo " selected=\"yes\" "; ?>>Yes</option>
</select>
</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
*
*/
global $CONFIG;
$form_body = "<p class=\"loginbox\"><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')) . "</label>";
$form_body .= "<br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</label><br />";
$form_body .= elgg_view('login/extend');
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <div id=\"persistent_login\"><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></div></p>";
$login_url = $vars['url'];
if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
$login_url = str_replace("http", "https", $vars['url']);
}
?>
<div id="login-box">
<?php
echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
?>
</div>
<div id="login-controls">
<p><?php echo elgg_echo("mobile:needaccount"); ?> <a href="<?php echo $vars['url']; ?>account/register.php?view=mobile"> <?php echo elgg_echo("signup"); ?> </a></p>
</div>
\ No newline at end of file
<?php
/**
* Elgg register form
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*/
$username = get_input('u');
$email = get_input('e');
$name = get_input('n');
$admin_option = false;
if (($_SESSION['user']->admin) && ($vars['show_admin'])) {
$admin_option = true;
}
$form_body = "<p><label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name', 'class' => "register-textarea", 'value' => $name)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email', 'class' => "register-textarea", 'value' => $email)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username', 'class' => "register-textarea", 'value' => $username)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password', 'class' => "register-textarea")) . "</label><br />";
$form_body .= "<label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2', 'class' => "register-textarea")) . "</label><br />";
// view to extend to add more fields to the registration form
$form_body .= elgg_view('register/extend');
// Add captcha hook
$form_body .= elgg_view('input/captcha');
if ($admin_option) {
$form_body .= elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option'))));
}
$form_body .= elgg_view('input/hidden', array('internalname' => 'friend_guid', 'value' => $vars['friend_guid']));
$form_body .= elgg_view('input/hidden', array('internalname' => 'invitecode', 'value' => $vars['invitecode']));
$form_body .= elgg_view('input/hidden', array('internalname' => 'action', 'value' => 'register'));
$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>";
?>
<div id="register-box">
<h2><?php echo elgg_echo('register'); ?></h2>
<?php echo elgg_view('input/form', array('action' => "{$vars['url']}action/register", 'body' => $form_body)) ?>
</div>
\ No newline at end of file
<?php
/**
* Elgg comment river view
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*/
$performed_by = get_entity($vars['item']->subject_guid);
$object = get_entity($vars['item']->object_guid);
$url = $object->getURL();
$title = $object->title;
if (!$title) {
$title = elgg_echo('untitled');
}
$subtype = get_subtype_from_id($object->subtype);
//grab the annotation, if one exists
if ($vars['item']->annotation_id != 0) {
$comment = get_annotation($vars['item']->annotation_id)->value;
}
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
$string .= elgg_echo("{$subtype}:river:annotate") . " | <a href=\"{$object->getURL()}\">" . $title . "</a>";
$string .= "<div class=\"river_content_display\">";
if ($comment) {
$contents = strip_tags($comment);//this is so we don't get large images etc in the activity river
if (strlen($contents) > 200) {
$string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
} else {
$string .= $contents;
}
}
$string .= "</div>";
echo $string;
\ No newline at end of file
<?php
/**
* Elgg generic comment
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
*/
$owner = get_user($vars['annotation']->owner_guid);
?>
<div class="generic_comment"><!-- start of generic_comment div -->
<div class="generic_comment_icon">
<?php
echo elgg_view("profile/icon",
array(
'entity' => $owner,
'size' => 'small'
)
);
?>
</div>
<div class="generic_comment_details">
<!-- output the actual comment -->
<?php echo elgg_view("output/longtext",array("value" => $vars['annotation']->value)); ?>
<p class="generic_comment_owner">
<a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo friendly_time($vars['annotation']->time_created); ?>
</p>
<?php
// if the user looking at the comment can edit, show the delete link
if ($vars['annotation']->canEdit()) {
?>
<p>
<?php
echo elgg_view("output/confirmlink",array(
'href' => $vars['url'] . "action/comments/delete?annotation_id=" . $vars['annotation']->id,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
));
?>
</p>
<?php
} //end of can edit if statement
?>
</div><!-- end of generic_comment_details -->
</div><!-- end of generic_comment div -->
\ No newline at end of file
<?php
$list = elgg_view('categories/list',$vars);
if (!empty($list)) {
?>
<div class="blog_categories">
<?php echo $list; ?>
</div>
<?php
}
?>
\ No newline at end of file
<?php
/**
* Elgg blog CSS extender
*
* @package ElggBlog
* @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/
*/
?>
.singleview {
margin-top:10px;
}
.blog_post_icon {
float:left;
margin:3px 0 0 0;
padding:0;
}
.blog_post h3 {
font-size: 150%;
margin:0 0 10px 0;
padding:0;
}
.blog_post h3 a {
text-decoration: none;
}
.blog_post p {
margin: 0 0 5px 0;
}
.blog_post .strapline {
margin: 0 0 0 35px;
padding:0;
color: #aaa;
line-height:1em;
}
.blog_post p.tags {
background:transparent url(<?php echo $vars['url']; ?>_graphics/icon_tag.gif) no-repeat scroll left 2px;
margin:0 0 7px 35px;
padding:0pt 0pt 0pt 16px;
min-height:22px;
}
.blog_post .options {
margin:0;
padding:0;
}
.blog_post_body img[align="left"] {
margin: 10px 10px 10px 0;
float:left;
}
.blog_post_body img[align="right"] {
margin: 10px 0 10px 10px;
float:right;
}
.blog_post_body img {
margin: 10px !important;
}
.blog-comments h3 {
font-size: 150%;
margin-bottom: 10px;
}
.blog-comment {
margin-top: 10px;
margin-bottom:20px;
border-bottom: 1px solid #aaaaaa;
}
.blog-comment img {
float:left;
margin: 0 10px 0 0;
}
.blog-comment-menu {
margin:0;
}
.blog-comment-byline {
background: #dddddd;
height:22px;
padding-top:3px;
margin:0;
}
.blog-comment-text {
margin:5px 0 5px 0;
}
/* New blog edit column */
#blog_edit_page {
/* background: #bbdaf7; */
margin-top:-10px;
}
#blog_edit_page #content_area_user_title h2 {
background: none;
border-top: none;
margin:0 0 10px 0px;
padding:0px 0 0 0;
}
#blog_edit_page #blog_edit_sidebar #content_area_user_title h2 {
background:none;
border-top:none;
margin:inherit;
padding:0 0 5px 5px;
font-size:1.25em;
line-height:1.2em;
}
#blog_edit_page #blog_edit_sidebar {
margin:0px 0 22px 0;
background: #dedede;
padding:5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
#blog_edit_page #two_column_left_sidebar_210 {
width:210px;
margin:0px 0 20px 0px;
min-height:360px;
float:left;
padding:0;
}
#blog_edit_page #two_column_left_sidebar_maincontent {
margin:0 0px 20px 20px;
padding:10px 20px 20px 20px;
width:670px;
background: #bbdaf7;
}
/* unsaved blog post preview */
.blog_previewpane {
border:1px solid #D3322A;
background:#F7DAD8;
padding:10px;
margin:10px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
.blog_previewpane p {
margin:0;
}
#blog_edit_sidebar .publish_controls,
#blog_edit_sidebar .blog_access,
#blog_edit_sidebar .publish_options,
#blog_edit_sidebar .publish_blog,
#blog_edit_sidebar .allow_comments,
#blog_edit_sidebar .categories {
margin:0 5px 5px 5px;
border-top:1px solid #cccccc;
}
#blog_edit_page ul {
padding-left:0px;
margin:5px 0 5px 0;
list-style: none;
}
#blog_edit_page p {
margin:5px 0 5px 0;
}
#blog_edit_page #two_column_left_sidebar_maincontent p {
margin:0 0 15px 0;
}
#blog_edit_page .publish_blog input[type="submit"] {
font-weight: bold;
padding:2px;
height:auto;
}
#blog_edit_page .preview_button a {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
background:white;
border: 1px solid #cccccc;
color:#999999;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
height: auto;
padding: 3px;
margin:1px 1px 5px 10px;
cursor: pointer;
float:right;
}
#blog_edit_page .preview_button a:hover {
background:#4690D6;
color:white;
text-decoration: none;
border: 1px solid #4690D6;
}
#blog_edit_page .allow_comments label {
font-size: 100%;
}
<?php
/**
* Elgg blog edit/add page
*
* @package ElggBlog
* @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['object'] Optionally, the blog post to edit
*/
// Set title, form destination
if (isset($vars['entity'])) {
$title = sprintf(elgg_echo("blog:editpost"),$object->title);
$action = "blog/edit";
$title = $vars['entity']->title;
$body = $vars['entity']->description;
$tags = $vars['entity']->tags;
if ($vars['entity']->comments_on == 'Off') {
$comments_on = false;
} else {
$comments_on = true;
}
$access_id = $vars['entity']->access_id;
} else {
$title = elgg_echo("blog:addpost");
$action = "blog/add";
$tags = "";
$title = "";
$comments_on = true;
$description = "";
if (defined('ACCESS_DEFAULT'))
$access_id = ACCESS_DEFAULT;
else
$access_id = 0;
}
// Just in case we have some cached details
if (empty($body)) {
$body = $vars['user']->blogbody;
if (!empty($body)) {
$title = $vars['user']->blogtitle;
$tags = $vars['user']->blogtags;
}
}
// set the required variables
$title_label = elgg_echo('title');
$title_textbox = elgg_view('input/text', array('internalname' => 'blogtitle', 'value' => $title));
$text_label = elgg_echo('blog:text');
$text_textarea = elgg_view('input/longtext', array('internalname' => 'blogbody', 'value' => $body));
$tag_label = elgg_echo('tags');
$tag_input = elgg_view('input/tags', array('internalname' => 'blogtags', 'value' => $tags));
$access_label = elgg_echo('access');
//$comments_select = elgg_view('input/checkboxes', array('internalname' => 'comments_on', 'value' => ''));
if($comments_on)
$comments_on_switch = "checked=\"checked\"";
else
$comment_on_switch = "";
$access_input = elgg_view('input/access', array('internalname' => 'access_id', 'value' => $access_id));
$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('publish')));
$conversation = elgg_echo('Conversation');
$publish = elgg_echo('publish');
$cat = elgg_echo('categories');
$preview = elgg_echo('blog:preview');
$privacy = elgg_echo('access');
$savedraft = elgg_echo('blog:draft:save');
$draftsaved = elgg_echo('blog:draft:saved');
$never = elgg_echo('blog:never');
$allowcomments = elgg_echo('blog:comments:allow');
// INSERT EXTRAS HERE
$extras = elgg_view('categories',$vars);
if (!empty($extras)) $extras = '<div id="blog_edit_sidebar">' . $extras . '</div>';
?>
<?php
$form_body = <<<EOT
<div id="two_column_left_sidebar_210">
<div id="blog_edit_sidebar">
<div id="content_area_user_title">
<div class="preview_button"><a onclick="javascript:saveDraft(true);return true;">{$preview}</a></div>
<h2>{$publish}</h2></div>
<div class="publish_controls">
<p>
<a href="#" onclick="javascript:saveDraft(false);return false;">{$savedraft}</a>
</p>
</div>
<div class="publish_options">
<!-- <p><b>{$publish}:</b> now <a href="">edit</a></p> -->
<p class="auto_save">{$draftsaved}: <span id="draftSavedCounter">{$never}</span></p>
</div>
<div class="blog_access">
<p>{$privacy}: {$access_input}
</p></div>
<div class="publish_blog">
{$submit_input}
</div>
</div>
<div id="blog_edit_sidebar">
<div id="content_area_user_title"><h2>{$conversation}</h2></div>
<div class="allow_comments">
<p><label>
<input type="checkbox" name="comments_select" {$comments_on_switch} /> {$allowcomments}
</label></p>
</div>
</div>
{$extras}
</div><!-- /two_column_left_sidebar_210 -->
<!-- main content -->
<div id="two_column_left_sidebar_maincontent">
EOT;
?>
<?php
if (isset($vars['entity'])) {
$entity_hidden = elgg_view('input/hidden', array('internalname' => 'blogpost', 'value' => $vars['entity']->getGUID()));
} else {
$entity_hidden = '';
}
$form_body .= <<<EOT
<p>
<label>$title_label</label><br />
$title_textbox
</p>
<p class='longtext_editarea'>
<label>$text_label</label><br />
$text_textarea
</p>
<p>
<label>$tag_label</label><br />
$tag_input
</p>
<!-- <p>
<label>$access_label</label><br />
$access_input
</p> -->
<p>
$entity_hidden
<!-- $submit_input -->
</p>
</div><div class="clearfloat"></div><!-- /two_column_left_sidebar_maincontent -->
EOT;
echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body, 'internalid' => 'blogPostForm'));
?>
<script type="text/javascript">
setInterval( "saveDraft(false)", 120000);
function saveDraft(preview) {
temppreview = preview;
var drafturl = "<?php echo $vars['url']; ?>mod/blog/savedraft.php";
var temptitle = $("input[@name='blogtitle']").val();
var tempbody = $("textarea[@name='blogbody']").val();
var temptags = $("input[@name='blogtags']").val();
var postdata = { blogtitle: temptitle, blogbody: tempbody, blogtags: temptags };
$.post(drafturl, postdata, function() {
var d = new Date();
var mins = d.getMinutes() + '';
if (mins.length == 1) mins = '0' + mins;
$("span#draftSavedCounter").html(d.getHours() + ":" + mins);
if (temppreview == true) {
$("form#blogPostForm").attr("action","<?php echo $vars['url']; ?>mod/blog/preview.php");
$("input[@name='submit']").click();
//$("form#blogPostForm").submit();
//document.blogPostForm.submit();
}
});
}
</script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment