Beispiel #1
0
    Folks::getUrlFor('list', 'list')->redirect();
}
$form = new Horde_Form($vars, $title, 'editprofile');
$form->addVariable(_("Email"), 'user_email', 'email', true);
$form->addVariable(_("Birthday"), 'user_birthday', 'monthdayyear', false, false, null, array(date('Y') - 90, date('Y') - 10, '%Y%m%d', '%Y%m%d'));
$form->addVariable(_("Gender"), 'user_gender', 'enum', false, false, null, array(array(1 => _("Male"), 2 => _("Female")), _("--- Select ---")));
$form->addVariable(_("City"), 'user_city', 'text', false);
$v = $form->addVariable(_("Country"), 'user_country', 'enum', false, false, null, array(Folks::getCountries()));
$v->setDefault('SI');
$form->addVariable(_("Homepage"), 'user_url', 'text', false);
if ($registry->hasMethod('video/listVideos')) {
    try {
        $result = $registry->call('video/listVideos', array(array('author' => $GLOBALS['registry']->getAuth()), 0, 100));
        $videos = array();
        foreach ($result as $video_id => $video) {
            $videos[$video_id] = $video['video_title'] . ' - ' . Folks::format_date($video['video_created']);
        }
        $video_link = '<a href="' . $registry->link('video/edit') . '">' . _("Upload a new video") . '</a>';
        $form->addVariable(_("Video"), 'user_video', 'enum', false, false, $video_link, array($videos, _("--- Select ---")));
    } catch (Horde_Exception $e) {
        $notification->push($e);
    }
}
$form->addVariable(_("Description"), 'user_description', 'longtext', false, false, false);
$form->addVariable(_("Picture"), 'user_picture', 'image', false);
$form->setButtons(array(_("Save"), _("Delete picture")));
if ($form->validate()) {
    switch (Horde_Util::getFormData('submitbutton')) {
        case _("Save"):
            $form->getInfo(null, $info);
            $info['user_description'] = strip_tags($info['user_description']);