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

Feature/635 #764

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/custom/cu_js_includes/cu_js_includes.install
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@ function cu_js_includes_install() {
'admithub' => 'admithub',
'livechat' => 'livechat',
'slateform' => 'slateform',
'statuspage' => 'statuspage'
'statuspage' => 'statuspage',
'burning_glass' => 'burning_glass'
);
variable_set('cu_js_includes_enabled', $types);
// Menu items are already added so we need to rebuild if types are changed.
menu_rebuild();
}

/**
* Implements hook_uninstall().
*/
function cu_js_includes_uninstall() {
variable_del('cu_js_includes_enabled');
}
2 changes: 1 addition & 1 deletion modules/custom/cu_js_includes/cu_js_includes.module
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function cu_js_includes_block_options() {
// Get enabled includes.
$enabled_includes = variable_get('cu_js_includes_enabled', array());
// Includes types that are options.
$types = array('statuspage', 'slateform');
$types = array('statuspage', 'slateform', 'burning_glass');
// Types of filters that are options that are also enabled.
$filter = array_intersect($types, $enabled_includes);
if (!empty($filter)) {
Expand Down
30 changes: 30 additions & 0 deletions modules/custom/cu_js_includes/includes/cu_js_includes.forms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,33 @@ function cu_js_includes_slateform_form(&$form, &$form_state, $id = NULL, $data =
'#size' => 128,
);
}

/**
* Form values for burning glass form embed.
*
* @param array $form
* Form containing default embed template form options.
* @param array $form_state
* State of the default embed template form.
* @param int|null $id
* ID of the current embed being edited if that embed exists.
* @param array $data
* Data of the current embed if it is being edited.
*/
function cu_js_includes_burning_glass_form(&$form, &$form_state, $id = NULL, $data = array()) {
$form['options']['access_code'] = array(
'#title' => t('Access Code'),
'#type' => 'textfield',
'#default_value' => !empty($data['access_code']) ? $data['access_code'] : '',
'#required' => TRUE,
'#size' => 128,
);

$form['options']['program_code'] = array(
'#title' => t('Program Code'),
'#type' => 'textfield',
'#default_value' => !empty($data['program_code']) ? $data['program_code'] : '',
'#required' => TRUE,
'#size' => 128,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ function cu_js_includes_secure_permissions($role) {
'view livechat js includes',
'view statuspage js includes',
'view slateform js includes',
'view burning_glass js includes',
'view any js_include bean',
),
'authenticated user' => array(
'view admithub js includes',
'view livechat js includes',
'view statuspage js includes',
'view slateform js includes',
'view burning_glass js includes',
'view any js_include bean',
),
'developer' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function cu_js_includes_get_include_types() {
'template' => 'templates/slateform',
);

$custom_types['burning_glass'] = array(
'label' => 'Burning Glass',
'form_callback' => 'cu_js_includes_burning_glass_form',
'renderer' => 'block',
'path' => $module_path,
'template' => 'templates/burning_glass'
);

return $custom_types;
}

Expand All @@ -57,5 +65,6 @@ function cu_js_includes_express_node_list_groups($bundles) {
$bundles['inlcudes']['types'][] = 'Add LiveChat Include';
$bundles['inlcudes']['types'][] = 'Add Slate Form Include';
$bundles['inlcudes']['types'][] = 'Add StatusPage Include';
$bundles['inlcudes']['types'][] = 'Add Burning Glass Include';
return $bundles;
}
19 changes: 19 additions & 0 deletions modules/custom/cu_js_includes/templates/burning_glass.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @file
* Template for Burning Glass include.
*/
?>
<div id="ci"></div>
<script src="https://careerinsight.burning-glass.com/enroll/scripts/cienroll.js"></script>
<script>
document.body.onload = function() {
var props = {
accessCode: '<?php print check_plain($access_code); ?>',
programCode: '<?php print check_plain($program_code) ?>',
elementId: 'ci'
}
openCI(props);
}
</script>