forked from Dolibarr/dolibarr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into f…
…ix_dev_permissions_error
- Loading branch information
Showing
9 changed files
with
499 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* \file htdocs/debugbar/class/DataCollector/DolHooksCollector.php | ||
* \brief Class for debugbar collection | ||
* \ingroup debugbar | ||
*/ | ||
|
||
use DebugBar\DataCollector\RequestDataCollector; | ||
|
||
|
||
/** | ||
* DolRequestDataCollector class | ||
*/ | ||
class DolHooksCollector extends RequestDataCollector | ||
{ | ||
/** | ||
* Collects the data from the collectors | ||
* | ||
* @return array | ||
*/ | ||
public function collect() | ||
Check warning on line 37 in htdocs/debugbar/class/DataCollector/DolHooksCollector.php GitHub Actions / phan / Run phan
|
||
{ | ||
/** | ||
* @global $hookmanager HookManager | ||
*/ | ||
global $hookmanager; | ||
|
||
$data = ['hooks' => []]; | ||
if (empty($hookmanager->hooksHistory)) { | ||
return $data; | ||
} | ||
$i = 0; | ||
foreach ($hookmanager->hooksHistory as $key => $hookHistory) { | ||
$i++; | ||
$hookHistory['contexts'] = implode(', ', $hookHistory['contexts']); | ||
$data['hooks']["[$i] {$hookHistory['name']}"] = $hookHistory; | ||
|
||
// $data["[$key] {$hookHistory['name']}"] = "{$hookHistory['file']} (L{$hookHistory['line']}). Contexts: " | ||
// . implode(', ', $hookHistory['contexts']); | ||
} | ||
$data['nb_of_hooks'] = count($data['hooks']); | ||
|
||
return $data; | ||
} | ||
|
||
/** | ||
* Return widget settings | ||
* | ||
* @return string[][] | ||
*/ | ||
public function getWidgets() | ||
{ | ||
global $langs; | ||
|
||
$langs->load("other"); | ||
|
||
return [ | ||
$langs->transnoentities('Hooks') => [ | ||
"icon" => "tags", | ||
"widget" => "PhpDebugBar.Widgets.HookListWidget", | ||
"map" => "hooks.hooks", | ||
"default" => "{}" | ||
], | ||
"{$langs->transnoentities('Hooks')}:badge" => [ | ||
"map" => "hooks.nb_of_hooks", | ||
Check warning on line 81 in htdocs/debugbar/class/DataCollector/DolHooksCollector.php GitHub Actions / phan / Run phan
|
||
"default" => 0 | ||
] | ||
]; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return 'hooks'; | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
htdocs/debugbar/class/DataCollector/DolMessagesCollector.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
span.phpdebugbar-widgets-value { | ||
white-space: pre; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist.phpdebugbar-widgets-hooklist dt { | ||
float: left; | ||
width: 230px; | ||
padding: 5px; | ||
border-top: 1px solid #eee; | ||
font-weight: bold; | ||
clear: both; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
dl.phpdebugbar-widgets-kvlist.phpdebugbar-widgets-hooklist dt span { | ||
font-weight: bold; | ||
} | ||
dl.phpdebugbar-widgets-kvlist dd { | ||
margin-left: 240px; | ||
padding: 5px; | ||
border-top: 1px solid #eee; | ||
cursor: pointer; | ||
min-height: 17px; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist dd span { | ||
display: inline-block; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist dd span strong{ | ||
font-weight: bold; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist dd span:nth-of-type(1) { | ||
min-width: 550px; | ||
margin-right: 20px; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist dd span:nth-of-type(2) { | ||
min-width: 90px; | ||
margin-right: 20px; | ||
} | ||
|
||
dl.phpdebugbar-widgets-kvlist dd span:nth-of-type(3) { | ||
min-width: 80px; | ||
margin-right: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.