Skip to content

Commit

Permalink
Show unpublished, hidden, and trashed status along with path (via too…
Browse files Browse the repository at this point in the history
…ltip) for Goto Page ID feature.
  • Loading branch information
adrianbj committed Oct 25, 2024
1 parent 4e42406 commit 5c48591
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TracyDebugger.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function getModuleInfo() {
'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/',
'version' => '4.26.40',
'version' => '4.26.41',
'autoload' => 100000, // 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
6 changes: 5 additions & 1 deletion includes/GetPageById.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$pageInfo['url'] = $p->url;
$pageInfo['template_id'] = $p->template->id;
$pageInfo['template_name'] = $p->template->name;
$pageInfo['path'] = $p->path;
$pageInfo['unpublished'] = $p->isUnpublished();
$pageInfo['hidden'] = $p->isHidden();
$pageInfo['trash'] = $p->isTrash();
}
echo json_encode($pageInfo);
exit;
Expand All @@ -21,4 +25,4 @@ function truncateText($rawText, $maxlength) {
$text = substr($text, 0, strrpos($text, ' '));
}
return trim($text) . (strlen($rawText) > $maxlength ? '…' : '');
}
}
3 changes: 2 additions & 1 deletion panels/ProcesswireInfoPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ function tracyClearGoToPageID(matchStatus) {
if(xmlhttp.readyState == XMLHttpRequest.DONE) {
if(xmlhttp.status == 200 && xmlhttp.responseText !== "[]") {
var pageDetails = JSON.parse(xmlhttp.responseText);
document.getElementById("pageDetails").innerHTML = "<span style='font-weight:bold'>" + pageDetails.title + "</span>&nbsp;&nbsp;<a href='{$this->wire('config')->urls->admin}setup/template/edit?id=" + pageDetails.template_id + "' style='color:#888'>" + pageDetails.template_name + "</a>";
console.log(pageDetails.trash);
document.getElementById("pageDetails").innerHTML = "<span uk-tooltip title='" + pageDetails.path + "' style='" + (pageDetails.unpublished ? 'text-decoration: line-through' : '') + (pageDetails.hidden ? '; opacity: 0.5' : '') + "'>" + (pageDetails.trash ? '🗑︎ ' : '') + pageDetails.title + "</span>&nbsp;(<a href='{$this->wire('config')->urls->admin}setup/template/edit?id=" + pageDetails.template_id + "' style='color:#888'>" + pageDetails.template_name + "</a>)";
document.getElementById("idGoToEdit").href = "{$this->wire('config')->urls->admin}page/edit/?id=" + pageDetails.id;
document.getElementById("idGoToView").href = pageDetails.url;
document.getElementById("idGoToOpen").href = "{$this->wire('config')->urls->admin}page/?open=" + pageDetails.id;
Expand Down

0 comments on commit 5c48591

Please sign in to comment.