Skip to content

Commit

Permalink
fix a warning is using action_map wild cards; regression fix expRecor…
Browse files Browse the repository at this point in the history
…d commented code
  • Loading branch information
dleffler committed Feb 16, 2018
1 parent ffe883b commit baedc73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
18 changes: 9 additions & 9 deletions framework/core/models/expRecord.php
Expand Up @@ -168,19 +168,19 @@ function __construct($params = null, $get_assoc = true, $get_attached = true) {
// public function __isset($property) {
// return isset($this->$property);
// }
//

// public function __unset($property) {
// unset($this->$property);
// }

// /**
// * name of module for backwards compat with old modules
// *
// * @return string
// */
// public function name() {
// return static::displayname();
// }
/**
* name of module for backwards compat with old modules
*
* @return string
*/
public function name() {
return static::displayname();
}

/**
* find an item or items
Expand Down
11 changes: 6 additions & 5 deletions framework/core/subsystems/expTheme.php
Expand Up @@ -673,14 +673,15 @@ public static function getTheme()
}

// if we are in an action and have action maps to work with...
if (self::inAction()
&& ((!empty($action_maps[$module]) || !empty($action_maps['*']))
if (self::inAction() && ((!empty($action_maps[$module]) || !empty($action_maps['*']))
&& ((isset($action_maps[$module]) && array_key_exists($_REQUEST['action'], $action_maps[$module]))
|| (isset($action_maps[$module]) && array_key_exists('*', $action_maps[$module])) // wildcard action
|| (isset($action_maps['*']) && array_key_exists($_REQUEST['action'], $action_maps['*'])) // wildcard module
)
)
) {
if (!isset($action_maps[$module]))
$module = '*';
$actionname = array_key_exists($_REQUEST['action'], $action_maps[$module]) ? $_REQUEST['action'] : '*';
if (!empty($action_maps[$module][$actionname]))
$actiontheme = explode(":", $action_maps[$module][$actionname]);
Expand All @@ -690,10 +691,10 @@ public static function getTheme()
if (!empty($actiontheme[1])) {
$sectionObj = @$router->getSectionObj($actiontheme[1]);
} elseif (empty($actiontheme[0]) && !empty($action_maps['*'][$_REQUEST['action']])) {
$actiontheme[0] = $action_maps['*'][$_REQUEST['action']];
$actiontheme[0] = $action_maps['*'][$_REQUEST['action']]; //note I don't think we ever get here since we now set $module above
}

if ($actiontheme[0] == "default" || $actiontheme[0] == "Default" || $actiontheme[0] == "index") {
if ($actiontheme[0] === "default" || $actiontheme[0] === "Default" || $actiontheme[0] === "index") {
if (MOBILE && is_readable(BASE . 'themes/' . DISPLAY_THEME . '/mobile/index.php')) {
$theme = BASE . 'themes/' . DISPLAY_THEME . '/mobile/index.php';
} else {
Expand Down Expand Up @@ -822,7 +823,7 @@ public static function inPreview()
* @param null $action
* @return bool
*/
public static function inAction($action=null)
public static function inAction($action = null)
{
return (isset($_REQUEST['action']) && (isset($_REQUEST['module']) || isset($_REQUEST['controller'])) && (!isset($action) || ($action == $_REQUEST['action'])));
}
Expand Down

0 comments on commit baedc73

Please sign in to comment.