add link to settings page on notification

master
unknown 2019-03-26 13:02:41 -04:00
parent 08850c5be4
commit fbef6f63d3
2 changed files with 7 additions and 10 deletions

View File

@ -32,7 +32,7 @@ class ROEIntegration extends Export {
error_log(print_r($output, true));*/
$siteurl = get_site_url(get_current_blog_id());
$identifier = isset($this->bookMeta['pb_print_isbn']) ? $this->bookMeta['pb_print_isbn'] : "url:md5:".md5($siteurl);
$identifier = isset($this->bookMeta['pb_print_isbn']) ? ("urn:isbn:" . $this->bookMeta['pb_print_isbn']) : ("url:md5:" . md5($siteurl));
$timestamp = (new \DateTime())->format('c');
$output = [
"metadata" => [

View File

@ -58,23 +58,20 @@ if ( ! \Pressbooks\Book::isBook() ) {
$updater->setBranch( 'master' );
}
function roe_check_compatibility () {
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' );
}
}
}
function _roe_show_set_config () {
echo '<div class="notice notice-warning"><p style="display:inline-block;height:40px;line-height:40px">';
_e('Please configure your site\'s publisher id and secret. It is required to publish to the River of Ebooks.', 'roe-pressbooks');
echo '</p><a class="button" style="float:right;height:30px;margin:15px 0;" href="#">';
echo '</p><a class="button" style="float:right;height:30px;margin:15px 0;" href="'. get_admin_url() .'network/settings.php?page=roe-pressbooks">';
_e('Settings', 'roe-pressbooks');
echo '</a></div>';
}
roe_check_compatibility();
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() ) {