Update docs files

This commit is contained in:
Paweł Klockiewicz
2017-04-26 17:54:59 +02:00
parent 3987b87cda
commit 7bf8c658ec
2 changed files with 46 additions and 6 deletions

View File

@@ -86,7 +86,13 @@ Themes
Structure
---------
The structure of themes in Batflat is very simple. Just create a new folder in the `themes/` directory and the `index.html` file, which will be the default template for the subpages. Each subpage can use another template, so besides the mentioned file, you can also create another, eg `xyz.html`. Template selection is available in the admin panel while creating a page. There are no rules about CSS and JS files. There is full freedom.
The structure of themes in Batflat is very simple. Just create a new folder in the `themes/` directory and the following files:
+ `index.html` — default template for subpages
+ `manifest.json` — theme informations
+ `preview.png` — screenshot showing the theme *(optional)*
Each subpage can use another template, so besides the mentioned file, you can also create another, eg `xyz.html`. Template selection is available in the admin panel while creating a page. There are no rules about CSS and JS files. There is full freedom.
In the theme folder you can also create your own module views. To do this, you need to create a directory `modules/module_name` and `*.html` files with names corresponding to the names of the original views. For example, the view of the contact form should be contained in the following path: `themes/theme_name/modules/contact/form.html`. Batflat automatically detects a new view and uses it instead of the module default view.
@@ -202,6 +208,20 @@ Batflat, like its modules, provides many variables *(usually arrays)* that serve
Example
-------
### manifest.json
```
{
"name": "Example",
"version": "1.0",
"author": "Bruce Wayne",
"email": "contact@waynecorp.com",
"thumb": "preview.png"
}
```
### index.html
```html
<!doctype html>
@@ -1023,7 +1043,7 @@ Database
The database used in Batflat is SQLite version 3. For its use, CMS uses a simple class that makes it easy to build queries. You do not need to know SQL to be able to operate it.
In addition, we recommend [*Adminer*](https://www.adminer.org/) app for database management. This is a one-file PHP script similar to *phpMyAdmin*, where you can administer Batflat tables. This will allow you to familiarize yourself with the structure of existing tables.
In addition, we recommend [*phpLiteAdmin*](https://github.com/sruupl/batflat-pla) app for database management. This is a one-file PHP script similar to *phpMyAdmin*, where you can administer Batflat tables. This will allow you to familiarize yourself with the structure of existing tables.
The database file is located in `inc/data/database.sdb`.
@@ -1108,7 +1128,7 @@ WHERE NOT IN:
$rows = $this->core->db('table')->notIn('foo', [1,2,3])->orNotIn('foo', [7,8,9])->toArray();
```
GROUPING CONDITIONS:
Grouping conditions:
```php
// Fetch rows those column value 'foo' is 1 or 2 AND status is 1
$rows = $this->core->db('table')->where(function($st) {

View File

@@ -86,7 +86,13 @@ Motywy
Struktura
---------
Struktura motywów w Batflacie jest bardzo prosta. Wystarczy utworzyć nowy folder z nazwą motywu w katalogu `themes/` oraz plik `index.html`, który będzie domyślnym szablonem dla podstron. Każda podstrona może korzystać z innego szablonu, zatem prócz wspomnianego pliku możesz utworzyć także inne, np. `xyz.html`. Wybór szablonu jest dostępny w panelu administracyjnym podczas tworzenia strony. Nie ma określonych reguł co do plików CSS oraz JS. Panuje pełna dowolność.
Struktura motywów w Batflacie jest bardzo prosta. Wystarczy utworzyć nowy folder z nazwą motywu w katalogu `themes/` oraz następujące pliki:
+ `index.html` — domyślny szablon dla podstron
+ `manifest.json` — informacje o motywie
+ `preview.png` — zrzut ekranu przedstawiający motyw *(opcjonalne)*
Każda podstrona może korzystać z innego szablonu, zatem prócz wspomnianego pliku możesz utworzyć także inne, np. `xyz.html`. Wybór szablonu jest dostępny w panelu administracyjnym podczas tworzenia strony. Nie ma określonych reguł co do plików CSS oraz JS. Panuje pełna dowolność.
W katalogu motywu możesz również stworzyć własne widoki modułów. Aby to zrobić, musisz utworzyć katalog `modules/nazwa_modułu/` oraz pliki `*.html` z nazwami odpowiadającymi nazwom oryginalnych widoków. Przykładowo, widok modułu formularza kontaktowego powinien być zawarty w następującej ścieżce: `themes/nazwa_motywu/modules/contact/form.html`. Batflat automatycznie wykryje nowy widok i użyje go zamiast domyślnego widoku modułu.
@@ -204,6 +210,20 @@ Batflat, podobnie jak i jego moduły, dostarcza wiele zmiennych *(zazwyczaj tabl
Przykład
--------
### manifest.json
```
{
"name": "Example",
"version": "1.0",
"author": "Bruce Wayne",
"email": "contact@waynecorp.com",
"thumb": "preview.png"
}
```
### index.html
```html
<!doctype html>
@@ -1022,7 +1042,7 @@ Baza danych
Zastosowana w Batflacie baza danych to SQLite w wersji 3. Do jej obsługi, CMS wykorzystuje prostą klasę, która ułatwia budowanie zapytań. Nie musisz znać języka SQL, by móc na niej operować.
Dodatkowo polecamy aplikację [*Adminer*](https://www.adminer.org/) do zarządzania nią. Jest to jednoplikowy skrypt PHP, podobny do *phpMyAdmin*, przy pomocy którego można administrować tabelami Batflata. Pozwoli on zapoznać się ze strukturą istniejących tabel.
Dodatkowo polecamy aplikację [*phpLiteAdmin*](https://github.com/sruupl/batflat-pla) do zarządzania bazą. Jest to jednoplikowy skrypt PHP, podobny do *phpMyAdmin*, przy pomocy którego można administrować tabelami Batflata. Pozwoli on zapoznać się ze strukturą istniejących tabel.
Plik bazy znajduje się w `inc/data/database.sdb`.
@@ -1107,7 +1127,7 @@ WHERE NOT IN:
$rows = $this->core->db('table')->notIn('foo', [1,2,3])->orNotIn('foo', [7,8,9])->toArray();
```
GRUPOWANIE WARUNKÓW:
Grupowanie warunków:
```php
// Pobranie wierszy, których wartość kolumny 'foo' to 1 lub 2 ORAZ posiadają status = 1
$rows = $this->core->db('table')->where(function($st) {