' . __( 'Cannot find Pressbooks install.', 'roe-pressbooks' ) . '

'; }); return; } elseif ( ! pb_meets_minimum_requirements() ) { return; } // ------------------------------------------------------------------------------------------------------------------- // Class autoloader // ------------------------------------------------------------------------------------------------------------------- \HM\Autoloader\register_class_path( 'ROE', __DIR__ . '/inc' ); // ------------------------------------------------------------------------------------------------------------------- // Composer autoloader // ------------------------------------------------------------------------------------------------------------------- if ( ! class_exists( '\ROE\ROEIntegration' ) ) { if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; } else { $title = __( 'Dependencies Missing', 'roe-pressbooks' ); $body = __( 'Please run composer install from the root of the River of Ebooks for Pressbooks plugin directory.', 'roe-pressbooks' ); $message = "

{$title}

{$body}

"; wp_die( $message, $title ); } } // ------------------------------------------------------------------------------------------------------------------- // Check for updates // ------------------------------------------------------------------------------------------------------------------- if ( ! \Pressbooks\Book::isBook() ) { $updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/villa7/roe-pressbooks/', __FILE__, 'roe-pressbooks' ); $updater->setBranch( 'master' ); } function _roe_show_set_config () { echo '

'; _e('Please configure your site\'s publisher id and secret. It is required to publish to the River of Ebooks.', 'roe-pressbooks'); echo '

'; _e('Settings', 'roe-pressbooks'); echo '
'; } if ( is_plugin_active('roe-pressbooks/roe-pressbooks.php') && is_network_admin() ) { if ( ! \ROE\ROEIntegration::is_active() ) { add_action( 'network_admin_notices', '_roe_show_set_config' ); } } add_filter( 'pb_active_export_modules', function ( $modules ) { if ( isset( $_POST['export_formats']['roe'] ) && \ROE\ROEIntegration::is_active() ) { $modules[] = '\ROE\ROEIntegration'; } return $modules; } ); add_filter( 'pb_export_formats', function ( $formats ) { if (\ROE\ROEIntegration::is_active()) { $formats['exotic']['roe'] = __( 'Send to River of Ebooks', 'pressbooks' ); } return $formats; } ); if (is_network_admin()) { new \ROE\Admin\ROEAdmin; }