You are here

function _opigno_lms_hide_coach_checkbox in Opigno LMS 7

Hides the coach role checkbox by adding some inline CSS. This is only to simplify the administration interface.

Parameters

object $node:

3 calls to _opigno_lms_hide_coach_checkbox()
opigno_lms_form_og_massadd_massadd_form_alter in ./opigno_lms.profile
Implements hook_form_FORM_ID_alter() for og_massadd_massadd_form().
opigno_lms_form_og_ui_add_users_alter in ./opigno_lms.profile
Implements hook_form_FORM_ID_alter() for og_ui_add_users().
opigno_lms_form_og_ui_edit_membership_alter in ./opigno_lms.profile
Implements hook_form_FORM_ID_alter() for og_ui_edit_membership().

File

./opigno_lms.profile, line 428
Enables modules and site configuration for a standard site installation. Provides a default API for Apps and modules to use. This will simplify the user experience.

Code

function _opigno_lms_hide_coach_checkbox($node) {
  if (module_exists('opigno_simple_ui') && !empty($node->nid) && $node->type === OPIGNO_COURSE_BUNDLE) {
    $rid = opigno_lms_get_role_id(OPIGNO_LMS_COURSE_COACH_ROLE);
    if (!empty($rid)) {
      drupal_add_css(".form-type-checkbox.form-item-roles-{$rid} { display: none; }", array(
        'type' => 'inline',
      ));
    }
  }
}