Example #1
0
 /**
  * Adds the sitemap active checkbox
  */
 private function AddSitemapActiveField()
 {
     $name = 'SitemapActive';
     $field = new Checkbox($name);
     if (!$this->site->Exists() || $this->site->GetSitemapActive()) {
         $field->SetChecked();
     }
     $this->AddField($field);
 }
 /**
  * Renders a specific checkbox
  * @param string $name
  * @return string
  */
 protected function RenderCheckbox($name)
 {
     $checkbox = new Checkbox($this->namePrefix . $name);
     $class = new \ReflectionClass($this);
     $checkbox->SetLabel(Trans('Core.' . $class->getShortName() . '.' . $name));
     if ($this->Value($name)) {
         $checkbox->SetChecked();
     }
     $field = new CheckboxField($checkbox);
     return $field->Render();
 }
 private function AddGroupCheckBoxes()
 {
     $this->currentGroups = array();
     $this->groupCheckBoxes = new FieldColumnizer($this);
     foreach ($this->groups as $group) {
         $name = 'Usergroup_' . $group->GetID();
         $cb = new Checkbox($name, $group->GetID());
         if ($this->HasGroup($group)) {
             $this->currentGroups[] = $group;
             $cb->SetChecked();
         }
         $this->AddField($cb, false, $group->GetName());
         $this->groupCheckBoxes->AddField($name);
     }
 }
Example #4
0
 private function AddIsAdminField()
 {
     $name = 'IsAdmin';
     $field = new Checkbox($name, '1', $this->user->GetIsAdmin());
     if (!$this->CanChangeIsAdmin()) {
         $field->SetHtmlAttribute('disabled', 'disabled');
     }
     $this->AddField($field);
 }
Example #5
0
 function __construct(Checkbox $field)
 {
     $this->field = $field;
     $this->attribs = $field->GetHtmlAttributes();
 }