Пример #1
0
 protected function _initTable(&$table, &$data, &$config, $force = false)
 {
     if (!$table->{self::$key}) {
         parent::g_initTable($table, isset($config['params']) ? $config['params'] : $this->params->toArray(), $force);
     }
 }
Пример #2
0
 protected function _initTable_fromSite(&$table, &$data, &$config, $force = false)
 {
     if (!$table->{self::$key}) {
         parent::g_initTable($table, isset($config['params']) ? $config['params'] : $this->params->toArray(), $force);
     } else {
         if (!JFactory::getUser()->authorise('core.admin', 'com_users')) {
             unset($data['block']);
         }
     }
 }
Пример #3
0
 protected function _initTable(&$table, &$data, &$config, $force = false)
 {
     $user = JFactory::getUser();
     if (!$table->{self::$key}) {
         parent::g_initTable($table, isset($config['params']) ? $config['params'] : $this->params->toArray(), $force);
         $table->{self::$author} = $table->{self::$author} ? $table->{self::$author} : JCck::getConfig_Param('integration_user_default_author', 42);
         if (isset($config['params'])) {
             $table->access = isset($config['params']['base_default-access']) ? $config['params']['base_default-access'] : 1;
             if (!isset($data['parent_id'])) {
                 $data['parent_id'] = isset($config['params']['base_default-parent_id']) ? $config['params']['base_default-parent_id'] : 1;
             }
         } else {
             $table->access = $this->params->get('base_default-access', 1);
             if (!isset($data['parent_id'])) {
                 $data['parent_id'] = $this->params->get('base_default-parent_id', 1);
             }
         }
         if ($user->get('id') > 0 && @$user->guest != 1 && !isset($data[self::$author]) && !$force) {
             $data[self::$author] = $user->get('id');
         }
     } else {
         $data[self::$key] = $table->{self::$key};
     }
     if ($table->parent_id != $data['parent_id'] || $data['id'] == 0) {
         $table->setLocation($data['parent_id'], 'last-child');
     }
     $table->{self::$custom} = '';
 }
 protected function _initTable(&$table, &$data, &$config, $force = false)
 {
     $user = JFactory::getUser();
     if (!$table->{self::$key}) {
         $table->access = '';
         parent::g_initTable($table, isset($config['params']) ? $config['params'] : $this->params->toArray(), $force);
         $table->{self::$author} = $table->{self::$author} ? $table->{self::$author} : JCck::getConfig_Param('integration_user_default_author', 42);
         if ($user->get('id') > 0 && @$user->guest != 1 && !isset($data[self::$author]) && !$force) {
             $data[self::$author] = $user->get('id');
         }
     }
     $table->{self::$custom} = '';
 }