Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelogs/issue-3150.yml
Original file line number Diff line number Diff line change
@@ -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."
43 changes: 43 additions & 0 deletions includes/abstracts/llms.abstract.integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
27 changes: 24 additions & 3 deletions includes/admin/settings/class.llms.settings.integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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() {

Expand All @@ -134,8 +136,9 @@ private function get_table_html() {
<thead>
<tr>
<th><?php esc_html_e( 'Integration', 'lifterlms' ); ?></th>
<th><?php esc_html_e( 'Integration ID', 'lifterlms' ); ?></th>
<th><?php esc_html_e( 'Description', 'lifterlms' ); ?></th>
<th><?php esc_html_e( 'Installed', 'lifterlms' ); ?></th>
<th><?php esc_html_e( 'Configured', 'lifterlms' ); ?></th>
<th><?php esc_html_e( 'Enabled', 'lifterlms' ); ?></th>
</tr>
</thead>
Expand All @@ -148,7 +151,12 @@ private function get_table_html() {
?>
<tr>
<td><a href="<?php echo esc_url( admin_url( 'admin.php?page=llms-settings&tab=' . $this->id . '&section=' . $integration->id ) ); ?>"><?php echo esc_html( $integration->title ); ?></a></td>
<td><?php echo esc_html( $integration->id ); ?></td>
<td>
<?php echo wp_kses_post( $integration->description ); ?>
<?php if ( ! empty( $integration->learn_more_url ) ) : ?>
<a href="<?php echo esc_url( $integration->learn_more_url ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Learn More', 'lifterlms' ); ?></a>
<?php endif; ?>
</td>
<td class="status available">
<?php if ( $integration->is_installed() ) : ?>
<span class="tip--bottom-right" data-tip="<?php esc_attr_e( 'Installed', 'lifterlms' ); ?>">
Expand All @@ -159,6 +167,19 @@ private function get_table_html() {
&ndash;
<?php endif; ?>
</td>
<td class="status configured">
<?php if ( $integration->is_configured() ) : ?>
<span class="tip--bottom-right" data-tip="<?php esc_attr_e( 'Configured', 'lifterlms' ); ?>">
<span class="screen-reader-text"><?php esc_html_e( 'Configured', 'lifterlms' ); ?></span>
<i class="fa fa-check-circle" aria-hidden="true"></i>
</span>
<?php else : ?>
<span class="tip--bottom-right" data-tip="<?php echo ! empty( $integration->configured_help ) ? esc_attr( $integration->configured_help ) : esc_attr__( 'Not configured', 'lifterlms' ); ?>">
<span class="screen-reader-text"><?php esc_html_e( 'Not configured', 'lifterlms' ); ?></span>
&ndash;
</span>
<?php endif; ?>
</td>
<td class="status enabled">
<?php if ( $integration->is_enabled() ) : ?>
<span class="tip--bottom-right" data-tip="<?php esc_attr_e( 'Enabled', 'lifterlms' ); ?>">
Expand Down
19 changes: 16 additions & 3 deletions includes/integrations/class.llms.integration.bbpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ), '<a href="https://lifterlms.com/docs/lifterlms-and-bbpress/" target="_blank">', '</a>' );
$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/';
}

/**
Expand Down Expand Up @@ -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
*
Expand Down
19 changes: 16 additions & 3 deletions includes/integrations/class.llms.integration.buddypress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ), '<a href="https://lifterlms.com/docs/lifterlms-and-buddypress/" target="_blank">', '</a>' );
$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/';
}

/**
Expand Down Expand Up @@ -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.
*
Expand Down
Loading