Example #1
0
 /**
  * Creates the category with the help of the interface class
  *
  * @param   array $user Holds the user data
  * @return  void
  * @since   1.5
  */
 protected function _createCategory($user)
 {
     // Get the interface
     require_once JPATH_ROOT . '/components/com_joomgallery/interface.php';
     $jinterface = new JoomInterface();
     // Create the category
     switch ($this->params->get('categoryname')) {
         case 0:
             if ($jinterface->getJConfig('jg_realname')) {
                 $category->name = $user['name'];
             } else {
                 $category->name = $user['username'];
             }
             break;
         case 1:
             $category->name = $user['name'];
             break;
         default:
             $category->name = $user['username'];
             break;
     }
     $category->owner = $user['id'];
     if ($parent = $this->params->get('parent')) {
         $category->parent_id = intval($parent);
     }
     if ($access = $this->params->get('access')) {
         $category->access = $access;
     }
     $category->published = $this->params->get('published');
     $jinterface->createCategory($category);
 }