/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date')); $resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_privat24_result'); $defaults = array('amt' => $invoice->getAmount(), 'ccy' => 'UAH', 'merchant' => sfConfig::get('app_privat24_merchant'), 'order' => $invoice->getTransactionId(), 'details' => $invoice->getDescription(), 'pay_way' => 'privat24', 'return_url' => $resultUrl, 'server_url' => $resultUrl); parent::__construct($defaults); }
/** * Constructor. * * @param opAuthAdapter $adapter An opAuthAdapter object * @param array $defaults An array of field default values * @param array $options An array of options * @param string $CRFSSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct(opAuthAdapter $adapter, $defaults = array(), $options = array(), $CSRFSecret = null) { $this->adapter = $adapter; parent::__construct($defaults, $options, false); $this->setWidget('next_uri', new opWidgetFormInputHiddenNextUri()); $this->setValidator('next_uri', new opValidatorNextUri()); }
/** * Constructor. * * Notifies the 'form.post_configure' event. * * @see sfForm */ public function __construct($defaults = array(), $options = array(), $CSRFSecret = null) { parent::__construct($defaults, $options, $CSRFSecret); if (self::$dispatcher) { self::$dispatcher->notify(new sfEvent($this, 'form.post_configure')); } }
/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date')); $resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_liqpay_result'); $defaults = array('version' => '1.1', 'merchant_id' => sfConfig::get('app_liqpay_merchant'), 'amount' => $invoice->getAmount(), 'currency' => 'UAH', 'order_id' => $invoice->getId(), 'description' => $invoice->getDescription(), 'result_url' => $resultUrl, 'server_url' => $resultUrl); parent::__construct($defaults); }
public function __construct($defaults = array(), $options = array(), $CSRFSecret = null) { if (!$options['fields']) { throw new sfException('The fields options required!'); } parent::__construct($defaults, $options, $CSRFSecret); }
/** * Form constructor. * * Available options: * - embedded_form_class: The class name of the forms to embed. Uses the model name by default. * (a form based on a collection of Book objects embeds BookForm objects) * - item_pattern: The pattern used to name each embedded form. Defaults to '%index%'. * - add_delete: Whether to add a delete widget for each object. Defaults to true. * - delete_name: Name of the delete widget. Defaults to 'delete'. * - delete_widget: Optional delete widget object. If left null, uses a sfWidgetFormDelete instance. * - alert_text: The text of the Javascript alert to show * - hide_parent: Whether to hide the parent form when clicking the checkbox * - parent_level: The number of times parentNode must be called to reach the parent to hide. * Recommended values: 6 for embedded form, 7 for merged form * - remove_fields: The list of fields to remove from the embedded object forms * * @param PropelCollection $collection A collection of Propel objects * used to initialize default values * @param array $options An array of options * @param string $CSRFSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct($collection = null, $options = array(), $CSRFSecret = null) { $options = array_merge(array( 'item_pattern' => '%index%', 'add_delete' => false, 'delete_name' => 'delete', 'delete_widget' => null, 'remove_fields' => array(), ), $options); if (!$collection) { $this->model = $options['model']; $collection = new PropelObjectCollection(); $collection->setModel($this->model); $this->collection = $collection; } else { if (!$collection instanceof PropelObjectCollection) { throw new sfException(sprintf('The "%s" form only accepts a PropelObjectCollection object.', get_class($this))); } $this->collection = $collection; $this->model = $collection->getModel(); } $this->isEmpty = $this->getCollection()->isEmpty(); parent::__construct(array(), $options, $CSRFSecret); }
public function __construct(array $info, $index) { $this->dimensions = $info['amount_of_segments']; parent::__construct(null, null, false); $this->setDefault('katuse tüüp', $index); $this->setDefault('katuse skeema', $info['big_picture_url']); }
/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url')); $defaults = array('WMI_MERCHANT_ID' => sfConfig::get('app_w1_merchant'), 'WMI_PAYMENT_AMOUNT' => sprintf('%01.2f', $invoice->getAmount()), 'WMI_CURRENCY_ID' => 980, 'WMI_PAYMENT_NO' => $invoice->getId(), 'WMI_DESCRIPTION' => $invoice->geDescription(), 'WMI_SUCCESS_URL' => url_for('payment_w1_success', array(), true), 'WMI_FAIL_URL' => url_for('payment_w1_fail', array(), true), 'WMI_PTENABLED' => 'CashTerminalUAH'); $defaults['WMI_SIGNATURE'] = $this->createSign($defaults); parent::__construct($defaults); }
public function __construct($id, $value, $soptions) { $this->id = $id; $this->value = $value; $this->soptions = $soptions; parent::__construct(); }
/** * Constructor */ public function __construct(Invoice $invoice, array $wallets) { $this->invoice = $invoice; $this->wallets = $wallets; $defaults = array('LMI_SIM_MODE' => sfConfig::get('app_webmoney_sim_mode'), 'LMI_PAYMENT_NO' => $invoice->getId(), 'LMI_PAYMENT_DESC_BASE64' => base64_encode($invoice->getDescription())); parent::__construct($defaults); }
/** * Constructor. * * @param sfUser A sfUser instance * @param array An array of options * @param string A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct(sfUser $user, $options = array(), $CSRFSecret = null) { $this->user = $user; parent::__construct(array(), $options, $CSRFSecret); // the defaults depend on the options, so set them after construction $this->setDefaults(array('max_per_page' => $user->getAttribute(self::getMaxPerPageName(), self::getMaxPerPageValue()))); }
public function __construct($page = null) { if (!$page) { $page = new aPage(); } $this->page = $page; parent::__construct(); }
public function __construct($section = false) { if ($section === false) { $section = $_SERVER['REQUEST_URI']; } $this->section = $section; parent::__construct(); }
public function __construct($profileMember = array(), $options = array(), $CSRFSecret = null) { parent::__construct(array(), $options, $CSRFSecret); $profiles = Doctrine::getTable('Profile')->findAll(); foreach ($profileMember as $profile) { $this->setDefault($profile->getName(), array('value' => $profile->getValue(), 'public_flag' => $profile->getPublicFlag())); } }
public function __construct($active = null) { if (is_null($active)) { $active = array('1'); } $this->active = array_flip($active); parent::__construct(); }
/** * Constructor. * * @param sfUser A sfUser instance * @param array An array of options * @param string A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct(sfUser $user, $options = array(), $CSRFSecret = null) { $this->user = $user; if (!isset($options['languages'])) { throw new RuntimeException(sprintf('%s requires a "languages" option.', get_class($this))); } parent::__construct(array('language' => $user->getCulture()), $options, $CSRFSecret); }
/** * Constructor. * * @param opAuthAdapter $adapter An opAuthAdapter object * @param array $defaults An array of field default values * @param array $options An array of options * * @see sfForm */ public function __construct(opAuthAdapter $adapter, $defaults = array(), $options = array()) { $this->adapter = $adapter; parent::__construct($defaults, $options, false); $this->setWidget('next_uri', new opWidgetFormInputHiddenNextUri()); $this->setValidator('next_uri', new opValidatorNextUri()); $this->widgetSchema->setNameFormat('auth' . $this->adapter->getAuthModeName() . '[%s]'); }
public function __construct($name, $configuration = null) { if (empty($name)) { throw new InvalidArgumentException('`$name`cannot be empty'); } $this->name = $name; $this->physical_access_controller = BasePhysicalAccessController::create($this->name, $configuration); parent::__construct(); }
public function __construct($id, $soptions = null) { $this->id = $id; $this->soptions = $soptions; $this->allowedTags = $this->consumeSlotOption('allowed-tags'); $this->allowedAttributes = $this->consumeSlotOption('allowed-attributes'); $this->allowedStyles = $this->consumeSlotOption('allowed-styles'); parent::__construct(); }
public function __construct($name, $configuration = null) { if (empty($name)) { throw new InvalidArgumentException('`$name`cannot be empty'); } $this->name = $name; $this->home_automation_controller = BaseHomeAutomationController::create($this->name, $configuration); parent::__construct(); }
/** * @param array $defaults * @param array $options * @param null $CSRFSecret */ public function __construct($defaults = array(), $options = array(), $CSRFSecret = null) { foreach (array('runs') as $option) { if (!isset($options[$option])) { throw new Exception(sprintf('Option [%s] is required', $option)); } } parent::__construct($defaults, $options, $CSRFSecret); }
public function __construct($activity = null) { if (is_null($activity)) { $this->activity = null; // Was this. //throw new InvalidArgumentException('activity parameter cannot be null.'); } else { $this->activity = $activity; } parent::__construct(); }
/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Number')); $amount = sprintf('%01.2f', $invoice->getAmount()); while (strlen($amount) < 13) { $amount = '0' . $amount; } $resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_sentry_result'); $defaults = array('version' => '1.0.0', 'MerID' => sfConfig::get('app_sentry_merchant'), 'MerRespURL' => $resultUrl, 'MerRespURL2' => $resultUrl, 'AcqID' => 414963, 'PurchaseAmt' => str_replace('.', '', $amount), 'PurchaseCurrency' => 980, 'PurchaseCurrencyExponent' => 2, 'SignatureMethod' => 'SHA1', 'OrderID' => $invoice->getTransactionId()); $defaults['Signature'] = $this->createSign($defaults); parent::__construct($defaults); }
/** * @param array $defaults * @param array $options * @param null $CSRFSecret */ public function __construct($defaults = array(), $options = array(), $CSRFSecret = null) { foreach (array('jenkins', 'sf_guard_user_id') as $option) { if (!isset($options[$option])) { throw new Exception(sprintf('Option [%s] is required', $option)); } } if (!$options['jenkins'] instanceof Jenkins) { throw new Exception('Option [jenkins] must be a Jenkins object'); } parent::__construct($defaults, $options, $CSRFSecret); }
/** * Constructor. * * @param sfUser A sfUser instance * @param array An array of options * @param string A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct(sfUser $user = null, $options = array(), $CSRFSecret = null) { if (is_null($user)) { $user = sfContext::getInstance()->getUser(); } $this->user = $user; if (!isset($options['languages'])) { $options['languages'] = sfConfig::get('app_a_i18n_languages', false); if ($options['languages'] === false) { throw new RuntimeException(sprintf('%s requires a "languages" option.', get_class($this))); } } parent::__construct(array('language' => $user->getCulture()), $options, $CSRFSecret); }
/** * Constructor. * * @param BaseObject A Doctrine object used to initialize default values * @param array An array of options * @param string A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct($object = null, $options = array(), $CSRFSecret = null) { $class = $this->getModelName(); if (!$object) { $this->object = new $class(); } else { if (!$object instanceof $class) { throw new sfException(sprintf('The "%s" form only accepts a "%s" object.', get_class($this), $class)); } $this->object = $object; } parent::__construct(array(), $options, $CSRFSecret); $this->updateDefaultsFromObject(); }
/** * Constructor. * * @param array $defaults An array of field default values * @param array $options An array of options * @param string $CRFSSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct($defaults = array(), $options = array(), $CSRFSecret = null) { if (isset($options['member']) && $options['member'] instanceof Member) { $this->setMember($options['member']); } else { $this->setMember(Doctrine::getTable('Member')->createPre()); } $this->memberForm = new MemberForm($this->getMember()); $this->profileForm = new MemberProfileForm($this->getMember()->getProfiles()); $this->profileForm->setRegisterWidgets(); $this->configForm = new MemberConfigForm($this->getMember()); parent::__construct($defaults, $options, $CSRFSecret); $this->mergePostValidator(new sfValidatorCallback(array('callback' => array($this, 'validateMobileUID')))); $this->widgetSchema->setNameFormat('auth[%s]'); }
public function __construct($params = array(), $options = array(), $CSRFSecret = null) { // validator options $options['allow_extra_fields'] = isset($options['allow_extra_fields']) ? $options['allow_extra_fields'] : true; $options['filter_extra_fields'] = isset($options['filter_extra_fields']) ? $options['filter_extra_fields'] : false; parent::__construct(array(), $options, $CSRFSecret); // init sort features $params['sort_by'] = isset($params['sort_by']) ? $params['sort_by'] : null; $params['sort_order'] = isset($params['sort_order']) ? $params['sort_order'] : null; // init values $defaults = $this->prepareDefaultValues($params); $this->setDefaults($defaults); $this->setStoredValues($defaults); $this->init(); }
public function __construct(Member $member = null, $options = array(), $CSRFSecret = null) { $this->setMemberConfigSettings(); $this->member = $member; if (is_null($this->member)) { $this->isNew = true; $this->member = new Member(); $this->member->setIsActive(false); } elseif (!$this->member->getIsActive()) { $this->isNew = true; } parent::__construct(array(), $options, $CSRFSecret); if ($this->isAutoGenerate) { $this->generateConfigWidgets(); } $this->widgetSchema->setNameFormat('member_config[%s]'); }
/** * Constructor. * * @param opAuthAdapter $adapter An opAuthAdapter object * @param array $defaults An array of field default values * @param array $options An array of options * @param string $CRFSSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret) * * @see sfForm */ public function __construct(opAuthAdapter $adapter, $defaults = array(), $options = array(), $CSRFSecret = null) { $this->adapter = $adapter; foreach ($this->adapter->getAuthConfigSettings() as $key => $value) { if (isset($defaults[$key])) { continue; } if (isset($value['IsConfig']) && !$value['IsConfig']) { $defaults[$key] = $value['Default']; continue; } $default = $this->adapter->getAuthConfig($key); if (!is_null($default)) { $defaults[$key] = $default; } } parent::__construct($defaults, $options, $CSRFSecret); }