コード例 #1
0
 public function objectResponse($disp)
 {
     $changed = false;
     if ($this->dynamic_attributes->isDynamic('handler')) {
         if ($new = $disp->valueChanged($this->dynamic_attributes->attribute('handler'))) {
             $hand = $new;
             $changed = true;
         } else {
             $hand = Display::rsmlValue($disp->variables(), $this->dynamic_attributes->attribute('handler'));
         }
     } else {
         $hand = $this->attribute('handler');
     }
     if (count($this->qs_nodes)) {
         $vars = array();
         foreach ($this->qs_nodes as $node) {
             $vars[] = $node->templateData(RsmlNode::CTX_ARRAY_ARGUMENT);
         }
         eval('$get_array = array(' . implode(',', $vars) . ');');
         $changed = true;
     } else {
         $get_array = '';
     }
     if ($changed && $disp->allowedHandler($hand)) {
         $disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'href', Display::hrefString($hand, $disp->remoteNum(), $get_array));
         if (!$this->hasAttribute('onclick')) {
             $disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'onclick', RemoteDisplay::onClickString($hand, $disp->remoteNum(), $get_array));
         } else {
             $disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'onclick', $this->attribute('onclick', RsmlNode::CTX_PLAIN));
         }
         if (!$this->text_node) {
             $nav = $disp->getSiteNavigation();
             $item = $nav->getItem($hand);
             $text = $item->displayInfoValue('text');
             $disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'innerHTML', $text);
         }
     }
 }
コード例 #2
0
 public static function triggerEventString($handler, $remote_num, $object_id, $event, $function, $secondary_get_vars = '')
 {
     if ($secondary_get_vars) {
         $new_secondary_get_vars = $secondary_get_vars;
     } else {
         $new_secondary_get_vars = array();
     }
     $new_secondary_get_vars['object_id'] = $object_id;
     $new_secondary_get_vars['event'] = $event;
     $new_secondary_get_vars['function'] = $function;
     return str_replace('return ', '', RemoteDisplay::onClickString($handler, $remote_num, $new_secondary_get_vars));
 }