示例#1
0
 /**
  * @param Main $main
  */
 public function execute($main)
 {
     $crService = new Default_Service_CombatReport($main);
     if ($main->getValidator()->isValid() && $main->getValidator()->isValidated()) {
         try {
             $settings = $crService->getSettings();
             $report = $crService->getReport();
             $renderer = $crService->getRenderer($settings, $report);
             $renderedReport = $renderer->renderReport();
             $renderedTitle = $renderer->renderTitle();
             $renderedPreview = Default_Renderer_Helper::parseBBCode($renderedReport);
             $main->getStore()->set('result-content', $renderedReport);
             $main->getStore()->set('result-title', $renderedTitle);
             $main->getStore()->set('result-preview', $renderedPreview);
         } catch (Exception $e) {
             //Debug::arr( $e );
             $main->addInfo(new Info($main->getDict()->getVal('Bad Cr'), Info::ERROR));
             $main->getStore()->set('error', true);
         }
     }
 }
示例#2
0
 /**
  * @param Main $main
  */
 public function __construct($main)
 {
     $this->_main = $main;
     $this->_main->getStore()->set('themes', $this->_themes);
 }