diff --git a/src/CoreFields/BooleanField.php b/src/CoreFields/BooleanField.php
index 4ee8962..2a8b55d 100644
--- a/src/CoreFields/BooleanField.php
+++ b/src/CoreFields/BooleanField.php
@@ -6,6 +6,8 @@
namespace PhangoApp\PhaModels\CoreFields;
+use PhangoApp\PhaI18n\I18n;
+
class BooleanField extends PhangoField {
public $size=1;
@@ -63,13 +65,13 @@ class BooleanField extends PhangoField {
{
default:
- return PhangoVar::$l_['common']->lang('no', 'No');
+ return I18n::lang('common', 'no', 'No');
break;
case 1:
- return PhangoVar::$l_['common']->lang('yes', 'Yes');
+ return I18n::lang('common', 'yes', 'Yes');
break;
@@ -81,7 +83,7 @@ class BooleanField extends PhangoField {
function get_parameters_default()
{
- $arr_values=array($this->default_value, PhangoVar::$l_['common']->lang('no', 'No'), 0, PhangoVar::$l_['common']->lang('yes', 'Yes'), 1);;
+ $arr_values=array($this->default_value, I18n::lang('common', 'no', 'No'), 0, I18n::lang('common', 'yes', 'Yes'), 1);;
return array($this->name_component, '', $arr_values);
diff --git a/src/CoreFields/ChoiceField.php b/src/CoreFields/ChoiceField.php
index 964530e..e48391d 100644
--- a/src/CoreFields/ChoiceField.php
+++ b/src/CoreFields/ChoiceField.php
@@ -2,6 +2,7 @@
namespace PhangoApp\PhaModels\CoreFields;
use PhangoApp\PhaUtils\Utils;
+use PhangoApp\PhaI18n\I18n;
/**
*
diff --git a/src/CoreFields/FileField.php b/src/CoreFields/FileField.php
index 0dfd9c4..670e434 100644
--- a/src/CoreFields/FileField.php
+++ b/src/CoreFields/FileField.php
@@ -73,7 +73,7 @@ class FileField extends PhangoField {
else
{
- $this->std_error=PhangoVar::$l_['common']->lang('error_cannot_upload_this_file_to_the_server', 'Error: Cannot upload this file to the server');
+ $this->std_error=I18n::lang('common', 'error_cannot_upload_this_file_to_the_server', 'Error: Cannot upload this file to the server');
return '';
@@ -92,7 +92,7 @@ class FileField extends PhangoField {
else
{
- $this->std_error=PhangoVar::$l_['error_model']->lang('check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
+ $this->std_error=I18n::lang('error_model', 'check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
return '';
@@ -149,7 +149,7 @@ class FileField extends PhangoField {
if(!unlink($this->path.'/'.$file_name))
{
- $this->std_error=PhangoVar::$l_['common']->lang('cannot_delete_file', 'Cannot delete the file');
+ $this->std_error=I18n::lang('common', 'cannot_delete_file', 'Cannot delete the file');
}
diff --git a/src/CoreFields/ForeignKeyField.php b/src/CoreFields/ForeignKeyField.php
index e534855..2661d3d 100644
--- a/src/CoreFields/ForeignKeyField.php
+++ b/src/CoreFields/ForeignKeyField.php
@@ -1,6 +1,7 @@
lang('any_option_chosen', 'Any option chosen'), '');
+ $arr_values=array('', I18n::lang('common', 'any_option_chosen', 'Any option chosen'), '');
return array($this->name_component, '', $arr_values);
diff --git a/src/CoreFields/ImageField.php b/src/CoreFields/ImageField.php
index ce56a3a..a08f8be 100644
--- a/src/CoreFields/ImageField.php
+++ b/src/CoreFields/ImageField.php
@@ -2,6 +2,7 @@
namespace PhangoApp\PhaModels\CoreFields;
use PhangoApp\PhaUtils\Utils;
+use PhangoApp\PhaI18n\I18n;
/**
* Imagefield is a field for upload images
@@ -112,7 +113,7 @@ class ImageField extends PhangoField {
if($arr_image[0]<$this->min_size[0] || $arr_image[1]<$this->min_size[1])
{
- $this->std_error=PhangoVar::$l_['common']->lang('image_size_is_not_correct', 'Image size is wrong').'
'.PhangoVar::$l_['common']->lang('min_size', 'Minimal size').': '.$this->min_size[0].'x'.$this->min_size[1];
+ $this->std_error=I18n::lang('common', 'image_size_is_not_correct', 'Image size is wrong').'
'.I18n::lang('common', 'min_size', 'Minimal size').': '.$this->min_size[0].'x'.$this->min_size[1];
$this->value='';
return '';
@@ -122,17 +123,6 @@ class ImageField extends PhangoField {
}
- /*//Check if exists a image with same name.
-
- if(file_exists($this->path.'/'.$_FILES[$file]['name']))
- {
-
- $this->std_error=PhangoVar::$l_['common']->lang('a_image_with_same_name_exists', 'There is an image with the same name');
-
- return $image;
-
- }*/
-
//Delete other image if exists..
if($image!='')
@@ -310,7 +300,7 @@ class ImageField extends PhangoField {
else
{
- $this->std_error=PhangoVar::$l_['common']->lang('error_cannot_upload_this_image_to_the_server', 'Error: Cannot upload this image to the server');
+ $this->std_error=I18n::lang('common', 'error_cannot_upload_this_image_to_the_server', 'Error: Cannot upload this image to the server');
if(DEBUG==1)
{
@@ -328,7 +318,7 @@ class ImageField extends PhangoField {
else
{
- $this->std_error.=PhangoVar::$l_['error_model']->lang('img_format_error', 'Img format error, only accept gif, jpg and png formats');
+ $this->std_error.=I18n::lang('error_model', 'img_format_error', 'Img format error, only accept gif, jpg and png formats');
}
@@ -356,7 +346,7 @@ class ImageField extends PhangoField {
else
{
- $this->std_error=PhangoVar::$l_['error_model']->lang('check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
+ $this->std_error=I18n::lang('error_model', 'check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
return '';
}
@@ -367,7 +357,7 @@ class ImageField extends PhangoField {
else
{
- $this->std_error=PhangoVar::$l_['error_model']->lang('check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
+ $this->std_error=I18n::lang('error_model', 'check_error_enctype_for_upload_file', 'Please, check enctype form of file form');
}
@@ -418,19 +408,19 @@ class ImageField extends PhangoField {
if(!unlink($this->path.'/'.$key.'_'.$image_name))
{
- $this->std_error.=PhangoVar::$l_['common']->lang('cannot_delete_image', 'Cannot delete the image').': '.$key.'_'.$image_name;
+ $this->std_error.=I18n::lang('common', 'cannot_delete_image', 'Cannot delete the image').': '.$key.'_'.$image_name;
}
}
- $this->std_error.=PhangoVar::$l_['common']->lang('cannot_delete_image', 'Cannot delete the image').': '.$image_name;
+ $this->std_error.=I18n::lang('common', 'cannot_delete_image', 'Cannot delete the image').': '.$image_name;
}
else
{
- $this->std_error.=PhangoVar::$l_['common']->lang('cannot_delete_image', 'Cannot delete the image').': '.$image_name;
+ $this->std_error.=I18n::lang('common', 'cannot_delete_image', 'Cannot delete the image').': '.$image_name;
}
@@ -438,7 +428,7 @@ class ImageField extends PhangoField {
else
{
- $this->std_error.=PhangoVar::$l_['common']->lang('cannot_delete_image', 'Cannot delete the image').': '.$image_name;
+ $this->std_error.=I18n::lang('common', 'cannot_delete_image', 'Cannot delete the image').': '.$image_name;
}
diff --git a/src/CoreFields/ParentField.php b/src/CoreFields/ParentField.php
index ee9773e..c5a664b 100644
--- a/src/CoreFields/ParentField.php
+++ b/src/CoreFields/ParentField.php
@@ -1,6 +1,7 @@
lang('any_option_chosen', 'Any option chosen'), '');
+ $arr_values=array('', I18n::lang('common', 'any_option_chosen', 'Any option chosen'), '');
return array($this->name_component, '', $arr_values);