Esempio n. 1
0
 /**
  * This function is called when hook uses the automatic insert template.
  *
  * @param HookRenderEvent $event
  * @param string $code
  */
 public function insertTemplate(HookRenderEvent $event, $code)
 {
     if (array_key_exists($code, $this->templates)) {
         $templates = explode(';', $this->templates[$code]);
         foreach ($templates as $template) {
             list($type, $filepath) = $this->getTemplateParams($template);
             if ("render" === $type) {
                 $event->add($this->render($filepath, $event->getArguments()));
                 continue;
             }
             if ("dump" === $type) {
                 $event->add($this->render($filepath));
                 continue;
             }
             if ("css" === $type) {
                 $event->add($this->addCSS($filepath));
                 continue;
             }
             if ("js" === $type) {
                 $event->add($this->addJS($filepath));
                 continue;
             }
             if (method_exists($this, $type)) {
                 $this->{$type}($filepath, $event->getArguments());
             }
         }
     }
 }
Esempio n. 2
0
 public function onTeamNavBar(HookRenderEvent $event)
 {
     $query = DealerTeamQuery::create();
     $joinPerson = new Join(DealerTeamTableMap::TEAM_ID, PersonTeamLinkTableMap::TEAM_ID, Criteria::LEFT_JOIN);
     $query->addJoinObject($joinPerson)->where(PersonTeamLinkTableMap::PERSON_ID . " " . Criteria::EQUAL . " " . $event->getArgument("person_id"));
     $dealer = $query->findOne();
     $args = $event->getArguments();
     if (null != $dealer) {
         $args["dealer_id"] = $dealer->getDealerId();
     }
     $event->add($this->render("includes/person-edit-link.html", $args));
 }
Esempio n. 3
0
 public function insertSelectCity(HookRenderEvent $event)
 {
     $argument = $event->getArguments();
     $event->add($this->render("form/select-city.html", $argument));
 }
Esempio n. 4
0
 public function onOrderInvoiceDeliveryAddress(HookRenderEvent $event)
 {
     $content = $this->render("delivery-address.html", $event->getArguments());
     $event->add($content);
 }