Author: XE Developers (developers@xpressengine.com)
Inheritance: use trait AttributeTrait, use trait LocatableTrait, use trait MinifyTrait, use trait SortTrait, use trait TargetTrait, use trait EmptyStringTrait
Ejemplo n.º 1
0
 public function getSetting(Request $request, SkinHandler $skinHandler)
 {
     $validation = Validator::make($request->all(), ['skinId' => 'required', 'instanceId' => 'required']);
     if ($validation->fails()) {
         throw new InvalidArgumentException();
     }
     $skinInstanceId = $request->get('instanceId');
     $skinId = $request->get('skinId');
     $skinConfig = $skinHandler->getStore()->getConfigs($skinInstanceId, $skinId);
     $skin = $skinHandler->get($skinId, $skinConfig);
     $view = $skin->renderSetting($skinConfig);
     $section = view('skin.setting', compact('skinId', 'skinInstanceId', 'view'));
     //return XePresenter::makeApi(['view' => (string) $section]);
     return XePresenter::makeApi(['result' => (string) $section, 'XE_ASSET_LOAD' => ['css' => \Xpressengine\Presenter\Html\Tags\CSSFile::getFileList(), 'js' => \Xpressengine\Presenter\Html\Tags\JSFile::getFileList()]]);
 }
Ejemplo n.º 2
0
 /**
  * XE.page() 를 사용하여 호출할 경우 render 된 html 반환
  *
  * @package Xpressengine\Presenter
  *
  * @param string $id           view id
  * @param array  $data         data
  * @param array  $responseData data
  *
  * @return mixed
  */
 function apiRender($id, array $data = [], array $responseData = [])
 {
     XePresenter::htmlRenderPartial();
     XePresenter::setId($id);
     XePresenter::setData($data);
     /** @var Xpressengine\Presenter\Html\HtmlPresenter $presenter */
     $presenter = XePresenter::getPresenter('html');
     $presenter->setData();
     $result = $presenter->renderSkin();
     if ($result instanceof \Illuminate\Contracts\Support\Renderable) {
         $result = $result->render();
     }
     return XePresenter::makeApi(['result' => (string) $result, 'data' => $responseData, 'XE_ASSET_LOAD' => ['css' => \Xpressengine\Presenter\Html\Tags\CSSFile::getFileList(), 'js' => \Xpressengine\Presenter\Html\Tags\JSFile::getFileList()]]);
 }
Ejemplo n.º 3
0
 public function editAdditionField($field)
 {
     $dynamicField = app('xe.dynamicField');
     $fieldType = $dynamicField->get('user', $field);
     $user = $this->user;
     /** @var SkinHandler $skinHandler */
     $skinHandler = app('xe.skin');
     $skin = $skinHandler->getAssigned('member/settings');
     $id = $field;
     $view = $skin->setView('edit-field')->setData(compact('user', 'fieldType', 'id'))->render();
     return XePresenter::makeApi(['result' => (string) $view, 'data' => compact('id'), 'XE_ASSET_LOAD' => ['css' => \Xpressengine\Presenter\Html\Tags\CSSFile::getFileList('head.append'), 'js' => \Xpressengine\Presenter\Html\Tags\JSFile::getFileList('body.append')]]);
 }
 /**
  * @depends testConstructWithTagArray
  */
 public function testMagicMethodForJSFile(FrontendHandler $frontend)
 {
     \Xpressengine\Presenter\Html\Tags\JSFile::init();
     $js = $frontend->js('path/to/file.js');
     $this->assertInstanceOf('\\Xpressengine\\Tests\\Frontend\\TagStub', $js);
 }
Ejemplo n.º 5
0
 /**
  * XE.page() 를 사용하여 호출할 경우 render 된 html 반환
  *
  * @package Xpressengine\Presenter
  *
  * @param string $id           view id
  * @param array  $data         data
  * @param array  $responseData data
  *
  * @return mixed
  */
 function apiRender($id, array $data = [], array $responseData = [])
 {
     XePresenter::htmlRenderPartial();
     XePresenter::setId($id);
     XePresenter::setData($data);
     /** @var Xpressengine\Presenter\Html\HtmlRenderer $renderer */
     $renderer = XePresenter::getRenderer('html');
     $renderer->setData();
     $result = $renderer->renderSkin();
     return XePresenter::makeApi(['result' => (string) $result, 'data' => $responseData, 'XE_ASSET_LOAD' => ['css' => \Xpressengine\Presenter\Html\Tags\CSSFile::getFileList(), 'js' => \Xpressengine\Presenter\Html\Tags\JSFile::getFileList()]]);
 }