mirror of
https://github.com/Karaka-Management/oms-Script.git
synced 2026-01-11 12:28:41 +00:00
Continue with getter/setter cleanup
This commit is contained in:
parent
8fbc5486d0
commit
10f6d7e622
|
|
@ -107,7 +107,7 @@ final class ApiController extends Controller
|
|||
|
||||
$view = $this->createView($template, $request, $response);
|
||||
$this->setHelperResponseHeader($view, $template->name, $request, $response);
|
||||
$view->setData('path', __DIR__ . '/../../../');
|
||||
$view->data['path'] = __DIR__ . '/../../../';
|
||||
|
||||
$response->set('export', $view);
|
||||
}
|
||||
|
|
@ -370,14 +370,14 @@ final class ApiController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('report', $report);
|
||||
$view->addData('rcoll', $rcoll);
|
||||
$view->data['report'] = $report;
|
||||
$view->data['rcoll'] = $rcoll;
|
||||
}
|
||||
|
||||
$view->addData('tcoll', $tcoll);
|
||||
$view->addData('lang', $request->getData('lang') ?? $request->header->l11n->language);
|
||||
$view->addData('template', $template);
|
||||
$view->addData('basepath', __DIR__ . '/../../../');
|
||||
$view->data['tcoll'] = $tcoll;
|
||||
$view->data['lang'] = $request->getData('lang') ?? $request->header->l11n->language;
|
||||
$view->data['template'] = $template;
|
||||
$view->data['basepath'] = __DIR__ . '/../../../';
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Helper/Theme/Backend/helper-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response);
|
||||
|
||||
$path = \str_replace('+', ' ', (string) ($request->getData('path') ?? '/'));
|
||||
$templates = TemplateMapper::getAll()
|
||||
|
|
@ -67,11 +67,11 @@ final class BackendController extends Controller
|
|||
|
||||
list($collection, $parent) = CollectionMapper::getCollectionsByPath($path);
|
||||
|
||||
$view->addData('parent', $parent);
|
||||
$view->addData('collections', $collection);
|
||||
$view->addData('path', $path);
|
||||
$view->addData('reports', $templates);
|
||||
$view->addData('account', $this->app->accountManager->get($request->header->account));
|
||||
$view->data['parent'] = $parent;
|
||||
$view->data['collections'] = $collection;
|
||||
$view->data['path'] = $path;
|
||||
$view->data['reports'] = $templates;
|
||||
$view->data['account'] = $this->app->accountManager->get($request->header->account);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -93,11 +93,11 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Helper/Theme/Backend/helper-template-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response));
|
||||
$view->addData('media-upload', new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response);
|
||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
$view->data['editor'] = $editor;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -119,11 +119,11 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Helper/Theme/Backend/helper-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response));
|
||||
$view->addData('media-upload', new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response);
|
||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
$view->data['editor'] = $editor;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -220,15 +220,15 @@ final class BackendController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('report', $report);
|
||||
$view->addData('rcoll', $rcoll);
|
||||
$view->data['report'] = $report;
|
||||
$view->data['rcoll'] = $rcoll;
|
||||
}
|
||||
|
||||
$view->addData('unit', $this->app->unitId);
|
||||
$view->addData('tcoll', $tcoll);
|
||||
$view->addData('lang', $request->getData('lang') ?? $request->header->l11n->language);
|
||||
$view->addData('template', $template);
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response));
|
||||
$view->data['unit'] = $this->app->unitId;
|
||||
$view->data['tcoll'] = $tcoll;
|
||||
$view->data['lang'] = $request->getData('lang') ?? $request->header->l11n->language;
|
||||
$view->data['template'] = $template;
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Uri\UriFactory;
|
|||
*/
|
||||
$templateList = \Modules\Helper\Models\TemplateMapper::getAll()->execute();
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
|
|||
|
|
@ -18,21 +18,21 @@ use phpOMS\Uri\UriFactory;
|
|||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Helper\Models\Template[] $templates
|
||||
*/
|
||||
$templates = $this->getData('reports');
|
||||
$templates = $this->data['reports'];
|
||||
|
||||
/** @var \Modules\Admin\Models\Account $account */
|
||||
$account = $this->getData('account');
|
||||
$account = $this->data['account'];
|
||||
|
||||
$accountDir = $account->id . ' ' . $account->login;
|
||||
|
||||
/** @var \Modules\Media\Models\Collection[] */
|
||||
$collections = $this->getData('collections');
|
||||
$collections = $this->data['collections'];
|
||||
$mediaPath = \urldecode($this->getData('path') ?? '/');
|
||||
|
||||
$previous = empty($templates) ? '{/base}/helper/list' : '{/base}/helper/list?{?}&id=' . \reset($templates)->id . '&ptype=p';
|
||||
$next = empty($templates) ? '{/base}/helper/list' : 'helper/list?{?}&id=' . \end($templates)->id . '&ptype=n';
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
|
|
|
|||
|
|
@ -20,19 +20,19 @@ use phpOMS\Uri\UriFactory;
|
|||
*/
|
||||
|
||||
/** @var \Modules\Media\Models\Collection $tcoll */
|
||||
$tcoll = $this->getData('tcoll');
|
||||
$tcoll = $this->data['tcoll'];
|
||||
|
||||
/** @var \Modules\Media\Models\Collection $rcoll */
|
||||
$rcoll = $this->getData('rcoll');
|
||||
$rcoll = $this->data['rcoll'];
|
||||
|
||||
/** @var string $cLang */
|
||||
$cLang = $this->getData('lang');
|
||||
$cLang = $this->data['lang'];
|
||||
|
||||
/** @var \Modules\Helper\Models\Template $template */
|
||||
$template = $this->getData('template');
|
||||
$template = $this->data['template'];
|
||||
|
||||
/** @var \Modules\Helper\Models\Report $report */
|
||||
$report = $this->getData('report');
|
||||
$report = $this->data['report'];
|
||||
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
/** @var array<string, array<string, string>> $reportLanguage */
|
||||
|
|
@ -42,12 +42,12 @@ $reportLanguage = isset($tcoll['lang']) ? include __DIR__ . '/../../../../' . \l
|
|||
$lang = $reportLanguage[$cLang] ?? [];
|
||||
$settings = isset($tcoll['cfg']) ? \json_decode(\file_get_contents(__DIR__ . '/../../../../' . \ltrim($tcoll['cfg']->getPath(), '/')), true) : [];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row" style="height: calc(100% - 85px);">
|
||||
<div class="col-xs-12 col-md-9">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<iframe data-form="iUiSettings" data-name="iframeHelper" id="iHelperFrame" src="<?= UriFactory::build('{/api}helper/report/export/?{?}&id=' . $template->id); ?>&u=<?= $this->getData('unit'); ?>" allowfullscreen></iframe>
|
||||
<iframe data-form="iUiSettings" data-name="iframeHelper" id="iHelperFrame" src="<?= UriFactory::build('{/api}helper/report/export/?{?}&id=' . $template->id); ?>&u=<?= $this->data['unit']; ?>" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ use PhpOffice\PhpWord\Style\Language;
|
|||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$tcoll = $this->getData('tcoll');
|
||||
$rcoll = $this->getData('rcoll');
|
||||
$cLang = $this->getData('lang');
|
||||
$template = $this->getData('template');
|
||||
$report = $this->getData('report');
|
||||
$basepath = \rtrim($this->getData('basepath') ?? '', '/');
|
||||
$tcoll = $this->data['tcoll'];
|
||||
$rcoll = $this->data['rcoll'];
|
||||
$cLang = $this->data['lang'];
|
||||
$template = $this->data['template'];
|
||||
$report = $this->data['report'];
|
||||
$basepath = \rtrim($this->data['basepath'] ?? '', '/');
|
||||
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
$reportLanguage = include $basepath . '/' . \ltrim($tcoll['lang']->getPath(), '/');
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ use phpOMS\Autoloader;
|
|||
|
||||
require_once Autoloader::findPaths('Resources\tcpdf\tcpdf')[0];
|
||||
|
||||
$cLang = $this->getData('lang');
|
||||
$cLang = $this->data['lang'];
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
$reportLanguage = include $basepath . '/' . \ltrim($tcoll['lang']->getPath(), '/');
|
||||
$lang = $reportLanguage[$cLang];
|
||||
|
||||
$amount = (float) ($this->request->getData('amount') ?? 10000.0);
|
||||
$duration = (int) ($this->request->getData('duration') ?? 10);
|
||||
$amount = $this->request->getDataFloat('amount') ?? 10000.0;
|
||||
$duration = $this->request->getDataInt('duration') ?? 10;
|
||||
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ $pdf->Rect(0, 0, $pdf->getPageWidth(), 5, 'F');
|
|||
|
||||
$pdf->SetFont('helvetica', '', 32);
|
||||
$pdf->SetTextColor(54, 151, 219);
|
||||
$pdf->Write(0, 'Demo Mailing - ' . $this->request->getData('date') ?? 'Y-m-d', '', 0, 'C', true, 0, false, false, 0);
|
||||
$pdf->Write(0, 'Demo Mailing - ' . $this->request->getDataString('date') ?? 'Y-m-d', '', 0, 'C', true, 0, false, false, 0);
|
||||
|
||||
$pdf->Image(__DIR__ . '/logo.png', $pdf->getPageWidth() / 2 - 60 / 2, 40, 60, 60, 'PNG', '', 'C', true, 300, '', false, false, 0, false, false, false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user