Пример #1
0
 /**
  *
  */
 protected function createGroup($groupOptions = array())
 {
     require_once WCF_DIR . 'lib/util/StringUtil.class.php';
     require_once WCF_DIR . 'lib/data/user/group/GroupEditor.class.php';
     $group = GroupEditor::create($groupName = StringUtil::getRandomID(), $groupOptions);
     // WCF does not clear instance caches... so rebuild
     $classFile = WCF_DIR . 'lib/system/cache/CacheBuilderGroups.class.php';
     WCF::getCache()->rebuild(array('cache' => 'groups', 'file' => WCF_DIR . 'cache/cache.groups.php', 'className' => StringUtil::getClassName($classFile), 'classFile' => $classFile));
     return $group;
 }
Пример #2
0
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // create
     require_once WCF_DIR . 'lib/data/user/group/GroupEditor.class.php';
     $this->group = GroupEditor::create($this->groupName, $this->activeOptions, $this->additionalFields);
     $this->saved();
     // show empty add form
     WCF::getTPL()->assign(array('success' => true, 'newGroup' => $this->group));
     // reset values
     $this->groupName = '';
     foreach ($this->activeOptions as $key => $option) {
         unset($this->activeOptions[$key]['optionValue']);
     }
 }