Project

General

Profile

1
<?php
2

    
3
defined('_JEXEC') or die('Access denied');
4

    
5
jimport('joomla.environment.uri');
6
jimport('joomla.html.html');
7
jimport('joomla.methods');
8

    
9
JHtml :: _('behavior.framework',true);
10
$document = JFactory :: getDocument();
11
$document -> addStyleSheet(JRoute :: _(JUri :: base() . 'components/com_openaire/css/Meio.Autocomplete.css'));
12
$document -> addScriptDeclaration("var openaireProjectsRawUrl = '" . jRoute::_("index.php?option=com_openaire&view=topics&format=raw&Itemid=" . $this->itemId, false) . "'");
13
$document -> addScript(JRoute :: _(JUri :: base() . 'components/com_openaire/js/alerts.js'));
14
$document -> addScript(JRoute :: _(JUri :: base() . 'components/com_openaire/js/Meio.Autocomplete.js'));
15

    
16
?>
17

    
18
<div>
19
	<p><?php echo(JText :: _('USE_THIS_SERVICE_TO_GET_UPDATES_ON_THE_TOPICS_OF_YOUR_CHOICE')); ?></p>
20
	<div class="manage_alerts">
21
		<h3><?php echo(JText :: _('MANAGE_YOUR_ALERTS')); ?></h3>
22
		<?php if ($this -> subscriptions === NULL) { ?>
23
			<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_YOUR_OPENAIRE_ALERTS')); ?></div>
24
		<?php } else if ($this -> subscriptions == NULL) { ?>
25
			<div class="box-info"><?php echo(JText :: _('YOU_DON_T_HAVE_ANY_OPENAIRE_ALERTS')); ?></div>
26
		<?php } else { ?>
27
			<table class="zebra subscriptions">
28
				<thead>
29
					<tr>
30
						<th><?php echo(JText :: _('TOPIC')); ?></th>
31
						<th style="width: 25%;"><?php echo(JText :: _('HOW')); ?></th>
32
						<th style="width: 15%;"><?php echo(JText :: _('HOW_OFTEN')); ?></th>
33
						<th style="width: 5%;">&nbsp;</th>
34
					</tr>
35
				</thead>
36
				<tbody>
37
					<?php foreach ($this -> subscriptions as $subscription) { ?>
38
						<tr>
39
							<td><?php echo($subscription -> topic); ?></td>
40
							<td><?php echo($subscription -> alertModeName); ?></td>
41
							<td><?php echo($subscription -> batchPeriod); ?></td>
42
							<td>
43
								<form method="post" action="<?php echo(JRoute :: _('index.php?option=com_openaire&view=alerts&ItemId=' . ($this -> itemId) . '&action=remove')); ?>">
44
									<input type="hidden" name="templateId" value="<?php echo($subscription -> templateId); ?>" />
45
									<input type="hidden" name="notificationService" value="<?php echo($subscription -> notificationService); ?>" />
46
									<input type="hidden" name="queryId" value="<?php echo($subscription -> queryId); ?>" />
47
									<input type="hidden" name="resultId" value="<?php echo($subscription -> resultId); ?>" />
48
									<input type="hidden" name="alertMode" value="<?php echo($subscription -> alertMode); ?>" />
49
									<input type="hidden" name="subscriber" value="<?php echo($subscription -> subscriber); ?>" />
50
									<input type="submit" value="<?php echo(JText :: _('REMOVE')); ?>" />
51
								</form>
52
							</td>
53
						</tr>
54
					<?php } ?>
55
				</tbody>
56
			</table>
57
		<?php } ?>
58
	</div>
59
	<div class="create_alert">
60
		<h3><?php echo(JText :: _('CREATE_NEW_ALERT')); ?></h3>
61
		<form id="addAlert" method="post" action="<?php echo(JRoute :: _('index.php?option=com_openaire&view=alerts&ItemId=' . ($this -> itemId) . '&action=add')); ?>">
62
			
63
			<!-- topics -->
64
			<input type="hidden" name="templateId" value="" />
65
			<input type="hidden" name="notificationService" value="" />
66
			<input type="hidden" name="queryId" value="" />
67
			<input type="hidden" name="resultId" value="" />
68
			<input type="hidden" name="maxTopics" value="<?php echo(OpenAireViewAlerts :: MAX_TOPICS); ?>" disabled="disabled" />
69
			<div class="topics comments"></div>
70
			<div class="topicDescription comments">&nbsp;</div>			
71
			<!-- topics -->
72
			
73
			<!-- alert modes -->
74
			<div>
75
				<label><?php echo(JText :: _('HOW_TO_DELIVER')); ?></label>
76
				<select name="alertMode"></select>
77
			</div>
78
			<div class="alertModeDescription comments">&nbsp;</div>
79
			<div class="alertMode">
80
				<input type="hidden" class="id" value="" />
81
				<input type="hidden" class="name" value="<?php echo(JText :: _('SELECT')); ?>" />
82
				<input type="hidden" class="description" value="&nbsp;" />
83
				<input type="hidden" class="batch" value="false" />
84
			</div>
85
			<?php foreach ($this -> alertModes as $alertMode) { ?>
86
				<div class="alertMode">
87
					<input type="hidden" class="id" value="<?php echo($alertMode -> id); ?>" />
88
					<input type="hidden" class="name" value="<?php echo($alertMode -> name); ?>" />
89
					<input type="hidden" class="description" value="<?php echo($alertMode -> description); ?>" />
90
					<input type="hidden" class="batch" value="<?php echo(($alertMode -> batch) ? 'true' : 'false'); ?>" />
91
				</div>
92
			<?php } ?>
93
			<div class="alertModeBatch">
94
				<label><?php echo(JText :: _('HOW_OFTEN')); ?></label>
95
				<select name="batchPeriod">
96
					<option value="0"><?php echo(JText :: _('AS_IT_HAPPENS')); ?></option>
97
					<option value="<?php echo(24 * 60); ?>"><?php echo(JText :: _('DAILY')); ?></option>
98
					<option value="<?php echo(7 * 24 * 60); ?>"><?php echo(JText :: _('WEEKLY')); ?></option>
99
					<option value="<?php echo(15 * 24 * 60); ?>"><?php echo(JText :: _('BI_MONTHLY')); ?></option>
100
					<option value="<?php echo(30 * 24 * 60); ?>"><?php echo(JText :: _('MONTHLY')); ?></option>
101
				</select>
102
			</div>
103
			<!-- alert modes -->
104
			
105
			<div>
106
				<input type="submit" value="<?php echo(JText :: _('CREATE_ALERT')); ?>" />
107
			</div>
108
		</form>
109
	</div>
110
</div>
111

    
(1-1/3)