* refactor

* Add event AFTER_DISPLAY_PAGE
This commit is contained in:
Eric Espie
2021-12-31 11:06:03 +01:00
parent fba78e7d9b
commit 374b71c017
21 changed files with 144 additions and 94 deletions

View File

@@ -15,6 +15,8 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
use Combodo\iTop\Service\EventName;
use Combodo\iTop\Service\EventService;
/**
* CLI page
@@ -37,6 +39,7 @@ class CLIPage implements Page
public function output()
{
$this->FireAfterDisplayEvent();
if (class_exists('DBSearch')) {
DBSearch::RecordQueryTrace();
}
@@ -45,6 +48,13 @@ class CLIPage implements Page
}
}
protected function FireAfterDisplayEvent()
{
$aData['debug_info'] = 'from: '.get_class($this).":[$this->s_title]";
$aData['object'] = $this;
EventService::FireEvent(EventName::AFTER_DISPLAY_PAGE, get_class($this), $aData);
}
public function add($sText)
{
echo $sText;