protected function __trigger() { $xml = new XMLelement('shopping-cart'); if ($_GET['cart-action']) { $action = $_GET['cart-action']; } else { list($action) = array_keys($_POST['cart-action']); } if (!method_exists($this, $action)) { $this->_error = true; $this->_msg = __('Unaccepted action'); } if (!$this->_error) { $this->_s =& $_SESSION[__SYM_COOKIE_PREFIX_ . 'cart']; $this->{$action}(); } $xml->setAttributeArray(array('action' => General::sanitize($action), 'result' => $this->_error == true ? 'error' : 'success')); $xml->appendChild(new XMLElement('msg', $this->_msg)); return $xml; }