Skip to content

Commit

Permalink
Improve if else if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
signalpoint committed Aug 24, 2022
1 parent 6d96cd4 commit 1fd96bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/includes/theme.inc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ dg.themeLoad = function() {
* @return {String}
*/
dg.theme = function(hook, variables) {

//try {

// @TODO add an `_access_callback` and `_access_arguments` properties, see Drupal's way before implementing

// If there is HTML markup present, just return it as is. Otherwise, run
// the theme hook and send along the variables.
// If variables weren't included, set them as an empty object, otherwise if there is HTML markup present
// return it immediately.
if (!variables) { variables = {}; }
if (variables._markup) { return variables._markup; }
else if (variables._markup) { return variables._markup; }

var content = '';

// Make sure there is a theme_*() function within the dg namespace for this hook.
Expand All @@ -97,6 +99,8 @@ dg.theme = function(hook, variables) {
return content;
}

// The theme hook exists...

dg.setRenderElementDefaults(variables);

// Utilizing the theme registry, determine if any module is implementing this theme hook.
Expand Down

0 comments on commit 1fd96bb

Please sign in to comment.