Files
oc-gcalendar-plugin/formwidgets/oauth/partials/_oauth.htm
2019-10-13 18:38:03 +02:00

47 lines
1.9 KiB
HTML

<?php if ($isAccessTokenExpired == '1'): ?>
<p class="flash-message static error w-300">
Access Token <b>not</b> valid.
</p>
<div class="callout fade in callout-info no-subheader">
<div class="header">
<i class="icon-info"></i>
<h3>Setup G-Calendar Plugin</h3>
</div>
<div class="content">
<ol>
<li>Go to <a href="https://console.developers.google.com/apis">Google APIs</a> to create a OAuth Client</li>
<li>Go to <i>"Credentials"</i> and create a new OAuth Client ID. (Create credentials > OAuth Client ID)</li>
<li>Select "Web application" and give it a name.</li>
<li>Add <b><?= $redirectUrl ?></b> to <i>"Authorised redirect URIs"</i> and create the client.</li>
<li>Copy the <i>"Client ID"</i> and <i>"Client Secret"</i> to the form above and save it.</li>
<li>Last step is to Request the access token with the button below.</li>
</ol>
</div>
</div>
<?php else: ?>
<div class="callout fade in callout-success no-icon">
<div class="header">
<h3><?= e(trans('nicost.gcalendar::lang.settings.oauth.tokenValid')) ?></h3>
</div>
</div>
<?php endif ?>
<br>
<p>
<?php if ($isAccessTokenExpired == '1' && $clientIdExist == '1'): ?>
<button type="button"
data-request="onRequestAccessToken"
data-request-update="gaccess: '#grand-access'"
class="btn btn-default">
<?= e(trans('nicost.gcalendar::lang.settings.button.requestToken')) ?>
</button>
<?php endif ?>
<?php if ($isAccessTokenExpired == '0'): ?>
<button type="button"
data-request="onClearAccessToken"
class="btn btn-danger">
<?= e(trans('nicost.gcalendar::lang.settings.button.clearToken')) ?>
</button>
<?php endif ?>
</p>
<div id="grand-access"></div>