accordion-item.php
1 year ago
accordion.php
1 year ago
columns.php
1 year ago
control-group-item.php
1 year ago
control-group.php
1 year ago
div.php
1 year ago
form-group.php
1 year ago
index.php
3 years ago
more-link.php
1 year ago
tab-item.php
1 year ago
tab.php
1 year ago
tab-item.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The file contains the class of Tab Item Control Holder. |
| 4 | * |
| 5 | * @author Alex Kovalev <alex.kovalevv@gmail.com> |
| 6 | * @copyright (c) 2018, Webcraftic Ltd |
| 7 | * |
| 8 | * @package factory-forms |
| 9 | * @since 1.0.0 |
| 10 | */ |
| 11 | // Exit if accessed directly |
| 12 | if( !defined('ABSPATH') ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | if( !class_exists('Wbcr_FactoryForms480_TabItemHolder') ) { |
| 17 | /** |
| 18 | * Tab Item Control Holder |
| 19 | * |
| 20 | * @since 1.0.0 |
| 21 | */ |
| 22 | class Wbcr_FactoryForms480_TabItemHolder extends Wbcr_FactoryForms480_Holder { |
| 23 | |
| 24 | /** |
| 25 | * A holder type. |
| 26 | * |
| 27 | * @since 1.0.0 |
| 28 | * @var string |
| 29 | */ |
| 30 | public $type = 'tab-item'; |
| 31 | |
| 32 | /** |
| 33 | * Here we should render a beginning html of the tab. |
| 34 | * |
| 35 | * @since 1.0.0 |
| 36 | * @return void |
| 37 | */ |
| 38 | public function beforeRendering() |
| 39 | { |
| 40 | |
| 41 | $this->addCssClass('tab-' . $this->getName()); |
| 42 | $this->addHtmlAttr('id', $this->getName()); |
| 43 | |
| 44 | $this->addCssClass('tab-pane'); |
| 45 | |
| 46 | if( isset($this->options['isFirst']) && $this->options['isFirst'] ) { |
| 47 | $this->addCssClass('active'); |
| 48 | } |
| 49 | |
| 50 | ?> |
| 51 | <div <?php $this->attrs() ?>> |
| 52 | <?php |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Here we should render an end html of the tab. |
| 57 | * |
| 58 | * @since 1.0.0 |
| 59 | * @return void |
| 60 | */ |
| 61 | public function afterRendering() |
| 62 | { |
| 63 | ?> |
| 64 | </div> |
| 65 | <?php |
| 66 | } |
| 67 | } |
| 68 | } |