Skip to content

Commit

Permalink
Define screen to show steps on specific screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
malayladu authored and mrcasual committed Apr 10, 2024
1 parent 3449f81 commit 23244e8
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions future/includes/class-gv-onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class Onboarding {
private $plugin = GRAVITYVIEW_FILE;

public function __construct() {
add_action( 'admin_enqueue_scripts', [ $this, 'init' ] );
}

public function init() {

// Define Steps.

Expand All @@ -18,14 +22,24 @@ public function __construct() {
$title = __( 'Start by giving your View a name.', 'gk-gravityview' );
$description = __( 'Depending on your website, the name may display publicly on the front end.', 'gk-gravityview' );

$step_1 = new Step( [ 'element' => $element, 'title' => $title, 'description' => $description ] );
$step_1 = new Step( [
'element' => $element,
'title' => $title,
'description' => $description,
'screen' => 'gravityview',
] );

// Step 2.
$element = '#gravityview_form_id';
$title = __( 'Start by giving your View a name.', 'gk-gravityview' );
$description = __( 'Depending on your website, the name may display publicly on the front end.', 'gk-gravityview' );

$step_2 = new Step( [ 'element' => $element, 'title' => $title, 'description' => $description ] );
$step_2 = new Step( [
'element' => $element,
'title' => $title,
'description' => $description,
'screen' => 'gravityview',
] );

// Step 3.
$element = '#gravityview_select_template';
Expand All @@ -36,7 +50,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 4.
Expand All @@ -48,7 +63,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 5.
Expand All @@ -60,7 +76,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 6.
Expand All @@ -72,7 +89,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 7.
Expand All @@ -84,7 +102,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 8.
Expand All @@ -96,7 +115,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 9.
Expand All @@ -108,7 +128,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 10.
Expand All @@ -120,7 +141,8 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Step 11.
Expand All @@ -132,11 +154,12 @@ public function __construct() {
'element' => $element,
'title' => $title,
'description' => $description,
'side' => 'top'
'side' => 'top',
'screen' => 'gravityview',
] );

// Initialise onboarding.
$onboarding = new OnboardingFramework( $this->plugin );
$onboarding = OnboardingFramework::get_instance( $this->plugin );

$onboarding->steps->add( $step_1 )
->add( $step_2 )
Expand Down

0 comments on commit 23244e8

Please sign in to comment.