Skip to content

Commit

Permalink
[-] Classes : #PSTEST-275 #PSFV-304 - Method Module::getPosition() wa…
Browse files Browse the repository at this point in the history
…s missing

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13279 b9a71923-0436-4b27-9f14-aed3839534dd
  • Loading branch information
mDeflotte committed Feb 14, 2012
1 parent 89286d1 commit 7d64fa4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions classes/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1633,5 +1633,29 @@ public function getPathUri()
{
return $this->_path;
}

/*
* Return module position for a given hook
*
* @param boolean $id_hook Hook ID
* @return integer position
*/
public function getPosition($id_hook)
{
if (isset(Hook::$preloadModulesFromHooks))
if (isset(Hook::$preloadModulesFromHooks[$id_hook]))
if (isset(Hook::$preloadModulesFromHooks[$id_hook]['module_position'][$this->id]))
return Hook::$preloadModulesFromHooks[$id_hook]['module_position'][$this->id];
else
return 0;
$result = Db::getInstance()->getRow('
SELECT `position`
FROM `'._DB_PREFIX_.'hook_module`
WHERE `id_hook` = '.(int)($id_hook).'
AND `id_module` = '.(int)($this->id).'
AND `id_shop` = '.(int)Context::getContext()->shop->getId(true));

return $result['position'];
}
}

0 comments on commit 7d64fa4

Please sign in to comment.