| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPDeveloper\BetterDocs\Editors\BlockEditor\Blocks; |
| 4 |
|
| 5 |
use WPDeveloper\BetterDocs\Editors\BlockEditor\Block; |
| 6 |
|
| 7 |
class BetterdocsPrint extends Block { |
| 8 |
protected $editor_styles = [ |
| 9 |
'betterdocs-single' |
| 10 |
]; |
| 11 |
|
| 12 |
protected $frontend_styles = [ |
| 13 |
'betterdocs-single', |
| 14 |
'betterdocs-encyclopedia' |
| 15 |
]; |
| 16 |
|
| 17 |
protected $frontend_scripts = [ |
| 18 |
'betterdocs' |
| 19 |
]; |
| 20 |
|
| 21 |
public function get_name() { |
| 22 |
return 'betterdocs-print'; |
| 23 |
} |
| 24 |
|
| 25 |
public function get_default_attributes() { |
| 26 |
return [ |
| 27 |
'blockId' => '', |
| 28 |
'layout' => 'layout-1', |
| 29 |
'enable' => true |
| 30 |
]; |
| 31 |
} |
| 32 |
|
| 33 |
public function render( $attributes, $content ) { |
| 34 |
$layout = $attributes['layout']; |
| 35 |
if ( $layout == 'layout-1' ) { |
| 36 |
$this->views( 'widgets/print-icon' ); |
| 37 |
} else { |
| 38 |
$this->views( 'templates/parts/print-icon-2' ); |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
|