Ticket #941: functions.inc.php.patch

File functions.inc.php.patch, 1.6 kB (added by webrainstorm, 6 years ago)

Patch to functions.inc.php

  • functions.inc.php

    old new  
    942942  var $hookHtml = ''; 
    943943  var $arrHooks = array(); 
    944944   
    945   function install_hooks($viewing_itemid,$target_module,$target_menuid = '') { 
     945  function install_hooks($target_module) { 
    946946    global $active_modules; 
    947947        // loop through all active modules 
    948948        foreach($active_modules as $this_module) { 
     
    950950      // ie: findme_hook_extensions() 
    951951      $funct = $this_module['rawname'] . '_hook_' . $target_module; 
    952952      if( function_exists( $funct ) ) { 
    953         // execute the function, appending the  
    954         // html output to that of other hooking modules 
    955         if ($hookReturn = $funct($viewing_itemid,$target_menuid)) 
    956           $this->hookHtml .= $hookReturn; 
    957953        // remember who installed hooks 
    958954        // we need to know this for processing form vars 
    959955        $this->arrHooks[] = $this_module['rawname']; 
    960956      } 
    961957        } 
    962958  } 
    963    
     959 
     960  // get html to be displayed in hooked module 
     961  function visualization_hooks($viewing_itemid, $target_module, $target_menuid = '') { 
     962    if(is_array($this->arrHooks)) { 
     963      foreach($this->arrHooks as $hookingMod) { 
     964        $funct = $hookingMod . '_hook_' . $target_module; 
     965        // execute the function, appending the  
     966        // html output to that of other hooking modules 
     967        if ($hookReturn = $funct($viewing_itemid,$target_menuid)) 
     968          $this->hookHtml .= $hookReturn;  
     969         
     970      } 
     971    } 
     972  } 
     973 
    964974  // process the request from the module we hooked 
    965975  function process_hooks($viewing_itemid, $target_module, $target_menuid, $request) { 
    966976    if(is_array($this->arrHooks)) {