Skip to content

Commit 52a322a

Browse files
committed
Add 2 actions for AIO
1 parent 7a1e1f9 commit 52a322a

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/Dashboard/Dashboard.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
class Dashboard {
55
private $is_pro = false;
6+
private $is_aio = false;
67
private $assets_url;
78

89
public function __construct( bool $is_pro ) {
910
$this->is_pro = $is_pro;
11+
$this->is_aio = defined( 'META_BOX_AIO_DIR' );
1012
$this->assets_url = RWMB_URL . 'src/Dashboard/assets';
1113

1214
$this->init();

src/Dashboard/content.php

+24
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ class="mb-dashboard__header__search-results"
108108
<span class="mb-dashboard__action__description"><?php esc_html_e( 'To establish connections between posts', 'meta-box' ); ?></span>
109109
</span>
110110
</a>
111+
112+
<?php if ( $this->is_aio ) : ?>
113+
<a class="mb-dashboard__action" href="<?php echo esc_attr( admin_url( 'post-new.php?post_type=mb-views' ) ); ?>">
114+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
115+
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z"/>
116+
<path d="M8.646 6.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 9 8.646 7.354a.5.5 0 0 1 0-.708m-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 9l1.647-1.646a.5.5 0 0 0 0-.708"/>
117+
</svg>
118+
<span class="mb-dashboard__action__text">
119+
<span class="mb-dashboard__action__title"><?php esc_html_e( 'Create a view', 'meta-box' ); ?></span>
120+
<span class="mb-dashboard__action__description"><?php esc_html_e( 'To output fields on the frontend', 'meta-box' ); ?></span>
121+
</span>
122+
</a>
123+
124+
<a class="mb-dashboard__action" href="<?php echo esc_attr( admin_url( 'post-new.php?post_type=mb-settings-page' ) ); ?>">
125+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
126+
<path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0"/>
127+
<path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z"/>
128+
</svg>
129+
<span class="mb-dashboard__action__text">
130+
<span class="mb-dashboard__action__title"><?php esc_html_e( 'Create a settings page', 'meta-box' ); ?></span>
131+
<span class="mb-dashboard__action__description"><?php esc_html_e( 'For global settings of your website', 'meta-box' ); ?></span>
132+
</span>
133+
</a>
134+
<?php endif; ?>
111135
</div>
112136
</section>
113137

src/Dashboard/todo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
- Add tab support
2-
- Add 2 actions for AIO
2+
- Add bulb icon

0 commit comments

Comments
 (0)