/
invite.php
140 lines (94 loc) · 4.44 KB
/
invite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
//sc/user/invite.php
include ('sc-app.inc');
include(APP_WEB_DIR . '/inc/header.inc');
use \com\indigloo\Util;
use \com\indigloo\Url;
use \com\indigloo\ui\form\Sticky;
use \com\indigloo\Constants as Constants;
use \com\indigloo\ui\form\Message as FormMessage;
use \com\indigloo\sc\auth\Login as Login;
$gWeb = \com\indigloo\core\Web::getInstance();
$sticky = new Sticky($gWeb->find(Constants::STICKY_MAP,true));
$qUrl = Url::tryBase64QueryParam("q", "/");
$fUrl = Url::current();
$loginId = Login::tryLoginIdInSession() ;
//add security token to form
$formToken = Util::getBase36GUID();
$gWeb->store("form.token",$formToken);
$defaultMessage = \com\indigloo\sc\html\Site::getInvitationMessage();
?>
<!DOCTYPE html>
<html>
<head>
<title> 3mik.com - invite your friends</title>
<?php include(APP_WEB_DIR . '/inc/meta.inc'); ?>
<?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.css"); ?>
</head>
<body>
<style>
/* @inpage @hardcoded remove hack */
.form-table {width:90%;}
</style>
<?php include(APP_WEB_DIR . '/inc/toolbar.inc'); ?>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h3> Send invitations</h3>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<?php FormMessage::render(); ?>
</div>
<div class="span6">
<form id="web-form1" name="web-form1" action="/user/action/invite.php" enctype="multipart/form-data" method="POST">
<table class="form-table">
<tr>
<td> <label>Emails (separate using comma)</label>
<input type="text" name="email" class="required wp100" value="<?php echo $sticky->get('email'); ?>" />
</td>
</tr>
<tr>
<td>
<label>Message* (max 512 chars)</label>
<textarea id="message" maxlength="512" name="message" class="required h130 wp100" cols="50" rows="4" ><?php echo $sticky->get('message',$defaultMessage); ?></textarea>
<br>
<span id="message_counter"></span>
</td>
</tr>
<tr>
<td>
<div class="form-actions">
<button class="btn btn-primary" type="submit" name="save" value="Save"><span>Submit</span></button>
<a href="<?php echo base64_decode($qUrl); ?>"> <button class="btn" type="button" name="cancel"><span>Cancel</span></button> </a>
</div>
</td>
</tr>
</table>
<input type="hidden" name="token" value="<?php echo $formToken; ?>" />
<input type="hidden" name="qUrl" value="<?php echo $qUrl; ?>" />
<input type="hidden" name="fUrl" value="<?php echo $fUrl; ?>" />
</form>
</div> <!-- col:1 -->
<div class="span6">
</div> <!-- col:2 -->
</div>
</div> <!-- container -->
<?php echo \com\indigloo\sc\util\Asset::version("/js/bundle.js"); ?>
<script type="text/javascript">
$(document).ready(function(){
$("#web-form1").validate({
errorLabelContainer: $("#web-form1 div.error")
});
webgloo.sc.util.addTextCounter("#message", "#message_counter");
});
</script>
<div id="ft">
<?php include(APP_WEB_DIR . '/inc/site-footer.inc'); ?>
</div>
</body>
</html>