extract stub.phtml
authorMichael Wallner <root@s201809.m6w6.name>
Tue, 12 Mar 2019 17:21:44 +0000 (18:21 +0100)
committerMichael Wallner <root@s201809.m6w6.name>
Tue, 12 Mar 2019 17:21:44 +0000 (18:21 +0100)
views/index.phtml
views/mdref.phtml
views/stub.phtml [new file with mode: 0644]

index aa9b1ffb3a42f1386270737e45ea2af3f2b21c44..db2accd3867eaf8ee18a9cac969e06e34bb1c55e 100644 (file)
                        ><?= $esc($entry->getTitle()) ?></a></h2>
                <div><?= $quick($entry->getIntro()) ?></div>
                        <?php if ($repo->hasStub($stub)) : ?>
-                               <div>
-                                       <p><strong>Download the Stub file:</strong></p>
-                                       <ul style="list-style-type: '&raquo;'">
-                                               <li>
-                                                       <a href="stub?ref=<?= $entry->getName() ?>"><?= $entry->getName() ?>.stub.php</a><br>
-                                                       <small>
-                                                               Last modified:
-                                                               <?= date_create("@".filemtime($stub))->setTimezone(new DateTimezone("UTC"))->format("Y-m-d H:i:s T") ?>
-                                                       </small>
-                                               </li>
-                                       </ul>
-                               </div>
+                               <?php include __DIR__ . "/stub.phtml"; ?>
                        <?php endif; ?>
                <?php endforeach; ?>
        <?php endforeach; ?>
index e9909b514d94ad3d76ea714606f39d6346030f4b..c05ad78d815cb668d7f6255585b72aa6e36ad846 100644 (file)
@@ -1,6 +1,12 @@
 
 <?= $file($entry->getPath()) ?>
 
+<?php if ($entry->isRoot() && $entry->getRepo()->hasStub($stub)) : ?>
+       <h2 id="Editor.Stub:">Editor Stub:</h2>
+       <p>This extension provides a stub file four your editor's auto-completion.</p>
+       <?php include __DIR__ . "/stub.phtml"; ?>
+<?php endif; ?>
+
 <?php if ($entry->hasFunctions()) : ?>
 
 <h2 id="Functions:">Functions:</h2>
diff --git a/views/stub.phtml b/views/stub.phtml
new file mode 100644 (file)
index 0000000..05679ab
--- /dev/null
@@ -0,0 +1,13 @@
+                               <div>
+                                       <p><strong>Download the Stub file:</strong></p>
+                                       <ul style="list-style-type: '&raquo;'">
+                                               <li>
+                                                       <a href="stub?ref=<?= $entry->getName() ?>"><?= $entry->getName() ?>.stub.php</a><br>
+                                                       <small>
+                                                               Last modified:
+                                                               <?= date_create("@".filemtime($stub))->setTimezone(new DateTimezone("UTC"))->format("Y-m-d H:i:s T") ?>
+                                                       </small>
+                                               </li>
+                                       </ul>
+                               </div>
+