Skip to content

Commit

Permalink
Fix typos (#2077)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
  • Loading branch information
szepeviktor and mvorisek committed Jun 26, 2023
1 parent c093efc commit a0d07d7
Show file tree
Hide file tree
Showing 67 changed files with 120 additions and 120 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -72,13 +72,13 @@ Open PHP in the browser and observe a fully working and good looking form:

![subscribe](docs/images/subscribe.png)

ATK UI relies on https://fomantic-ui.com CSS framework to render the form beautifully. It also implements submission callback in a very straightforward way. The demo also demonstrates use of JavaScript action, which can make objects interract with each-other (e.g. Form submit reloads Table).
ATK UI relies on https://fomantic-ui.com CSS framework to render the form beautifully. It also implements submission callback in a very straightforward way. The demo also demonstrates use of JavaScript action, which can make objects interact with each-other (e.g. Form submit reloads Table).

### Database Integration with ATK Data

To get most of ATK UI, use [ATK Data](https://github.com/atk4/data) to describe your business models such as "User" or "Purchase". When you define models, you can start using some more advanced components:

[Crud](https://ui.agiletoolkit.org/demos/crud.php) is a fully-interractive component that supports pagination, reloading, conditions, data formatting, sorting, quick-search, ordering, custom actions and modals, but at the same time is very easy to use:
[Crud](https://ui.agiletoolkit.org/demos/crud.php) is a fully-interactive component that supports pagination, reloading, conditions, data formatting, sorting, quick-search, ordering, custom actions and modals, but at the same time is very easy to use:

``` php
$app = new \Atk4\Ui\App(['title' => 'hello world']);
Expand Down Expand Up @@ -248,7 +248,7 @@ _All components can be view using the [demos](https://ui.agiletoolkit.org/demos/
| Console | Execute server/shell commands and display progress live | 1.4 |
| Items and Lists | Flexible and high-performance way to display lists of items. | 1.4 |
| Wizard | Multi-step, wizard with temporary data storing. | 1.4 |
| Actions | Vizualization of user-defined actions | 2.0 |
| Actions | Visualization of user-defined actions | 2.0 |


## Add-ons and integrations
Expand Down
2 changes: 1 addition & 1 deletion demos/basic/menu.php
Expand Up @@ -20,7 +20,7 @@
$dropdown = UiDropdown::addTo($menu, ['With Callback', 'dropdownOptions' => ['on' => 'hover']]);
$dropdown->setSource(['a', 'b', 'c']);
$dropdown->onChange(function (string $itemId) {
return 'New seleced item ID: ' . $itemId;
return 'New selected item ID: ' . $itemId;
});

$submenu = $menu->addMenu('Sub-menu');
Expand Down
2 changes: 1 addition & 1 deletion demos/basic/view.php
Expand Up @@ -63,7 +63,7 @@
Header::addTo($app, ['Has a unique global identifier']);
Label::addTo($app, ['Plane ID:', 'detail' => $plane->name]);

Header::addTo($app, ['Can interract with JavaScript actions']);
Header::addTo($app, ['Can interact with JavaScript actions']);
Button::addTo($app, ['Hide plane', 'icon' => 'down arrow'])
->on('click', $plane->js()->hide());
Button::addTo($app, ['Show plane', 'icon' => 'up arrow'])
Expand Down
2 changes: 1 addition & 1 deletion demos/collection/table2.php
Expand Up @@ -84,7 +84,7 @@

// one formatter
return [[Table\Column\Money::class]];
}, 'attr' => ['all' => ['class' => ['right aligned singel line']]]]);
}, 'attr' => ['all' => ['class' => ['right aligned single line']]]]);

Header::addTo($app, ['Table with resizable columns', 'subHeader' => 'Just drag column header to resize', 'icon' => 'table']);

Expand Down
4 changes: 2 additions & 2 deletions demos/collection/tablecolumnmenu.php
Expand Up @@ -16,15 +16,15 @@

Header::addTo($app, ['Table column may contains popup or dropdown menu.']);

// Better Popup positionning when Popup are inside a container.
// Better Popup positioning when Popup are inside a container.
$container = View::addTo($app, ['ui' => 'vertical segment']);
$table = Table::addTo($container, ['class.celled' => true]);
$table->setModel(new SomeData(), []);

// will add popup to this column.
$colName = $table->addColumn('name');

// will add dropdown menu to this colum.
// will add dropdown menu to this column.
$colSurname = $table->addColumn('surname');

$colTitle = $table->addColumn('title');
Expand Down
2 changes: 1 addition & 1 deletion demos/form/form5.php
Expand Up @@ -70,7 +70,7 @@
$form->setModel($model);
$form->onSubmit($formSubmit);

// Next form won't initalize default fields, but we'll add them individually
// Next form won't initialize default fields, but we'll add them individually
$form = Form::addTo($cc->addColumn());
$form->setModel($model, []);

Expand Down
2 changes: 1 addition & 1 deletion demos/form/jscondform.php
Expand Up @@ -83,7 +83,7 @@
$groupBasic->addControl('middle_name', ['width' => 'three']);
$groupBasic->addControl('last_name', ['width' => 'five']);

$formGroup->addControl('dev', [Form\Control\Checkbox::class, 'caption' => 'I am a developper']);
$formGroup->addControl('dev', [Form\Control\Checkbox::class, 'caption' => 'I am a developer']);

$groupCode = $formGroup->addGroup(['Check all language that apply']);
$groupCode->addControl('php', [Form\Control\Checkbox::class]);
Expand Down
2 changes: 1 addition & 1 deletion demos/form/templates/form-custom-layout.html
Expand Up @@ -12,7 +12,7 @@
<div class="column">Number Code: {$atk_fp_country__numcode}</div>
</div>
<div class="centered row">
<div class="colum">{$Buttons}</div>
<div class="column">{$Buttons}</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion demos/form/templates/form-custom-layout.pug
Expand Up @@ -14,6 +14,6 @@
.column
| Number Code: {$atk_fp_country__numcode}
.centered.row
.colum
.column
| {$Buttons}
= "\n"
4 changes: 2 additions & 2 deletions demos/init-db.php
Expand Up @@ -87,7 +87,7 @@ protected function initPreventModification(): void
{
$makeMessageFx = function (string $actionName, Model $model) {
return $model->getModelCaption() . ' action "' . $actionName . '" with "' . $model->getTitle() . '" entity '
. ' was executed. In demo mode all changes are reverved.';
. ' was executed. In demo mode all changes are reversed.';
};

$this->wrapUserActionCallbackPreventModification($this->getUserAction('add'), function (Model $model) use ($makeMessageFx) {
Expand Down Expand Up @@ -528,7 +528,7 @@ protected function init(): void
$this->addField($this->fieldName()->qty, ['type' => 'integer', 'required' => true]);
$this->addField($this->fieldName()->box, ['type' => 'integer', 'required' => true]);
$this->addExpression($this->fieldName()->total_sql, [
'expr' => function (Model /* TODO self is not working bacause of clone in Multiline */ $row) {
'expr' => function (Model /* TODO self is not working because of clone in Multiline */ $row) {
return $row->expr('{' . $this->fieldName()->qty . '} * {' . $this->fieldName()->box . '}'); // @phpstan-ignore-line
},
'type' => 'integer',
Expand Down
4 changes: 2 additions & 2 deletions demos/interactive/console.php
Expand Up @@ -62,8 +62,8 @@ public function generateReport()
$tab = $tabs->addTab('runMethod()', function (VirtualPage $vp) use ($testRunClass) {
Header::addTo($vp, [
'icon' => 'terminal',
'Non-interractive method invocation',
'subHeader' => 'console can invoke a method, which normaly would be non-interractive and can still capture debug output',
'Non-interactive method invocation',
'subHeader' => 'console can invoke a method, which normally would be non-interactive and can still capture debug output',
]);
Console::addTo($vp)->runMethod($testRunClass::addTo($vp), 'generateReport');
});
Expand Down
10 changes: 5 additions & 5 deletions demos/interactive/popup.php
Expand Up @@ -161,7 +161,7 @@ public function linkCart(View $cart, JsExpressionable $jsAction = null): void
$cartItem = $menu->addItem([$cartClass, 'icon' => 'cart'])->set('Cart');

$cartPopup = Popup::addTo($app, [$cartItem, 'position' => 'bottom left']);
// Popup won't dissapear as you hover over it.
// Popup won't disappear as you hover over it.
$cartPopup->setHoverable();

$shelf = $itemShelfClass::addTo($app);
Expand All @@ -172,7 +172,7 @@ public function linkCart(View $cart, JsExpressionable $jsAction = null): void
//
// This can happen when your popup content is non-trivial. So we are moving Popup into the app and linking up
// the triggers. Now, since it's outside, we can't use a single jsAction to reload menu item (along with label)
// and the contens. We could use 2 requests for reloading, but that's not good.
// and the content. We could use 2 requests for reloading, but that's not good.
//
// The next idea is to make cart dynamic, so it loads when you move mouse over the menu. This probably is good,
// as it will always be accurate, even if you added items form multiple browser tabs.
Expand All @@ -194,9 +194,9 @@ public function linkCart(View $cart, JsExpressionable $jsAction = null): void

// Label now can be added referencing Cart's items. Init() was colled when I added it into app, so the
// item property is populated.
$cartOutterLabel = Label::addTo($cartItem, [(string) count($cart->items), 'class.floating red' => true]);
$cartOuterLabel = Label::addTo($cartItem, [(string) count($cart->items), 'class.floating red' => true]);
if (!$cart->items) {
$cartOutterLabel->setStyle('display', 'none');
$cartOuterLabel->setStyle('display', 'none');
}

$cartPopup->set(function (View $popup) use ($cart) {
Expand All @@ -214,7 +214,7 @@ public function linkCart(View $cart, JsExpressionable $jsAction = null): void
// Add item shelf below menu and link it with the cart
$shelf->linkCart($cart, new JsBlock([
// array is a valid JS action. Will relad cart item (along with drop-down and label)
$cartOutterLabel->jsReload(),
$cartOuterLabel->jsReload(),

// also will hide current item from the shelf
(new Jquery())->hide(),
Expand Down
2 changes: 1 addition & 1 deletion demos/interactive/toast.php
Expand Up @@ -34,7 +34,7 @@
$button = Button::addTo($app)->set('Error');
$button->on('click', new JsToast([
'title' => 'Error',
'message' => 'An error occured',
'message' => 'An error occurred',
'class' => 'error',
]));

Expand Down
6 changes: 3 additions & 3 deletions demos/interactive/wizard.php
Expand Up @@ -17,7 +17,7 @@
require_once __DIR__ . '/../init-app.php';

$wizard = Wizard::addTo($app, ['urlTrigger' => 'demo_wizard']);
// First step will automatcally be active when you open page first. It
// First step will automatically be active when you open page first. It
// will contain the 'Next' button with a link.
$wizard->addStep('Welcome', function (Wizard $wizard) {
Message::addTo($wizard, ['Welcome to wizard demonstration'])->text
Expand All @@ -43,7 +43,7 @@
});
});

// Alternatvely, you may access buttonNext, buttonPrevious properties of a wizard
// Alternately, you may access buttonNext, buttonPrevious properties of a wizard
// and set a custom JS action or even set a different link. You can use recall()
// to access some values that were recorded on another steps.
$wizard->addStep(['Select Model', 'description' => '"Country" or "Stat"', 'icon' => 'table'], function (Wizard $wizard) {
Expand All @@ -68,7 +68,7 @@
$wizard->buttonNext->addClass('disabled');
});

// Steps may contain interractive elements. You can disable navigational buttons
// Steps may contain interactive elements. You can disable navigational buttons
// and enable them as you see fit. Use handy JS method to trigger advancement to
// the next step.
$wizard->addStep(['Migration', 'description' => 'Create or update table', 'icon' => 'database'], function (Wizard $wizard) {
Expand Down
2 changes: 1 addition & 1 deletion demos/javascript/js.php
Expand Up @@ -15,7 +15,7 @@
/** @var \Atk4\Ui\App $app */
require_once __DIR__ . '/../init-app.php';

// Demonstrates how to use interractive buttons.
// Demonstrates how to use interactive buttons.
Header::addTo($app, ['Basic Button']);

// This button hides on page load
Expand Down
2 changes: 1 addition & 1 deletion demos/layout/templates/layout1.html
Expand Up @@ -30,7 +30,7 @@
</div>
</div>
<div class="ui main basic segment">
<h3>Nominal Acitivity Report</h3>
<h3>Nominal Activity Report</h3>
<form class="ui form small segment">
<div class="inline fields">
<div class="field">
Expand Down
2 changes: 1 addition & 1 deletion demos/layout/templates/layout1.pug
Expand Up @@ -33,7 +33,7 @@ html
a.item(href="index.php") Back to other tests

.ui.main.basic.segment
h3 Nominal Acitivity Report
h3 Nominal Activity Report

form.ui.form.small.segment
.inline.fields
Expand Down
2 changes: 1 addition & 1 deletion demos/others/sticky2.php
Expand Up @@ -32,7 +32,7 @@
Label::addTo($frame, ['Reset', 'iconRight' => 'close', 'class.black' => true])->link($app->url());
View::addTo($frame, ['ui' => 'hidden divider']);

// nested interractive elemetns will respect lockal sticky get
// nested interactive elements will respect lockal sticky get
Button::addTo($frame, ['Triggering callback here will inherit color'])
->on('click', function () {
return new JsToast('Color was = ' . $_GET['name']);
Expand Down
4 changes: 2 additions & 2 deletions docs/button.rst
Expand Up @@ -59,12 +59,12 @@ Setting this will display icon on the right of the button::
$button = Button::addTo($app, ['Next', 'iconRight' => 'right arrow']);

Apart from being on the right, the same rules apply as :php:attr:`Button::$icon`. Both
icons cannot be specified simultaniously.
icons cannot be specified simultaneously.

Button Bar
----------

Buttons can be aranged into a bar. You would need to create a :php:class:`View` component
Buttons can be arranged into a bar. You would need to create a :php:class:`View` component
with property ``ui='buttons'`` and add your other buttons inside::

$bar = View::addTo($app, ['ui' => 'vertical buttons']);
Expand Down
4 changes: 2 additions & 2 deletions docs/callbacks.rst
Expand Up @@ -180,7 +180,7 @@ for the $view object.

Should JsReload use regular 'Callback', then it wouldn't know that $view must contain LoremIpsum text.

JsReload existance is only possible thanks to CallbackLater implementation.
JsReload existence is only possible thanks to CallbackLater implementation.


JsCallback
Expand Down Expand Up @@ -303,7 +303,7 @@ If you do not need to specify confirm, you can actually pass arguments in a key-
}, [new \Atk4\Ui\Js\JsExpression('$(window).width()')]);


Refering to event origin
Referring to event origin
^^^^^^^^^^^^^^^^^^^^^^^^

You might have noticed that JsCallback now passes first argument ($j) which so far, we have ignored. This argument is a
Expand Down
2 changes: 1 addition & 1 deletion docs/components.rst
Expand Up @@ -60,7 +60,7 @@ Interactive components

Interactive components rely on :ref:`callback`, :ref:`virtualpage` or :ref:`sse` to communicate with themselves in the PHP realm. You add them
just as you would add any other component, yet they will send additional requests, like loading additional data or executing
other code. Here is how interractive components will typically communicate:
other code. Here is how interactive components will typically communicate:

1. request by browser is made.
2. :php:class:`App` asks :php:class:`Console` to render HTML + JavaScript.
Expand Down
10 changes: 5 additions & 5 deletions docs/crud.rst
Expand Up @@ -11,7 +11,7 @@ Crud
Crud class offers a very usable extension to :php:class:`Grid` class, which automatically adds actions for deleting,
updating and adding records as well as linking them with corresponding Model actions.

.. important:: If you only wish to display a non-interractive table use :php:class:`Table` class. If you need to
.. important:: If you only wish to display a non-interactive table use :php:class:`Table` class. If you need to
display Data Grid with some custom actions (not update/delete/add) or if you want to use your own editing
mechanism (such as edit data on separate page, not inside a modal), use :php:class:`Grid`

Expand Down Expand Up @@ -49,7 +49,7 @@ Disabling Actions
By default Crud allows all four operations - creating, reading, updating and deleting. These action is set by default in model
action. It is possible to disable these default actions by setting their system property to true in your model::

$euCountries->getUserAction('edit')->sytem = true;
$euCountries->getUserAction('edit')->system = true;

Model action using system property set to true, will not be display in Crud. Note that action must be setup prior to use
`$crud->setModel($euCountries)`
Expand All @@ -63,10 +63,10 @@ Only fields name set in this property will be display in Grid. Leave empty for a

.. php:attr:: editFields
If you'd like to have different fields in the grid of the CRUD, but you need more/different fields in the editting modal (which opens when clicking on an entry),
you can choose here the fields that are available in the editting modal window.
If you'd like to have different fields in the grid of the CRUD, but you need more/different fields in the editing modal (which opens when clicking on an entry),
you can choose here the fields that are available in the editing modal window.

.. important:: Both views (overview and editting view) refer to the same model, just the fields shown in either of them differ
.. important:: Both views (overview and editing view) refer to the same model, just the fields shown in either of them differ

Example::

Expand Down
2 changes: 1 addition & 1 deletion docs/dataexecutor.rst
Expand Up @@ -200,7 +200,7 @@ The method is::

ExecutorFactory::createTrigger(UserAction $action, string $type = null): View

This method return an instance object for the proper type. When no type is supply, a default View Button obeject
This method return an instance object for the proper type. When no type is supply, a default View Button object
is returned.

As per executor type, it is also possible to add or change already register type via the registerTrigger method::
Expand Down
2 changes: 1 addition & 1 deletion docs/filestructure.rst
Expand Up @@ -116,7 +116,7 @@ But you can't call it directly through the domain (that means in our case "db.ph
Create your application
=======================

To initalize your application we need to do the following steps:
To initialize your application we need to do the following steps:
#) Create db.php for database

#) Create init.php
Expand Down
2 changes: 1 addition & 1 deletion docs/fileupload.rst
Expand Up @@ -108,7 +108,7 @@ receive the same fileId set during the onUpload callback as function parameter.

The onDelete callback function is a good place to:

- validate ID (as it can technically be chenged through browser's inspector)
- validate ID (as it can technically be changed through browser's inspector)
- load file property from db
- remove previously uploaded file from server or cloud,
- delete db entry according to the fileId,
Expand Down

0 comments on commit a0d07d7

Please sign in to comment.