Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created April 29, 2014 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fi1osof/d3323ac5a2a82dbacc46 to your computer and use it in GitHub Desktop.
Save Fi1osof/d3323ac5a2a82dbacc46 to your computer and use it in GitHub Desktop.
{*
Редактирование компании
*}
{extends file="office/users/create.tpl"}
{block name=properties}
{$params = [
"where" => [
"id" => $smarty.get.id
],
"limit" => 1
]}
{processor action="mgr/users/getdata" ns="modxsite" params=$params assign=result}
{*
Если был получен user, то выполняем все остальные действия
*}
{if $result.success && $result.object}
{$user = $result.object|current}
{$properties = array_merge($user, (array)$request)}
{$action = 'update'}
{/if}
{/block}
{*
Этот блок внутри блока form
*}
{block name=EditFields}
<div class="editor-label">
Логин: {$user.username}
</div>
{/block}
{block name=form}
{if $user}
{include file="office/users/form.tpl"}
{else}
<p style="color:red;">{$result.message|default:"Не был получен пользователь"}</p>
{/if}
{/block}
{block name="result"}
<p style="color:green;">{$result.message|default:"Пользователь успешно обновлен"}</p>
{/block}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment