Commit a6fa8af2 authored by jaapjansma's avatar jaapjansma

Added URL in the File Type. So that we can use a URL instead of the file contents.

parent 22cc7ba2
......@@ -4,6 +4,7 @@ Version 1.6 (not yet released)
* Updated user interface for better usability.
* Added validation for minimum length.
* Added title column to default data retrieval criteria.
* Added URL in the File Type. So that we can use a URL instead of the file contents.
Version 1.5.1
=============
......
......@@ -4,26 +4,26 @@
* @author Jaap Jansma (CiviCooP) <jaap.jansma@civicoop.org>
* @license http://www.gnu.org/licenses/agpl-3.0.html
*/
namespace Civi\FormProcessor\Type;
use \Civi\FormProcessor\Type\GenericType;
use \Civi\FormProcessor\Config\Specification;
use \Civi\FormProcessor\Config\SpecificationBag;
use \CRM_FormProcessor_ExtensionUtil as E;
class FileType extends GenericType {
/**
* Get the configuration specification.
*
* The configuration is
*
* The configuration is
* format: a string containing the input format.
* see for valid formats http://nl1.php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters
*
*
* @return SpecificationBag
*/
public function getConfigurationSpecification() {
......@@ -35,7 +35,7 @@
return false;
}
if (!isset($value['id'])) {
if (!isset($value['name']) || !isset($value['mime_type']) || !isset($value['content'])) {
if (!isset($value['name']) || !isset($value['mime_type']) || (!isset($value['content']) && !isset($value['url']))) {
return false;
}
}
......@@ -49,5 +49,5 @@
public function getCrmType() {
return \CRM_Utils_Type::T_BLOB;
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment