. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
fi
-REAL_DAEMON=$GNUSTEP_SYSTEM_ROOT/Tools/sogod-0.9
+REAL_DAEMON=sogod-0.9
DAEMON=/usr/sbin/sogod
NAME=sogo
DESC="Scalable OpenGroupware.Org (Inverse edition)"
case "$1" in
start)
- echo -n $"Starting $DESC: "
+ echo $"Starting $DESC: "
for ((a=1; a <= PREFORK ; a++))
do
- daemon su - sogo -c "$DAEMON $a"
+ daemon --user=sogo $DAEMON $a
+ echo "$DAEMON $a"
done
-# daemon --user sogo --pidfile $PIDFILE $DAEMON
- echo "$NAME."
;;
stop)
echo -n $"Stopping $DESC: "
- killproc `basename $REAL_DAEMON` && rm -f ${PIDFILE}*
-# killproc -p $PIDFILE $REAL_DAEMON && rm -f $PIDFILE
+ killproc $REAL_DAEMON && rm -f ${PIDFILE}*
echo "$NAME."
;;
restart|force-reload)
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
+if [ -f $GNUSTEP_USER_ROOT/Tools/sogod-0.9 ]; then
+ sogod="$GNUSTEP_USER_ROOT/Tools/sogod-0.9"
+elif [ -f $GNUSTEP_LOCAL_ROOT/Tools/sogod-0.9 ]; then
+ sogod="$GNUSTEP_LOCAL_ROOT/Tools/sogod-0.9"
+else
+ echo "Can't find sogod-0.9"
+ exit 1
+fi
+
echo $$ > $PIDFILE
startport=`defaults read sogod-0.9 WOPort`
fi
let "port=$startport + $1 - 1"
-exec $GNUSTEP_LOCAL_ROOT/Tools/sogod-0.9 -WOPort $port >& /var/log/sogo/sogod-$port.log
+exec $sogod -WOPort $port >& /var/log/sogo/sogod-$port.log &
return s;
}
-function getQueryParaArray(s) {
- if (s.charAt(0) == "?") s = s.substr(1, s.length - 1);
- return s.split("&");
-}
-
-function getQueryParaValue(s, name) {
- var t;
-
- t = getQueryParaArray(s);
- for (var i = 0; i < t.length; i++) {
- var s = t[i];
-
- if (s.indexOf(name) != 0)
- continue;
-
- s = s.substr(name.length, s.length - name.length);
- return decodeURIComponent(s);
- }
- return null;
-}
-
-/* opener callback */
-
-function triggerOpenerCallback() {
- /* this code has some issue if the folder has no proper trailing slash! */
- if (window.opener && !window.opener.closed) {
- var t, cburl;
-
- t = getQueryParaValue(window.location.search, "openerurl=");
- cburl = window.opener.location.href;
- if (cburl[cburl.length - 1] != "/") {
- cburl = cburl.substr(0, cburl.lastIndexOf("/") + 1);
- }
- cburl = cburl + t;
- window.opener.location.href = cburl;
- }
-}
-
/* selection mechanism */
function deselectAll(parent) {
hideMenu(document.currentPopupMenu);
var popup = $(menuId);
- var menuTop = Event.pointerY(event);
- var menuLeft = Event.pointerX(event);
+
+ var deltaX = 0;
+ var deltaY = 0;
+
+ var pageContent = $("pageContent");
+ if (popup.parentNode.tagName != "BODY") {
+ var offset = pageContent.cascadeLeftOffset();
+ deltaX = -($(popup.parentNode).cascadeLeftOffset() - offset);
+ offset = pageContent.cascadeTopOffset();
+ deltaY = -($(popup.parentNode).cascadeTopOffset() - offset);
+ }
+
+ var menuTop = Event.pointerY(event) + deltaY;
+ var menuLeft = Event.pointerX(event) + deltaX;
var heightDiff = (window.height()
- (menuTop + popup.offsetHeight));
if (heightDiff < 0)