classes/hypeJunction/Prototyper/Plugin.php
public function init() {

		elgg_extend_view('css/elgg', 'css/framework/prototyper/stylesheet');
		elgg_extend_view('css/admin', 'css/framework/prototyper/stylesheet');

		elgg_register_css('jquery.cropper', '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.css');

		elgg_extend_view('prototyper/input/before', 'prototyper/elements/js');

		if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) {
			// Prototyper interface
			elgg_register_simplecache_view('js/framework/legacy/prototyper');
			elgg_register_js('prototyper', elgg_get_simplecache_url('js', 'framework/legacy/prototyper'), 'footer');

			elgg_register_js('jquery.cropper', '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.js', 'footer');

			elgg_register_simplecache_view('js/framework/legacy/prototyper_cropper');
			elgg_register_js('prototyper_cropper', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_cropper'), 'footer');
		} else {
			elgg_define_js('cropper', array(
				'src' => '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.js',
				'deps' => array('jquery'),
			));
		}

		elgg_extend_view('input/file', 'prototyper/ui/cropper');

		hypePrototyper()->config->registerType('title', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'title',
			'input_view' => 'input/text',
			'output_view' => 'output/text',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));
		hypePrototyper()->config->registerType('name', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'name',
			'input_view' => 'input/text',
			'output_view' => 'output/text',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('description', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'description',
			'input_view' => 'input/longtext',
			'output_view' => 'output/longtext',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('access', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'access_id',
			'value' => get_default_access(),
			'input_view' => 'input/access',
			'output_view' => 'output/access',
			'value_type' => 'int',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('text', Elements\MetadataField::CLASSNAME);
		hypePrototyper()->config->registerType('text', Elements\AnnotationField::CLASSNAME);

		hypePrototyper()->config->registerType('plaintext', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'text',
		));
		hypePrototyper()->config->registerType('longtext', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'text',
		));
		hypePrototyper()->config->registerType('hidden', Elements\MetadataField::CLASSNAME, array(
			'multiple' => false,
			'required' => false,
			'show_access' => false,
			'label' => false,
			'help' => false,
			'ui_sections' => array(
				'required' => false,
				'access' => false,
				'multiple' => false,
				'label' => false,
				'help' => false,
		)));

		hypePrototyper()->config->registerType('select', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'optionsvalues' => true,
			)
		));

		hypePrototyper()->config->registerType('access', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'optionsvalues' => false,
			)
		));

		hypePrototyper()->config->registerType('checkboxes', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
				'optionsvalues' => true,
			)
		));

		hypePrototyper()->config->registerType('radio', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
				'optionsvalues' => true,
		)));

		hypePrototyper()->config->registerType('tags', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
		)));

		hypePrototyper()->config->registerType('date', Elements\MetadataField::CLASSNAME, array(
			'timestamp' => false,
		));

		hypePrototyper()->config->registerType('time', Elements\MetadataField::CLASSNAME, array(
			'input_view' => 'input/prototyper/time',
			'format' => 'g:ia',
			'interval' => 900, // 15min
		));

		hypePrototyper()->config->registerType('email', Elements\MetadataField::CLASSNAME);

		hypePrototyper()->config->registerType('url', Elements\MetadataField::CLASSNAME);

		hypePrototyper()->config->registerType('stars', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'number',
			'ui_sections' => array(
				'validation' => false,
			)
		));
		hypePrototyper()->config->registerType('stars', Elements\AnnotationField::CLASSNAME, array(
			'value_type' => 'number',
			'ui_sections' => array(
				'validation' => false,
			)
		));

		hypePrototyper()->config->registerType('userpicker', Elements\RelationshipField::CLASSNAME, array(
			'value_type' => 'guid',
			'inverse_relationship' => false,
			'bilateral' => false,
			'multiple' => false,
			'show_access' => false,
			'ui_sections' => array(
				'access' => false,
				'multiple' => false,
				'relationship' => true,
			)
		));

		hypePrototyper()->config->registerType('friendspicker', Elements\RelationshipField::CLASSNAME, array(
			'value_type' => 'guid',
			'inverse_relationship' => false,
			'bilateral' => false,
			'multiple' => false,
			'show_access' => false,
			'ui_sections' => array(
				'access' => false,
				'multiple' => false,
				'relationship' => true,
			)
		));

		if (elgg_is_active_plugin('hypeCategories')) {
			hypePrototyper()->config->registerType('category', Elements\CategoryField::CLASSNAME, array(
				'value_type' => 'guid',
				'inverse_relationship' => false,
				'bilateral' => false,
				'multiple' => true,
				'show_access' => false,
				'ui_sections' => array(
					'access' => false,
					'multiple' => true,
					'relationship' => false,
				)
			));
		}

		hypePrototyper()->config->registerType('icon', Elements\IconField::CLASSNAME, array(
			'accept' => 'image/*',
			'value_type' => 'image',
			'multiple' => false,
			'show_access' => false,
			'input_view' => 'input/file',
			'output_view' => 'icon/default',
			'ui_sections' => array(
				'value' => false,
				'access' => false,
				'multiple' => false,
			)
		));

		hypePrototyper()->config->registerType('upload', Elements\UploadField::CLASSNAME, array(
			'multiple' => false,
			'show_access' => false,
			'input_view' => 'input/file',
			'ui_sections' => array(
				'value' => true,
				'access' => false,
				'multiple' => false,
				'validation' => true
			)
		));

		hypePrototyper()->config->registerType('image_upload', Elements\ImageUploadField::CLASSNAME, array(
			'multiple' => false,
			'accept' => 'image/*',
			'value_type' => 'image',
			'show_access' => false,
			'input_view' => 'input/file',
			'validation_rules' => array(
				'type' => 'image',
			),
			'ui_sections' => array(
				'value' => true,
				'access' => false,
				'multiple' => false,
				'validation' => true
			)
		));
	}
public function init() {

		elgg_extend_view('css/elgg', 'css/framework/prototyper/stylesheet');
		elgg_extend_view('css/admin', 'css/framework/prototyper/stylesheet');

		elgg_register_css('jquery.cropper', '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.css');

		elgg_extend_view('prototyper/input/before', 'prototyper/elements/js');

		if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) {
			// Prototyper interface
			elgg_register_simplecache_view('js/framework/legacy/prototyper');
			elgg_register_js('prototyper', elgg_get_simplecache_url('js', 'framework/legacy/prototyper'), 'footer');

			elgg_register_js('jquery.cropper', '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.js', 'footer');

			elgg_register_simplecache_view('js/framework/legacy/prototyper_cropper');
			elgg_register_js('prototyper_cropper', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_cropper'), 'footer');
		} else {
			elgg_define_js('cropper', array(
				'src' => '/mod/hypePrototyper/vendors/jquery.cropper/cropper.min.js',
				'deps' => array('jquery'),
			));
		}

		elgg_extend_view('input/file', 'prototyper/ui/cropper');

		hypePrototyper()->config->registerType('title', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'title',
			'input_view' => 'input/text',
			'output_view' => 'output/text',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));
		hypePrototyper()->config->registerType('name', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'name',
			'input_view' => 'input/text',
			'output_view' => 'output/text',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('description', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'description',
			'input_view' => 'input/longtext',
			'output_view' => 'output/longtext',
			'value_type' => 'text',
			'show_access' => false,
			'multiple' => false,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('access', Elements\AttributeField::CLASSNAME, array(
			'shortname' => 'access_id',
			'value' => get_default_access(),
			'input_view' => 'input/access',
			'output_view' => 'output/access',
			'value_type' => 'int',
			'show_access' => false,
			'multiple' => false,
			'required' => true,
			'ui_sections' => array(
				'multiple' => false,
				'access' => false,
			)
		));

		hypePrototyper()->config->registerType('text', Elements\MetadataField::CLASSNAME);
		hypePrototyper()->config->registerType('text', Elements\AnnotationField::CLASSNAME);

		hypePrototyper()->config->registerType('plaintext', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'text',
		));
		hypePrototyper()->config->registerType('longtext', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'text',
		));
		hypePrototyper()->config->registerType('hidden', Elements\MetadataField::CLASSNAME, array(
			'multiple' => false,
			'required' => false,
			'show_access' => false,
			'label' => false,
			'help' => false,
			'ui_sections' => array(
				'required' => false,
				'access' => false,
				'multiple' => false,
				'label' => false,
				'help' => false,
		)));

		hypePrototyper()->config->registerType('select', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'optionsvalues' => true,
			)
		));

		hypePrototyper()->config->registerType('access', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'optionsvalues' => false,
			)
		));

		hypePrototyper()->config->registerType('checkboxes', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
				'optionsvalues' => true,
			)
		));

		hypePrototyper()->config->registerType('radio', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
				'optionsvalues' => true,
		)));

		hypePrototyper()->config->registerType('tags', Elements\MetadataField::CLASSNAME, array(
			'ui_sections' => array(
				'multiple' => false,
		)));

		hypePrototyper()->config->registerType('date', Elements\MetadataField::CLASSNAME, array(
			'timestamp' => false,
		));

		hypePrototyper()->config->registerType('time', Elements\MetadataField::CLASSNAME, array(
			'input_view' => 'input/prototyper/time',
			'format' => 'g:ia',
			'interval' => 900, // 15min
		));

		hypePrototyper()->config->registerType('email', Elements\MetadataField::CLASSNAME);

		hypePrototyper()->config->registerType('url', Elements\MetadataField::CLASSNAME);

		hypePrototyper()->config->registerType('stars', Elements\MetadataField::CLASSNAME, array(
			'value_type' => 'number',
			'ui_sections' => array(
				'validation' => false,
			)
		));
		hypePrototyper()->config->registerType('stars', Elements\AnnotationField::CLASSNAME, array(
			'value_type' => 'number',
			'ui_sections' => array(
				'validation' => false,
			)
		));

		hypePrototyper()->config->registerType('userpicker', Elements\RelationshipField::CLASSNAME, array(
			'value_type' => 'guid',
			'inverse_relationship' => false,
			'bilateral' => false,
			'multiple' => false,
			'show_access' => false,
			'ui_sections' => array(
				'access' => false,
				'multiple' => false,
				'relationship' => true,
			)
		));

		hypePrototyper()->config->registerType('friendspicker', Elements\RelationshipField::CLASSNAME, array(
			'value_type' => 'guid',
			'inverse_relationship' => false,
			'bilateral' => false,
			'multiple' => false,
			'show_access' => false,
			'ui_sections' => array(
				'access' => false,
				'multiple' => false,
				'relationship' => true,
			)
		));

		if (elgg_is_active_plugin('hypeCategories')) {
			hypePrototyper()->config->registerType('category', Elements\CategoryField::CLASSNAME, array(
				'value_type' => 'guid',
				'inverse_relationship' => false,
				'bilateral' => false,
				'multiple' => true,
				'show_access' => false,
				'ui_sections' => array(
					'access' => false,
					'multiple' => true,
					'relationship' => false,
				)
			));
		}

		hypePrototyper()->config->registerType('icon', Elements\IconField::CLASSNAME, array(
			'accept' => 'image/*',
			'value_type' => 'image',
			'multiple' => false,
			'show_access' => false,
			'input_view' => 'input/file',
			'output_view' => 'icon/default',
			'ui_sections' => array(
				'value' => false,
				'access' => false,
				'multiple' => false,
			)
		));

		hypePrototyper()->config->registerType('upload', Elements\UploadField::CLASSNAME, array(
			'multiple' => false,
			'show_access' => false,
			'input_view' => 'input/file',
			'ui_sections' => array(
				'value' => true,
				'access' => false,
				'multiple' => false,
				'validation' => true
			)
		));

		hypePrototyper()->config->registerType('image_upload', Elements\ImageUploadField::CLASSNAME, array(
			'multiple' => false,
			'accept' => 'image/*',
			'value_type' => 'image',
			'show_access' => false,
			'input_view' => 'input/file',
			'validation_rules' => array(
				'type' => 'image',
			),
			'ui_sections' => array(
				'value' => true,
				'access' => false,
				'multiple' => false,
				'validation' => true
			)
		));
	}
Init callback