8889841cBlockButtonImport.php000064400000000441150515613430010700 0ustar00setLabel(n2_('Import')); $this->setBig(); $this->setGreen(); } }BlockButtonBack.php000064400000000440150515613430010265 0ustar00setLabel(n2_('Back')); $this->setBig(); $this->setGreyDark(); } }BlockButtonCancel.php000064400000000437150515613430010620 0ustar00setLabel(n2_('Cancel')); $this->setBig(); $this->setRed(); } }AbstractButton.php000064400000004173150515613430010224 0ustar00getContent(), $this->getUrl(), $this->getAttributes()), Sanitize::$adminTemplateTags); } abstract protected function getContent(); /** * @return string */ public function getUrl() { return $this->url; } /** * @param string $url */ public function setUrl($url) { $this->url = $url; } /** * @param $className */ public function addClass($className) { $this->classes[] = $className; } public function addAttribute($name, $value) { $this->attributes[$name] = $value; } public function getAttributes() { $classes = array_merge(array($this->baseClass), $this->getClasses()); return $this->attributes + array('class' => implode(' ', $classes)); } /** * @param string $target */ public function setTarget($target) { $this->addAttribute('target', $target); } /** * @return array */ public function getClasses() { $classes = $this->classes; $classes[] = $this->baseClass . '--' . $this->size; return $classes; } public function setSmall() { $this->size = 'small'; } public function setMedium() { $this->size = 'medium'; } public function setBig() { $this->size = 'big'; } /** * @param integer $tabIndex */ public function setTabIndex($tabIndex) { $this->tabindex = $tabIndex; if ($this->tabindex === 0) { unset($this->attributes['tabindex']); } else { $this->attributes['tabindex'] = $this->tabindex; } } }BlockButtonPlainIcon.php000064400000000662150515613430011307 0ustar00icon . '">'; } /** * @param string $icon */ public function setIcon($icon) { $this->icon = $icon; } }BlockButtonIconCode.php000064400000000325150515613430011112 0ustar00icon; } }BlockButtonSpacer.php000064400000001145150515613430010645 0ustar00isVisible) { $classes[] = 'n2_button_spacer--visible'; } echo '
'; } /** * @param bool $isVisible */ public function setIsVisible($isVisible) { $this->isVisible = $isVisible; } }AbstractButtonLabel.php000064400000002421150515613430011156 0ustar00iconBefore)) { $content .= ''; } $content .= '' . $this->getLabel() . ''; if (!empty($this->icon)) { $content .= ''; } return $content; } /** * @return string */ public function getLabel() { return $this->label; } /** * @param string $label */ public function setLabel($label) { $this->label = $label; } /** * @param string $icon */ public function setIcon($icon) { $this->icon = $icon; } /** * @param string $icon * @param string $extraClass */ public function setIconBefore($icon, $extraClass = "") { $this->iconBefore = $icon; $this->iconBeforeClass = $extraClass; } }BlockButtonSave.php000064400000000435150515613430010327 0ustar00setLabel(n2_('Save')); $this->setBig(); $this->setGreen(); } }BlockButtonApply.php000064400000000437150515613430010520 0ustar00setLabel(n2_('Apply')); $this->setBig(); $this->setGreen(); } }BlockButtonPlain.php000064400000001053150515613430010471 0ustar00color = 'blue'; } /** * @return array */ public function getClasses() { $classes = parent::getClasses(); if (!empty($this->color)) { $classes[] = $this->baseClass . '--color-' . $this->color; } return $classes; } }BlockButtonDashboardInfo.php000064400000001016150515613430012130 0ustar00setTabIndex(-1); } protected function getContent() { return '
'; } }BlockButton.php000064400000001342150515613430007506 0ustar00color = 'blue'; } public function setGreen() { $this->color = 'green'; } public function setRed() { $this->color = 'red'; } public function setGrey() { $this->color = 'grey'; } public function setGreyDark() { $this->color = 'grey-dark'; } public function getClasses() { $classes = parent::getClasses(); $classes[] = $this->baseClass . '--' . $this->color; return $classes; } }BlockButtonIcon.php000064400000001355150515613430010323 0ustar00color = 'blue'; } public function setGreen() { $this->color = 'green'; } public function setRed() { $this->color = 'red'; } public function setGrey() { $this->color = 'grey'; } public function setGreyDark() { $this->color = 'grey-dark'; } public function getClasses() { $classes = parent::getClasses(); $classes[] = $this->baseClass . '--' . $this->color; return $classes; } }ItemButtonFrontend.php000064400000003342150522071350011051 0ustar00getHtml(); } public function renderAdminTemplate() { return $this->getHtml(); } private function getHtml() { $owner = $this->layer->getOwner(); $this->loadResources($owner); $font = $owner->addFont($this->data->get('font'), 'link'); $html = Html::openTag("div", array( "class" => "n2-ss-button-container n2-ss-item-content n2-ow " . $font . ($this->data->get('nowrap', 1) ? ' n2-ss-nowrap' : '') . ($this->isAuto() ? ' n2-ss-button-container--non-full-width' : '') )); $content = '
' . Sanitize::filter_allowed_html($owner->fill($this->data->get("content"))) . '
'; $attrs = array(); $style = $owner->addStyle($this->data->get('style'), 'heading'); $html .= $this->getLink('
' . $content . '
', $attrs + array( "class" => "{$style} n2-ow " . $owner->fill($this->data->get('class', '')) ), true); $html .= Html::closeTag("div"); return $html; } /** * @param AbstractRenderableOwner $owner */ public function loadResources($owner) { $owner->addLess(self::getAssetsPath() . "/button.n2less", array( "sliderid" => $owner->getElementID() )); } public function isAuto() { return !$this->data->get('fullwidth', 0); } }ItemButton.php000064400000013532150522071350007353 0ustar00 array( 'defaultName' => 'item-button-font', 'value' => '{"data":[{"color":"ffffffff","size":"14||px","align":"center"}, {"extra":""}]}' ) ); protected $styles = array( 'style' => array( 'defaultName' => 'item-button-style', 'value' => '{"data":[{"backgroundcolor":"5cba3cff","padding":"10|*|30|*|10|*|30|*|px"}, {"extra":""}]}' ) ); protected function isBuiltIn() { return true; } public function getType() { return 'button'; } public function getTitle() { return n2_('Button'); } public function getIcon() { return 'ssi_32 ssi_32--button'; } public function createFrontend($id, $itemData, $layer) { return new ItemButtonFrontend($this, $id, $itemData, $layer); } public function globalDefaultItemFontAndStyle($container) { $table = new ContainerTable($container, $this->getType(), $this->getTitle()); $row1 = $table->createRow($this->getType() . '-1'); new Font($row1, 'item-button-font', false, $this->fonts['font']['value'], array( 'mode' => 'link' )); new Style($row1, 'item-button-style', false, $this->styles['style']['value'], array( 'mode' => 'button' )); } public function getValues() { return parent::getValues() + array( 'content' => n2_x('MORE', 'Button layer default text'), 'nowrap' => 1, 'fullwidth' => 0, 'href' => '#', 'href-target' => '_self', 'href-rel' => '', 'class' => '', 'icon' => '', 'iconsize' => '100', 'iconspacing' => '30', 'iconplacement' => 'left', ); } public function upgradeData($data) { $linkV1 = $data->get('link', ''); if (!empty($linkV1)) { list($link, $target, $rel) = array_pad((array)Common::parse($linkV1), 3, ''); $data->un_set('link'); $data->set('href', $link); $data->set('href-target', $target); $data->set('href-rel', $rel); } } public function getFilled($slide, $data) { $data = parent::getFilled($slide, $data); $data->set('content', $slide->fill($data->get('content', ''))); $data->set('href', $slide->fill($data->get('href', '#|*|'))); return $data; } public function prepareExport($export, $data) { parent::prepareExport($export, $data); $export->addVisual($data->get('font')); $export->addVisual($data->get('style')); $export->addLightbox($data->get('href')); } public function prepareImport($import, $data) { $data = parent::prepareImport($import, $data); $data->set('font', $import->fixSection($data->get('font'))); $data->set('style', $import->fixSection($data->get('style'))); $data->set('href', $import->fixLightbox($data->get('href'))); return $data; } public function loadResources($renderable) { parent::loadResources($renderable); $renderable->addLess(self::getAssetsPath() . "/button.n2less", array( "sliderid" => $renderable->elementId )); } public function renderFields($container) { $settings = new Fieldset\LayerWindow\FieldsetLayerWindow($container, 'item-button', n2_('General')); new Text($settings, 'content', n2_('Label'), n2_('Button'), array( 'style' => 'width:302px;' )); new HiddenFont($settings, 'font', false, '', array( 'mode' => 'link' )); new HiddenStyle($settings, 'style', false, '', array( 'mode' => 'button' )); new OnOff($settings, 'fullwidth', n2_('Full width'), 1); new OnOff($settings, 'nowrap', n2_('No wrap'), 1, array( 'tipLabel' => n2_('No wrap'), 'tipDescription' => n2_('Prevents the text from breaking into more lines') )); $link = new Fieldset\LayerWindow\FieldsetLayerWindow($container, 'item-button-link', n2_('Link')); new Url($link, 'href', n2_('Link'), '', array( 'relatedFields' => array( 'item_buttonhref-target', 'item_buttonhref-rel' ), 'width' => 248 )); new LinkTarget($link, 'href-target', n2_('Target window')); new Text($link, 'href-rel', n2_('Rel'), '', array( 'style' => 'width:195px;', 'tipLabel' => n2_('Rel'), 'tipDescription' => sprintf(n2_('Enter the %1$s rel attribute %2$s that represents the relationship between the current document and the linked document. Multiple rel attributes can be separated with space. E.g. nofollow noopener noreferrer'), '', '') )); } }