示例#1
0
 /**
  * Process uploaded files and removing of characters, as well as showing of the characters list.
  *
  * @return void
  */
 public function process()
 {
     if ($_FILES['fileupload']) {
         $file = $_FILES['fileupload']['tmp_name'];
         $heroImport = new \Helper\HeroImport(file_get_contents($file));
         if ($heroImport->import()) {
             redirect('index.php?page=Characters&success=1');
         } else {
             redirect('index.php?page=Characters&error=1');
         }
     }
     if ($_GET['remove']) {
         $this->removeCharacter(\Model\Character::loadById($_GET['remove']));
     }
     $this->getTemplate()->assign('characters', \Listing\Characters::loadList());
 }
示例#2
0
    /**
     * Add javascripts, handle the removing of craftings and show the list of undergoing and done
     * craftings.
     *
     * @return void
     */
    public function process()
    {
        $this->getTemplate()->loadJs('addCrafting');
        $this->getTemplate()->loadJs('jquery.blueprint');
        $this->getTemplate()->loadJs('showCrafting');
        $this->getTemplate()->loadJs('jquery.addTalentPoints');
        $this->getTemplate()->loadJsReadyScript('
			$(document).tooltip({
				content: function () {
					$(this).addClass("tooltip");
					return $(this).attr("title").replace(/(?:\\r\\n|\\r|\\n)/g, "<br />");
				}
			});
			$(".addTalentPoints").addTalentPoints();
		');
        $craftingsList = \Listing\Craftings::loadList();
        if ($_GET['remove']) {
            $this->removeCrafting($craftingsList->getById($_GET['remove']));
        }
        $this->getTemplate()->assign('blueprints', \Listing\Blueprints::loadList());
        $this->getTemplate()->assign('characters', \Listing\Characters::loadList());
        $this->getTemplate()->assign('craftings', $craftingsList);
    }