Overview

Classes

  • Bright
  • BrightWoocommerceConstants
  • BrightWoocommerceIntegration
  • WoocommerceExtensions

Functions

  • bright_add_quicktags
  • bright_add_token_tag
  • bright_call_api_for_course
  • bright_check_compat
  • bright_curl
  • bright_curl_error
  • bright_echo_message
  • bright_extract_embed_code
  • bright_fetch_template_text
  • bright_fetch_user_attributes
  • bright_get_authentication_code_for_user
  • bright_get_avatar_url
  • bright_get_course_data
  • bright_get_course_list_with_registrations
  • bright_get_course_providers
  • bright_get_registration_data
  • bright_get_registration_list
  • bright_get_reportage_urls
  • bright_get_template_data
  • bright_get_user
  • bright_learning_paths_load_bright_customization_scripts
  • bright_load_custom_wp_admin_style
  • bright_load_scripts
  • bright_log
  • bright_manage_woocommerce_order
  • bright_menu_admin
  • bright_menu_overview
  • bright_menu_settings
  • bright_menu_sync
  • bright_message
  • bright_register_user_to_course
  • bright_render_as_javascript
  • bright_reset_token
  • bright_results_matrix
  • bright_return_as_javascript
  • bright_rewrite_embed_code
  • bright_run_stored_query
  • bright_set_current_course_provider
  • bright_shortcode_func
  • bright_stop
  • bright_stub
  • bright_support
  • bright_template_pack_load_bright_customization_scripts
  • bright_template_pack_load_bright_customization_styles
  • bright_update_all_users
  • bright_update_realmuser_meta
  • bright_update_user_licenses
  • bright_update_user_meta
  • btp_create_header_text
  • dump_bright_js_for_footer
  • setup_bright_menu
  • Overview
  • Class
  1: <?php
  2: // ### Overview
  3: //
  4: 
  5: // Wordpress requires this documentation header for your plugin script, otherwise you won't find your plugin in the wordpress console.
  6:     /*
  7:     Plugin Name: Bright learning paths
  8:     Plugin URI: http://aurabright.aura-software.com/
  9:     Description: Collection of learning path oriented templates for bright.
 10:     Author: Aura Software
 11:     Version: 1.4
 12:     Author URI: http://www.aura-software.com/
 13:     */
 14: 
 15: // Enqueue the custom javascript functions for this plugin.
 16: // Remember to add "array('bright')" as argument 3 to this call, this insures your template JS
 17: // loads in the correct order.
 18: function bright_learning_paths_load_bright_customization_scripts() {
 19:   wp_enqueue_script('bright_learning_paths',
 20:     plugins_url('bright-learning-paths.js', __FILE__),
 21:     array('bright'));
 22: }
 23: // you must add your javascript enqueue statement to the wordpress wp_enqueue_script hook.
 24: add_action('wp_enqueue_scripts', 'bright_learning_paths_load_bright_customization_scripts');
 25: 
 26: // add a function to register as hook to make wordpress load your styles (.css).
 27: //
 28: /* function bright_learning_paths_load_bright_customization_styles() { */
 29: /*   wp_register_style('bright_learning_paths_custom', */
 30: /*     plugins_url('bright-learning-paths/bright-learning-paths.css')); */
 31: /*   // you would add another line as above if you had multiple styles here. */
 32: /*   wp_enqueue_style('bright_learning_paths_custom'); */
 33: /* } */
 34: /* add_action('wp_enqueue_scripts', 'bright_learning_paths_load_bright_customization_styles'); */
 35: 
 36: // You *MUST* have this global call for proper functioning.
 37: global $bright_embedder_templates;
 38: 
 39: // Because of the way WordPress loads plugins, there is no guarantee the bright has already been loaded.
 40: // Thus you must initialize the global here.
 41: if (empty($bright_embedder_templates)) { 
 42:   $bright_embedder_templates = array();
 43: }
 44: 
 45: // From here on in, we are just injecting strings (templates) into the $bright_embedder_templates array.
 46: // Anything you can do in PHP, you can do here to generate these strings.
 47: $bright_embedder_templates['bright-learning-path'] = <<<EOF
 48: <table id="learning-path-{{attributes.path}}" class="tablesorter">
 49:   <thead>
 50:   <tr>
 51:     <th>Course</th>
 52:     <th>Step</th>
 53:     <th>Description</th>
 54:     <th>Completed</th>
 55:     <th>Success</th>
 56:     <th>Score</th>
 57:     <th>Launch</th>
 58:   </tr>
 59:   </thead>
 60:   <tbody>
 61: {{#learning-path containerId courses attributes selector="learning_paths"}}
 62:   <tr>
 63:     <td><a href="/bright-course?bright_course_id={{course_guid}}">{{title}}</a></td>
 64:     <td>{{this_learning_path_step}}</td>
 65:     <td>{{{metadata.description}}}</td>
 66:     <td>{{registration.complete}}</td>
 67:     <td>{{registration.success}}</td>
 68:     <td>{{registration.score}}</td>
 69:     <td>
 70: {{#if registration}} <!-- Always give a Launchbutton IF they are registered! -->
 71:   {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
 72: {{else}}
 73: {{#if_in_learning_path_previous_course_completed this}}
 74: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
 75: {{else}}
 76: You must complete the previous step to unlock this course.
 77: {{/if_in_learning_path_previous_course_completed}}
 78: {{/if}}
 79:     </td>
 80:   </tr>
 81: {{/learning-path}}
 82:   </tbody>
 83: </table>
 84: EOF;
 85: 
 86: $bright_embedder_templates['bright-learning-path-narrow'] = <<<EOF
 87: <table id="learning-path-{{attributes.path}}" class="tablesorter">
 88:   <thead>
 89:   <tr>
 90:     <th>Course</th>
 91:     <th>Launch</th>
 92:   </tr>
 93:   </thead>
 94:   <tbody>
 95: {{#learning-path containerId courses attributes selector="learning_paths"}}
 96:   <tr>
 97:     <td><a href="/bright-course?bright_course_id={{course_guid}}">{{title}}</a></td>
 98:     <td>
 99: {{#if registration}} <!-- Always give a Launchbutton IF they are registered! -->
100:   {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
101: {{else}}
102: {{#if_in_learning_path_previous_course_completed this}}
103: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
104: {{else}}
105: Complete the previous step to unlock.
106: {{/if_in_learning_path_previous_course_completed}}
107: {{/if}}
108:     </td>
109:   </tr>
110: {{/learning-path}}
111:   </tbody>
112: </table>
113: EOF;
114: 
115: ?>
116: 
API documentation generated by ApiGen