views: fix base url to omit scheme for when we connect through a https gateway
authorMichael Wallner <mike@php.net>
Fri, 16 Dec 2016 09:10:53 +0000 (10:10 +0100)
committerMichael Wallner <mike@php.net>
Fri, 20 Dec 2019 12:21:59 +0000 (13:21 +0100)
app/views/alert.phtml
app/views/github/index.phtml
app/views/github/repo.phtml
app/views/layout.phtml
app/views/modal/hook.phtml
app/views/navbar.phtml
app/views/pages/index.phtml
app/views/pages/wiki.phtml

index 8a5a45acf5e888537ffdb717b1faadff63c19e91..c8c527f6eb8f5687aa14d7dbd5da379722bfd243 100644 (file)
@@ -3,10 +3,10 @@
        <strong><?= nl2br($this->e($exception->getMessage())) ?></strong>
        (<?= $exception->getCode() ?>)<br>
        <?php if ($exception instanceof \app\Github\Exception\TokenException) : ?>
-               You might want to try to <a href="<?= $baseUrl->mod("./github/signin") ?>">renew your token</a>!
+               You might want to try to <a href="<?= $baseUrl->mod(":./github/signin") ?>">renew your token</a>!
        <?php endif; ?>
        <?php if ($exception instanceof \app\Github\Exception\StateException) : ?>
-               You might want to try to <a href="<?= $baseUrl->mod("./github/signin") ?>">try again</a>!
+               You might want to try to <a href="<?= $baseUrl->mod(":./github/signin") ?>">try again</a>!
        <?php endif; ?>
 </div>
 
index 070db76b1c4ff3dd7e42e884bf3b4de68085c062..ba0170fac332f70042cee124bb445cc61badf339 100644 (file)
@@ -28,7 +28,7 @@
                                <?php endif; ?>
                        </td>
                        <th>
-                               <a href="<?= $baseUrl->mod("./github/repo/".$repo->full_name) ?>">
+                               <a href="<?= $baseUrl->mod(":./github/repo/".$repo->full_name) ?>">
                                        <big class="text-primary" title="<?= $this->e($repo->description) ?>"><?= $this->e($repo->name) ?></big>
                                </a>
                                <br>
@@ -37,7 +37,7 @@
                        <td class="text-right"><time datetime="<?= $this->e($repo->pushed_at) ?>"><?= $this->e($this->utc($repo->pushed_at)->format("Y-m-d H:i T")) ?></time></td>
                        <td class="text-center">
                                <?php if ($this->check($repo)) : ?>
-                               <form class="form" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>"> 
+                               <form class="form" style="display: inline-block" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/del") ?>">
                                        <input type="hidden" name="returnback" value="1">
                                        <button type="submit" class="btn btn-block btn-danger">
                                                <span class="glyphicon glyphicon-remove"></span>
@@ -45,7 +45,7 @@
                                        </button>
                                </form>
                                <?php else : ?>
-                               <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/add") ?>">
+                               <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/add") ?>">
                                                <div class="checkbox">
                                                        <label for="hook-tag">
                                                                <input id="hook-tag" type="checkbox" name="tag" value="1" checked>
index fff952d75cdafab28b194e9a7fdcef3f955e6cfe..21d640c317d8881f111b0a6525a7682ec9f3ad42 100644 (file)
@@ -1,4 +1,4 @@
-<?php $this->layout("layout", ["title" => "Github: {$repo->name}"]) ?>
+<?php $this->layout("layout", ["title" => "Github: ". (isset($repo) ? $repo->name : $name)]) ?>
 
 <div class="page-header">
        <h1>
 
        <div class="col-sm-6">
                <div class="row">
-                       <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/" . (!empty($hook) ? "upd" : "add")) ?>">
+                       <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/" . (!empty($hook) ? "upd" : "add")) ?>">
                                <div class="col-sm-6">
                                        <h4>PHARext Options:</h4>
                                        <div class="checkbox">
                        <!-- column wrapping! -->
                        <?php if ($this->check($repo)) : ?>
                        <div class="col-sm-6">
-                               <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>"> 
+                               <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/del") ?>">
                                <button class="btn btn-lg btn-block btn-danger">
                                        <span class="glyphicon glyphicon-remove-circle"></span>
                                        Remove Hook
                                        <?php endforeach; ?>
                                </ul>
                        <?php else: ?>
-                               <form class="form-inline pull-right" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/release") ?>">
+                               <form class="form-inline pull-right" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/release") ?>">
                                        <input type="hidden" name="tag" value="<?= $this->e($v->tag->name) ?>">
                                        <div class="checkbox">
                                                <label for="hook-zend">
index 6bf5eb497b3ccd602d8653e67eccf411b5a3c113..e8e40571f13cf160346c5f4b98ad06a16332c20e 100644 (file)
@@ -10,8 +10,8 @@
                </title>
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
-               <link rel="stylesheet" href="<?= $baseUrl->mod("./octicons/octicons.css") ?>">
-               <link rel="stylesheet" href="<?= $baseUrl->mod("./index.css") ?>">
+               <link rel="stylesheet" href="<?= $baseUrl->mod(":./octicons/octicons.css") ?>">
+               <link rel="stylesheet" href="<?= $baseUrl->mod(":./index.css") ?>">
                
                <?php if (!empty($styles)) : ?>
                        <?php foreach($styles as $style) : ?>
@@ -52,7 +52,7 @@
                        </div>
                </footer>
                <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
-               <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
+               <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
                <script>$(".modal").modal("show")</script>
                <?php if (!empty($scripts)) : ?>
                        <?php foreach ($scripts as $script) : ?>
index 6a6df0d215bb04c47eb6a80831a8747461ce9c7f..68bb5edb77dd743f6673b5c88cf22aa86dde1b53 100644 (file)
       </div>
       <div class="modal-footer">
                <?php if ($action === "add") : ?>
-               <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/add") ?>"> 
+               <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/add") ?>">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                        <button type="submit" class="btn btn-primary">Enable Hook</button>
                </form>
                <?php elseif ($action === "del") : ?>
-               <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>"> 
+               <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/del") ?>">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                        <button type="submit" class="btn btn-primary">Disable Hook</button>
                </form>
index 310ab533b469277573eb1ac25ec3ad081d5f85e3..0b0a5986168ffd2404575465bd05bec5cb9e7669 100644 (file)
@@ -9,7 +9,7 @@
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                        </button>
-                       <a class="navbar-brand" href="<?=$baseUrl->mod("./")?>">PHARext</a>
+                       <a class="navbar-brand" href="<?=$baseUrl->mod(":./")?>">PHARext</a>
                </div>
 
                <!-- Collect the nav links, forms, and other content for toggling -->
                                                data-toggle="dropdown"
                                                role="button"
                                                aria-expand="false"
-                                               href="<?=$baseUrl->mod("./pages/Home")?>">
+                                               href="<?=$baseUrl->mod(":./pages/Home")?>">
                                                About
                                                <span class="caret"></span>
                                        </a>
                                        <ul class="dropdown-menu" role="menu">
                                                <?php foreach ($pages as $page) : ?>
-                                               <li><a href="<?= $baseUrl->mod("./pages/". rawurlencode($page)) ?>">
+                                               <li><a href="<?= $baseUrl->mod(":./pages/". rawurlencode($page)) ?>">
                                                        <?= $this->e($page) ?></a></li>
                                                <?php endforeach; ?>
                                        </ul>
                                </li>
                                <?php else : ?>
-                               <li><a href="<?=$baseUrl->mod("./pages/Home")?>">About</a></li>
+                               <li><a href="<?=$baseUrl->mod(":./pages/Home")?>">About</a></li>
                                <?php endif; ?>
                                <li
                                        <?php if ($location == "github") : ?>
                                        class="active"
                                        <?php endif; ?>
-                                       ><a href="<?=$baseUrl->mod("./github")?>">Github</a>
+                                       ><a href="<?=$baseUrl->mod(":./github")?>">Github</a>
                                </li>
                        </ul>
                        <?php if (isset($session)) : ?>
@@ -60,7 +60,7 @@
                                                </a>
                                                <ul class="dropdown-menu" role="menu">
                                                        <li>
-                                                               <a href="<?= $baseUrl->mod("./reset") ?>">
+                                                               <a href="<?= $baseUrl->mod(":./reset") ?>">
                                                                        Signout
                                                                </a>
                                                        </li>
index 119da529c6728e596c9b7c7a79c9276a2eb55d4d..a9a777bddf79e118e9d83ad4320e37253c974a71 100644 (file)
@@ -14,7 +14,7 @@
                                <p>
                                        Distribute your PHP extensions as self-installing PHAR archives.<sup><a id="ref-unix" href="#fn-unix">1</a>)</sup>
                                </p>
-                               <p><a href="<?= $baseUrl->mod("./pages/Home") ?>" class="btn btn-primary btn-lg btn-block">
+                               <p><a href="<?= $baseUrl->mod(":./pages/Home") ?>" class="btn btn-primary btn-lg btn-block">
                                        Learn more about <em>pharext</em>!
                                </a>
                                </p>
@@ -26,7 +26,7 @@
                                <p>
                                        Manage automatic pharext builds of your PHP extensions.
                                </p>
-                               <a href="<?= $baseUrl->mod("./github") ?>" class="btn btn-primary btn-lg btn-block">
+                               <a href="<?= $baseUrl->mod(":./github") ?>" class="btn btn-primary btn-lg btn-block">
                                Start right with your <em>Github</em> repos!
                                </a>
                        </div>
index b154fad4c0d98e71acb97930afa16218e52fac78..f60864eb5ff945ddd1b680063eeb961fe5449b9e 100644 (file)
@@ -22,7 +22,7 @@
                        </li>
                        <?php foreach ($pages as $page) : ?>
                        <li>
-                               <a href="<?= $baseUrl->mod("./pages/". rawurlencode($page)) ?>">
+                               <a href="<?= $baseUrl->mod(":./pages/". rawurlencode($page)) ?>">
                                <?= $this->e($page) ?>
                                </a>
                        </li>