Skip to content

Instantly share code, notes, and snippets.

@akool
Last active April 26, 2019 18:14
Show Gist options
  • Select an option

  • Save akool/16076c8826a4acc727a09dbd5a1762d2 to your computer and use it in GitHub Desktop.

Select an option

Save akool/16076c8826a4acc727a09dbd5a1762d2 to your computer and use it in GitHub Desktop.
//<?php
$manager_theme = $modx->config['manager_theme'];
$data = $modx->runSnippet('DocLister', array(
'debug' => 0,
'idType' => 'documents',
'ignoreEmpty' => 1,
'controller' => 'onetable',
'table' => 'subscribers',
'dateSource' => 'createdon',
'ownerTPL' => '@CODE:<table class="grid">
<tr><td class="gridHeader">Email</td><td class="gridHeader">Дата</td><td class="gridHeader">Отправлено</td></tr>
[+dl.wrap+]</table> ',
'tpl' => '@CODE:<tr><td>[+email+]</td><td>[+dl.date+]</td><td>[+sent-text+]</td></tr>',
'prepare' => function($data){
$data['sent-text'] = $data['sent'] ? 'Да' : 'Нет';
return $data;
}
));
$output=<<<OUT
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="media/style/{$manager_theme}/style.css">
</head>
<body>
<h1></h1>
<div class="section">
<div class="sectionHeader">Подписки</div>
<div class="sectionBody">
{$data}
</div>
</div>
</body>
</html>
OUT;
echo $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment