Пример #1
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'submit';
     $this->attributes['value'] = '';
     $this->rules['value'] = 'optional';
 }
Пример #2
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'text';
     $this->attributes['value'] = '';
     $this->rules['value'] = 'required|trim';
 }
Пример #3
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'checkbox';
     $this->attributes['value'] = '1';
     $this->rules['value'] = 'optional';
 }
Пример #4
0
 public function __construct($name, $type = 'text')
 {
     parent::__construct($name);
     $this->attributes['type'] = $type;
     $this->attributes['value'] = [];
     $this->rules['value[]'] = 'required|trim';
 }
Пример #5
0
 public function __construct($disabled = false)
 {
     parent::__contruct();
     if ($disabled) {
         parent::setAttribute((new Attribute('disabled'))->append('disabled'));
     }
 }
Пример #6
0
 /**
  * @param string $name
  * @param bool $abstract
  * @param string|PhpClass|null $extends
  * @param string[]|PhpClass[] $interfaces
  */
 public function __construct($name, $abstract = false, $extends = null, array $interfaces = array())
 {
     parent::__construct($name);
     $this->setAbstract($abstract);
     $this->setExtends($extends);
     $this->setInterfaces($interfaces);
 }
Пример #7
0
 public function __construct($multiple = false)
 {
     parent::__contruct();
     if ($multiple) {
         parent::setAttribute((new Attribute('multiple'))->append(''));
     }
 }
Пример #8
0
 /**
  * @throws \InvalidArgumentException
  * @param mixed $child
  * @return PhpAnnotationBlock
  */
 public function addChild($child)
 {
     if (!$this->childIsValid($child)) {
         return parent::addChild($child);
     }
     $this->children[] = $this->transformAnnotation($child);
     return $this;
 }
Пример #9
0
 public function __construct($size = 1)
 {
     if (is_string($size)) {
         $size = substr($size, 1, 1);
     }
     $this->tag = $this->tag . $size;
     parent::__construct();
 }
Пример #10
0
 /**
  * Constructor
  */
 public function __construct($field)
 {
     parent::__construct($field);
     $this->attributes['cols'] = 'cols';
     $this->attributes['rows'] = 'rows';
     $this->attributes['disabled'] = 'disabled';
     $this->attributes['readonly'] = 'readonly';
 }
Пример #11
0
 /**
  * Add list items to the array
  */
 public function toArray()
 {
     $arr = parent::toArray();
     $arr['items'] = array();
     foreach ($this->items as $i) {
         $arr['items'][] = array('value' => $i->getValue(), 'label' => $i->getLabel());
     }
     return $arr;
 }
Пример #12
0
 public function __construct($href, $rel, $type = null)
 {
     parent::__construct();
     parent::setAttribute((new Attribute('href'))->append($href));
     parent::setAttribute((new Attribute('rel'))->append($rel));
     if (isset($type)) {
         parent:
         setAttribute((new Attribute('type'))->append($type));
     }
 }
Пример #13
0
 public function __construct($placeholder = null, $rows = null)
 {
     parent::__construct();
     if (isset($placeholder)) {
         parent::setAttribute((new Attribute('placeholder'))->append($placeholder));
     }
     if (isset($rows)) {
         parent::setAttribute((new Attribute('rows'))->append($rows));
     }
 }
Пример #14
0
 public function setAttribute($name, $value)
 {
     parent::setAttribute($name, $value);
     if ($name !== 'id') {
         foreach ($this->radioElements as $element) {
             $element->setAttribute($name, $value);
         }
     }
     return $this;
 }
Пример #15
0
 public function __construct($type, $name, $readonly = false, $disabled = false)
 {
     parent::__construct();
     parent::setAttribute('type', $type);
     parent::setAttribute('name', $name);
     if ($readonly) {
         parent::setAttribute((new Attribute('readonly'))->append('readonly'));
     }
     if ($disabled) {
         parent::setAttribute((new Attribute('disabled'))->append('disabled'));
     }
 }
Пример #16
0
 /**
  * Return all the fields within a given table identified by its name.
  * @param string|\dbeurive\Backend\Database\EntryPoints\Description\Element\Table $inTable Name of the table, or object that represents the table.
  * @return array The method returns the list of fields within the table identified by the given name.
  */
 public static function getNamesByTable($inTable)
 {
     $inTable = is_a($inTable, Table::getFullyQualifiedClassName()) ? $inTable->getName() : $inTable;
     $res = [];
     $repository = parent::getRepositoryForClass(__CLASS__);
     foreach ($repository as $_name => $_field) {
         $tokens = explode('.', $_name);
         if ($tokens[0] == $inTable) {
             $res[] = $_name;
         }
     }
     return $res;
 }
Пример #17
0
 /**
  * Constructor
  * Check the API keys
  */
 public function __construct($field)
 {
     if (!self::$privateApiKey) {
         throw new \Foundation\Exception('Private API Key not set for reCAPTCHA library.');
     }
     if (!self::$publicApiKey) {
         throw new \Foundation\Exception('Public API Key not set for reCAPTCHA library.');
     }
     //move the static keys into local space for ease of use
     $this->publicKey = self::$publicApiKey;
     //use the secure server
     $this->server = self::API_SECURE_SERVER;
     parent::__construct($field);
     $this->addValidator(new \Foundation\Form\Validator\Captcha($this, self::$privateApiKey));
 }
Пример #18
0
 public function __construct($src = null, $type = null, $defer = false, $async = false)
 {
     parent::__construct();
     if (isset($src)) {
         parent::setAttribute((new Attribute('src'))->append($src));
     }
     if (isset($type)) {
         parent::setAttribute((new Attribute('type'))->append($type));
     }
     if ($defer) {
         parent::setAttribute((new Attribute('defer'))->append($defer));
     }
     if ($async) {
         parent::setAttribute((new Attribute('async'))->append($async));
     }
 }
Пример #19
0
 /**
  * Constructor
  *
  * Instantiate the button form element.
  *
  * @param  string $name
  * @param  string $value
  * @param  string $indent
  * @return Button
  */
 public function __construct($name, $value = null, $indent = null)
 {
     parent::__construct($this->type, $value, null, false, $indent);
     $this->setAttributes(['name' => $name, 'id' => $name]);
     if (strtolower($name) == 'submit') {
         $this->setAttribute('type', 'submit');
     } else {
         if (strtolower($name) == 'reset') {
             $this->setAttribute('type', 'reset');
         } else {
             $this->setAttribute('type', 'button');
         }
     }
     $this->setValue($value);
     $this->setName($name);
 }
 /**
  * @param string $name
  * @param string $access
  */
 public function __construct($name, $access = self::ACCESS_PUBLIC)
 {
     parent::__construct($name);
     $this->setAccess($access);
 }
Пример #21
0
 public function addRow(AbstractElement\TableRow $row, $prepend = false)
 {
     parent::add($row, $prepend);
     return $this;
 }
Пример #22
0
 /**
  * Return header title part of html for fieldset
  *
  * @param AbstractElement $element
  * @return string
  */
 protected function _getHeaderTitleHtml($element)
 {
     return '<a id="' . $element->getHtmlId() . '-head" href="#' . $element->getHtmlId() . '-link" onclick="return false;">' . $element->getLegend() . '</a>';
 }
Пример #23
0
 public function __construct($data = array())
 {
     parent::__construct('input', $data);
 }
Пример #24
0
 /**
  * @see \WsdlToPhp\PhpGenerator\Element\AbstractElement::getPhpName()
  * @return string
  */
 public function getPhpName()
 {
     return !empty($this->name) && $this->getName() !== static::NO_NAME ? sprintf(' @%s', parent::getPhpName()) : '';
 }
Пример #25
0
 public function prepareDisplay()
 {
     parent::prepareDisplay();
     $this->view->items = $this->items;
 }
Пример #26
0
 /**
  * @see \WsdlToPhp\PhpGenerator\Element\AbstractElement::toString()
  * @param int $indentation
  * @return string
  */
 public function toString($indentation = null)
 {
     return sprintf('%s%s', parent::toString($indentation), self::BREAK_LINE_CHAR);
 }
Пример #27
0
 public function __construct($title)
 {
     parent::construct();
     parent::setAttribute((new Attribute('title'))->append($title));
 }
Пример #28
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $jsConfig = $this->getConfiguration($this, Input::NAME);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
Пример #29
0
 /**
  * Format element answer data into an array
  * Include links in PDF files for the file and thumbnail
  * 
  * @param array $elementAnswers
  * 
  * @return array
  */
 public function formatApplicantArray(array $elementAnswers)
 {
     $arr = parent::formatApplicantArray($elementAnswers);
     $arr['filePath'] = false;
     $arr['thumbnailPath'] = false;
     foreach ($elementAnswers as $elementAnswer) {
         $arr['values'][] = $this->arrayValue($elementAnswer);
     }
     if ($arr['values'][0]['value']) {
         $base = $this->_element->getTitle() . '_' . $elementAnswer['id'];
         //remove slashes in path to fix an apache issues with encoding slashes in redirects
         $base = str_replace(array('/', '\\'), 'slash', $base);
         $name = $base . '.pdf';
         \Jazzee\Globals::getFileStore()->createSessionFile($name, $arr['values'][0]['value']);
         $arr['filePath'] = \Jazzee\Globals::path('file/' . \urlencode($name));
         if (!empty($arr['values'][1]['value'])) {
             $name = $base . '.png';
             \Jazzee\Globals::getFileStore()->createSessionFile($name, $arr['values'][1]['value']);
             $arr['thumbnailPath'] = \Jazzee\Globals::path('file/' . \urlencode($name));
         } else {
             $arr['thumbnailPath'] = \Jazzee\Globals::path('resource/foundation/media/default_pdf_logo.png');
         }
         $arr['displayValue'] = "<a href='{$arr['filePath']}'><img src='{$arr['thumbnailPath']}' /></a>";
     }
     return $arr;
 }
Пример #30
0
 /**
  * Set the value of the form element object
  *
  * @param  mixed $value
  * @return Input
  */
 public function setValue($value)
 {
     $this->setAttribute('value', $value);
     return parent::setValue($value);
 }