本文整理汇总了PHP中Neuron_Core_Tools::output_form方法的典型用法代码示例。如果您正苦于以下问题:PHP Neuron_Core_Tools::output_form方法的具体用法?PHP Neuron_Core_Tools::output_form怎么用?PHP Neuron_Core_Tools::output_form使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Neuron_Core_Tools
的用法示例。
在下文中一共展示了Neuron_Core_Tools::output_form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: chooseNickname
private function chooseNickname()
{
$db = Neuron_Core_Database::__getInstance();
// Check for input
$data = $this->getInputData();
$login = Neuron_Core_Login::__getInstance();
$error = '';
$username = '';
$showForm = true;
$me = Neuron_GameServer::getPlayer();
if (isset($data['username'])) {
$username = $data['username'];
if ($me->setNickname($username)) {
return $this->getPlayerInitialization(true);
} else {
$error = $me->getError();
}
}
if ($showForm) {
$text = Neuron_Core_Text::__getInstance();
$text->setFile('account');
$text->setSection('nickname');
$page = new Neuron_Core_Template();
if (!empty($error)) {
$page->set('error', $text->get($error));
}
if (empty($username) && isset($_SESSION['openid_nickname'])) {
$username = $_SESSION['openid_nickname'];
}
$page->set('chooseName', $text->get('chooseName'));
$page->set('welcome', $text->get('welcome'));
$page->set('username', $text->get('username'));
$page->set('submit', $text->get('submit'));
$page->set('username_value', Neuron_Core_Tools::output_form($username));
return $page->parse('gameserver/account/chooseNickname.tpl');
}
}
示例2: getGovernment
private function getGovernment($clan)
{
$myself = Neuron_GameServer::getPlayer();
// If this guy is not a leader, throw him out
if (!$clan->isLeader($myself)) {
return $this->getOverview($clan);
}
// Check for input
$input = $this->getInputData();
if (isset($input['password'])) {
$clan->setPassword($input['password']);
}
// Define a local variable, this will become false if
// the leadership is given away.
$isLeader = true;
// Check for description
$form = isset($input['form']) ? $input['form'] : null;
switch ($form) {
case 'description':
$name = isset($input['name']) ? $input['name'] : null;
$description = isset($input['description']) ? $input['description'] : null;
if ($name) {
$clan->setName($name, $description);
}
break;
case 'usermanagement':
// Loop trough the members
foreach ($clan->getMembers() as $v) {
// Check for input
$role = isset($input['member_' . $v->getId()]) ? $input['member_' . $v->getId()] : null;
switch ($role) {
case 'leader':
$isLeader = false;
$clan->makeLeader($v);
break;
case 'captain':
case 'member':
$clan->setRole($v, $role);
break;
case 'kick':
$clan->kickFromClan($v);
break;
}
}
$clan->reloadMembers();
break;
}
if ($isLeader) {
$page = new Neuron_Core_Template();
$page->setTextSection('government', 'clan');
$page->set('isProtected', $clan->isPasswordProtected());
// Fetch members and list
foreach ($clan->getMembers() as $v) {
if ($v->getId() != $myself->getId()) {
$page->addListValue('members', array('id' => $v->getId(), 'name' => Neuron_Core_Tools::output_varchar($v->getNickname()), 'role' => $clan->getMemberStatus($v)));
}
}
// Values
$page->set('name_value', Neuron_Core_Tools::output_form($clan->getName()));
$page->set('description_value', Neuron_Core_Tools::output_form($clan->getDescription(false)));
// Get roles
$page->set('roles', array('leader', 'captain', 'member', 'kick'));
return $page->parse('clan/government.phpt');
} else {
return $this->getOverview($clan);
}
}