Ejemplo n.º 1
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'submit';
     $this->attributes['value'] = '';
     $this->rules['value'] = 'optional';
 }
Ejemplo n.º 2
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'text';
     $this->attributes['value'] = '';
     $this->rules['value'] = 'required|trim';
 }
Ejemplo n.º 3
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'checkbox';
     $this->attributes['value'] = '1';
     $this->rules['value'] = 'optional';
 }
Ejemplo n.º 4
0
 public function __construct($name, $type = 'text')
 {
     parent::__construct($name);
     $this->attributes['type'] = $type;
     $this->attributes['value'] = [];
     $this->rules['value[]'] = 'required|trim';
 }
Ejemplo n.º 5
0
 public function __construct($disabled = false)
 {
     parent::__contruct();
     if ($disabled) {
         parent::setAttribute((new Attribute('disabled'))->append('disabled'));
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 7
0
 public function __construct($multiple = false)
 {
     parent::__contruct();
     if ($multiple) {
         parent::setAttribute((new Attribute('multiple'))->append(''));
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 9
0
 public function __construct($size = 1)
 {
     if (is_string($size)) {
         $size = substr($size, 1, 1);
     }
     $this->tag = $this->tag . $size;
     parent::__construct();
 }
Ejemplo n.º 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';
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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'));
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 21
0
 public function addRow(AbstractElement\TableRow $row, $prepend = false)
 {
     parent::add($row, $prepend);
     return $this;
 }
Ejemplo n.º 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>';
 }
Ejemplo n.º 23
0
 public function __construct($data = array())
 {
     parent::__construct('input', $data);
 }
Ejemplo n.º 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()) : '';
 }
Ejemplo n.º 25
0
 public function prepareDisplay()
 {
     parent::prepareDisplay();
     $this->view->items = $this->items;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 27
0
 public function __construct($title)
 {
     parent::construct();
     parent::setAttribute((new Attribute('title'))->append($title));
 }
Ejemplo n.º 28
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $jsConfig = $this->getConfiguration($this, Input::NAME);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }