aboutsummaryrefslogtreecommitdiff
path: root/demo/components
diff options
context:
space:
mode:
authorValentin Popov <dev@valentineus.link>2016-09-21 17:12:07 +0300
committerValentin Popov <dev@valentineus.link>2016-09-21 17:12:07 +0300
commit07c1b99cb5880f9f3b54ab417387487365db87ac (patch)
tree333a3c7eedded83a5829775c1e5210db2f17aa43 /demo/components
parentb9628f189b0ca2f7c411bd79566da37c73cc8e8f (diff)
downloadiii-module-07c1b99cb5880f9f3b54ab417387487365db87ac.tar.xz
iii-module-07c1b99cb5880f9f3b54ab417387487365db87ac.zip
RC demo
Diffstat (limited to 'demo/components')
-rw-r--r--demo/components/class-application.php59
-rw-r--r--demo/components/footer.php4
-rw-r--r--demo/components/navbar.php2
-rw-r--r--demo/components/on-board-panel.php (renamed from demo/components/communication.php)1
4 files changed, 40 insertions, 26 deletions
diff --git a/demo/components/class-application.php b/demo/components/class-application.php
index bdd6419..317795d 100644
--- a/demo/components/class-application.php
+++ b/demo/components/class-application.php
@@ -1,12 +1,18 @@
<?php
/**
-* Function of saving the token in a cookie.
-* When you receive the new value clears all stored cookies.
-* @param $token - The values of the token.
+* The function returns the current ID.
+* Returns zero if no ID is stored.
*/
-function NewToken($token) {
- unset($_COOKIE); // Removes all
- SetCookie("BOT_TOKEN", $token); // Save a new cookie
+function GetID() {
+ // Search current ID...
+ if (isset($_COOKIE['CURRENT_ID'])) {
+ $id = (int)$_COOKIE['CURRENT_ID'] + 1;
+ // ...or returns zero
+ } else {
+ $id = 0;
+ }
+ // We issue results
+ return $id;
}
/**
@@ -34,22 +40,6 @@ function GetSession($token, $bot) {
}
/**
-* The function returns the current ID.
-* Returns zero if no ID is stored.
-*/
-function GetID() {
- // Search current ID...
- if (isset($_COOKIE['CURRENT_ID'])) {
- $id = (int)$_COOKIE['CURRENT_ID'] + 1;
- // ...or returns zero
- } else {
- $id = 0;
- }
- // We issue results
- return $id;
-}
-
-/**
* The function overrides the current ID to
* the specified or the next. If any missing ID
* returns the one.
@@ -67,8 +57,29 @@ function SetID($id) {
$id = 1;
}
SetCookie('CURRENT_ID', $id, time()+300); // Save the result
- // We issue results
- return $id;
+ return $id; // We issue results
+}
+
+/**
+* Cleaning function of the parameter that is passed to it.
+* @param $type - Type cleansed.
+*/
+function ClearingCache($type) {
+ switch ($type) {
+ // Clear the cookies
+ case 'cookies':
+ foreach ($_COOKIE as $key => $value) {
+ SetCookie($key, $value, time()-1000);
+ }
+ break;
+ // Clear the POST
+ case 'post':
+ $_POST = array();
+ break;
+ // ...
+ default:
+ break;
+ }
}
/**
diff --git a/demo/components/footer.php b/demo/components/footer.php
index b1df881..21f2e3e 100644
--- a/demo/components/footer.php
+++ b/demo/components/footer.php
@@ -1,8 +1,8 @@
<!-- Beginning footer -->
<footer class="footer">
<div class="container">
- <p class="text-muted">
- <a href="mailto:dev@valentineus.link">dev@valentineus.link</a>
+ <p class="text-muted text-center">
+ With love <i class="glyphicon glyphicon-heart text-danger"></i> from Russia
</p>
</div>
</footer>
diff --git a/demo/components/navbar.php b/demo/components/navbar.php
index 9fcb9ee..3e57cac 100644
--- a/demo/components/navbar.php
+++ b/demo/components/navbar.php
@@ -1,8 +1,10 @@
<!-- Start navigation bar -->
<nav class="navbar navbar-default navbar-fixed-top">
+ <!-- Loaded banner GitHub -->
<a href="https://github.com/valentineus/Module-III-API">
<img class="github-fork">
</a>
+ <!-- Filling panel -->
<div class="container">
<div class="collapse navbar-collapse">
<!-- The right side of the navigation bar -->
diff --git a/demo/components/communication.php b/demo/components/on-board-panel.php
index e73be75..c9fab05 100644
--- a/demo/components/communication.php
+++ b/demo/components/on-board-panel.php
@@ -9,6 +9,7 @@
<div class="col-md-4">
<button type="submit" class="btn btn-default">Submit</button>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#SettingsModal">Settings</button>
+ <button type="submit" class="btn btn-danger" name="reset">Reset</button>
</div>
</div><!-- row -->
</form>