diff --git a/.changelogs/issue-3150.yml b/.changelogs/issue-3150.yml new file mode 100644 index 0000000000..582f18f99d --- /dev/null +++ b/.changelogs/issue-3150.yml @@ -0,0 +1,3 @@ +significance: minor +type: changed +entry: "Restructured the Integrations list table: removed the Integration ID column, added a Description column with a Learn More link, and added a Configured column to indicate when an integration's required credentials are present." diff --git a/includes/abstracts/llms.abstract.integration.php b/includes/abstracts/llms.abstract.integration.php index 7f7541f377..a7d162b21b 100644 --- a/includes/abstracts/llms.abstract.integration.php +++ b/includes/abstracts/llms.abstract.integration.php @@ -38,12 +38,28 @@ abstract class LLMS_Abstract_Integration extends LLMS_Abstract_Options_Data { /** * Integration Description * + * A short, one-sentence description of the integration shown in the + * Integrations list table. + * * Should be defined by extending class in configure() function (so it can be translated). * * @var string */ public $description = ''; + /** + * Integration "Learn More" URL + * + * Optional URL to the integration's getting started / documentation page. + * + * When defined, the Integrations list table renders a "Learn More" link + * alongside the integration's description. + * + * @since 10.0.6 + * @var string + */ + public $learn_more_url = ''; + /** * Integration Missing Dependencies Description * @@ -56,6 +72,17 @@ abstract class LLMS_Abstract_Integration extends LLMS_Abstract_Options_Data { */ public $description_missing = ''; + /** + * Integration "Configured" help text + * + * Optional short string used as a tooltip in the Integrations list table + * when the integration is not yet configured (e.g. `"Add your API key to enable."`). + * + * @since 10.0.6 + * @var string + */ + public $configured_help = ''; + /** * Reference to the integration plugin's main plugin file basename * @@ -297,6 +324,22 @@ public function is_installed() { return true; } + /** + * Determine if the integration has been configured. + * + * "Configured" means any required credentials (e.g. API keys) have been + * provided. Extending classes should override this to perform credential + * checks; the default returns `true` for integrations that do not require + * configuration. + * + * @since 10.0.6 + * + * @return boolean + */ + public function is_configured() { + return true; + } + /** * Add plugin settings Action Links * diff --git a/includes/admin/settings/class.llms.settings.integrations.php b/includes/admin/settings/class.llms.settings.integrations.php index bc3a94e1df..5348c27f45 100644 --- a/includes/admin/settings/class.llms.settings.integrations.php +++ b/includes/admin/settings/class.llms.settings.integrations.php @@ -17,6 +17,8 @@ * * @since 1.0.0 * @since 3.18.2 Unknown. + * @since 10.0.6 Replaced the "Integration ID" column with a "Description" column + * and added a "Configured" column to the integrations list. */ class LLMS_Settings_Integrations extends LLMS_Settings_Page { @@ -122,7 +124,7 @@ public function get_settings() { * * @return string * @since 3.18.2 - * @version 3.18.2 + * @version 10.0.6 */ private function get_table_html() { @@ -134,8 +136,9 @@ private function get_table_html() { - + + @@ -148,7 +151,12 @@ private function get_table_html() { ?> title ); ?> - id ); ?> + + description ); ?> + learn_more_url ) ) : ?> + + + is_installed() ) : ?> @@ -159,6 +167,19 @@ private function get_table_html() { – + + is_configured() ) : ?> + + + + + + + + – + + + is_enabled() ) : ?> diff --git a/includes/integrations/class.llms.integration.bbpress.php b/includes/integrations/class.llms.integration.bbpress.php index 2fd8d7337f..0d59ab8750 100644 --- a/includes/integrations/class.llms.integration.bbpress.php +++ b/includes/integrations/class.llms.integration.bbpress.php @@ -80,9 +80,9 @@ protected function configure() { } public function set_title_and_description() { - $this->title = __( 'bbPress', 'lifterlms' ); - /* translators: %1$s: Open learn more link tag, %2$s: Closing tag. */ - $this->description = sprintf( __( 'Restrict forums and topics to memberships, add forums to courses, and %1$smore%2$s.', 'lifterlms' ), '', '' ); + $this->title = __( 'bbPress', 'lifterlms' ); + $this->description = __( 'Restrict forums and topics to memberships and add forums to courses.', 'lifterlms' ); + $this->learn_more_url = 'https://lifterlms.com/docs/lifterlms-and-bbpress/'; } /** @@ -282,6 +282,19 @@ public function is_installed() { return class_exists( 'bbPress' ); } + /** + * Determine if the integration is configured. + * + * bbPress requires no API keys or credentials. + * + * @since 10.0.6 + * + * @return boolean + */ + public function is_configured() { + return true; + } + /** * Register shortcodes via LifterLMS core registration methods * diff --git a/includes/integrations/class.llms.integration.buddypress.php b/includes/integrations/class.llms.integration.buddypress.php index 87445e0d41..b40feca306 100644 --- a/includes/integrations/class.llms.integration.buddypress.php +++ b/includes/integrations/class.llms.integration.buddypress.php @@ -80,9 +80,9 @@ protected function configure() { } public function set_title_and_description() { - $this->title = __( 'BuddyPress', 'lifterlms' ); - /* translators: %1$s: Open learn more link tag, %2$s: Closing tag. */ - $this->description = sprintf( __( 'Add LifterLMS information to user profiles and enable membership restrictions for activity, group, and member directories. %1$sLearn More%2$s.', 'lifterlms' ), '', '' ); + $this->title = __( 'BuddyPress', 'lifterlms' ); + $this->description = __( 'Add LifterLMS information to user profiles and enable membership restrictions for activity, group, and member directories.', 'lifterlms' ); + $this->learn_more_url = 'https://lifterlms.com/docs/lifterlms-and-buddypress/'; } /** @@ -212,6 +212,19 @@ public function is_installed() { return ( class_exists( 'BuddyPress' ) ); } + /** + * Determine if the integration is configured. + * + * BuddyPress requires no API keys or credentials. + * + * @since 10.0.6 + * + * @return bool + */ + public function is_configured() { + return true; + } + /** * Callback for "Achievements" profile screen. *