|
9 months ago | |
---|---|---|
api | 9 months ago | |
langs | 11 months ago | |
lib | 9 months ago | |
mobile | 11 months ago | |
nbproject | 1 year ago | |
pages | 11 months ago | |
static | 9 months ago | |
tests | 1 year ago | |
.gitignore | 2 years ago | |
.gitmodules | 2 years ago | |
LICENSE.md | 11 months ago | |
README.md | 11 months ago | |
action.php | 9 months ago | |
api.php | 11 months ago | |
app.php | 11 months ago | |
composer.json | 1 year ago | |
composer.lock | 1 year ago | |
index.php | 11 months ago | |
pages.php | 11 months ago | |
required.php | 11 months ago | |
settings.template.php | 11 months ago |
This is an empty (but fully functional) PHP application. It is designed to integrate with AccountHub, an account management web interface. AccountHub manages user credentials and account data, and is accessed by this app via a simple API.
LANGUAGE
in settings.php
.
All .json files in a language folder are parsed and loaded into the dictionary (use via $Strings->get('some key')
)..lib.php
are automatically loaded.pages.php
and define a page with the name foo
, there should be a foo.php
in here.
The app checks before loading, so it will give a friendly 404 error if it doesn’t find your page.
Woe to you if you delete home.php
or 404.php
, as those are assumed to exist for fallback behavior.settings.php
and customize. Documented with inline comments.$navbar_breakpoint
.
To change the navbar colors, find and edit <nav class="navbar ...
, changing navbar-dark bg-blue
to suit.require_once __DIR__."/required.php"
at the top of every file.
It loads Composer dependencies, library files, app settings, language data, and creates $database
for accessing the database.
It also has some utility functions, including dieifnotloggedin()
.
Read through it to see exactly what it does.index.php
if the user is not logged in.
Note: to show an alert message (success, error, whatever), set the GET argument msg
to a message ID from lang/messages.php
.pages/{key}.php
, or it will 404.
Optional parameters:
'navbar' => true
will show the page as a button in the app menu bar.
'icon' => '...'
will show an icon from FontAwesome in the menu bar. Setting this to home
will show the icon fa-home
.
'styles' => ["file.css"]
will inject the listed CSS files into the page header (after all other CSS, like Bootstrap).
'scripts' => ["file.js"]
will inject the listed JavaScript files into the page footer (after jQuery and other builtin scripts)."string"
is the language string for the message, "type"
is one of success
, info
, warning
, or danger
(i.e. Bootstrap alert classes).
Changing the type changes the icon and color of the alert box.git submodule init
and git submodule update
.