当前位置: 首页>>代码示例>>PHP>>正文


PHP Neuron_Core_Tools::output_form方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:37,代码来源:MyAccount.php

示例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);
     }
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:67,代码来源:Clan.php


注:本文中的Neuron_Core_Tools::output_form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。