aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.htaccess1
-rw-r--r--include/dir_fns.php2
-rw-r--r--include/widgets.php16
-rw-r--r--install/INSTALL.txt41
-rwxr-xr-xmod/events.php21
-rw-r--r--view/css/bootstrap-red.css3
-rw-r--r--view/css/mod_events.css36
-rw-r--r--view/pdl/mod_events.pdl1
-rw-r--r--view/theme/redbasic/css/style.css78
-rwxr-xr-xview/tpl/event_head.tpl4
-rwxr-xr-xview/tpl/events-js.tpl17
-rwxr-xr-xview/tpl/events_menu_side.tpl (renamed from view/tpl/events_side.tpl)0
-rwxr-xr-xview/tpl/events_tools_side.tpl15
13 files changed, 128 insertions, 107 deletions
diff --git a/.htaccess b/.htaccess
index 7f3935117..5f6414882 100644
--- a/.htaccess
+++ b/.htaccess
@@ -28,3 +28,4 @@ AddType audio/ogg .oga
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>
+
diff --git a/include/dir_fns.php b/include/dir_fns.php
index b9f221bd1..fd2a5835d 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -22,7 +22,7 @@ function find_upstream_directory($dirmode) {
$r = q("select * from site where site_url = '%s' limit 1",
dbesc($preferred)
);
- if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STADALONE)) {
+ if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STANDALONE)) {
$preferred = '';
}
}
diff --git a/include/widgets.php b/include/widgets.php
index a3f7444ec..d4f3d32e1 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -666,7 +666,7 @@ function widget_eventsmenu($arr) {
if (! local_channel())
return;
- return replace_macros(get_markup_template('events_side.tpl'), array(
+ return replace_macros(get_markup_template('events_menu_side.tpl'), array(
'$title' => t('Events Menu'),
'$day' => t('Day View'),
'$week' => t('Week View'),
@@ -677,6 +677,18 @@ function widget_eventsmenu($arr) {
));
}
+function widget_eventstools($arr) {
+ if (! local_channel())
+ return;
+
+ return replace_macros(get_markup_template('events_tools_side.tpl'), array(
+ '$title' => t('Events Tools'),
+ '$export' => t('Export Calendar'),
+ '$import' => t('Import Calendar'),
+ '$submit' => t('Submit')
+ ));
+}
+
function widget_design_tools($arr) {
$a = get_app();
@@ -1147,6 +1159,8 @@ function widget_forums($arr) {
function widget_tasklist($arr) {
+ if (! local_channel())
+ return;
require_once('include/event.php');
$o .= '<script>var tasksShowAll = 0; $(document).ready(function() { tasksFetch(); $("#tasklist-new-form").submit(function(event) { event.preventDefault(); $.post( "tasks/new", $("#tasklist-new-form").serialize(), function(data) { tasksFetch(); $("#tasklist-new-summary").val(""); } ); return false; } )});</script>';
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index c81510522..25852497b 100644
--- a/install/INSTALL.txt
+++ b/install/INSTALL.txt
@@ -341,3 +341,44 @@ This is obvious as soon as you notice that the cron uses proc_open to
execute php-scripts that also use proc_open, but it took me quite some time to
find that out. I hope this saves some time for other people using suhosin with
function blacklists.
+
+#####################################################################
+- Apache processes hanging, using as much CPU as they can
+#####################################################################
+
+This seems to happen sometimes if you use mpm_prefork and the PHP process
+started by Apache cannot get database access.
+
+Consider the following settings:
+
+In /etc/apache2/mods-enabled/mpm_prefork.conf (Debian, path and file name
+may vary depending on your OS and distribution), set
+
+ GracefulShutdownTimeout 300
+
+This makes sure that Apache processes that are running wild will not do so
+forever, but will be killed if they didn't stop five minutes after a
+shutdown command was sent to the process.
+
+If you expect high load on your server (public servers, e.g.), also make
+sure that Apache will not spawn more processes than MySQL will accept
+connections.
+
+In the default Debian configuration, in
+/etc/apache2/mods-enabled/mpm_prefork.conf the maximum number of workers
+is set to 150:
+
+ MaxRequestWorkers 150
+
+However, in /etc/mysql/my.cnf the maximum number of connection is set to
+100:
+
+ max_connections = 100
+
+150 workers are a lot and probably too much for small servers. However you
+set those values, make sure that the number of Apache workers is smaller
+than the number of connections MySQL accepts, leaving some room for other
+stuff on your server that might access MySQL, and Hubzilla's poller which
+needs MySQL access, too. A good setting for a medium-sized hub might be to
+keep MySQL's max_connections at 100 and set mpm_prefork's
+MaxRequestWorkers to 70.
diff --git a/mod/events.php b/mod/events.php
index 64d7dfb93..080c39911 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -90,7 +90,7 @@ function events_post(&$a) {
linkify_tags($a, $desc, local_channel());
linkify_tags($a, $location, local_channel());
- $action = ($event_hash == '') ? 'new' : "event/" . $event_hash;
+ //$action = ($event_hash == '') ? 'new' : "event/" . $event_hash;
//fixme: this url gives a wsod if there is a linebreak detected in one of the variables ($desc or $location)
//$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type";
@@ -376,39 +376,24 @@ function events_content(&$a) {
if(x($orig_event))
$tz = (($orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
-// $syear = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'Y') : '0000');
-// $smonth = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'm') : '00');
-// $sday = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'd') : '00');
-
$syear = datetime_convert('UTC', $tz, $sdt, 'Y');
$smonth = datetime_convert('UTC', $tz, $sdt, 'm');
$sday = datetime_convert('UTC', $tz, $sdt, 'd');
-
-// $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00');
-// $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00');
-
$shour = datetime_convert('UTC', $tz, $sdt, 'H');
$sminute = datetime_convert('UTC', $tz, $sdt, 'i');
$stext = datetime_convert('UTC',$tz,$sdt);
$stext = substr($stext,0,14) . "00:00";
-// $fyear = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'Y') : '0000');
-// $fmonth = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'm') : '00');
-// $fday = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'd') : '00');
-
$fyear = datetime_convert('UTC', $tz, $fdt, 'Y');
$fmonth = datetime_convert('UTC', $tz, $fdt, 'm');
$fday = datetime_convert('UTC', $tz, $fdt, 'd');
-
-// $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00');
-// $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00');
-
$fhour = datetime_convert('UTC', $tz, $fdt, 'H');
$fminute = datetime_convert('UTC', $tz, $fdt, 'i');
$ftext = datetime_convert('UTC',$tz,$fdt);
$ftext = substr($ftext,0,14) . "00:00";
+
$type = ((x($orig_event)) ? $orig_event['type'] : 'event');
$f = get_config('system','event_input_format');
@@ -608,7 +593,7 @@ function events_content(&$a) {
$last_date = $d;
- $edit = array($a->get_baseurl().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','');
+ $edit = ((local_channel() && $rr['author_xchan'] == get_observer_hash()) ? array($a->get_baseurl().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','') : false);
$drop = array($a->get_baseurl().'/events/drop/'.$rr['event_hash'],t('Delete event'),'','');
diff --git a/view/css/bootstrap-red.css b/view/css/bootstrap-red.css
index 19796679a..29164c7ad 100644
--- a/view/css/bootstrap-red.css
+++ b/view/css/bootstrap-red.css
@@ -57,7 +57,8 @@ nav .navbar-toggle {
/* nav overrides end */
-aside .nav-pills > li > a {
+aside .nav-pills > li > a,
+.response-list .nav-pills > li > a {
padding: 6px 10px;
}
diff --git a/view/css/mod_events.css b/view/css/mod_events.css
index 5e0fc2bce..dc1dc902f 100644
--- a/view/css/mod_events.css
+++ b/view/css/mod_events.css
@@ -4,6 +4,21 @@
margin-bottom: -1px;
}
+.fc-unthemed th,
+.fc-unthemed td,
+.fc-unthemed thead,
+.fc-unthemed tbody,
+.fc-unthemed .fc-divider,
+.fc-unthemed .fc-row,
+.fc-unthemed .fc-popover {
+ border-color: #ccc !important;
+}
+
+#events-spinner .spinner {
+ margin-top: 9px;
+ margin-bottom: -9px;
+}
+
.bootstrap-tagsinput {
width: 100%;
padding: 6px 12px;
@@ -14,3 +29,24 @@
height: auto;
padding: 10px;
}
+
+.event-owner {
+ margin-bottom: 15px;
+}
+
+.event-owner img {
+ margin-right: 5px;
+}
+
+.event-buttons,
+.event-description {
+ margin-top: 10px;
+}
+
+#event-upload-form {
+ margin-top: 10px;
+}
+
+#event-upload-choose {
+ width: 100%;
+}
diff --git a/view/pdl/mod_events.pdl b/view/pdl/mod_events.pdl
index 5a71d88d9..a3bc0c019 100644
--- a/view/pdl/mod_events.pdl
+++ b/view/pdl/mod_events.pdl
@@ -1,4 +1,5 @@
[region=aside]
[widget=eventsmenu][/widget]
+[widget=eventstools][/widget]
[widget=tasklist][/widget]
[/region]
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index fe6f10365..e392f00d9 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -241,7 +241,8 @@ footer {
padding-right: 3em;
}
-.birthday-today, .event-today {
+.birthday-today,
+.event-today {
font-weight: bold;
}
@@ -847,68 +848,6 @@ nav .acpopup {
cursor: pointer;
}
-.fc-unthemed th,
-.fc-unthemed td,
-.fc-unthemed thead,
-.fc-unthemed tbody,
-.fc-unthemed .fc-divider,
-.fc-unthemed .fc-row,
-.fc-unthemed .fc-popover {
- border-color: #ccc !important;
-}
-
-.wall-event-item {
- padding: 10px;
- color: #fff;
- background-color: #3A87AD; /* should reflect calendar color */
- border-top-left-radius: $radiuspx;
- border-top-right-radius: $radiuspx;
-}
-
-.vevent .event-end {
- padding-bottom: 10px;
-}
-
-#event-summary-text {
- margin-top: 15px;
-}
-
-
-#new-event-link {
- margin-bottom: 10px;
-}
-
-.edit-event-link, .plink-event-link, .drop-event-link {
- float: left;
- margin-top: 4px;
- margin-right: 4px;
- margin-bottom: 15px;
-}
-
-.event-owner img {
- padding-bottom: 10px;
- padding-right: 10px;
-}
-
-.event-buttons {
- margin-top: 10px;
-}
-
-.event-list-date {
- margin-bottom: 10px;
-}
-
-.prevcal, .nextcal {
- float: left;
- margin-left: 32px;
- margin-right: 32px;
- margin-top: 64px;
-}
-.event-calendar-end {
- clear: both;
-}
-
-
#cboxOverlay {
z-index: 1050;
}
@@ -1562,8 +1501,12 @@ img.mail-conv-sender-photo {
padding: 0.5em 10px;
}
-.wall-photo-item {
- /*padding: 0.5em 10px;*/
+.wall-event-item {
+ padding: 10px;
+ color: #fff;
+ background-color: #3A87AD; /* should reflect calendar color */
+ border-top-left-radius: $radiuspx;
+ border-top-right-radius: $radiuspx;
}
.wall-photo-item img {
@@ -2252,8 +2195,3 @@ nav .badge.mail-update:hover {
.help-searchlist a {
font-size: 130%;
}
-
-.response-list ul {
- list-style-type: none;
-}
-
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl
index 6a38057fd..dc98d14b3 100755
--- a/view/tpl/event_head.tpl
+++ b/view/tpl/event_head.tpl
@@ -55,7 +55,11 @@
showEvent(calEvent.id);
},
loading: function(isLoading, view) {
+ $('#events-spinner').spin('tiny');
+ $('#events-spinner > i').css('color', 'transparent');
if(!isLoading) {
+ $('#events-spinner').spin(false);
+ $('#events-spinner > i').css('color', '');
$('td.fc-day').dblclick(function() {
openMenu('form');
//window.location.href='/events/new?start='+$(this).data('date');
diff --git a/view/tpl/events-js.tpl b/view/tpl/events-js.tpl
index b2de90da1..08c8aa64a 100755
--- a/view/tpl/events-js.tpl
+++ b/view/tpl/events-js.tpl
@@ -1,12 +1,10 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<div class="pull-right">
- <button class="btn btn-default btn-xs" onclick="openClose('event-tools'); closeMenu('form');"><i class="icon-cog"></i></button>
<button class="btn btn-success btn-xs" onclick="openClose('form'); closeMenu('event-tools');">{{$new_event.1}}</button>
-
<div class="btn-group">
<button class="btn btn-default btn-xs" onclick="changeView('prev', false);" title="{{$prev}}"><i class="icon-backward"></i></button>
- <button class="btn btn-default btn-xs" onclick="changeView('today', false);" title="{{$today}}"><i class="icon-bullseye"></i></button>
+ <button id="events-spinner" class="btn btn-default btn-xs" onclick="changeView('today', false);" title="{{$today}}"><i class="icon-bullseye"></i></button>
<button class="btn btn-default btn-xs" onclick="changeView('next', false);" title="{{$next}}"><i class="icon-forward"></i></button>
</div>
</div>
@@ -16,19 +14,6 @@
<div id="form" class="section-content-tools-wrapper"{{if !$expandform}} style="display:none;"{{/if}}>
{{$form}}
</div>
- <div id="event-tools" class="section-content-tools-wrapper" style="display:none;">
- <div class="form-group">
- <button class="btn btn-primary btn-xs" onclick="exportDate(); return false;"><i class="icon-download"></i>&nbsp;{{$export.1}}</button>
- <button class="btn btn-primary btn-xs" onclick="openClose('event-upload-form');"><i class="icon-upload"></i>&nbsp;{{$upload}}</button>
- </div>
- <div id="event-upload-form" style="display:none;">
- <form action="events" enctype="multipart/form-data" method="post" name="event-upload-form" id="event-upload-form">
- <button id="dbtn-submit" class="btn btn-primary btn-sm pull-right" type="submit" name="submit" >{{$submit}}</button>
- <input id="event-upload-choose" type="file" name="userfile" />
-
- </form>
- </div>
- </div>
<div class="clear"></div>
<div class="section-content-wrapper-np">
<div id="events-calendar"></div>
diff --git a/view/tpl/events_side.tpl b/view/tpl/events_menu_side.tpl
index b9a9062b1..b9a9062b1 100755
--- a/view/tpl/events_side.tpl
+++ b/view/tpl/events_menu_side.tpl
diff --git a/view/tpl/events_tools_side.tpl b/view/tpl/events_tools_side.tpl
new file mode 100755
index 000000000..5e20511fc
--- /dev/null
+++ b/view/tpl/events_tools_side.tpl
@@ -0,0 +1,15 @@
+<div class="widget">
+ <h3>{{$title}}</h3>
+ <ul class="nav nav-pills nav-stacked">
+ <li><a href="#" onclick="exportDate(); return false;"><i class="icon-download"></i>&nbsp;{{$export}}</a></li>
+ <li><a href="#" onclick="openClose('event-upload-form'); return false;"><i class="icon-upload"></i>&nbsp;{{$import}}</a></li>
+ </ul>
+ <div id="event-upload-form" style="display: none;">
+ <form action="events" enctype="multipart/form-data" method="post" name="event-upload-form" id="event-upload-form">
+ <div class="form-group">
+ <input id="event-upload-choose" type="file" name="userfile" />
+ </div>
+ <button id="dbtn-submit" class="btn btn-primary btn-xs" type="submit" name="submit" >{{$submit}}</button>
+ </form>
+ </div>
+</div>