-
-
Save Fi1osof/80e5681962d5d8adcdcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$modx->regClientStartupScript("{$template_url}Scripts/jquery.validate.min.js")} | |
{$modx->regClientStartupScript("{$template_url}Scripts/jquery.validate.unobtrusive.min.js")} | |
{$request = $smarty.post} | |
{block name=properties} | |
{$properties = $request} | |
{$action = 'create'} | |
{/block} | |
{if $request} | |
{processor action="mgr/users/{$action}" ns="modxsite" params=$request assign=result} | |
{if !$result.success} | |
<p style="color:red;font-weight:bold;">{$result.message|default:"Ошибка выполнения запроса"}</p> | |
{foreach $result.field_errors as $error} | |
<p style="color:red;">{$error}</p> | |
{/foreach} | |
{else} | |
{$params = [ | |
'user_id' => $result.object.id, | |
'delivery_group' => $request.delivery_group | |
]} | |
{processor action="mgr/users/deliverygroup/manage" ns="modxsite" params=$params assign=delivery_result} | |
{block name="result"} | |
<p style="color:green;">{$result.message|default:"Пользователь успешно создан"}</p> | |
<p><a href="{$modx->resource->uri}">Добавить еще пользователя</a></p> | |
{/block} | |
{/if} | |
{/if} | |
{block name=form} | |
{if !$result.success} | |
{include file="office/users/form.tpl"} | |
{/if} | |
{/block} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment