Ejemplo n.º 1
0
 function onGroupCreate($group)
 {
     if (!self::kunenaOnline()) {
         return;
     }
     if (JRequest::getInt('kunenaforum', 0) < 0) {
         return;
     }
     $catid = self::getForumCategory($group->categoryid);
     if ($catid === false) {
         return;
     }
     $category = new KunenaForumCategory();
     $category->set('parent_id', $catid);
     $category->set('name', $group->name);
     $category->set('description', $group->description);
     $category->set('headerdesc', $group->description);
     $category->set('accesstype', 'jomsocial');
     $category->set('access', $group->id);
     $category->set('published', $group->published);
     $success = $category->save();
     if (!$success) {
         JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_COMMUNITY_KUNENAGROUPS_GROUP_CREATE_FAILED', 'notice'));
         return;
     }
     $category->setModerator($group->ownerid, 1);
 }
Ejemplo n.º 2
0
	/**
	 * sets the forum access based off category or group object access
	 *
	 * @param \CB\Plugin\GroupJive\Table\CategoryTable|GroupTable $row
	 */
	public function access( $row )
	{
		if ( $row instanceof \CB\Plugin\GroupJive\Table\CategoryTable ) {
			$this->_category->set( 'accesstype', 'joomla.level' );
			$this->_category->set( 'access', $row->get( 'access' ) );
		} elseif ( $row instanceof GroupTable ) {
			$this->_category->set( 'accesstype', 'communitybuilder' );
			$this->_category->set( 'access', $row->get( 'id' ) );
		}
	}