Пример #1
0
 public function add(AbstractComponent $component)
 {
     if ($component instanceof FieldSet && !$component->isNamespaced()) {
         $this->components = array_merge($this->components, $component->getComponents());
     }
     parent::add($component);
     return $this;
 }
Пример #2
0
 /**
  * Constructor.
  *
  * @param Row[] $rows
  */
 public function __construct(array $rows = array())
 {
     parent::__construct();
     foreach ($rows as $name => $row) {
         $this->add($name, $row);
     }
 }
Пример #3
0
 /**
  * Register component and apply paging settings to Data Provider
  *
  * @return void
  */
 public function prepare()
 {
     $this->prepareOptions();
     $paging = $this->getContext()->getRequestParam('paging');
     $this->getContext()->getDataProvider()->setLimit($this->getOffset($paging), $this->getSize($paging));
     parent::prepare();
 }
Пример #4
0
 public function __construct(\Slipstream\Common\ConfigurationInterface $conf, \Slipstream\Common\DomainObjectManager $domainObjectManager, \Slipstream\Common\Log\Handler $log, \Slipstream\Common\Injector\Injector $injector)
 {
     $this->_configuration = $conf;
     $this->_dom = $domainObjectManager;
     $this->_injector = $injector;
     parent::__construct($log);
 }
Пример #5
0
 /**
  * @param string $text
  * @param bool   $trans
  * @param string $domain
  */
 public function __construct($text, $trans = false, $domain = 'datagrid')
 {
     parent::__construct();
     $this->name = 'label';
     $this->text = $text;
     $this->trans = $trans;
     $this->domain = $domain;
 }
Пример #6
0
 /**
  * Constructor.
  *
  * @param string $type
  * @param Cell[] $cells
  */
 public function __construct($type, array $cells = array())
 {
     parent::__construct();
     $this->type = $type;
     foreach ($cells as $name => $cell) {
         $this->add($name, $cell);
     }
 }
Пример #7
0
 /**
  * @param array ComponentInterface[]
  */
 public function __construct(array $items = array())
 {
     parent::__construct();
     $this->name = 'collection';
     foreach ($items as $item) {
         $this->add($item);
     }
 }
Пример #8
0
 /**
  * @param string|null $url
  * @param string|null $route
  * @param array       $parameters
  */
 public function __construct($url = null, $route = null, array $parameters = array())
 {
     parent::__construct();
     $this->name = 'url';
     $this->url = $url;
     $this->route = $route;
     $this->parameters = $parameters;
 }
Пример #9
0
 public function renderElementProgressive($renderApi, $unit)
 {
     $output = '';
     foreach ($this->children as $child) {
         $output .= $child->renderElement();
     }
     parent::setContent($output);
     return parent::renderElementProgressive($renderApi, $unit);
 }
Пример #10
0
 /**
  * {@inheritdoc}
  */
 public function __toString()
 {
     $value = parent::__toString();
     // according to http://tools.ietf.org/html/rfc3986#section-3.5
     $rawSymbols = array('/', '?', '-', '.', '_', '~', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', ':', '@');
     $encodedSymbols = array_map(function ($symbol) {
         return urlencode($symbol);
     }, $rawSymbols);
     return str_replace($encodedSymbols, $rawSymbols, rawurlencode($value));
 }
Пример #11
0
 /**
  * Register component and apply paging settings to Data Provider
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $this->prepareConfiguration();
     $this->prepareOptions();
     $paging = $this->getContext()->getRequestParam('paging');
     $this->getContext()->getDataProvider()->setLimit($this->getOffset($paging), $this->getSize($paging));
     $jsConfig = $this->getConfiguration($this);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
Пример #12
0
 /**
  * Constructor.
  *
  * @param null|Section $head
  * @param null|Section $body
  * @param null|Section $foot
  * @param string       $name
  * @param null|string  $caption
  */
 public function __construct(Section $head = null, Section $body = null, Section $foot = null, $name = 'datagrid', $caption = null)
 {
     parent::__construct();
     $head = $head ?: new Section();
     $body = $body ?: new Section();
     $foot = $foot ?: new Section();
     $this->children = array('head' => $head->bind($this, 'head'), 'body' => $body->bind($this, 'body'), 'foot' => $foot->bind($this, 'foot'));
     $this->name = $name;
     $this->caption = $caption;
     $this->columns = array();
 }
Пример #13
0
 /**
  * @inheritDoc
  */
 public function prepare()
 {
     $config = $this->getConfiguration();
     foreach ($this->getChildComponents() as $actionComponent) {
         $config['actions'][] = $actionComponent->getConfiguration();
     }
     $origConfig = $this->getConfiguration();
     if ($origConfig !== $config) {
         $config = array_replace_recursive($config, $origConfig);
     }
     $this->setData('config', $config);
     parent::prepare();
 }
Пример #14
0
 public function add(AbstractComponent $component)
 {
     $name = $component->getPropertyName();
     $this->components[$name] = $component;
     return $this;
 }
Пример #15
0
 /**
  * @param string $value
  */
 public function __construct($value)
 {
     parent::__construct();
     $this->name = 'data';
     $this->value = $value;
 }
Пример #16
0
 public function setContent($content)
 {
     parent::setContent($content);
 }
Пример #17
0
 /**
  * @param string $token
  * @param string $text
  */
 public function __construct($token, $text)
 {
     parent::__construct($token);
     $this->text = $text;
 }
Пример #18
0
 /**
  * Register component.
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $jsConfig = $this->getConfiguration($this);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
Пример #19
0
 public function __construct(\Slipstream\Common\DomainObjectManager $dom, \Slipstream\Common\Log\Handler $log)
 {
     $this->_dom = $dom;
     parent::__construct($log);
 }
Пример #20
0
 /**
  * {@inheritdoc}
  */
 public function __toString()
 {
     $value = parent::__toString();
     return rawurlencode($value);
 }