Permalink
Browse files

Check if `themes/vip` and `themes/vip/plugins` exist

  • Loading branch information...
1 parent b024368 commit fc81e86a2b777e85611fc4122d0340330e146e11 @joshbetz joshbetz committed Jun 4, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 developer.php
View
@@ -373,7 +373,9 @@ public function settings_page() {
add_settings_section( 'a8c_developer_settings', esc_html__( 'Settings', 'a8c-developer' ), array( &$this, 'settings_section_settings' ), $this->settings_page_slug . '_status' );
add_settings_field( 'a8c_developer_setting_permalink_structure', esc_html__( 'Pretty Permalinks', 'a8c-developer' ), array( &$this, 'settings_field_setting_permalink_structure' ), $this->settings_page_slug . '_status', 'a8c_developer_settings' );
-
+ if ( 'wpcom-vip' == $this->settings['project_type'] ) {
+ add_settings_field( 'a8c_developer_setting_vip_environment', esc_html__( 'VIP Environment', 'a8c-developer' ), array( &$this, 'settings_field_setting_vip_environment' ), $this->settings_page_slug . '_status', 'a8c_developer_settings' );
+ }
# Add more sections and fields here as needed
@@ -478,6 +480,14 @@ public function settings_field_setting_permalink_structure() {
}
}
+ public function settings_field_setting_vip_environment() {
+ if( file_exists(WP_CONTENT_DIR . '/themes/vip') && file_exists(WP_CONTENT_DIR . '/themes/vip/plugins') ) {
+ echo '<span class="a8c-developer-active">' . esc_html__( 'ENABLED', 'a8c-developer' ) . '</span>';
+ } else {
+ echo '<span class="a8c-developer-notactive">' . esc_html__( 'DISABLED', 'a8c-developer' ) . '</span>';
+ }
+ }
+
public function settings_validate( $raw_settings ) {
$settings = array();

2 comments on commit fc81e86

Owner

mjangda replied Jun 8, 2012

Let's link the Disabled state to http://lobby.vip.wordpress.com/getting-started/development-environment/#plugins-and-helper-functions

It would be super cool in a future version to add a way for the plugin to checkout the repo for them (although, it can get tricky with shell access across environments since we'd be interfacing with SVN via command line.)

Owner

joshbetz replied Jun 8, 2012

Sounds good. Maybe we could test for shell access and fall back to this link if necessary.

Please sign in to comment.