Skip to content

Commit

Permalink
fix: vscode links not working with .view.php files
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Dec 3, 2023
1 parent 07b1418 commit 7f68831
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -925,10 +925,13 @@ public function ___getIcons($page, $opt)
'tooltip' => $opt->path,
];

// get base filepath without extension
$ext = pathinfo($opt->path, PATHINFO_EXTENSION);
$base = substr($opt->path, 0, -strlen($ext) - 1);
if (str_ends_with($base, ".view")) $base = substr($base, 0, -5);

// php file edit link
$php = substr($opt->path, 0, strlen($ext) * -1 - 1) . ".php";
$php = "$base.php";
if (is_file($php)) {
$icons[] = (object)[
'icon' => 'php',
Expand All @@ -937,8 +940,9 @@ public function ___getIcons($page, $opt)
'tooltip' => $php,
];
}

// style edit link
$less = substr($opt->path, 0, strlen($ext) * -1 - 1) . ".less";
$less = "$base.less";
if (is_file($less)) {
$icons[] = (object)[
'icon' => 'eye',
Expand Down

0 comments on commit 7f68831

Please sign in to comment.