3if (!defined(
'XOOPS_ROOT_PATH')) {
7require_once XOOPS_ROOT_PATH .
'/core/XCube_ActionForm.class.php';
8require_once XOOPS_MODULE_PATH .
'/legacy/class/Legacy_Validator.class.php';
12 public $mOldFileName =
null;
13 public $_mIsNew =
null;
14 public $mFormFile =
null;
15 public $_allowExtensions = [
'tar',
'tar.gz',
'tgz',
'gz',
'zip'];
19 return 'module.user.AvatarUploadForm.TOKEN';
33 $this->mFieldProperties[
'upload']->setDependsByArray([
'required']);
34 $this->mFieldProperties[
'upload']->addMessage(
'required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_AVATAR_UPLOAD_FILE);
37 public function validateUpload()
39 $formFile = $this->
get(
'upload');
40 if (
null != $formFile) {
42 foreach ($this->_allowExtensions as $ext) {
43 $flag |= preg_match(
'/' . str_replace(
'.',
"\.", $ext) .
'$/', $formFile->getFileName());
[Abstract] Used for validating member property values of XCube_ActionForm.
Represents the special property which handles uploaded file.