function _janrain_capture_get_screen_file in Janrain Registration 7.2
Same name and namespace in other branches
- 7.4 janrain_capture_screens/janrain_capture_screens.module \_janrain_capture_get_screen_file()
- 7.3 janrain_capture_screens/janrain_capture_screens.module \_janrain_capture_get_screen_file()
Gets the appropriate Janrain screen file.
Parameters
string $screen_name: Janrain screen name. @see _janrain_capture_get_screens()
Return value
string|bool Janrain screen uri if file found, FALSE if not.
3 calls to _janrain_capture_get_screen_file()
- janrain_capture_widget_js in includes/
janrain_capture.widget.inc - Returns Capture widget js.
- _janrain_capture_get_screen in ./
janrain_capture.module - _janrain_capture_widget_get_screen in includes/
janrain_capture.widget.inc - Get the contents of a JTL or events file
File
- janrain_capture_screens/
janrain_capture_screens.module, line 34 - Janrain Capture Admin Screens Module
Code
function _janrain_capture_get_screen_file($screen_name) {
// Serve updated screen if availible.
$screen_machine_name = _janrain_capture_get_screen_machine_name($screen_name);
$updated_screen = variable_get("janrain_capture_screen_{$screen_machine_name}");
$updated_screen_remote_url = trim(variable_get("janrain_capture_screen_{$screen_machine_name}_remote_url", ''));
$updated_screen_remote_fid = variable_get('janrain_capture_screen_' . $screen_machine_name . '_remote_fid');
$screen_fid = $updated_screen_remote_url && $updated_screen_remote_fid ? $updated_screen_remote_fid : $updated_screen;
if ($screen_fid) {
if ($file = file_load($screen_fid)) {
return $file->uri;
}
}
// Serve default shipped screen if not.
$module_path = drupal_get_path('module', 'janrain_capture');
$file_path = "{$module_path}/janrain-capture-screens/{$screen_name}";
return file_exists($file_path) ? $file_path : FALSE;
}