public function process() { switch ($this->_attributeParse()) { case 'base64': $image = new AjdeResourceImage($this->attributes['filename']); $image->setWidth(issetor($this->attributes['width'])); $image->setHeight(issetor($this->attributes['height'])); $image->setCrop(String::toBoolean(issetor($this->attributes['crop'], true))); $controller = Controller::fromRoute(new Route('_core/component:imageBase64')); $controller->setImage($image); $controller->setWidth(issetor($this->attributes['width'], null)); $controller->setHeight(issetor($this->attributes['height'], null)); $controller->setExtraClass(issetor($this->attributes['class'], '')); return $controller->invoke(); break; case 'html': return self::getImageTag($this->attributes['filename'], issetor($this->attributes['width']), issetor($this->attributes['height']), String::toBoolean(issetor($this->attributes['crop'], true)), issetor($this->attributes['class'], ''), issetor($this->attributes['lazy'], false), issetor($this->attributes['absoluteUrl'], false)); break; case 'image': return false; break; } // TODO: throw new Exception('Missing required attributes for component call'); }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = "hidden"; $attributes['value'] = String::escape($this->getValue()); return $attributes; }
protected function writer() { if ($this->_secure) { return String::encrypt(serialize($this->values())); } else { return serialize($this->values()); } }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = "hidden"; $attributes['value'] = String::escape($this->getValue()); if ($this->hasReadonly() && $this->getReadonly() === true) { $attributes['readonly'] = 'readonly'; } return $attributes; }
public function getRedirectParams($description = null) { $transaction = $this->getTransaction(); // NOOOO.. THE UGLY HACKING $return = Config::get('site_root') . 'presale/transaction:complete'; $method = $transaction->shipment_method; if ($method == 'presale-remainder') { $return = Config::get('site_root') . 'presale/transaction:confirm_complete'; } return array('cmd' => '_xclick', 'business' => Config::get('shopPaypalAccount'), 'notify_url' => Config::get('site_root') . $this->returnRoute . 'paypal' . $this->getMethod() . '.html', 'bn' => Config::get('ident') . '_BuyNow_WPS_' . strtoupper(Lang::getInstance()->getShortLang()), 'amount' => $transaction->payment_amount, 'item_name' => issetor($description, Config::get('sitename') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item')), 'quantity' => 1, 'address_ override' => 1, 'address1' => $transaction->shipment_address, 'zip' => $transaction->shipment_zipcode, 'city' => $transaction->shipment_city, 'state' => $transaction->shipment_region, 'country' => $transaction->shipment_country, 'email' => $transaction->email, 'first_name' => $transaction->name, 'currency_code' => Config::get('currencyCode'), 'custom' => $transaction->secret, 'no_shipping' => 1, 'no_note' => 1, 'return' => $return, 'rm' => 1); }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = "hidden"; if ($this->getMode() === self::MODE_NEW) { $attributes['value'] = $this->getDefault(); } else { $attributes['value'] = String::escape($this->getValue()); } return $attributes; }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = "number"; $attributes['step'] = "any"; $attributes['value'] = String::escape($this->getValue()); $attributes['maxlength'] = $this->getLength(); if ($this->getIsAutoIncrement() === true || $this->hasReadonly() && $this->getReadonly() === true) { $attributes['readonly'] = "readonly"; } return $attributes; }
public function getRedirectUrl($description = null) { $transaction = $this->getTransaction(); $mollie = new Client(); $mollie->setApiKey($this->getApiKey()); $order_id = $transaction->secret; $data = array("amount" => $transaction->payment_amount, "description" => isset($description) ? $description : Config::get('sitename') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item'), "redirectUrl" => Config::get('site_root') . $this->returnRoute . 'mollie_' . $this->getMethod() . '.html?order_id=' . $order_id, "method" => $this->getMethod(), "metadata" => array("order_id" => $order_id)); $payment = $mollie->payments->create($data); // save details $transaction->payment_providerid = $payment->id; $transaction->save(); $url = $payment->getPaymentUrl(); return $this->ping($url) ? $url : false; }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = 'time'; if ($this->getValue()) { $attributes['value'] = String::escape(date('H:i', strtotime($this->getValue()))); } else { $attributes['value'] = ''; } if ($this->hasReadonly() && $this->getReadonly() === true) { $attributes['readonly'] = 'readonly'; } return $attributes; }
protected function _getHtmlAttributes() { $attributes = array(); if ($this->hasReadonly() && $this->getReadonly() === true) { $attributes['value'] = String::escape($this->getValue()); $attributes['type'] = "text"; $attributes['readonly'] = "readonly"; } else { if ($this->getValue()) { $attributes['value'] = String::escape(date('Y-m-d', strtotime($this->getValue()))); } $attributes['type'] = "date"; } return $attributes; }
public function getModule($module = null) { if (!$module) { foreach (debug_backtrace() as $item) { if (!empty($item['class'])) { if (is_subclass_of($item['class'], "Ajde_Controller")) { $module = current(explode('_', String::toSnakeCase($item['class']))); break; } } } } if (!$module) { $module = 'main'; } return $module; }
protected function _getHtmlAttributes() { $attributes = array(); $attributes['type'] = "text"; $attributes['value'] = String::escape($this->getValue()); $attributes['maxlength'] = String::escape($this->getLength()); if ($this->hasReadonly() && $this->getReadonly() === true) { $attributes['readonly'] = "readonly"; } if ($this->hasEmphasis() && $this->getEmphasis() === true) { $attributes['class'] = "emphasis"; } if ($this->hasPlaceholder()) { $attributes['placeholder'] = $this->getPlaceholder(); } return $attributes; }
public function getRedirectUrl($description = null) { $transaction = $this->getTransaction(); $request = array("type" => "transaction", "transactionreq" => array("username" => Config::get('shopWedealUsername'), "password" => Config::get('shopWedealPassword'), "reference" => $transaction->secret, "description" => Config::get('ident') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item'), "amount" => str_replace(".", ",", (string) $transaction->payment_amount), "methodcode" => "0101", "maxcount" => "1", "test" => $this->isSandbox() ? "true" : "false", "successurl" => Config::get('site_root') . 'shop/transaction:callback/wedeal.html', "failurl" => Config::get('site_root') . 'shop/transaction:callback/wedeal.html')); $res = $this->sendRequest($request, true); if ($res['success'] === true) { $url = $res['response']; if (substr($url, 0, 7) === 'http://' || substr($url, 0, 8) === 'https://') { return $this->ping($url) ? $res['response'] : false; } else { Log::log("Wedeal::getRedirectUrl() returned no URL but: " . $res['response']); return false; } } else { Log::log("Wedeal::getRedirectUrl() returned no URL but: " . $res['response']); return false; } }
public function process() { switch ($this->_attributeParse()) { case 'render': $image = new Image($this->attributes['filename']); $image->setWidth($this->attributes['width']); $image->setHeight($this->attributes['height']); $image->setCrop(String::toBoolean($this->attributes['crop'])); $controller = Controller::fromRoute(new Route('_core/component:imageBase64')); $controller->setImage($image); $controller->setWidth(issetor($this->attributes['width'], null)); $controller->setHeight(issetor($this->attributes['height'], null)); $controller->setExtraClass(issetor($this->attributes['class'], '')); return $controller->invoke(); break; } // TODO: throw new Exception('Missing required attributes for component call'); }
public function getParam($key, $default = null, $type = self::TYPE_STRING, $post = false) { $data = $this->_data; if ($post === true) { $data = $this->getPostData(); } if (isset($data[$key])) { switch ($type) { case self::TYPE_HTML: if ($this->autoCleanHtml() === true) { return String::clean($data[$key]); } else { return $data[$key]; } break; case self::TYPE_INTEGER: return (int) $data[$key]; break; case self::TYPE_FLOAT: return (double) $data[$key]; break; case self::TYPE_RAW: return $data[$key]; break; case self::TYPE_STRING: default: if ($this->autoEscapeString() === true) { if (is_array($data[$key])) { array_walk($data[$key], array("Ajde_Component_String", "escape")); return $data[$key]; } else { return String::escape($data[$key]); } } else { return $data[$key]; } } } else { if (isset($default)) { return $default; } else { // TODO: throw new Exception("Parameter '{$key}' not present in request and no default value given"); } } }