*/ $domain = AthlonCalameoManageConfiguration::$PLUGIN['localization_domain']; add_action( 'admin_init', 'ath_calameo_credentials_init' ); function ath_calameo_credentials_init() { global $domain; wp_enqueue_script( 'get_account_calameo_info', AthlonManageCalameoPublications::$CALAMEO_DIRECTORY . '/assets/js/get_account_info.js', false, false, ASSETS_JAVASCRIPTS_IN_FOOTER ); wp_enqueue_script( 'get_account_subscriptions', AthlonManageCalameoPublications::$CALAMEO_DIRECTORY . '/assets/js/get_account_subscriptions.js', false, false, ASSETS_JAVASCRIPTS_IN_FOOTER ); register_setting( 'calameo_credentials', 'calameo_credentials', 'ath_calameo_validate_credentials' ); /*API credentials section*/ add_settings_section( 'calameo_credentials_section', __( 'Enter your API credentials', $domain ), 'calameo_section_callback', __FILE__ ); add_settings_field( 'calameo_api_key', __( 'Calameo API key', $domain ), 'ath_calameo_api_key_callback', __FILE__, 'calameo_credentials_section' ); add_settings_field( 'calameo_api_secret', __( 'Calameo API secret', $domain ), 'ath_calameo_api_secret_callback', __FILE__, 'calameo_credentials_section' ); add_settings_field( 'calameo_check_account', '', 'ath_calameo_check_account_callback', __FILE__, 'calameo_credentials_section' ); } add_action( 'admin_menu', 'ath_calameo_credentials_page' ); /* Add sub option page to the Settings Menu */ function ath_calameo_credentials_page() { global $ath_calameo_credentials_page_hook, $domain; $ath_calameo_credentials_page_hook = add_options_page( __( 'Calameo Credentials', $domain ), __( 'Calameo Credentials', $domain ), 'manage_options', 'calameo_credentials', 'ath_calameo_credentials_form' ); /* Calling function which will add new tabs to contextual menu when loads */ add_action( 'load-'. $ath_calameo_credentials_page_hook, 'ath_calameo_credentials_help_tabs' ); add_action( 'load-'. $ath_calameo_credentials_page_hook, 'ath_calameo_add_setting_error_wp_calameo_not_installed' ); } /* Callbacks function */ global $calameo_credentials; $calameo_credentials = get_option( 'calameo_credentials' ); function ath_calameo_api_key_callback() { global $calameo_credentials, $domain; add_settings_error( $calameo_credentials['calameo_api_secret'], 'txt_multinumeric_error', __( 'Please enter a valid Calameo API Secret', $domain ), 'error' ); ?>
' . __( 'On this page you can change the credentials that will be used to connect to the Calameo API.
Note that your API credentials should have at least commons and publish access rights.', $domain ) . '
' . __( 'Calaméo offers you some types of accounts according to the features you wish to have: FREE, PREMIUM, PLATINUM and SOLO account.
If account is FREE you don\'t have to access Calaméo API.', $domain ) . '
For more information :
Get Calameo API Key