Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and gulp deps #2

Merged
merged 14 commits into from
Nov 30, 2022
2 changes: 1 addition & 1 deletion assets/admin/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

.iconic-wds-gcal-redirect-copy {
margin-left: 5px !important;
}
}
54 changes: 27 additions & 27 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/**
* Load the "Iconic Plugin" Gulp module.
*/
require( 'iconic-plugin' )( {
plugin_data: require( './plugin-data.json' ),
const { registry, task } = require('gulp');
const CommonRegistry = require('iconic-plugin');

const deps = {
// 'src' : 'dest'
'vendor/iconicwp/iconic-core/class-core-licence.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-settings.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-helpers.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-cross-sells.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-autoloader.php': 'inc',
'vendor/iconicwp/iconic-core/plugin-icon.png': 'assets/img',
'vendor/iconicwp/workflows/release/release.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/auto_assign.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/phpcs.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/phpcs.xml': '.',
'vendor/iconicwp/workflows/changelog/changelog.yml': '.github/workflows',
'vendor/iconicwp/workflows/templates/ISSUE_TEMPLATE/bug.md': '.github/ISSUE_TEMPLATE',
'vendor/iconicwp/workflows/templates/ISSUE_TEMPLATE/feature.md': '.github/ISSUE_TEMPLATE',
'vendor/iconicwp/workflows/templates/PULL_REQUEST_TEMPLATE.md': '.github'
}

registry(new CommonRegistry({
plugin_id: 1038.1,
plugin_name: 'Google Calendar addon for WooCommerce Delivery Slots',
plugin_name: 'WooCommerce Delivery Slots by Iconic: Google Calendar Addon',
plugin_filename: 'iconic-wds-google-calendar',
premium_suffix: true,
textdomain: 'jckwds',
premium_suffix: false,
textdomain: 'iconic-wds-gcal',
is_envato_constant: false,
is_upload: true,
class_prefix: 'Iconic_WDS_Gcal_',
deps: {
// 'src' : 'dest'
'vendor/iconicwp/iconic-core/class-core-licence.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-settings.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-helpers.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-cross-sells.php': 'inc',
'vendor/iconicwp/iconic-core/class-core-autoloader.php': 'inc',
'vendor/iconicwp/iconic-core/plugin-icon.png': 'assets/img',
'vendor/iconicwp/workflows/release/release.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/auto_assign.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/phpcs.yml': '.github/workflows',
'vendor/iconicwp/workflows/phpcs/phpcs.xml': '.',
'vendor/iconicwp/workflows/changelog/changelog.yml': '.github/workflows',
'vendor/iconicwp/workflows/templates/ISSUE_TEMPLATE/bug.md': '.github/ISSUE_TEMPLATE',
'vendor/iconicwp/workflows/templates/ISSUE_TEMPLATE/feature.md': '.github/ISSUE_TEMPLATE',
'vendor/iconicwp/workflows/templates/PULL_REQUEST_TEMPLATE.md': '.github',
'vendor/iconicwp/iconic-core/plugin-icon.png': 'assets/img',
}
} );
nolic: false,
}));
21 changes: 21 additions & 0 deletions iconic-wds-google-calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function plugins_loaded() {

if ( is_admin() ) {
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
add_action( 'plugin_action_links', array( $this, 'add_plugin_actions' ), 10, 4 );
}

Iconic_WDS_Gcal_Google_Calendar::run();
Expand Down Expand Up @@ -136,6 +137,26 @@ public function admin_scripts() {
wp_enqueue_script( 'iconic-wds-gcal-admin', ICONIC_WDS_GCAL_URL . 'assets/admin/js/main' . $suffix . '.js', array( 'jquery' ), self::$version, true );
wp_enqueue_style( 'iconic-wds-gcal-admin', ICONIC_WDS_GCAL_URL . 'assets/admin/css/main' . $suffix . '.css', array(), self::$version );
}

/**
* Add settings URL to plugin action links.
*
* @param string[] $actions Actions.
* @param string $plugin_file Plugin file.
* @param array $plugin_data Plugin data.
* @param string $context Context.
*
* @return string[]
*/
public static function add_plugin_actions( $actions, $plugin_file, $plugin_data, $context ) {
if ( false === strpos( $plugin_file, 'iconic-wds-google-calendar.php' ) ) {
return $actions;
}

$settings_url = admin_url( 'admin.php?page=jckwds-settings#tab-integrations' );
$actions[] = sprintf( "<a href='%s'>%s</a>", esc_url( $settings_url ), esc_html__( 'Settings', 'iconic-wds-gcal' ) );
return $actions;
}
}

global $iconic_wds_gcal;
Expand Down
27 changes: 22 additions & 5 deletions inc/admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,33 @@ function jckwds_gcal_settings( $wpsf_settings ) {
);
}

// @todo change this URL.
$document_url = 'https://iconicwp.com/?post_type=knowledgebase&p=9872&preview=true';

$gcal_fields = array(
array(
'id' => 'api',
'title' => __( 'Client ID', 'iconic-wds-gcal' ),
'subtitle' => '',
'type' => 'text',
'link' => array(
'text' => __( 'Get your API key', 'iconic-wds-gcal' ),
'url' => $document_url,
'type' => 'tooltip',
'external' => true,
),
),
array(
'id' => 'secret',
'title' => __( 'Client Secret', 'iconic-wds-gcal' ),
'subtitle' => '',
'type' => 'text',
'link' => array(
'text' => __( 'Get your Secret Key', 'iconic-wds-gcal' ),
'url' => $document_url,
'type' => 'tooltip',
'external' => true,
),
),
array(
'id' => 'redirect_url',
Expand Down Expand Up @@ -69,11 +84,13 @@ function jckwds_gcal_settings( $wpsf_settings ) {
}

$wpsf_settings['sections'][] = array(
'tab_id' => 'integrations',
'section_id' => 'google',
'section_title' => __( 'Google Calender Authentication', 'iconic-wds-gcal' ),
'section_order' => 0,
'fields' => $gcal_fields,
'tab_id' => 'integrations',
'section_id' => 'google',
'section_title' => __( 'Google Calender Authentication', 'iconic-wds-gcal' ),
// translators: %s: URL to the document.
'section_description' => sprintf( __( 'Follow <a href="%s">this guide</a> to create a Google App and generate Client ID and Secret key.', 'iconic-wds-gcal' ), $document_url ),
'section_order' => 0,
'fields' => $gcal_fields,
);

$wpsf_settings['sections'][] = array(
Expand Down
Loading