Initial commit
This commit is contained in:
6
formwidgets/oauth/partials/_gaccess.htm
Normal file
6
formwidgets/oauth/partials/_gaccess.htm
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php if (!empty($auth_url)): ?>
|
||||
<p>
|
||||
<?= e(trans('nicost.gcalendar::lang.settings.gaccess.text')) ?><br>
|
||||
<a href="<?= $auth_url ?>" target="_blank"><?= e(trans('nicost.gcalendar::lang.settings.gaccess.button')) ?></a>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
47
formwidgets/oauth/partials/_oauth.htm
Normal file
47
formwidgets/oauth/partials/_oauth.htm
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user