/** * @return SocialSharing_HtmlBuilder_AbstractElement */ protected function getToggleButton() { $builder = $this->builder->getBuilder(); $position = $this->builder->getProject()->getExtra('left'); $type = 'arrow'; $icon = 'fa-' . $type . '-' . str_replace(array('top', 'bottom'), array('up', 'down'), $position); $pairs = array('left' => 'right', 'right' => 'left', 'up' => 'down', 'down' => 'up'); return $builder->createElement('button', array($builder->createAttribute('class', 'social-sharing-navigation-toggle'), $builder->createAttribute('title', $builder->getEnvironment()->translate('Toggle')), $builder->createAttribute('data-pointer', $position), $builder->createAttribute('data-replace', $icon), $builder->createAttribute('data-replace-with', @strtr($icon, $pairs))))->addElement($builder->createElement('i', array($builder->createAttribute('class', array('fa', 'fa-fw', $icon))))); }
/** * Constructs the builder decorator. * * @param \SocialSharing_Projects_Builder $builder * @param array $networks */ public function __construct(SocialSharing_Projects_Builder $builder, array $networks) { parent::__construct($builder->getProject(), $builder->getEnvironment()); $this->builder = $builder; $this->networks = $networks; }