PluginProbe
Depicter — Popup & Slider Builder / 1.2.0
Depicter — Popup & Slider Builder v1.2.0
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Modules / Beaver / module.php

module.php in Depicter — Popup & Slider Builder 1.2.0, at app/src/Modules/Beaver/module.php

94 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Modules\Beaver;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 class Module extends \FLBuilderModule {
9
10 public function __construct() {
11 parent::__construct( array(
12
13 'name' => __( 'Depicter', 'depicter' ),
14
15 'description' => __( 'Make animated and interactive image slider, video slider, post slider and carousel which work smoothly across devices.', 'depicter' ),
16
17 'category' => __( 'Depicter', 'depicter' ),
18
19 'dir' => DEPICTER_PLUGIN_PATH . '/app/src/Modules/Beaver/',
20
21 'url' => DEPICTER_PLUGIN_URL . '/app/src/Modules/Beaver/',
22
23 // 'icon' => 'button.svg',
24
25 'editor_export' => true, // Defaults to true and can be omitted.
26
27 'enabled' => true, // Defaults to true and can be omitted.
28
29 'partial_refresh' => false, // Defaults to false and can be omitted.
30
31 ) );
32
33 $styles = \Depicter::front()->assets()->registerStyles();
34 foreach ( $styles as $handler => $style ) {
35 $this->add_css( $handler );
36 }
37
38 $scripts = \Depicter::front()->assets()->registerScripts();
39 foreach ( $scripts as $handler => $script ) {
40 $this->add_js( $handler );
41 }
42 }
43
44 public static function getDepicterFields() {
45 if ( ! isset( $_GET['fl_builder'] ) ) {
46 return[];
47 }
48
49 $list = [
50 0 => __( 'Select Slider', 'depicter' )
51 ];
52 $documents = \Depicter::documentRepository()->getList();
53 foreach( $documents as $document ) {
54 $list[ $document['id'] ] = "[#{$document['id']}]: " . $document['name'];
55 }
56
57 $fields = [
58 'document_id' => [
59 'type' => 'select',
60 'label' => __( 'Select Slider', 'depicter' ),
61 'default' => '0',
62 'options' => $list
63 ]
64 ];
65 foreach( $documents as $document ) {
66
67 $args = [
68 'isNotPublished' => \Depicter::documentRepository()->isNotPublished( $document['id'], [ 'status' => 'publish' ] ),
69 'documentStatus' => $document['status']
70 ];
71
72 $markup = \Depicter::view('admin/notices/builders-draft-notice')->with('view_args', $args)->toString();
73 $fields[ 'slider_control_buttons_' . $document['id'] ] = [
74 'type' => 'raw',
75 'content' => $markup,
76 ];
77 }
78
79 return $fields;
80 }
81 }
82
83 \FLBuilder::register_module( '\Depicter\Modules\Beaver\Module', array(
84 'general' => array( // Tab
85 'title' => __('General', 'depicter'), // Tab title
86 'sections' => array( // Tab Sections
87 'general' => array( // Section
88 'title' => __('Depicter Settings', 'depicter'), // Section Title
89 'fields' => Module::getDepicterFields() // Section Fields
90 ),
91 ),
92 )
93 ) );
94