public function render()
 {
     $htmlString = [];
     $args = $this->arguments;
     $title = $args['title'];
     $type = $args['type'];
     $target = $args['target'];
     /** @var Factory $permissionFactory */
     $permissionFactory = app('xe.permission');
     $permission = $permissionFactory->make($type, $target);
     $actions = $permission->getActions();
     $registered = $permission->getRegistered();
     $groups = app('xe.member.groups')->all();
     $settings = [];
     $content = [];
     foreach ($actions as $action) {
         $pureGrant = $registered->pure($action);
         $mode = "manual";
         $content[] = uio('permission', ['mode' => $mode, 'title' => $action, 'grant' => $this->getGrant($registered, $action), 'groups' => $groups])->render();
     }
     $content = implode('<hr>', $content);
     $settings[] = $this->generateBox($title, $content);
     $this->template = implode(PHP_EOL, $settings);
     return parent::render();
 }
 public function render()
 {
     $args = $this->arguments;
     $permissionInfo = $args['permission'];
     $title = $permissionInfo['title'];
     /** @var Permission $permission */
     $permission = $permissionInfo['permission'];
     // permission is collection of grant
     // grant is bundle of assigned
     // $grant = [
     //    'rating' => $visibleGrant['rating'],
     //    'group' => UserGroup::whereIn('id', $visibleGrant['group'])->get()->toArray(),
     //    'user' => User::whereIn('id', $visibleGrant['user'])->get()->toArray(),
     //    'except' => User::whereIn('id', $visibleGrant['except'])->get()->toArray(),
     // ];
     $groups = app('xe.user.groups')->all();
     $settings = [];
     $content = uio('permission', ['mode' => 'manual', 'title' => 'access', 'grant' => $this->getGrant($permission['access']), 'groups' => $groups]);
     $settings[] = $this->generateBox($title, $content);
     $this->template = implode(PHP_EOL, $settings);
     //        XeFrontend::js('/assets/core/permission/Permission.js')->unload();
     //        XeFrontend::js([
     //
     //            '/assets/core/permission/SettingsPermission.js',
     //            '/assets/core/permission/PermissionTag.js'
     //
     //        ])->load();
     return parent::render();
 }
Exemple #3
0
 private function appendFields($form, $inputs, $values)
 {
     foreach ($inputs as $name => $arg) {
         preg_match("/^([^[]+)\\[(.+)\\]\$/", $name, $m);
         if (!empty($m)) {
             $seq = (int) $m[2];
             $value = array_get($values, "{$m['1']}.{$seq}");
             $name = $m[1] . '[]';
         } else {
             $value = array_get($values, $name);
         }
         $arg['name'] = $name;
         $type = array_get($arg, '_type');
         unset($arg['_type']);
         array_set($arg, 'value', $value);
         $uio = 'form' . ucfirst($type);
         $input = uio($uio, $arg);
         $field = $this->wrapInput($name, $input);
         $sectionName = array_get($arg, '_section');
         unset($arg['_section']);
         $style = array_get($this->arguments, 'type', 'panel');
         $section = $this->getSection($form, $sectionName, $style);
         $field->appendTo($section);
     }
 }
 public function render()
 {
     $this->loadAssets();
     $member = $this->data['member'];
     if ($this->data['grant']['modify']) {
         $this->data['profileImageHtml'] = uio('xpressengine@profileImage', ['name' => 'profileImgFile', 'image' => $member->getProfileImage(), 'width' => 120, 'height' => 120]);
         $this->data['bgImageHtml'] = uio('xpressengine@profileBgImage', ['name' => 'bgImgFile', 'image' => $member->getProfileImage(), 'width' => 2048, 'height' => 2048]);
     }
     return parent::render();
 }
 public function render()
 {
     $args = $this->arguments;
     $value = array_get($args, 'value');
     if ($value !== null) {
         array_set($args, 'langKey', $value);
     }
     $label = array_get($args, 'label', '');
     if ($label) {
         $label = '<label>' . $label . '</label>';
     }
     $content = uio('langTextArea', $args);
     return sprintf('
         <div class="form-group">
             %s
             %s
         </div>
     ', $label, $content);
 }
 /**
  * 위젯 설정 페이지에 출력할 폼을 출력한다.
  *
  * @param array $args 설정값
  *
  * @return string
  */
 public function renderSetting(array $args = [])
 {
     return uio('formTextarea', ['id' => '', 'name' => 'content', 'label' => 'HTML', 'value' => array_get($args, 'content')]);
 }
 /**
  * info.php에 등록돼 있는 setting 폼 리스트를 가져와 form을 생성하여 반환한다.
  *
  * @param array        $info setting form info
  * @param ConfigEntity $old  old config data
  *
  * @return string
  */
 protected function makeConfigView(array $info, ConfigEntity $old)
 {
     return uio('form', ['class' => $this->getId(), 'inputs' => $info, 'value' => $old]);
 }
 /**
  * info.php에 등록돼 있는 setting 폼 리스트를 가져와 form을 생성하여 반환한다.
  *
  * @param array $info setting form info
  * @param array $old  old config data
  *
  * @return string
  */
 protected function makeConfigView(array $info, $old)
 {
     return uio('form', ['type' => 'fieldset', 'class' => $this->getId(), 'inputs' => $info, 'value' => $old]);
 }
 /**
  * getCodeCreationForm
  *
  * @param array $args
  *
  * @return mixed
  */
 public function renderSetting(array $args = [])
 {
     return uio('form', ['fields' => ['limit' => ['_type' => 'text', 'label' => '목록수', 'description' => '파일수가 많은 파일형식(확장자) 순으로 출력됩니다. 출력할 파일형식의 목록수를 지정하십시오.']], 'value' => $args, 'type' => 'fieldset']);
 }