Skip to content

Commit

Permalink
Fix broken links to Ryan's APIExplorer module from Tracy's APIExplore…
Browse files Browse the repository at this point in the history
…r panel.
  • Loading branch information
adrianbj committed Nov 21, 2018
1 parent d88d245 commit 60a6b71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion TracyDebugger.module
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
'version' => '4.14.13',
'version' => '4.14.14',
'autoload' => 9999, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first
'singular' => true,
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
Expand Down
13 changes: 13 additions & 0 deletions includes/PwApiData.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ class TracyPwApiData extends WireData {

private $n = 0;

public function __construct() {
if($this->wire('modules')->isInstalled('ProcessWireAPI')) {
$apiModuleInstalled = true;
$apiModuleId = $this->wire('modules')->getModuleID("ProcessWireAPI");
$this->apiBaseUrl = $this->wire('pages')->get("process=$apiModuleId")->url.'methods/';
}
else {
$apiModuleInstalled = false;
$this->apiBaseUrl = 'https://processwire.com/api/ref/';
}
$this->newTab = \TracyDebugger::getDataValue('linksNewTab') ? 'target="_blank"' : '';
}

public function getVariables() {
$apiVars = array();
$apiVariables = array();
Expand Down
12 changes: 0 additions & 12 deletions panels/ProcesswireInfoPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@
class ProcesswireInfoPanel extends BasePanel {

protected $icon;
protected $apiBaseUrl;
protected $newTab;

public function __construct() {
if($this->wire('modules')->isInstalled('ProcessWireAPI')) {
$apiModuleId = $this->wire('modules')->getModuleID("ProcessWireAPI");
$this->apiBaseUrl = $this->wire('pages')->get("process=$apiModuleId")->url.'methods/';
}
else {
$this->apiBaseUrl = 'https://processwire.com/api/ref/';
}
$this->newTab = \TracyDebugger::getDataValue('pWInfoPanelLinksNewTab') ? 'target="_blank"' : '';
}

public function getTab() {
if(\TracyDebugger::isAdditionalBar()) return;
\Tracy\Debugger::timer('processwireInfo');
Expand Down

0 comments on commit 60a6b71

Please sign in to comment.