aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/event_calendar')
-rw-r--r--views/default/event_calendar/calendar_toggle.php20
-rw-r--r--views/default/event_calendar/css.php15
-rw-r--r--views/default/event_calendar/filter_menu.php1
-rw-r--r--views/default/event_calendar/group_module.php48
-rw-r--r--views/default/event_calendar/groupprofile_calendar.php11
-rw-r--r--views/default/event_calendar/groupprofile_calendar_deprecated.php44
-rw-r--r--views/default/event_calendar/paged_item_view.php6
-rw-r--r--views/default/event_calendar/paged_view.php21
-rw-r--r--views/default/event_calendar/region_select.php10
-rw-r--r--views/default/event_calendar/review_requests.php21
-rw-r--r--views/default/event_calendar/show_events.php28
11 files changed, 136 insertions, 89 deletions
diff --git a/views/default/event_calendar/calendar_toggle.php b/views/default/event_calendar/calendar_toggle.php
new file mode 100644
index 000000000..7180dec75
--- /dev/null
+++ b/views/default/event_calendar/calendar_toggle.php
@@ -0,0 +1,20 @@
+<?php
+$event = $vars['event_calendar_event'];
+$user = $vars['entity'];
+$container = get_entity($event->container_guid);
+
+if ($container->canEdit()) {
+ $link = '<p class="event-calendar-personal-calendar-toggle"><a href="javascript:void(0);" ';
+ $link .= 'onclick="javascript:event_calendar_personal_toggle('.$event->guid.','.$vars['entity']->guid.'); return false;" ';
+ $link .= ' >';
+ $link .= '<span id="event_calendar_user_data_'.$vars['entity']->guid.'">'.elgg_echo('event_calendar:remove_from_the_calendar').'</span>';
+ $link .= '</a></p>';
+
+ $button = elgg_view('input/button',array(
+ 'id'=>'event_calendar_user_data_'.$event->guid.'_'.$user->guid,
+ 'class' => "event-calendar-personal-calendar-toggle",
+ 'value' => elgg_echo('event_calendar:remove_from_the_calendar_button'),
+ ));
+}
+
+echo '<div class="event-calendar-personal-calendar-toggle-wrapper">'.$button.'<div>';
diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php
index 7e399c547..2059a3ea9 100644
--- a/views/default/event_calendar/css.php
+++ b/views/default/event_calendar/css.php
@@ -8,7 +8,7 @@ $highlight_colour = '#3874B7';
#calendarmenucontainer {
position:relative;
- left: 40px;
+ left: 25px;
}
ul#calendarmenu li {
@@ -117,6 +117,10 @@ td.event_calendar_paged_title {
width: 280px;
}
+td.event_calendar_paged_calendar {
+ padding-left: 30px;
+}
+
table.event_calendar_paged_table {
width:100%;
border-collapse:collapse;
@@ -144,4 +148,13 @@ table.event_calendar_paged_table th {
.event_calendar_strapline {
font-size: 85%;
+}
+
+.event-calendar-personal-calendar-toggle-wrapper {
+ width: 100%;
+ margin-bottom: 30px;
+}
+
+.event-calendar-personal-calendar-toggle {
+ float: right;
} \ No newline at end of file
diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php
index 62d38939b..2d4805bd4 100644
--- a/views/default/event_calendar/filter_menu.php
+++ b/views/default/event_calendar/filter_menu.php
@@ -49,6 +49,7 @@ echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-me
$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar');
if ($event_calendar_region_display == 'yes') {
+ elgg_load_js("elgg.event_calendar");
$url_start .= "/$filter_context";
echo elgg_view('event_calendar/region_select',array('url_start'=>$url_start,'region'=>$vars['region']));
} \ No newline at end of file
diff --git a/views/default/event_calendar/group_module.php b/views/default/event_calendar/group_module.php
index 5fc644e8b..b1c1567e7 100644
--- a/views/default/event_calendar/group_module.php
+++ b/views/default/event_calendar/group_module.php
@@ -9,35 +9,29 @@ if ($group->event_calendar_enable == "no") {
return true;
}
-$all_link = elgg_view('output/url', array(
- 'href' => "event_calendar/group/$group->guid/all",
- 'text' => elgg_echo('link:view:all'),
-));
-
elgg_push_context('widgets');
-$options = array(
- 'type' => 'object',
- 'subtype' => 'event_calendar',
- 'container_guid' => elgg_get_page_owner_guid(),
- 'limit' => 6,
- 'full_view' => false,
- 'pagination' => false,
-);
-$content = elgg_list_entities($options);
+$content = elgg_view('event_calendar/groupprofile_calendar');
elgg_pop_context();
-if (!$content) {
- $content = '<p>' . elgg_echo('event_calendar:no_events_found') . '</p>';
+if (!$content) {
+ if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') {
+ $content = elgg_echo('event_calendar:no_events_found');
+ }
}
-$new_link = elgg_view('output/url', array(
- 'href' => "event_calendar/add/$group->guid",
- 'text' => elgg_echo('event_calendar:new'),
-));
-
-echo elgg_view('groups/profile/module', array(
- 'title' => elgg_echo('event_calendar:group'),
- 'content' => $content,
- 'all_link' => $all_link,
- 'add_link' => $new_link,
-));
+if ($content) {
+ $all_link = elgg_view('output/url', array(
+ 'href' => "event_calendar/group/$group->guid",
+ 'text' => elgg_echo('link:view:all'),
+ ));
+ $new_link = elgg_view('output/url', array(
+ 'href' => "event_calendar/add/$group->guid",
+ 'text' => elgg_echo('event_calendar:new'),
+ ));
+ echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('event_calendar:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+ ));
+}
diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php
index 826fafa67..7ee09104f 100644
--- a/views/default/event_calendar/groupprofile_calendar.php
+++ b/views/default/event_calendar/groupprofile_calendar.php
@@ -20,24 +20,15 @@ if (event_calendar_activated_for_group($page_owner_entity)) {
// Get the upcoming events
$start_date = time(); // now
$end_date = $start_date + 60*60*24*365*2; // maximum is two years from now
- $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,page_owner());
+ $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,elgg_get_page_owner_guid());
// If there are any events to view, view them
if (is_array($events) && sizeof($events) > 0) {
- echo '<div id="group_pages_widget">';
- echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
foreach($events as $event) {
echo elgg_view("object/event_calendar",array('entity' => $event));
}
- echo '<div class="forum_latest"><a href="'.$vars['url'].'pg/event_calendar/group/'.page_owner().'">'.elgg_echo('event_calendar:view_calendar').'</a></div>';
- echo "</div>";
- } else if (get_plugin_setting('group_always_display', 'event_calendar') == 'yes') {
- echo '<div id="group_pages_widget">';
- echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
- echo '<div class="forum_latest">'.elgg_echo('event_calendar:no_events_found').'</div>';
- echo "</div>";
}
}
diff --git a/views/default/event_calendar/groupprofile_calendar_deprecated.php b/views/default/event_calendar/groupprofile_calendar_deprecated.php
new file mode 100644
index 000000000..081a0eb2d
--- /dev/null
+++ b/views/default/event_calendar/groupprofile_calendar_deprecated.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * Elgg event_calendar group profile content
+ *
+ * @package event_calendar
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Kevin Jardine <kevin@radagast.biz>
+ * @copyright Radagast Solutions 2008
+ * @link http://radagast.biz/
+ *
+ */
+
+elgg_load_library('elgg:event_calendar');
+
+$page_owner_entity = elgg_get_page_owner_entity();
+
+if (event_calendar_activated_for_group($page_owner_entity)) {
+ $num = 5;
+ // Get the upcoming events
+ $start_date = time(); // now
+ $end_date = $start_date + 60*60*24*365*2; // maximum is two years from now
+ $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,elgg_get_page_owner_guid());
+
+ // If there are any events to view, view them
+ if (is_array($events) && sizeof($events) > 0) {
+
+ echo '<div id="group_pages_widget">';
+ echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
+ foreach($events as $event) {
+ echo elgg_view("object/event_calendar",array('entity' => $event));
+ }
+ echo '<div class="forum_latest"><a href="'.$vars['url'].'pg/event_calendar/group/'.page_owner().'">'.elgg_echo('event_calendar:view_calendar').'</a></div>';
+ echo "</div>";
+
+ } else if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') {
+ echo '<div id="group_pages_widget">';
+ echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
+ echo '<div class="forum_latest">'.elgg_echo('event_calendar:no_events_found').'</div>';
+ echo "</div>";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/paged_item_view.php b/views/default/event_calendar/paged_item_view.php
index 77c8bed4e..f2092bafc 100644
--- a/views/default/event_calendar/paged_item_view.php
+++ b/views/default/event_calendar/paged_item_view.php
@@ -7,21 +7,19 @@ if (is_numeric($event->start_time)) {
$date_bit = event_calendar_get_formatted_date($event->start_date);
-if (event_calendar_has_personal_event($event->guid,get_loggedin_userid())) {
+if (event_calendar_has_personal_event($event->guid,elgg_get_logged_in_user_guid())) {
$calendar_bit = 'checked = "checked"';
} else {
$calendar_bit = '';
}
-$calendar_bit .= ' onclick="javascript:event_calendar_personal_toggle('.$event->guid.'); return true;" ';
-
$info = '<tr>';
$info .= '<td class="event_calendar_paged_date">'.$date_bit.'</td>';
$info .= '<td class="event_calendar_paged_time">'.$time_bit.'</td>';
$info .= '<td class="event_calendar_paged_title"><a href="'.$event->getUrl().'">'.$event->title.'</a></td>';
$info .= '<td class="event_calendar_paged_venue">'.$event->venue.'</td>';
if ($vars['personal_manage'] != 'no') {
- $info .= '<td class="event_calendar_paged_calendar"><input id="event_calendar_paged_checkbox_'.$event->guid.'" type="checkbox" '.$calendar_bit.' /></td>';
+ $info .= '<td class="event_calendar_paged_calendar"><input class="event_calendar_paged_checkbox" id="event_calendar_paged_checkbox_'.$event->guid.'" '.$calendar_bit.' type="checkbox" /></td>';
}
$info .= '</tr>';
diff --git a/views/default/event_calendar/paged_view.php b/views/default/event_calendar/paged_view.php
index 7c2ea2eaa..f8257792f 100644
--- a/views/default/event_calendar/paged_view.php
+++ b/views/default/event_calendar/paged_view.php
@@ -1,4 +1,5 @@
<?php
+elgg_load_js('elgg.event_calendar');
$nav = elgg_view('navigation/pagination',array(
// 'baseurl' => $_SERVER['REQUEST_URI'],
@@ -8,8 +9,8 @@ $nav = elgg_view('navigation/pagination',array(
'limit' => $vars['limit'],
));
-$event_calendar_times = get_plugin_setting('times', 'event_calendar');
-$event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar');
+$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar');
+$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar');
$events = $vars['events'];
$html = '';
$date_format = 'F Y';
@@ -33,19 +34,3 @@ $msgs = '<div id="event_calendar_paged_messages"></div>';
$html = $msgs.$nav.'<div class="event_calendar_paged">'.$html.'</div>'.$nav;
echo $html;
-?>
-<script type="text/javascript">
-function event_calendar_personal_toggle(guid) {
- $.get("<?php echo $vars['url'].'action/event_calendar/toggle_personal_calendar?'.event_calendar_security_fields().'&event_id='; ?>"+guid,
- function (res) {
- var flag = res.substring(0,3);
- var msg = res.substring(3);
- $('#event_calendar_paged_messages').html(msg);
- if (flag == '@f@') {
- // action failed so toggle checkbox
- $("#event_calendar_paged_checkbox_"+guid).attr('checked',!$("#event_calendar_paged_checkbox_"+guid).attr('checked'));
- }
- }
- );
-}
-</script> \ No newline at end of file
diff --git a/views/default/event_calendar/region_select.php b/views/default/event_calendar/region_select.php
index 81407b27d..a987171a2 100644
--- a/views/default/event_calendar/region_select.php
+++ b/views/default/event_calendar/region_select.php
@@ -1,6 +1,6 @@
<?php
-$region_list = trim(get_plugin_setting('region_list', 'event_calendar'));
+$region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar'));
// make sure that we are using Unix line endings
$region_list = str_replace("\r\n","\n",$region_list);
$region_list = str_replace("\r","\n",$region_list);
@@ -11,13 +11,11 @@ if ($region_list) {
$region_item = trim($region_item);
$options_values[$region_item] = $region_item;
}
- $js = "onchange=\"javascript:$('#event_list').load('".$vars['url_start']
- ."&amp;callback=true&region='+escape($('#region').val() ));\"";
- //$js = "onchange=\"javascript:$('#event_list').load('".$vars['url_start']."&amp;callback=true&region='+$('#region').val());\"";
+
$body .= elgg_echo('event_calendar:region_filter_by_label');
- $body .= elgg_view("input/pulldown",array('internalid' => 'region','js'=>$js,'value'=>$vars['region'],'options_values'=>$options_values));
+ $body .= elgg_view('input/hidden',array('id'=>'event-calendar-region-url-start','value'=>$vars['url_start']));
+ $body .= elgg_view("input/dropdown",array('id' => 'event-calendar-region','value'=>$vars['region'],'options_values'=>$options_values));
$body .= '<br />';
}
echo $body;
-?> \ No newline at end of file
diff --git a/views/default/event_calendar/review_requests.php b/views/default/event_calendar/review_requests.php
index e1866a32b..11916b4e3 100644
--- a/views/default/event_calendar/review_requests.php
+++ b/views/default/event_calendar/review_requests.php
@@ -10,16 +10,21 @@ foreach($vars['requests'] as $request) {
$info .= '<div style="margin-top: 5px;" ></div>';
$info .= elgg_view('output/confirmlink',
array(
- 'class' => "cancel_button",
- 'href' => $vars['url'] . 'action/event_calendar/killrequest?user_guid='.$request->guid.'&event_id=' . $vars['entity']->guid,
+ 'class' => "elgg-button elgg-button-delete",
+ 'href' => 'action/event_calendar/killrequest?user_guid='.$request->guid.'&event_guid=' . $vars['entity']->guid,
'confirm' => elgg_echo('event_calendar:request:remove:check'),
- 'text' => elgg_echo('delete'),
+ 'text' => elgg_echo('event_calendar:review_requests:reject'),
+ 'title' => elgg_echo('event_calendar:review_requests:reject:title'),
));
$info .= '&nbsp;&nbsp;';
- $url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_id={$vars['entity']->guid}");
- $info .= '<a href="'.$url.'" class="add_topic_button">'.elgg_echo('accept').'</a>';
- echo elgg_view_listing($icon,$info);
+ $info .= elgg_view('output/url', array(
+ 'text' => elgg_echo('event_calendar:review_requests:accept'),
+ 'title' => elgg_echo('event_calendar:review_requests:accept:title'),
+ 'href' => "action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}",
+ 'class' => "elgg-button elgg-button-submit",
+ 'is_action' => TRUE,
+ ));
+ //$url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}");
+ echo elgg_view_image_block($icon,$info);
}
}
-
-?>
diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php
index 580fb5a45..b51b1c05f 100644
--- a/views/default/event_calendar/show_events.php
+++ b/views/default/event_calendar/show_events.php
@@ -13,23 +13,21 @@
$listing_format = $vars['listing_format'];
if ($vars['events']) {
- if (elgg_get_plugin_setting('agenda_view', 'event_calendar') == 'yes') {
+ if ($listing_format == 'agenda') {
$event_list = elgg_view('event_calendar/agenda_view',$vars);
+ } else if ($listing_format == 'paged') {
+ $event_list = elgg_view('event_calendar/paged_view',$vars);
} else {
- if ($listing_format == 'paged') {
- $event_list = elgg_view('event_calendar/paged_view',$vars);
- } else {
- $options = array(
- 'list_class' => 'elgg-list-entity',
- 'full_view' => FALSE,
- 'pagination' => TRUE,
- 'list_type' => 'listing',
- 'list_type_toggle' => FALSE,
- 'offset' => $vars['offset'],
- 'limit' => $vars['limit'],
- );
- $event_list = elgg_view_entity_list($vars['events'], $options);
- }
+ $options = array(
+ 'list_class' => 'elgg-list-entity',
+ 'full_view' => FALSE,
+ 'pagination' => TRUE,
+ 'list_type' => 'listing',
+ 'list_type_toggle' => FALSE,
+ 'offset' => $vars['offset'],
+ 'limit' => $vars['limit'],
+ );
+ $event_list = elgg_view_entity_list($vars['events'], $options);
}
} else {
$event_list = '<p>'.elgg_echo('event_calendar:no_events_found').'</p>';