Example #1
0
/**
 * Implements template_preprocess_page.
 */
function foundation_access_preprocess_page(&$variables)
{
    // make sure we have lmsless enabled so we don't WSOD
    $variables['cis_lmsless'] = array('active' => array('title' => ''));
    if (module_exists('cis_lmsless')) {
        $variables['cis_lmsless'] = _cis_lmsless_theme_vars();
    }
    if (_cis_connector_role_grouping('staff') || _cis_connector_role_grouping('teacher')) {
        $variables['tabs_extras'][100][] = '<hr>';
        $variables['tabs_extras'][100][] = '<a href="#" data-reveal-id="block-menu-menu-course-tools-menu-nav-modal">' . t('Course Settings') . '</a>';
    }
    // wrap non-node content in an article tag
    if (isset($variables['page']['content']['system_main']['main'])) {
        $variables['page']['content']['system_main']['main']['#markup'] = '<article class="large-12 columns view-mode-full">' . $variables['page']['content']['system_main']['main']['#markup'] . '</article>';
    }
}
Example #2
0
/**
 * Implements template_preprocess_page.
 */
function foundation_access_preprocess_page(&$variables)
{
    // make sure we have lmsless enabled so we don't WSOD
    $variables['cis_lmsless'] = array('active' => array('title' => ''));
    // support for lmsless since we don't require it
    if (module_exists('cis_lmsless')) {
        $variables['cis_lmsless'] = _cis_lmsless_theme_vars();
    }
    // support for cis_shortcodes
    if (module_exists('cis_shortcodes')) {
        $block = cis_shortcodes_block_view('cis_shortcodes_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] = $block['content'];
        }
    } else {
        $variables['cis_shortcodes'] = '';
    }
    // support for entity_iframe
    if (module_exists('entity_iframe')) {
        $block = entity_iframe_block_view('entity_iframe_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] .= $block['content'];
        }
    }
    // wrap non-node content in an article tag
    if (isset($variables['page']['content']['system_main']['main'])) {
        $variables['page']['content']['system_main']['main']['#markup'] = '<article class="large-12 columns view-mode-full">' . $variables['page']['content']['system_main']['main']['#markup'] . '</article>';
    }
}
Example #3
0
/**
 * Implements template_preprocess_page.
 */
function foundation_access_preprocess_page(&$variables)
{
    $variables['contentwrappers'] = _elmsln_core_path_is_wrapped(current_path());
    $menu_item = menu_get_item();
    // allow modules to supply accessibility enhancements to the menu
    $a11y = module_invoke_all('fa_a11y');
    drupal_alter('fa_a11y', $a11y);
    // add in the form api wrapper meta properties to render as materialize collapse
    $a11y['#type'] = 'fieldset';
    $a11y['#materialize'] = array('type' => 'collapsible_wrapper');
    $a11y['#attributes'] = array('class' => array('collapsible'), 'data-collapsible' => 'accordion');
    $variables['a11y'] = drupal_render($a11y);
    // sniff out if this is a view
    if ($menu_item['page_callback'] == 'views_page') {
        // try and auto append exposed filters to our local_subheader region
        $bid = '-exp-' . $menu_item['page_arguments'][0] . '-' . (is_array($menu_item['page_arguments'][1]) ? $menu_item['page_arguments'][1][0] : $menu_item['page_arguments'][1]);
        $block = module_invoke('views', 'block_view', $bid);
        $variables['page']['local_subheader'][$bid] = $block['content'];
    }
    $variables['distro'] = elmsln_core_get_profile_key();
    // make sure we have lmsless enabled so we don't WSOD
    $variables['cis_lmsless'] = array('active' => array('title' => ''));
    // support for lmsless since we don't require it
    if (module_exists('cis_lmsless')) {
        $variables['cis_lmsless'] = _cis_lmsless_theme_vars();
    }
    // support for cis_shortcodes
    if (module_exists('cis_shortcodes')) {
        $block = cis_shortcodes_block_view('cis_shortcodes_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] = $block['content'];
        } else {
            $variables['cis_shortcodes'] = '';
        }
    } else {
        $variables['cis_shortcodes'] = '';
    }
    // support for entity_iframe
    if (module_exists('entity_iframe')) {
        $block = entity_iframe_block_view('entity_iframe_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] .= $block['content'];
        }
    }
    // wrap non-node content in an article tag
    if (isset($variables['page']['content']['system_main']['main'])) {
        $variables['page']['content']['system_main']['main']['#markup'] = '<article class="l12 col view-mode-full">' . $variables['page']['content']['system_main']['main']['#markup'] . '</article>';
    }
    /**
     * @todo Get rid of this logic and put it somewhere else
     *       based on the new design.
     */
    // add a sharing url to view the specific section
    if (module_exists('cis_connector')) {
        $url_options = array('absolute' => TRUE);
        // check for setting section context
        $current_section = _cis_connector_section_context();
        if (isset($current_section) && $current_section) {
            $url_options['query']['elmsln_active_section'] = $current_section;
        }
        // check for setting course context
        $current_course = _cis_connector_course_context();
        if (isset($current_course) && $current_course) {
            $url_options['query']['elmsln_active_course'] = $current_course;
        }
        $current_page = url(current_path(), $url_options);
        // establish the fieldset container for shortcodes
        $field['cis_section_share'] = array('#type' => 'fieldset', '#collapsed' => FALSE, '#collapsible' => TRUE, '#title' => t('Share this page'));
        $field['cis_section_share']['cis_section_share_link'] = array('#title' => t('Page URL'), '#value' => $current_page, '#type' => 'textfield', '#weight' => 0);
        $variables['cis_section_share'] = $field;
    }
    // attempt to find an edit path for the current page
    if (isset($variables['tabs']) && is_array($variables['tabs']['#primary'])) {
        $edit_path = arg(0) . '/' . arg(1) . '/edit';
        foreach ($variables['tabs']['#primary'] as $key => $tab) {
            if (isset($tab['#link']['href']) && $tab['#link']['href'] == $edit_path) {
                $variables['edit_path'] = base_path() . $edit_path;
                // hide the edit tab cause our on canvas pencil does this
                unset($variables['tabs']['#primary'][$key]);
            }
        }
    }
}
Example #4
0
/**
 * Implements template_preprocess_page.
 */
function foundation_access_preprocess_page(&$variables)
{
    $menu_item = menu_get_item();
    // sniff out if this is a view
    if ($menu_item['page_callback'] == 'views_page') {
        // try and auto append exposed filters to our local_subheader region
        $bid = '-exp-' . $menu_item['page_arguments'][0] . '-' . (is_array($menu_item['page_arguments'][1]) ? $menu_item['page_arguments'][1][0] : $menu_item['page_arguments'][1]);
        $block = module_invoke('views', 'block_view', $bid);
        $variables['page']['local_subheader'][$bid] = $block['content'];
    }
    $variables['distro'] = variable_get('install_profile', 'standard');
    // load registry for this distro
    $settings = _cis_connector_build_registry($variables['distro']);
    $home_text = isset($settings['default_title']) ? $settings['default_title'] : $variables['distro'];
    $variables['home'] = l('<div class="' . $variables['distro'] . '-home elmsln-home-icon icon-' . $variables['distro'] . '-black etb-modal-icons"></div><span>' . $home_text . '</span>', '<front>', array('html' => TRUE, 'attributes' => array('class' => array($variables['distro'] . '-home-button', 'elmsln-home-button-link'))));
    // ensure header has something in it in the first place
    if (isset($variables['page']['header'])) {
        $keys = array_keys($variables['page']['header']);
        $keyname = array_shift($keys);
        $variables['page']['header'][$keyname]['#prefix'] = $variables['home'];
    }
    // make sure we have lmsless enabled so we don't WSOD
    $variables['cis_lmsless'] = array('active' => array('title' => ''));
    // support for lmsless since we don't require it
    if (module_exists('cis_lmsless')) {
        $variables['cis_lmsless'] = _cis_lmsless_theme_vars();
    }
    // support for cis_shortcodes
    if (module_exists('cis_shortcodes')) {
        $block = cis_shortcodes_block_view('cis_shortcodes_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] = $block['content'];
        }
    } else {
        $variables['cis_shortcodes'] = '';
    }
    // support for entity_iframe
    if (module_exists('entity_iframe')) {
        $block = entity_iframe_block_view('entity_iframe_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] .= $block['content'];
        }
    }
    // wrap non-node content in an article tag
    if (isset($variables['page']['content']['system_main']['main'])) {
        $variables['page']['content']['system_main']['main']['#markup'] = '<article class="large-12 columns view-mode-full">' . $variables['page']['content']['system_main']['main']['#markup'] . '</article>';
    }
    /**
     * @todo Get rid of this logic and put it somewhere else
     *       based on the new design.
     */
    // add a sharing url to view the specific section
    if (module_exists('cis_connector')) {
        $url_options = array('absolute' => TRUE);
        $current_section = _cis_connector_section_context();
        if (isset($current_section) && $current_section) {
            $url_options['query']['elmsln_active_course'] = $current_section;
        }
        $current_page = url(current_path(), $url_options);
        // establish the fieldset container for shortcodes
        $field['cis_section_share'] = array('#type' => 'fieldset', '#collapsed' => FALSE, '#collapsible' => TRUE, '#title' => t('Share this page'));
        $field['cis_section_share']['cis_section_share_link'] = array('#title' => t('Page URL'), '#value' => $current_page, '#type' => 'textfield', '#weight' => 0);
        $variables['cis_section_share'] = $field;
    }
    // attempt to find an edit path for the current page
    if (isset($variables['tabs']) && is_array($variables['tabs']['#primary'])) {
        foreach ($variables['tabs']['#primary'] as $key => $tab) {
            $edit_path = arg(0) . '/' . arg(1) . '/edit';
            if (isset($tab['#link']['href']) && $tab['#link']['href'] == $edit_path) {
                $variables['edit_path'] = base_path() . $edit_path;
                // hide the edit tab cause our on canvas pencil does this
                unset($variables['tabs']['#primary'][$key]);
            }
        }
    }
}
Example #5
0
/**
 * Implements template_preprocess_page.
 */
function foundation_access_preprocess_page(&$variables)
{
    // make sure we have lmsless enabled so we don't WSOD
    $variables['cis_lmsless'] = array('active' => array('title' => ''));
    // support for lmsless since we don't require it
    if (module_exists('cis_lmsless')) {
        $variables['cis_lmsless'] = _cis_lmsless_theme_vars();
    }
    // support for cis_shortcodes
    if (module_exists('cis_shortcodes')) {
        $block = cis_shortcodes_block_view('cis_shortcodes_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] = $block['content'];
        }
    } else {
        $variables['cis_shortcodes'] = '';
    }
    // support for entity_iframe
    if (module_exists('entity_iframe')) {
        $block = entity_iframe_block_view('entity_iframe_block');
        if (!empty($block['content'])) {
            $variables['cis_shortcodes'] .= $block['content'];
        }
    }
    // wrap non-node content in an article tag
    if (isset($variables['page']['content']['system_main']['main'])) {
        $variables['page']['content']['system_main']['main']['#markup'] = '<article class="large-12 columns view-mode-full">' . $variables['page']['content']['system_main']['main']['#markup'] . '</article>';
    }
    /**
     * @todo Get rid of this logic and put it somewhere else
     *       based on the new design.
     */
    // add a sharing url to view the specific section
    if (module_exists('cis_connector')) {
        $url_options = array('absolute' => TRUE);
        $current_section = _cis_connector_section_context();
        if (isset($current_section) && $current_section) {
            $url_options['query']['elmsln_active_course'] = $current_section;
        }
        $current_page = url(current_path(), $url_options);
        // establish the fieldset container for shortcodes
        $field['cis_section_share'] = array('#type' => 'fieldset', '#collapsed' => FALSE, '#collapsible' => TRUE, '#title' => t('Share this page'));
        $field['cis_section_share']['cis_section_share_link'] = array('#title' => t('Page URL'), '#value' => $current_page, '#type' => 'textfield', '#weight' => 0);
        $variables['cis_section_share'] = $field;
    }
}