mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 17:18:42 +00:00
Continue with getter/setter cleanup
This commit is contained in:
parent
4933832530
commit
4eb1a5b752
|
|
@ -690,10 +690,10 @@ final class ApiController extends Controller
|
|||
->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_ASSETS]->content)
|
||||
->execute();
|
||||
|
||||
$view->setData('defaultTemplates', $defaultTemplates);
|
||||
$view->setData('defaultAssets', $defaultAssets);
|
||||
$view->setData('pdf', $pdf);
|
||||
$view->setData('doc', $doc);
|
||||
$view->data['defaultTemplates'] = $defaultTemplates;
|
||||
$view->data['defaultAssets'] = $defaultAssets;
|
||||
$view->data['pdf'] = $pdf;
|
||||
$view->data['doc'] = $doc;
|
||||
|
||||
$response->set('', $view->render());
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ final class BackendController extends Controller
|
|||
*/
|
||||
public function setUpEditorEditor(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head = $response->get('Content')->head;
|
||||
$head->addAsset(AssetType::JSLATE, 'Modules/Editor/Controller.js', ['type' => 'module']);
|
||||
}
|
||||
|
||||
|
|
@ -71,13 +71,13 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Editor/Theme/Backend/editor-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response);
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
$view->data['editor'] = $editor;
|
||||
|
||||
$tagSelector = new \Modules\Tag\Theme\Backend\Components\TagSelector\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('tagSelector', $tagSelector);
|
||||
$view->data['tagSelector'] = $tagSelector;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -99,18 +99,18 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Editor/Theme/Backend/editor-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response);
|
||||
|
||||
$path = \str_replace('+', ' ', (string) ($request->getData('path') ?? '/'));
|
||||
$docs = EditorDocMapper::getByVirtualPath($path, $request->header->account)->where('tags/title/language', $response->header->l11n->language)->execute();
|
||||
|
||||
list($collection, $parent) = CollectionMapper::getCollectionsByPath($path);
|
||||
|
||||
$view->addData('parent', $parent);
|
||||
$view->addData('collections', $collection);
|
||||
$view->addData('path', $path);
|
||||
$view->addData('docs', $docs);
|
||||
$view->addData('account', $this->app->accountManager->get($request->header->account));
|
||||
$view->data['parent'] = $parent;
|
||||
$view->data['collections'] = $collection;
|
||||
$view->data['path'] = $path;
|
||||
$view->data['docs'] = $docs;
|
||||
$view->data['account'] = $this->app->accountManager->get($request->header->account);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -152,18 +152,17 @@ final class BackendController extends Controller
|
|||
}
|
||||
|
||||
$view->setTemplate('/Modules/Editor/Theme/Backend/editor-single');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
|
||||
$view->addData('doc', $doc);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response);
|
||||
$view->data['doc'] = $doc;
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
$view->data['editor'] = $editor;
|
||||
|
||||
$tagSelector = new \Modules\Tag\Theme\Backend\Components\TagSelector\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('tagSelector', $tagSelector);
|
||||
$view->data['tagSelector'] = $tagSelector;
|
||||
|
||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::DOC, $doc->id)
|
||||
);
|
||||
$view->data['editable'] = $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::DOC, $doc->id);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -198,14 +197,14 @@ final class BackendController extends Controller
|
|||
}
|
||||
|
||||
$view->setTemplate('/Modules/Editor/Theme/Backend/editor-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
|
||||
$view->addData('doc', $doc);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response);
|
||||
$view->data['doc'] = $doc;
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
$view->data['editor'] = $editor;
|
||||
|
||||
$tagSelector = new \Modules\Tag\Theme\Backend\Components\TagSelector\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('tagSelector', $tagSelector);
|
||||
$view->data['tagSelector'] = $tagSelector;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ $doc = $this->getData('doc') ?? new NullEditorDoc();
|
|||
$isNewDoc = $doc->id === 0;
|
||||
|
||||
/** @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-8">
|
||||
|
|
|
|||
|
|
@ -18,21 +18,21 @@ use phpOMS\Uri\UriFactory;
|
|||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Editor\Models\EditorDoc[] $docs
|
||||
*/
|
||||
$docs = $this->getData('docs') ?? [];
|
||||
$docs = $this->data['docs'] ?? [];
|
||||
|
||||
/** @var \Modules\Media\Models\Collection[] */
|
||||
$collections = $this->getData('collections');
|
||||
$collections = $this->data['collections'];
|
||||
$mediaPath = \urldecode($this->getData('path') ?? '/');
|
||||
$account = $this->getData('account');
|
||||
$account = $this->data['account'];
|
||||
|
||||
$accountDir = $account->id . ' ' . $account->login;
|
||||
|
||||
$previous = empty($docs) ? '{/base}/editor/list' : '{/base}/editor/list?{?}&id=' . \reset($docs)->id . '&ptype=p';
|
||||
$next = empty($docs) ? '{/base}/editor/list' : '{/base}/editor/list?{?}&id=' . \end($docs)->id . '&ptype=n';
|
||||
|
||||
$docs = $this->getData('docs');
|
||||
$docs = $this->data['docs'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \Modules\Editor\Models\EditorDoc $doc */
|
||||
$doc = $this->getData('doc');
|
||||
$doc = $this->data['doc'];
|
||||
$files = $doc->getMedia();
|
||||
|
||||
/** @var bool $editable */
|
||||
$editable = $this->getData('editable');
|
||||
$editable = $this->data['editable'];
|
||||
|
||||
/** @var \Modules\Tag\Models\Tag[] $tag */
|
||||
$tags = $doc->getTags();
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user