Sindbad~EG File Manager

Current Path : /var/www/html/ch.sumar.com.py/wp-content/plugins/peepso/classes/fields/tests/
Upload File :
Current File : /var/www/html/ch.sumar.com.py/wp-content/plugins/peepso/classes/fields/tests/fieldtestrequired.php

<?php

class PeepSoFieldTestRequired extends PeepSoFieldTestAbstract
{

	public function __construct($value)
	{
		parent::__construct($value);

		$this->admin_label = __('Required', 'peepso-core');
		$this->admin_type = 'checkbox';
	}
	
	public function test()
	{
		$success = TRUE;

		if( !is_array($this->value) && !strlen($this->value) ) {
			$success = FALSE;
		}

		if( is_array($this->value) && !count($this->value) ) {
			$success = FALSE;
		}

		if( FALSE === $success) {
			$this->error = __('This field is required', 'peepso-core');

			return FALSE;
		}

		return TRUE;
	}

}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists