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()]); }
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()); }
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()); }
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()); }
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()); }
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); }
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); }
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); }
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); }
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); }
public function buildStatus() { return Util\Form::buildDropdown('status' . $this->unique, $this->getModel()->getStatusList(), $this->getModel()->getStatus()); }
public function buildDisplayOrder() { return Util\Form::buildField('displayOrder' . $this->unique, $this->displayOrderBuilder, $this->getModel()->getDisplayOrder()); }
public function req($member) { $v = $member . 'Validator'; return Util\Form::isReq($this->{$v}); }
public function buildFullComponent() { $items = \Rebond\Cms\Component\Data::loadFullComponents(); return Util\Form::buildDropdownList('componentId' . $this->unique, $items, 'id', 'title', $this->getModel()->getComponentId(), true); }
public function buildType() { return Util\Form::buildDropdown('type' . $this->unique, $this->getModel()->getTypeList(), $this->getModel()->getType()); }
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; }
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']); }
public function buildVersion() { return Util\Form::buildDropdown('version' . $this->unique, $this->getModel()->getVersionList(), $this->getModel()->getVersion()); }
public function buildPaging() { return Util\Form::buildDropdown('paging' . $this->unique, $this->getModel()->getPagingList(), $this->getModel()->getPaging()); }
public function buildAvatar() { return Util\Form::buildField('avatarId' . $this->unique, 'media', $this->getModel()->getUser()->getAvatar()); }
public function buildDescription() { return Util\Form::buildField('description' . $this->unique, $this->descriptionBuilder, $this->getModel()->getDescription()); }