Overview

Namespaces

  • None
  • swag

Classes

  • H5pSwagifact
  • H5pUtil
  • SettingsPageController
  • ShortcodeUtil
  • swag\ArrayUtil
  • swag\Singleton
  • swag\WpUtil
  • SwagMapController
  • SwagPageController
  • Swagpath
  • SwagpathController
  • SwagpathSyncer
  • SwagPlugin
  • SwagPostItem
  • SwagTgmpaController
  • SwagTrack
  • SwagTrackController
  • SwagUser
  • Template
  • Xapi
  • Overview
  • Namespace
  • Class
  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 
<?php

require_once __DIR__."/../../ext/TGM-Plugin-Activation/class-tgm-plugin-activation.php";
require_once __DIR__."/../utils/Singleton.php";

use swag\Singleton;

/**
 * Manage plugin dependencies.
 */
class SwagTgmpaController extends Singleton {

    /**
     * Init.
     */
    public function init() {
        add_action("tgmpa_register",array($this,"registerRequiredPlugins"));
    }

    /**
     * Register plugins we require.
     */
    public function registerRequiredPlugins() {
        $plugins = array(
            array(
                'name'      => 'H5P',
                'slug'      => 'h5p',
                'required'  => true,
            ),
            array(
                'name'      => 'H5P xAPI',
                'slug'      => 'wp-h5p-xapi',
                'required'  => true,
                'version'   => '0.1.4',
            ),
            array(
                'name'      => 'Remote Sync',
                'slug'      => 'wp-remote-sync',
                'source'    => "https://github.com/tunapanda/wp-remote-sync/archive/master.zip",
                'required'  => true,
            ),
            array(
                'name'      => "Deliverable",
                "slug"      => "wp-deliverable",
                "source"    => "https://github.com/tunapanda/wp-deliverable/archive/master.zip",
                "required"  => true
            ),
            array(
                'name'      => 'xAPI LRS',
                'slug'      => 'wp-xapi-lrs',
                'source'    => "https://github.com/tunapanda/wp-xapi-lrs/archive/master.zip",
            ),
            array(
                'name'      => 'GitHub Updater',
                'slug'      => 'github-updater',
                'source'    => "https://github.com/afragen/github-updater/archive/master.zip",
            ),
            array(
                'name'      => 'Logged In User Shortcode',
                'slug'      => 'logged-in-user-shortcode',
                'required'  => true,
            ),
            array(
                'name'      => 'Profile Builder',
                'slug'      => 'profile-builder',
                'required'  => true,
            ),
            array(
                'name'      => 'Tabby Responsive Tabs',
                'slug'      => 'tabby-responsive-tabs',
                'required'  => true,
            ),

        );

        $config = array(
            'id'           => 'wp-swag',
            'menu'         => 'tgmpa-install-plugins',
            'parent_slug'  => 'plugins.php',
            'capability'   => 'manage_options',
            'dismissable'  => false,
            'message'      => '<p>These plugins are required in order to run Tunapanda Swag.</p>',

            'strings'=>array(
                'menu_title'=> __( 'Plugins required by Tunapanda Swag', 'wp-swag' ),
                'notice_can_install_required'     => _n_noop(
                    'Tunapanda Swag requires the following plugin: %1$s.',
                    'Tunapanda Swag requires the following plugins: %1$s.',
                    'wp-swag'
                ),
                'notice_can_install_recommended'     => _n_noop(
                    'Tunapanda Swag recommends the following plugin: %1$s.',
                    'Tunapanda Swag recommends the following plugins: %1$s.',
                    'wp-swag'
                ),
                'notice_can_activate_required'    => _n_noop(
                    'The following plugin required by Tunapanda Swag is currently inactive: %1$s.',
                    'The following plugins required by Tunapanda Swag are currently inactive: %1$s.',
                    'wp-swag'
                ),
                'notice_can_activate_recommended' => _n_noop(
                    'The following plugin recommended by Tunapanda Swag is currently inactive: %1$s.',
                    'The following plugins recommended by Tunapanda Swag are currently inactive: %1$s.',
                    'wp-swag'
                ),
            )
        );

        tgmpa( $plugins, $config );
    }
}
Swag API documentation generated by ApiGen