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


PHP Neuron_Core_Tools::checkConfirmLink方法代码示例

本文整理汇总了PHP中Neuron_Core_Tools::checkConfirmLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Neuron_Core_Tools::checkConfirmLink方法的具体用法?PHP Neuron_Core_Tools::checkConfirmLink怎么用?PHP Neuron_Core_Tools::checkConfirmLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Neuron_Core_Tools的用法示例。


在下文中一共展示了Neuron_Core_Tools::checkConfirmLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContent

 public function getContent()
 {
     $text = Neuron_Core_Text::__getInstance();
     if ($this->building) {
         $input = $this->getInputData();
         $me = Neuron_GameServer::getPlayer();
         if ($me && $this->building->getOwner()->getId() == $me->getId() && $this->building->getVillage()->isActive()) {
             if (isset($input['action']) && $input['action'] == 'destruct' && isset($input['key']) && Neuron_Core_Tools::checkConfirmLink($input['key'])) {
                 // Reload
                 reloadEverything();
                 $loc = $this->building->getLocation();
                 //$this->reloadLocation ($loc[0], $loc[1]);
                 return $this->building->destructBuilding();
             } else {
                 // Make sure you are not in vacation mode.
                 if ($this->building->getVillage()->getOwner()->inVacationMode()) {
                     return '<p class="false">' . $text->get('vacationMode', 'main', 'main') . '</p>';
                 }
                 return $this->building->getMyContent($input);
             }
         } else {
             return $this->building->getGeneralContent(false);
         }
     } else {
         return '<p class="false">' . $text->get('notFound', 'building', 'building') . '</p>';
     }
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:27,代码来源:Building.php

示例2: getStartVacation

 private function getStartVacation()
 {
     $myself = Neuron_GameServer::getPlayer();
     $input = $this->getInputData();
     $page = new Neuron_Core_Template();
     if (isset($input['confirm']) && Neuron_Core_Tools::checkConfirmLink($input['confirm'])) {
         if ($myself->startVacationMode()) {
             $page->set('done', true);
         } else {
             $page->set('done', false);
             $page->set('error', $myself->getError());
         }
     } else {
         $page->set('done', false);
     }
     $page->set('checkkey', Neuron_Core_Tools::getConfirmLink());
     return $page->parse('gameserver/account/vacationMode.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:18,代码来源:Vacation.php

示例3: getUpgradeTechnology

 public function getUpgradeTechnology($input)
 {
     $s_technology = $input['technology'];
     $technologies = $this->getTechnologyUpgrades();
     $text = Neuron_Core_Text::__getInstance();
     $text->setFile('building');
     $text->setSection('technology');
     $page = new Neuron_Core_Template();
     $page->set('title', $text->get('technology'));
     $village = $this->getVillage();
     if (in_array($s_technology, $technologies) && !$village->hasTechnology($s_technology, true)) {
         $technology = Dolumar_Technology_Technology::getTechnology($s_technology);
         $showForm = true;
         if ($technology->canResearch($this)) {
             if (isset($input['confirm']) && Neuron_Core_Tools::checkConfirmLink($input['confirm'])) {
                 $cost = $technology->getResearchCost();
                 if (isset($cost['runeId']) && $cost['runeId'] == 'random' && isset($input['runeSelection'])) {
                     $cost['runeId'] = $input['runeSelection'];
                 }
                 if ($village->resources->takeResourcesAndRunes($cost)) {
                     if ($village->trainTechnology($technology)) {
                         $showForm = false;
                         $page->set('done', $text->get('done'));
                         reloadStatusCounters();
                     } else {
                         $page->set('error', 'Error: couldn\'t start the research.');
                     }
                 } else {
                     $page->set('error', $text->get('notEnoughResources'));
                 }
             }
             if ($showForm) {
                 $page->set('youSure', Neuron_Core_Tools::putIntoText($text->get('youSure'), array(Neuron_Core_Tools::output_varchar($technology->getName()))));
                 $page->set('description', Neuron_Core_Tools::output_varchar($technology->getDescription()));
                 $page->set('cost', Neuron_Core_Tools::putIntoText($text->get('costTime'), array($this->resourceToText($technology->getResearchCost(), true, true, false, $this->getBuildingId()))));
                 $page->set('duration', Neuron_Core_Tools::putIntoText($text->get('duration'), array(Neuron_Core_Tools::getDuration($technology->getDuration()))));
                 $page->set('confirm', $text->getClickto($text->get('toConfirm')));
                 $page->set('technology', $s_technology);
                 $page->set('confirmation', Neuron_Core_Tools::getConfirmLink());
             }
         } else {
             return '<p>Invalid input: technology not researchable.</p>';
         }
     } else {
         $page->set('notFound', $text->get('notFound'));
     }
     $page->set('return', $text->getClickto($text->get('toReturn')));
     return $page->parse('buildings/general_tech.tpl');
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:49,代码来源:Building.php


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