PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / addon-api / classes / view.php
wp-all-export / addon-api / classes Last commit date
base.php 2 months ago exporter.php 2 months ago helpers.php 2 months ago resolver.php 2 months ago updater.php 2 months ago view.php 2 months ago
view.php
46 lines
1 <?php
2
3 namespace Wpae\AddonAPI;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 class PMXE_Addon_View {
8 public PMXE_Addon_Base $addon;
9
10 public function __construct( PMXE_Addon_Base $addon ) {
11 $this->addon = $addon;
12 }
13
14 private function renderView( $viewName, $extraData = [] ) {
15 $groups = $this->addon->getGroupsByExportType();
16 $groups = array_map( function ( $group ) {
17 $group['fields'] = $this->addon->getFieldsByGroup( $group['id'] );
18
19 return $group;
20 }, $groups );
21
22 if ( empty( $groups ) ) {
23 return;
24 }
25
26 $data = array_merge( [
27 'groups' => $groups,
28 'addon' => $this->addon,
29 ], $extraData );
30
31 view( $viewName, $data );
32 }
33
34 public function render( $i ) {
35 $this->renderView( 'fields', [ 'i' => $i ] );
36 }
37
38 public function filters() {
39 $this->renderView( 'filters' );
40 }
41
42 public function newField() {
43 $this->renderView( 'new-field' );
44 }
45 }
46