| 1 |
<?php |
| 2 |
/** |
| 3 |
* The file contains the class of Group 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 |
|
| 12 |
// Exit if accessed directly |
| 13 |
if( !defined('ABSPATH') ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
if( !class_exists('Wbcr_FactoryForms480_FormGroupHolder') ) { |
| 18 |
/** |
| 19 |
* Group Holder |
| 20 |
* |
| 21 |
* @since 1.0.0 |
| 22 |
*/ |
| 23 |
class Wbcr_FactoryForms480_FormGroupHolder extends Wbcr_FactoryForms480_Holder { |
| 24 |
|
| 25 |
/** |
| 26 |
* A holder type. |
| 27 |
* |
| 28 |
* @since 1.0.0 |
| 29 |
* @var string |
| 30 |
*/ |
| 31 |
public $type = 'form-group'; |
| 32 |
|
| 33 |
/** |
| 34 |
* Here we should render a beginning html of the tab. |
| 35 |
* |
| 36 |
* @since 1.0.0 |
| 37 |
* @return void |
| 38 |
*/ |
| 39 |
public function beforeRendering() |
| 40 |
{ |
| 41 |
|
| 42 |
$this->addCssClass('factory-form-group-' . $this->getName()); |
| 43 |
$this->addHtmlAttr('id', 'factory-form-group-' . $this->getName()); |
| 44 |
|
| 45 |
?> |
| 46 |
<fieldset <?php $this->attrs() ?>> |
| 47 |
<?php if( $this->hasTitle() ) { ?> |
| 48 |
<legend class='factory-legend'> |
| 49 |
<p class='factory-title'><?php $this->title() ?></p> |
| 50 |
<?php if( $this->hasHint() ) { ?> |
| 51 |
<p class='factory-hint'><?php echo $this->hint() ?></p> |
| 52 |
<?php } ?> |
| 53 |
</legend> |
| 54 |
<?php } ?> |
| 55 |
<?php |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Here we should render an end html of the tab. |
| 60 |
* |
| 61 |
* @since 1.0.0 |
| 62 |
* @return void |
| 63 |
*/ |
| 64 |
public function afterRendering() |
| 65 |
{ |
| 66 |
?> |
| 67 |
</fieldset> |
| 68 |
<?php |
| 69 |
} |
| 70 |
} |
| 71 |
} |