Ejemplo n.º 1
0
/** This function gets the players data out of the game and login
 *  database.
 */
function profile_fillUserData($template, $playerData)
{
    global $params, $config;
    ////////////// user data //////////////////////
    $p = new ProfileDataGroup(_('Benutzerdaten'));
    $p->add(new ProfileElementInfo(_('Name'), $playerData['game']['name']));
    $p->add(new ProfileElementInfo(_('Geschlecht'), $playerData['game']['sex']));
    $p->add(new ProfileElementInfo(_('Email'), $playerData['game']['email']));
    $p->add(new ProfileElementInput(_('Email 2'), $playerData['game']['email2'], 'data', 'email2', 30, 90));
    $p->add(new ProfileElementInput(_('Herkunft'), $playerData['game']['origin'], 'data', 'origin', 30, 30));
    $p->add(new ProfileElementInput(_('ICQ#'), $playerData['game']['icq'], 'data', 'icq', 15, 15));
    $p->add(new ProfileElementInput(_('Avatar URL'), $playerData['game']['avatar'], 'data', 'avatar', 60, 200));
    $p->add(new ProfileElementMemo(_('Beschreibung'), $playerData['game']['description'], 'data', 'description', 25, 8));
    tmpl_set($template, '/DATA_GROUP', $p->getTmplData());
    ////////////// L10N //////////////////////
    $uaLanguageNames = LanguageNames::getLanguageNames();
    $p = new ProfileDataGroup(_('Lokalisierung'));
    $slct = new ProfileElementSelection(_('Sprache'), 'data', 'language');
    foreach ($uaLanguageNames as $key => $text) {
        $slct->add(new ProfileSelector($key, $text, $key == $params->SESSION->player->language));
    }
    $p->add($slct);
    tmpl_iterate($template, '/DATA_GROUP');
    tmpl_set($template, '/DATA_GROUP', $p->getTmplData());
    ////////////// template //////////////////////
    $p = new ProfileDataGroup(_('Template auswählen'));
    $slct = new ProfileElementSelection(_('Template auswählen'), 'data', 'template');
    foreach ($config->template_paths as $key => $text) {
        $slct->add(new ProfileSelector($key, $text, $key == $params->SESSION->player->template));
    }
    $p->add($slct);
    tmpl_iterate($template, '/DATA_GROUP');
    tmpl_set($template, '/DATA_GROUP', $p->getTmplData());
    ////////////// gfxpath //////////////////////
    $p = new ProfileDataGroup(_('Grafikpack'));
    $p->add(new ProfileElementInput(sprintf(_('Pfad zum Grafikpack<br />(default:%s)'), DEFAULT_GFX_PATH), $playerData['game']['gfxpath'], 'data', 'gfxpath', 60, 200));
    tmpl_iterate($template, '/DATA_GROUP');
    tmpl_set($template, '/DATA_GROUP', $p->getTmplData());
    ////////////// password //////////////////////
    $p = new ProfileDataGroup(_('Passwort-Änderung'));
    $p->add(new ProfileElementPassword(_('Neues Passwort'), '', 'password', 'password1', 15, 15));
    $p->add(new ProfileElementPassword(_('Neues Passwort - Wiederholung'), '', 'password', 'password2', 15, 15));
    tmpl_iterate($template, '/DATA_GROUP');
    tmpl_set($template, '/DATA_GROUP', $p->getTmplData());
}
Ejemplo n.º 2
0
/** This function gets the players data out of the game and login
 *  database.
 */
function profile_fillUserData($template, $playerData)
{
    global $template;
    $profileData = array();
    $playerData['game']['avatar'] = @unserialize($playerData['game']['avatar']);
    ////////////// user data //////////////////////
    $p = new ProfileDataGroup(_('Benutzerdaten'));
    $p->add(new ProfileElementInfo(_('Name'), $playerData['game']['name']));
    $p->add(new ProfileElementInfo(_('Geschlecht'), $playerData['game']['sex']));
    $p->add(new ProfileElementInfo(_('Email'), $playerData['game']['email']));
    $p->add(new ProfileElementInput(_('Email 2'), $playerData['game']['email2'], 'data', 'email2', 30, 90));
    $p->add(new ProfileElementInput(_('Herkunft'), $playerData['game']['origin'], 'data', 'origin', 30, 30));
    $p->add(new ProfileElementInput(_('ICQ#'), $playerData['game']['icq'], 'data', 'icq', 15, 15));
    $p->add(new ProfileElementInput(_('Avatar URL <br /><small>(max. Breite: ' . MAX_AVATAR_WIDTH . ', max. Höhe: ' . MAX_AVATAR_HEIGHT . ')</small>'), $playerData['game']['avatar']['path'], 'data', 'avatar', 60, 200));
    $p->add(new ProfileElementMemo(_('Beschreibung'), $playerData['game']['description'], 'data', 'description', 25, 8));
    $profileData[] = $p->getTmplData();
    ////////////// L10N //////////////////////
    $uaLanguageNames = LanguageNames::getLanguageNames();
    $p = new ProfileDataGroup(_('Lokalisierung'));
    $slct = new ProfileElementSelection(_('Sprache'), 'data', 'language');
    foreach ($uaLanguageNames as $key => $text) {
        $slct->add(new ProfileSelector($key, $text, $key == $_SESSION['player']->language));
    }
    $p->add($slct);
    $profileData[] = $p->getTmplData();
    ////////////// template //////////////////////
    $p = new ProfileDataGroup(_('Template auswählen'));
    $slct = new ProfileElementSelection(_('Template auswählen'), 'data', 'template');
    foreach (Config::$template_paths as $key => $text) {
        $slct->add(new ProfileSelector($key, $text, $key == $_SESSION['player']->template));
    }
    $p->add($slct);
    $profileData[] = $p->getTmplData();
    ////////////// gfxpath //////////////////////
    $p = new ProfileDataGroup(_('Grafikpack'));
    $p->add(new ProfileElementInput(sprintf(_('Pfad zum Grafikpack<br />(default:%s)'), DEFAULT_GFX_PATH), $playerData['game']['gfxpath'], 'data', 'gfxpath', 60, 200));
    $profileData[] = $p->getTmplData();
    ////////////// password //////////////////////
    $p = new ProfileDataGroup(_('Passwort-Änderung'));
    $p->add(new ProfileElementPassword(_('Neues Passwort'), '', 'password', 'password1', 15, 15));
    $p->add(new ProfileElementPassword(_('Neues Passwort - Wiederholung'), '', 'password', 'password2', 15, 15));
    $profileData[] = $p->getTmplData();
    $template->addVar('profile_data', $profileData);
}