/** * Should the validation be run - based on whether in admin/front end * * @return boolean */ protected function shouldValidateIn() { $params = $this->getParams(); $name = $this->elementModel->getFullName(); $app = JFactory::getApplication(); $in = $params->get('validate_in', 'both'); $admin = $app->isAdmin(); if ($in === 'both') { return true; } if ($admin && $in === 'back') { return true; } if (!$admin && $in === 'front') { return true; } return false; }