Пример #1
0
 public function buildParent()
 {
     if ($this->getModel()->getId() == 1) {
         return 'root';
     }
     $items = Service::renderList();
     return Util\Form::buildDropdown('parentId' . $this->unique, $items, $this->getModel()->getParentId(), false, [$this->getModel()->getId()]);
 }
Пример #2
0
 public function buildModule()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Cms\Module\Data::getList(['id', 'title']);
     $options['where'][] = 'module.status = 1';
     $items = \Rebond\Cms\Module\Data::loadAll($options);
     return Util\Form::buildDropdownList('moduleId' . $this->unique, $items, 'id', 'title', $this->getModel()->getModuleId());
 }
Пример #3
0
 public function buildSkin()
 {
     $skins = Util\File::getFolders(\Rebond\Config::getPath('siteFolder') . '/css/skin');
     $list = [];
     foreach ($skins as $skin) {
         $list[$skin] = $skin;
     }
     return Util\Form::buildDropDown('skin' . $this->unique, $list, $this->getModel()->getSkin());
 }
Пример #4
0
 public function buildFilter()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Cms\Filter\Data::getList(['id', 'title']);
     $options['where'][] = ['filter.module_id = ?', $this->getModel()->getModuleId()];
     $options['order'][] = 'filter.display_order, filter.title';
     $items = \Rebond\Cms\Filter\Data::loadAll($options);
     return Util\Form::buildDropdownList('filterId' . $this->unique, $items, 'id', 'title', $this->getModel()->getFilterId());
 }
Пример #5
0
 public function buildPlayerMatch2()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Own\Bus\PlayerMatch\Data::getList(['id', 'player_id']);
     $options['select'][] = \Own\Bus\Player\Data::getList(['id', 'username'], 'player_match_player');
     $options['join'][] = 'bus_player player_match_player ON player_match_player.id = player_match.player_id';
     $items = \Own\Bus\PlayerMatch\Data::loadAll($options);
     return Util\Form::buildDropdownList('player_match2_id' . $this->unique, $items, 'id', 'player', $this->getModel()->getPlayerMatch2Id());
 }
Пример #6
0
 public function buildMemberships()
 {
     $items = \Own\Bus\Membership\Data::loadAll();
     $memberships = \Own\Bus\PlayerMembership\Data::loadAllByPlayerId($this->getModel()->getId());
     $selectedValues = [];
     foreach ($memberships as $membership) {
         $selectedValues[] = $membership->getMembershipId();
     }
     return Util\Form::buildCheckboxList('membership' . $this->unique, $items, 'id', 'title', $selectedValues);
 }
Пример #7
0
 public function buildCourts()
 {
     $items = \Own\Bus\Court\Data::loadAll();
     $courts = \Own\Bus\MembershipCourt\Data::loadAllByMembershipId($this->getModel()->getId());
     $selectedValues = [];
     foreach ($courts as $court) {
         $selectedValues[] = $court->getCourtId();
     }
     return Util\Form::buildCheckboxList('court' . $this->unique, $items, 'id', 'title', $selectedValues);
 }
Пример #8
0
 public function buildParent()
 {
     if ($this->getModel()->getId() == 1) {
         return '<span class="input">' . Util\Lang::lang('home') . '</span>';
     }
     $items = Service::renderList();
     $disabled = [];
     $disabled[] = $this->getModel()->getId();
     return Util\Form::buildDropdown('parentId' . $this->unique, $items, $this->getModel()->getParentId(), true, $disabled);
 }
Пример #9
0
 public function buildRoles()
 {
     $items = \Rebond\Core\Role\Data::loadAll();
     $roles = \Rebond\Core\UserRole\Data::loadAllByUserId($this->getModel()->getId());
     $selectedValues = [];
     if (isset($roles) && count($roles)) {
         foreach ($roles as $role) {
             $selectedValues[] = $role->getRoleId();
         }
     }
     return Util\Form::buildCheckboxList('role' . $this->unique, $items, 'id', 'title', $selectedValues);
 }
Пример #10
0
 public function buildPermissions()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Core\Permission\Data::getList(['id', 'title']);
     $options['where'][] = 'permission.status IN (0,1)';
     $options['order'][] = 'permission.title';
     $items = \Rebond\Core\Permission\Data::loadAll($options);
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Core\RolePermission\Data::getList(['permission_id']);
     $permissions = \Rebond\Core\RolePermission\Data::loadAllByRoleId($this->getModel()->getId());
     $selectedValues = [];
     if (isset($permissions)) {
         foreach ($permissions as $permission) {
             $selectedValues[] = $permission->getPermissionId();
         }
     }
     return Util\Form::buildCheckboxList('permission' . $this->unique, $items, 'id', 'title', $selectedValues);
 }
Пример #11
0
 public function buildStatus()
 {
     return Util\Form::buildDropdown('status' . $this->unique, $this->getModel()->getStatusList(), $this->getModel()->getStatus());
 }
Пример #12
0
 public function buildDisplayOrder()
 {
     return Util\Form::buildField('displayOrder' . $this->unique, $this->displayOrderBuilder, $this->getModel()->getDisplayOrder());
 }
Пример #13
0
 public function req($member)
 {
     $v = $member . 'Validator';
     return Util\Form::isReq($this->{$v});
 }
Пример #14
0
 public function buildFullComponent()
 {
     $items = \Rebond\Cms\Component\Data::loadFullComponents();
     return Util\Form::buildDropdownList('componentId' . $this->unique, $items, 'id', 'title', $this->getModel()->getComponentId(), true);
 }
Пример #15
0
 public function buildType()
 {
     return Util\Form::buildDropdown('type' . $this->unique, $this->getModel()->getTypeList(), $this->getModel()->getType());
 }
Пример #16
0
 public static function renderMastery($class, $mastery, $value, $max, $form = true)
 {
     $tpl = new Util\Template(Util\Template::MODULE, ['bus', 'player']);
     $html = '<div class="r-row">
         <div class="r-col-xs-10 tooltip" title="' . $tpl->render('mastery-' . $mastery) . '"> ' . self::renderProgressBar($class, $mastery, $value, $max) . '</div>
         <div class="r-col-xs-2">';
     if ($form) {
         $html .= '<a href="#" class="button action tooltip" data-mastery="' . $mastery . '" title="">+</a>
             ' . Util\Form::buildField($mastery, 'hidden', $value);
     }
     $html .= '</div></div>';
     return $html;
 }
Пример #17
0
 public function buildPermission()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Core\Permission\Data::getList(['id', 'title']);
     $models = \Rebond\Core\Permission\Data::loadAll($options);
     return Util\Form::buildDropdownList('permissionId' . $this->unique, $models, 'id', 'title', $this->getModel()->getPermissionId(), $this->permissionValidator['foreignKey']);
 }
Пример #18
0
 public function buildVersion()
 {
     return Util\Form::buildDropdown('version' . $this->unique, $this->getModel()->getVersionList(), $this->getModel()->getVersion());
 }
Пример #19
0
 public function buildPaging()
 {
     return Util\Form::buildDropdown('paging' . $this->unique, $this->getModel()->getPagingList(), $this->getModel()->getPaging());
 }
Пример #20
0
 public function buildAvatar()
 {
     return Util\Form::buildField('avatarId' . $this->unique, 'media', $this->getModel()->getUser()->getAvatar());
 }
Пример #21
0
 public function buildDescription()
 {
     return Util\Form::buildField('description' . $this->unique, $this->descriptionBuilder, $this->getModel()->getDescription());
 }