starting on email

This commit is contained in:
Mike Macgirvin 2010-07-28 04:45:07 -07:00
parent aaa06c57e6
commit da766f1159
2 changed files with 79 additions and 0 deletions

55
mod/message.php Normal file
View File

@ -0,0 +1,55 @@
<?php
require_once('view/acl_selectors.php');
function message_init(&$a) {
}
function message_content(&$a) {
if(! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
if(($a->argc > 1) && ($a->argv[1] == 'new')) {
$tpl = file_get_contents('view/jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
$select .= contact_select('messageto','message-to-select');
$tpl = file_get_contents('view/prv_message.tpl');
$o = replace_macros($tpl,array(
'$select' => $select
));
return $o;
}
if($a->argc == 1) {
$r = q("SELECT * FROM `mail` WHERE `seen` = 0 AND `uid` = %d LIMIT %d , %d ",
intval($_SESSION['uid']),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
if(! count($r)) {
notice( t('No messages.') . EOL);
return;
}
}
}

24
view/prv_message.tpl Normal file
View File

@ -0,0 +1,24 @@
<div id="prvmail-wrapper" >
<form id="prvmail-form" action="message" method="post" >
$select
<textarea rows="5" cols="64" class="prvmail-text" id="prvmail-text" name="body" ></textarea>
</div>
<div id="prvmail-submit-wrapper" >
<input type="submit" id="prvmail-submit" name="submit" value="Submit" />
<div id="prvmail-upload-wrapper" >
<div id="prvmail-upload-div" ><img id="prvmail-upload" src="images/camera-icon.gif" alt="Upload Photo" title="Upload Photo" /></div>
</div>
<div id="prvmail-link-wrapper" >
<img id="prvmail-link" src="images/link-icon.gif" alt="Insert web link" title="Insert web link" onclick="jotGetLink();" />
</div>
<div id="prvmail-rotator-wrapper" >
<img id="prvmail-rotator" src="images/rotator.gif" alt="Please wait" title="Please wait" style="display: none;" />
</div>
</div>
<div id="prvmail-end"></div>
</form>
</div>