Ejemplo n.º 1
0
                            // TODO: abstract this out.
                            $kronolith_driver->move($eventId, $target);
                            $kronolith_driver->open($target);
                            $event = $kronolith_driver->getEvent($eventId);
                        } catch (Exception $e) {
                            $notification->push(sprintf(_("There was an error moving the event: %s"), $e->getMessage()), 'horde.error');
                        }
                    } else {
                        $kronolith_driver->deleteEvent($eventId);
                        $kronolith_driver = Kronolith::getDriver($targetType, $target);
                        $event = $kronolith_driver->getEvent();
                    }
                }
            }
        }
        if ($event) {
            $event->readForm();
            _save($event);
        }
    } catch (Exception $e) {
        $notification->push(sprintf(_("There was an error accessing the calendar: %s"), $e->getMessage()), 'horde.error');
    }
} while (false);
$url = Horde_Util::getFormData('url');
if (!empty($url)) {
    $url = new Horde_Url($url, true);
} else {
    $url = Horde::url($prefs->getValue('defaultview') . '.php', true)->add(array('month' => Horde_Util::getFormData('month'), 'year' => Horde_Util::getFormData('year')));
}
/* Make sure URL is unique. */
$url->unique()->redirect();
Ejemplo n.º 2
0
function crawler($id, $url)
{
    $content = _curl_get_file_contents($url);
    _save($id, $url, $content);
    if ($content) {
        $url_list = _reviseUrl($url, _filterUrl($content));
        if ($url_list) {
            return $url_list;
        } else {
            return;
        }
    } else {
        return;
    }
}
Ejemplo n.º 3
0
*	returns:	message string (green/red)
*/
function _change($lineup_ID, $type_ID)
{
    global $dbi;
    if ($lineup_ID > 0) {
        $qry = 'UPDATE tblteamplayer set ltype=' . $type_ID . ' WHERE lid=' . $lineup_ID . ' limit 1';
        $presult = sql_query($qry, $dbi);
    } else {
        $presult = 0;
    }
    if ($presult == 1) {
        echo "<font color=\"green\">Success</font>";
    } else {
        echo "<font color=\"red\">Error</font>";
    }
}
switch ($myAction) {
    default:
        _blank();
        break;
    case "save":
        _save($lineup_ID, $event_ID, $team_ID, $player_ID);
        break;
    case "remove":
        _remove($lineup_ID);
        break;
    case "change":
        _change($lineup_ID, $type_ID);
        break;
}