module_load_include('inc', 'bf_calendar_field', 'bf_calendar_field.fields');
/**
* bf_calendar_field_views_api()
*
* @return
*/
function bf_calendar_field_views_api()
{
return array('api' => 3, 'path' => drupal_get_path('module', 'bf_calendar_field'));
}
/**
* bf_calendar_field_form_calendar_admin_settings_alter()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function bf_calendar_field_form_calendar_admin_settings_alter(&$form, &$form_state)
{
$calendars = _bf_calendar_field_get_calendars();
$values = array();
foreach ($calendars as $calendar) {
$values[] = $calendar->name. '|'. $calendar->machine_name;
}
$form['bf_calendar'] = array(
'#type' => 'fieldset',
//'#title' => 'qwe',
'calendar_type' => array(
'#title' => t('Calendars'),
'#type' => 'textarea',
'#default_value' => join("\n", $values),
),
);
//$form['#validate'][] = '';
$form['#submit'][] = 'bf_calendar_field_settings_submit';
}
/**
* bf_calendar_field_settings_submit()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function bf_calendar_field_settings_submit(&$form, &$form_state)
{
$values = $form_state['values'];
$calendars = preg_split( '/\r\n|\r|\n/', $values['calendar_type']);
db_delete('calendar_field')
->execute();
foreach($calendars as &$calendar) {
list($name, $machine_name) = explode('|', $calendar);
if (!trim($name)) {
continue;
}
if (!$machine_name) {
$machine_name = preg_replace('@[^a-z0-9_]+@', '_', $name);
}
db_insert('calendar_field')
->fields(array(
'name' => $name,
'machine_name' => $machine_name,
))
->execute();
}
}
/**
* _bf_calendar_field_get_calendars()
*
* @return
*/
function _bf_calendar_field_get_calendars()
{
$calendars = db_select('calendar_field', 'cf')
->fields('cf')
->execute()
->fetchAll();
return $calendars;
}
/**
* bf_calendar_field_permission()
*
* @return void
*/
function bf_calendar_field_permission()
{
$perms = array();
$calendars = _bf_calendar_field_get_calendars();
foreach ($calendars as $calendar) {
$perms[_bf_calendar_field_get_permission_name($calendar->machine_name, 'admin')] = array(
'title' => t('Create/edit events on calendar !calendar', array('!calendar' => $calendar->name)),
'description' => t('Perform administration tasks on calendar !calendar', array('!calendar' => $calendar->name)),
);
$perms[_bf_calendar_field_get_permission_name($calendar->machine_name, 'view')] = array(
'title' => t('View events of calendar !calendar', array('!calendar' => $calendar->name)),
'description' => '',
);
}
return $perms;
}
/**
* _bf_calendar_field_get_permission_name()
*
* @param mixed $machine_name
* @param string $mode
* @return
*/
function _bf_calendar_field_get_permission_name($machine_name, $mode = 'view')
{
return ($mode == 'admin' ? 'administer calendar ' : 'view calendar '). $machine_name;
}
/**
* bf_calendar_field_date_format_types()
*
* @return
*/
function bf_calendar_field_date_format_types()
{
return array(
'bf_calendar_field_year' => t('Calendar - Year'),
'bf_calendar_field_month' => t('Calendar - Month'),
'bf_calendar_field_week' => t('Calendar - Week'),
'bf_calendar_field_day' => t('Calendar - Day'),
);
}
/**
* bf_calendar_field_date_formats()
*
* @return
*/
function bf_calendar_field_date_formats()
{
return FALSE;
}
/**
* bf_calendar_field_process_date_nav_title()
*
* @param mixed $vars
* @return void
*/
function bf_calendar_field_process_date_nav_title(&$vars)
{
switch ($vars['granularity']) {
case 'year':
$vars['format'] = date_format_type_format('bf_calendar_field_year');
break;
case 'month':
$vars['format'] = date_format_type_format('bf_calendar_field_month');
break;
case 'week':
$vars['format'] = date_format_type_format('bf_calendar_field_week');
break;
case 'day':
$vars['format'] = date_format_type_format('bf_calendar_field_day');
break;
}
}
module_load_include('inc', 'bf_gallery', 'bf_gallery.field');
module_load_include('inc', 'bf_gallery', 'bf_gallery.theme');
function bf_gallery_theme()
{
return array(
'bf_gallery' => array(
'render element' => 'element',
),
);
}
function bf_gallery_theme_registry_alter(&$theme_registry)
{
//$theme_registry['image_formatter']['path'] = drupal_get_path('module', 'bf_gallery'). '/theme';
//$theme_registry['image_formatter']['template'] = 'field--image';
}
function _bf_gallery_get_library_path($module = 'galleria')
{
$library_path = libraries_get_path($module);
if (!empty($library_path)) {
// Attempt to use minified version of Galleria plugin.
if ($galleria_path = array_shift(glob($library_path . '/galleria*.min.js'))) {
return $galleria_path;
}
// Otherwise use non-minified version if available.
elseif ($galleria_path = array_shift(glob($library_path . '/galleria*.js'))) {
return $galleria_path;
}
}
return false;
}
/**
* bf_node_import_menu()
*
* @return
*/
function bf_node_import_menu()
{
$items['admin/content/node_import'] = array(
'title' => 'CSV export/import',
'description' => '',
'page callback' => 'drupal_get_form',
'page arguments' => array('bf_node_import_form'),
'access callback' => 'bf_node_import_access',
'access arguments' => array('import nodes'),
'type' => MENU_LOCAL_TASK,
);
return $items;
}
/**
* bf_node_import_permission()
*
* @return
*/
function bf_node_import_permission()
{
return array(
'import nodes' => array(
'title' => t('Import content from CSV'),
'description' => '',
),
);
}
/**
* bf_node_import_access()
*
* @param mixed $permission
* @return
*/
function bf_node_import_access($permission)
{
return user_access($permission);
}
/**
* bf_node_import_form()
*
* @param mixed $form
* @param mixed $form_state
* @return
*/
function bf_node_import_form($form, &$form_state)
{
$nodeTypes = _node_types_build()->types;
if (!isset($form_state['storage']['step'])) {
$form_state['storage']['step'] = 1;
}
$nodeTypeOptions = array();
foreach ($nodeTypes as $nodeType => $Type) {
$nodeTypeOptions[$nodeType] = $Type->name;
}
switch ($form_state['storage']['step']) {
case 1:
default:
$form['set-node-type'] = array(
'#type' => 'fieldset',
'#title' => t('Node type'),
'node-type' => array(
'#type' => 'select',
'#default_value' => variable_get('bf_node_import_limit', 5),
'#attributes' => array(
),
'#options' => $nodeTypeOptions
),
);
$form['actions'] = array(
'#type' => 'actions',
'export' => array(
'#type' => 'submit',
'#name' => 'export',
'#value' => t('Export'),
),
'import' => array(
'#type' => 'submit',
'#name' => 'import',
'#value' => t('Import'),
),
);
break;
case 2:
$op = $form_state['storage']['op'];
switch($op) {
case 'import':
$form = _bf_node_import_form_import_2($form, $form_state);
break;
case 'export':
$form = _bf_node_import_form_export_2($form, $form_state);
break;
}
break;
}
return $form;
}
/**
* _bf_node_import_form_import_2()
*
* @param mixed $form
* @param mixed $form_state
* @return
*/
function _bf_node_import_form_import_2($form, &$form_state)
{
$form['#attributes'] = array('enctype' => "multipart/form-data");
$form['set-import'] = array(
'#type' => 'fieldset',
'#title' => t('Select CSV file'),
'#collapsible' => false,
'csv' => array(
'#type' => 'file',
'#title' => t('File'),
),
);
$form['actions'] = array(
'#type' => 'actions',
'upload' => array(
'#type' => 'submit',
'#name' => 'upload',
'#value' => t('Upload'),
),
);
return $form;
}
/**
* _bf_node_import_form_export_2()
*
* @param mixed $form
* @param mixed $form_state
* @return
*/
function _bf_node_import_form_export_2($form, &$form_state)
{
$nodeType = $form_state['storage']['node-type'];
$defaultFields = array(
'nid' => t('Node ID'),
'title' => t('Title'),
);
$selectableFields = field_info_instances('node', $nodeType);
$options = array();
foreach ($selectableFields as $field => $info) {
$options[$field] = $info['label'];
}
$form['set-fields'] = array(
'#type' => 'fieldset',
'#title' => t('Select fields'),
'#collapsible' => false,
);
foreach ($defaultFields as $fieldName => $title) {
$form['set-fields'][$fieldName] = array(
'#type' => 'checkbox',
'#title' => $title,
'#default_value' => 1,
'#disabled' => TRUE,
);
}
$form['set-fields']['fields'] = array(
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => array_keys($options),
);
$form['actions'] = array(
'#type' => 'actions',
'download' => array(
'#type' => 'submit',
'#name' => 'download',
'#value' => t('Download'),
),
'back' => array(
'#type' => 'submit',
'#name' => 'back',
'#value' => t('Back'),
),
);
return $form;
}
/**
* bf_node_import_form_validate()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function bf_node_import_form_validate($form, &$form_state)
{
}
/**
* bf_node_import_form_submit()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function bf_node_import_form_submit($form, &$form_state)
{
$formValues = $form_state['values'];
$op = $form_state['clicked_button']['#name'];
switch ($form_state['storage']['step']) {
case 1:
$form_state['storage']['op'] = $op;
$form_state['rebuild'] = TRUE;
$form_state['storage']['node-type'] = $formValues['node-type'];
$form_state['storage']['step'] = 2;
switch ($op) {
case 'export':
break;
case 'import':
break;
}
break;
case 2:
switch ($op) {
case 'upload':
_bf_node_import_form_submit_import_2($form, $form_state);
break;
case 'download':
_bf_node_import_form_submit_export_2($form, $form_state);
break;
default:
}
break;
default:
}
}
/**
* _bf_node_import_import_form_submit_import_2()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function _bf_node_import_form_submit_import_2($form, &$form_state)
{
$files = $_FILES['files'];
$fields = array();
$nodes = array();
$csvUploaded = array();
$nodeType = $form_state['storage']['node-type'];
foreach ($files as $paramName => $param) {
$csvUploaded[$paramName] = $param['csv'];
}
$csvPath = $csvUploaded['tmp_name'];
if (($csv = fopen($csvPath, 'r')) != FALSE) {
$first = TRUE;
while (($row = fgetcsv($csv, 10000, ';', '"')) != FALSE) {
if ($first) {
$fields = $row;
$first = FALSE;
continue;
}
$nodes[] = array_combine($fields, $row);
}
}
foreach ($nodes as $node) {
$success = _bf_node_import_update_node($node, $nodeType);
}
}
/**
* _bf_node_import_update_node()
*
* @param mixed $data
* @param mixed $nodeType
* @return
*/
function _bf_node_import_update_node(array $data, $nodeType)
{
static $fieldInfo;
$nid = $data['nid'];
if (!(int)$nid) {
return FALSE;
}
unset($data['nid']);
$Node = node_load($nid);
if ($Node->type !== $nodeType) {
$nodeTypeInfo = node_type_load($nodeType);
drupal_set_message(t('Node #!nid is not !type!', array('!nid' => $nid, '!type' => $nodeTypeInfo->name)), 'error');
return FALSE;
}
//$fields = field_info_instances('node', $nodeType);
foreach ($data as $fieldName => $value) {
if (!isset($fieldInfo[$fieldName])) {
$fieldInfo[$fieldName] = field_info_field($fieldName);
}
switch ($fieldInfo[$fieldName]['module']) {
case 'taxonomy':
$tids = array();
$termNames = explode('|', $value);
foreach ($termNames as $termName) {
$vocab_name = $info['settings']['allowed_values'][0]['vocabulary'];
$terms = taxonomy_get_term_by_name($termName, $vocab_name);
foreach ($terms as $tid => $term) {
$tids[] = $tid;
}
}
_bf_node_import_set_taxonomy($Node, $fieldName, $tids);
break;
case 'text':
$Node->body['und'][0]['value'] = $value;
break;
default:
$Node->{$fieldName} = $value;
}
}
//return TRUE;
return node_save($Node);
}
/**
* _bf_node_import_form_submit_export_2()
*
* @param mixed $form
* @param mixed $form_state
* @return void
*/
function _bf_node_import_form_submit_export_2($form, &$form_state)
{
$formValues = $form_state['values'];
$op = $form_state['clicked_button']['#name'];
$nodeType = $form_state['storage']['node-type'];
$selectedFields = $formValues['fields'];
switch($op) {
case 'download':
foreach ($selectedFields as $fieldName => $selected) {
if (!$selected) {
unset($selectedFields[$fieldName]);
}
}
$rows = array();
$defaultFields = drupal_map_assoc(array('nid', 'title'));
$selectedFields = array_merge($defaultFields, $selectedFields);
$nids = db_select('node', 'n')
->fields('n', array('nid'))
->condition('type', $nodeType)
->execute()
->fetchCol();
$nodes = node_load_multiple($nids);
$rows[0] = $selectedFields;
foreach ($nodes as $nid => $node) {
$row = array();
foreach ($selectedFields as $fieldName) {
$row[] = _bf_node_import_get_field_value($node, $fieldName);
}
$rows[] = $row;
}
$tempDir = file_directory_temp();
$csvUri = 'temporary://node_export_'.$nodeType.'_'.date('Ymd').'_'.date('Hi').'.csv';
if (($f = fopen($csvUri, 'w+')) != FALSE) {
foreach ($rows as $row) {
fputcsv($f, $row, ';', '"');
}
}
_bf_node_import_download($csvUri);
break;
case 'back':
break;
}
}
/**
* _bf_node_import_get_field_value()
*
* @param mixed $node
* @param mixed $fieldName
* @return
*/
function _bf_node_import_get_field_value(stdClass $node, $fieldName)
{
if (!isset($node->{$fieldName})) {
return NULL;
}
$value = $node->{$fieldName};
if (is_array($value)) {
$field = field_info_field($fieldName);
switch ($field['type']) {
case 'taxonomy_term_reference':
$terms = array();
$values = $value[LANGUAGE_NONE];
foreach ($values as $v) {
$term = taxonomy_term_load($v['tid']);
$terms[] = $term->name;
}
return join('|', array_unique($terms));
break;
case 'text_with_summary':
foreach ($value as $lang => $values) {
foreach ($values as $text) {
return $text['value'];
}
}
break;
}
} elseif (is_object($value)) {
return FALSE;
} else {
return $value;
}
}
/**
* _bf_node_import_download()
*
* @param mixed $uri
* @return void
*/
function _bf_node_import_download($uri)
{
$filePath = drupal_realpath($uri);
$fileName = basename($filePath);
$fileSize = filesize($filePath);
$headers = array(
'Content-Type' => 'force-download',
'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
'Content-Length' => $fileSize,
'Content-Transfer-Encoding' => 'binary',
'Pragma' => 'no-cache',
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Expires' => '0',
'Accept-Ranges' => 'bytes'
);
file_transfer($uri, $headers);
}
/**
* _bf_node_import_set_taxonomy()
*
* @param mixed $Node
* @param mixed $fieldName
* @param mixed $tids
* @return void
*/
function _bf_node_import_set_taxonomy(stdClass &$Node, $fieldName, $tids)
{
$Node->{$fieldName}[LANGUAGE_NONE] = array();
foreach ($tids as $tid) {
$Node->{$fieldName}[LANGUAGE_NONE][] = array('tid' => $tid);
}
}
module_load_include('inc', 'bf_personal_feeds', 'bf_personal_feeds.user');
function bf_personal_feeds_preprocess_item_list(&$vars)
{
}
/**
* bf_personal_feeds_menu()
*
* @return
*/
function bf_personal_feeds_menu()
{
$items['admin/config/bf_personal_feeds'] = array(
'title' => 'Personal feeds configuration',
'description' => '',
'page callback' => 'drupal_get_form',
'page arguments' => array('bf_personal_feeds_admin_form'),
'access arguments' => array('administer site configuration'),
'file' => 'bf_personal_feeds.admin.inc',
);
$terms_enabled = _bf_personal_feeds_get_terms_enabled();
if (!empty($terms_enabled)) {
$items['user/%user/personal_feeds'] = array(
'title' => 'Feeds',
'page callback' => 'drupal_get_form',
'page arguments' => array('bf_personal_feeds_user_form'),
'access callback' => 'bf_personal_feeds_user_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
);
}
return $items;
}
function bf_personal_feeds_views_api()
{
return array('api' => 3, 'path' => drupal_get_path('module', 'bf_personal_feeds'));
}
/**
* _bf_personal_feeds_get_terms()
*
* @param mixed $uid
* @return
*/
function _bf_personal_feeds_get_terms($uid)
{
if (!(int)$uid) {
return FALSE;
}
$rows = (array)db_select('personal_feeds', 'pn')
->fields('pn')
->condition('pn.uid', (int)$uid)
->execute()
->fetchAll();
$terms = array();
foreach ($rows as $row) {
$terms[$row->node_type][] = (int)$row->tid;
}
return $terms;
}
/**
* _bf_personal_feeds_get_terms_enabled()
*
* @return
*/
function _bf_personal_feeds_get_terms_enabled()
{
$rows = (array)db_select('personal_feeds_admin', 'pn')
->fields('pn')
->execute()
->fetchAll();
$terms = array();
foreach ($rows as $row) {
$terms[$row->node_type][] = (int)$row->tid;
}
return $terms;
}
/**
* _bf_personal_feeds_get_user_tids()
*
* @return
*/
function _bf_personal_feeds_get_user_tids()
{
global $user;
$tids = array();
$nids = array();
$terms = array ();
$limit = variable_get('bf_personal_feeds_limit', 5);
$enabled = _bf_personal_feeds_get_terms_enabled();
if (is_object($user) && (int)$user->uid) {
$terms = _bf_personal_feeds_get_terms((int)$user->uid);
}
if (is_array($terms) && !empty($terms)) {
foreach ($terms as $nodeType => $tids_) {
$tids = array_merge($tids, $tids_);
}
$tids = array_unique($tids);
return $tids;
}
return FALSE;
}
/**
* bf_upload_theme()
*
* @return
*/
function bf_upload_theme()
{
return array(
'bf_upload_uploader' => array(
'render element' => 'element',
),
'bf_upload_items' => array(
'render element' => 'element'
)
);
}
/**
* Theme Upload widget.
*/
function theme_bf_upload_uploader($variables)
{
$element = $variables['element'];
$attributes = array();
if (isset($element['#id'])) {
$attributes['id'] = $element['#id'];
}
if (!empty($element['#attributes']['class'])) {
$attributes['class'] = (array)$element['#attributes']['class'];
}
$attributes['class'][] = 'bf_upload';
$hasTitle = isset($element['#bf_upload_override']['title_field']) && $element['#bf_upload_override']['title_field'] == 1;
if ($hasTitle) {
$attributes['class'][] = 'has-title';
}
/*
$hasAlt = (bool)(isset($element['#bf_upload_override']['alt_field']) && $element['#bf_upload_override']['alt_field'] == 1);
if ($hasAlt) {
$attributes['class'][] = 'has-alt';
}
*/
$output = '
'.
theme('bf_upload_items', array('element' => $element)).'
' . t('Drag files here') . '
' . implode("\n", $element['#info']) . '
';
return $output;
}
/**
* Theme Batch upload items within widget.
*/
function theme_bf_upload_items($vars)
{
$element = &$vars['element'];
if (isset($element['#default_value']) && !empty($element['#default_value'])) {
$items = &$element['#default_value'];
} else {
return '';
}
$output = '';
foreach ($items as $delta => $item) {
// If user deleted all items I'll get array('fid' => 0)
if ($item['fid'] > 0) {
$hasTitle = $element['#bf_upload_override']['title_field'] == 1;
$hasAlt = $element['#bf_upload_override']['alt_field'] == 1;
$hasDescription = $element['#bf_upload_override']['description_field'] == 1;
$name = $element['#name'] . '[' . $delta . ']';
$fileTypeThumb = '%s %s
';
$fileTypeThumbCaption = (!empty($item['uri'])) ? $item['uri'] : print_r($item, true);
$fileTypeThumb = sprintf($fileTypeThumb, theme('image', array('path' => '/'. _bf_upload_get_filetype_image($item))), $fileTypeThumbCaption);
$output .= '
'.
($item['type'] == 'image' ? theme('image_style', array('style_name' => $element['#bf_upload']['image_style'], 'path' => $item['uri'])) : $fileTypeThumb) .'
'.
($hasTitle ? ' ' : '').
($hasDescription ? ' ' : '').
//($hasAlt ? ' ' : '').
'
';
(isset($item['rename']) ? ' ' : '').'
';
}
}
return $output;
}
/**
* _field_widget_info
*/
function bf_upload_field_widget_info()
{
return array(
'bf_upload' => array(
'label' => t('BIG FISH Uploader'),
'field types' => array('file', 'image'),
'behaviors' => array(
'multiple values' => FIELD_BEHAVIOR_CUSTOM,
'default value' => FIELD_BEHAVIOR_NONE,
),
),
);
}
/**
* _field_widget_settings_form
*/
function bf_upload_field_widget_settings_form($field, $instance)
{
$form = array();
switch ($field['type']) {
case 'image':
$styles = array();
foreach (image_styles() as $name => $style) {
$styles[$name] = $style['name'];
}
$form['image_style'] = array(
'#type' => 'select',
'#title' => t('Image style'),
'#default_value' => isset($instance['widget']['settings']['image_style']) ? $instance['widget']['settings']['image_style'] : 'thumbnail',
'#options' => $styles
);
break;
}
return $form;
}
/**
* _field_widget_form
*/
function bf_upload_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element)
{
$parents = array_merge(
array('values', $element['#field_name'], $element['#language']),
$element['#field_parents']
);
$state_data = drupal_array_get_nested_value($form_state, $parents);
// We inform user about restrictions
$info = array();
if ($field['cardinality'] > 0) {
$info[] = ''. t("You can upload up to !num files.", array('!num' => '' . $field['cardinality'] . ' ')). '
';
}
if (isset($instance['settings']['max_filesize']) && !empty($instance['settings']['max_filesize'])) {
$info[] = ''. t("Maximal file size: !size", array('!size' => ''. $instance['settings']['max_filesize'] . ' ')). '
';
}
$info[] = ''. t("Allowed files types: !types.", array('!types' => '' . $instance['settings']['file_extensions'] . ' ')). '
';
/*
$max = $instance['settings']['max_resolution'];
$min = $instance['settings']['min_resolution'];
if ($min && $max && $min == $max) {
$info[] = ''. t('Images must be exactly !size pixels.', array('!size' => '' . $max . ' ')). '
';
} elseif ($min && $max) {
$info[] = ''. t('Images must be between !min and !max pixels.', array('!min' =>'' . $min . ' ', '!max' => '' . $max . ' ')). '
';
} elseif ($min) {
$info[] = ''. t('Images must be larger than !min pixels.', array('!min' => '' . $min . ' ')). '
';
} elseif ($max) {
$info[] = ''. t('Images must be smaller than !max pixels.', array('!max' => '' . $max . ' ')). '
';
}
*/
if (isset($state_data)) {
$default_values = $state_data;
} else {
if (isset($items)) {
$default_values = $items;
} else {
$default_values = array();
}
}
$images = array(
'#type' => 'bf_upload',
'#default_value' => $default_values,
'#info' => $info
);
// Allowed file types(extensions) needs to be set here
$ext = new stdClass();
$ext->title = 'Allowed extensions'; // This won't show up anywhere so no t()
$ext->extensions = (isset($instance['settings']['file_extensions']) && !empty($instance['settings']['file_extensions'])) ? strtr($instance['settings']['file_extensions'], ' ', ',') : 'jpg,png,gif';
$images['#bf_upload_override']['filters'] = array($ext);
// Maximal file size
if (isset($instance['settings']['max_filesize']) && !empty($instance['settings']['max_filesize'])) {
$images['#bf_upload_override']['max_file_size'] = $instance['settings']['max_filesize'];
}
// URL callback for Plupload library has to be altered so we can get instance ID for later validation
$images['#bf_upload_override']['url'] = url('bf_upload/' . $instance['id'], array(
'query' => array(
'bf_upload_token' => drupal_get_token('bf_upload-handle-uploads')
)
));
$images['#bf_upload_override']['image_style'] = isset($instance['widget']['settings']['image_style']) ? $instance['widget']['settings']['image_style'] : 'thumbnail';
$images['#bf_upload_override']['alt_field'] = (int)$instance['settings']['alt_field'];
$images['#bf_upload_override']['title_field'] = (int)$instance['settings']['title_field'];
$images['#bf_upload_override']['description_field'] = (int)$instance['settings']['description_field'];
// We set the maximum files user can upload
$images['#bf_upload_override']['max_files'] = (int)$field['cardinality'];
$element += $images;
return $element;
}
/**
* bf_upload_element_info()
*
* @return
*/
function bf_upload_element_info()
{
$plupload = libraries_get_path('plupload');
$types['bf_upload'] = array(
'#input' => true,
'#title' => null,
'#process' => array('bf_upload_process_element'),
'#value_callback' => 'bf_upload_value_element',
'#element_validate' => array('bf_upload_validate_element'),
'#pre_render' => array('bf_upload_pre_render_element'),
'#default_value' => null,
'#required' => false,
'#autocomplete_path' => false,
'#theme_wrappers' => array('form_element'),
'#theme' => 'bf_upload_uploader',
'#upload_location' => null,
'#info' => array(),
'#attached' => array('library' => array(array('bf_upload', 'plupload'))),
'#bf_upload' => array(
'container' => 'bf_upload-container',
'browse_button' => 'bf_upload-select',
'upload' => 'bf_upload-upload',
'runtimes' => 'html5,gears,flash,silverlight,browserplus,html4',
'max_file_size' => '512MB',
'chunk_size' => '2048K',
'url' => url('bf_upload', array(
'query' => array(
'bf_upload_token' => drupal_get_token('bf_upload-handle-uploads')
)
)
),
'filters' => array(),
'unique_names' => false,
'flash_swf_url' => base_path() . $plupload. '/js/plupload.flash.swf',
'silverlight_xap_url' => base_path() . $plupload. '/js/plupload.silverlight.xap',
'drop_element' => 'bf_upload-filelist',
'multipart' => true,
'dragdrop' => true,
'multiple_queues' => true,
'urlstream_upload' => false,
'image_style' => 'thumbnail',
'image_style_path' => '',
'max_files' => -1,
),
'#bf_upload_override' => array()
);
return $types;
}
/**
* Value callback needed for removing all items.
*/
function bf_upload_value_element(&$element, $input = false, $form_state = null)
{
// Default state - no new data
if ($input === false) {
return null;
}
// Field was emptied - user deleted all files
if (is_null($input)) {
return array(array('fid' => 0));
}
// Field has new data
return $input;
}
/**
* Process callback to set JS settings before Plupload init.
*/
function bf_upload_process_element($element, &$form_state, $form)
{
$rand = mt_rand(1,1000);
$element['#bf_upload']['browse_button'] .= $rand;
$element['#bf_upload']['container'] .= $rand;
$element['#bf_upload']['upload'] .= $rand;
$element['#default_value'] = isset($element['#value']) ? $element['#value'] : $element['#default_value'];
$element['#bf_upload']['name'] = $element['#name'];
$element['#bf_upload'] = array_merge($element['#bf_upload'], $element['#bf_upload_override']);
$files = file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath();
$element['#bf_upload']['image_style_path'] = base_path() . $files . '/styles/' . $element['#bf_upload']['image_style']. '/';
$element['#attached']['js'][] = array(
'data' => array(
'bf_upload' => array($element['#bf_upload'])
),
'type' => 'setting',
);
return $element;
}
/**
* Pre-render callback to load existing items.
*/
function bf_upload_pre_render_element($element)
{
if (isset($element['#default_value']) && !empty($element['#default_value'])) {
foreach ($element['#default_value'] as $delta => $item) {
$element['#default_value'][$delta] = array_merge($item, (array)file_load($item['fid']));
}
}
return $element;
}
/**
* Element validation callback.
*/
function bf_upload_validate_element($element, &$form_state, $form)
{
if ($element['#required'] == true && $element['#value'][0]['fid'] == 0) {
form_error($element, t("@field field is required.", array('@field' => $element['#title'])));
}
$cardinality = isset($element['#bf_upload_override']['max_files']) ? $element['#bf_upload_override']['max_files'] : $element['#bf_upload']['max_files'];
if ($cardinality > 0 && count($element['#value']) > $cardinality) {
form_error($element, t("Only !num items are allowed.", array('!num' => $cardinality)));
}
}
Adatkezelési tájékoztató | SZIE Regatta
A 2019. évi SZIE Regatta rendezvényhez és a hozzá kapcsolódó nyereményjátékhoz
1.Adatkezelő megnevezése
Teljes név:
Szent István Egyetem
Adatkezelő képviselői:
Dr. Palkovics László és Magyar Ferenc
Beosztásuk:
rektor és kancellár
E-mail címe:
adatvedelem@szie.hu
Telefonszáma:
28 / 522 000
Honlapja:
www.szie.hu
Székhelye:
2100 Gödöllő, Páter Károly u.1.
Postai címe:
2103 Gödöllő, Pf. 303
Adószáma:
15329767-2-13
Adatvédelmi tisztviselő neve:
Gyarmati Gábor
E-mail címe:
dpo@szie.hu
2.Jogszabályi háttér
A Szent István Egyetem (a továbbiakban: Egyetem) által szervezett Regatta és a hozzá kapcsolódó nyereményjáték adatkezelése során az alábbi jogszabályok alapján jár el:
AZ EURÓPAI PARLAMENT ÉS A TANÁCS (EU) 2016/679 RENDELETE (2016. április 27.) a természetes személyeknek a személyes adatok kezelése tekintetében történő védelméről és az ilyen adatok szabad áramlásáról, valamint a 95/46/EK rendelet hatályon kívül helyezéséről (a továbbiakban: általános adatvédelmi rendelet)
3.A jelentkezés
3.1.A kezelt személyes adatok köre és az adatkezelés célja
személyes adat jellege
adatkezelés célja
adatkezelés jogalapja
Viselt név
A rendezvényen részt vevő
személy azonosításához szükséges
Önkéntes hozzájárulás
E-mail cím
A rendezvényen részt vevő személlyel való kapcsolattartáshoz szükséges
Önkéntes hozzájárulás
Telefonszám
A rendezvényen részt vevő személlyel való kapcsolattartáshoz szükséges
Önkéntes hozzájárulás
3.2.Az adatkezelés jogalapja
Az adatkezelésre jogalapot az Ön önkéntes hozzájárulása ad. Ezt a hozzájárulását a rendezvény kezdete előtt bármikor visszavonhatja, de ez a jelentkezés visszavonásával együtt jár.
3.3.Az adatkezelés időtartama
Az Ön által megadott valamennyi adatot a regisztráció kezdetétől, 2019. április 15. napjától legkésőbb 2019. július 15-éig, vagy az Ön hozzájárulásának visszavonásáig tároljuk.
3.4.Az adatokhoz való hozzáférés
A regisztráció során megadott adatokat az Egyetem megbízásából a rendezvény szervezéséért és lebonyolításáért felelős Médiaközpont arra kijelölt munkatársai kezelik a feladatellátásuk keretében, az ahhoz szükséges mértékben.
Ezeket az adatokat használjuk fel a nyereményjáték sorsolása során is, így nem szükséges őket újra megadni.
Az Egyetem az Ön által megadott adatokat nem továbbítja harmadik félnek.
3.5.Adatbiztonsági intézkedések
Az Egyetem az Ön által megadott személyes adatokat Excel táblázatban gyűjti, majd legkésőbb 2019. július 15-ig megsemmisíti, és megsemmisítésükről jegyzőkönyvet vesz fel. Az elektronikus állományokat az Egyetem központjában található szerveren őrizzük a megfelelő adatbiztonsági intézkedések betartásával.
4.A nyereményjáték
4.1.A kezelt adatok köre és az adatkezelés célja
személyes adat jellege
adatkezelés célja
adatkezelés jogalapja
Viselt név
A nyereményjátékban részt vevő személy azonosításához szükséges
Önkéntes hozzájárulás
E-mail cím
A nyereményjátékban részt vevő személlyel való kapcsolattartáshoz szükséges
Önkéntes hozzájárulás
Telefonszám
A nyereményjátékban részt vevő személlyel való kapcsolattartáshoz szükséges
Önkéntes hozzájárulás
4.2.Az adatkezelés jogalapja
Az adatkezelésre jogalapot az Ön önkéntes hozzájárulása ad. Ezt a hozzájárulását a nyereményjáték kezdete előtt bármikor visszavonhatja, de ez a nyereményjátékból való kizárással együtt jár.
4.3.Az adatkezelés időtartama
Az Ön által megadott valamennyi adatot a Regattára való regisztráció kezdetétől, 2019. április 15.
napjától legkésőbb 2019. július 15-éig, vagy az Ön hozzájárulásának visszavonásáig tároljuk.
4.4.Az adatokhoz való hozzáférés
A regisztráció során megadott adatokat az Egyetem megbízásából a rendezvény szervezéséért és lebonyolításáért felelős Médiaközpont arra kijelölt munkatársai kezelik a feladatellátásuk keretében, az ahhoz szükséges mértékben.
Az Egyetem az Ön által korábban megadott adatokat nem továbbítja harmadik félnek.
5.Az adatkezeléssel kapcsolatos jogai
A GDPR alapján Önt a személyes adataival kapcsolatban az alábbi jogok illetik meg:
tájékoztatáshoz való jog,
helyesbítéshez való jog,
törléshez való jog.
5.1.Tájékoztatás-kéréshez való jog
A tájékoztató 1. pontjában található elérhetőségeken írásban információt kérhet az Egyetemtől arról, hogy
mely személyes adatokat,
milyen jogalapon,
milyen adatkezelési céllal,
milyen forrásból,
mennyi ideig
kezeljük.
A kérésnek 30 napon belül eleget teszünk.
Amennyiben érdeklődni szeretne a fentebb felsoroltak iránt, azt mindenképpen az adattárolási időn belül tegye, különben csak az adatok megsemmisítéséről tudjuk tájékoztatni.
5.2.Helyesbítéshez való jog
Amennyiben a jelentkezési lap kitöltése során megadott adataiban változás történt, azok kijavítását illetve módosítását kérheti az adatvedelem@szie.hu e-mail címen. A beérkezett kéréseknek a tőlünk telhető leggyorsabban eleget fogunk tenni.
Ha bármilyen módosítást szeretne kérni, azt mindenképpen az adattárolási időn belül tegye, különben csak az adatok megsemmisítéséről tudjuk tájékoztatni.
5.3.Törléshez való jog
Az 1. pontban megadott e-mail címen kérheti, hogy töröljük az Ön által megadott személyes adatokat. A kérésnek igyekszünk haladéktalanul eleget tenni.
6.Az adatkezeléssel kapcsolatos jogorvoslati lehetőségek
Amennyiben bármilyen problémát észlel az adatkezelés kapcsán, kérjük, elsőként jelezze az Egyetem adatvédelmi tisztviselőjének. Ez hozzásegít minket ahhoz, hogy azonnal megoldást tudjunk találni, és kizárjuk, hogy ez a jövőben is előfordulhasson. Írjon az adatvedelem@szie.hu e-mail címre, és a tőlünk telhető leggyorsabban igyekszünk majd megoldást találni.
Amennyiben nem sikerült vele felvenni a kapcsolatot, vagy nem elégedett a megoldási javaslatainkkal, a Nemzeti Adatvédelmi és Információszabadság Hatóságnál (a továbbiakban: Hatóság) vizsgálatot kezdeményezhet a személyes adatai kezelésével kapcsolatos jogaiban esett sérelemre, vagy annak közvetlen veszélyére való hivatkozással.
A Hatóság a panaszokat csak abban az esetben vizsgálja ki, ha a Hatóságnál tett bejelentését megelőzően már megkereste az Egyetemet a Tájékoztató 5. pontjában megjelölt jogai gyakorlásával kapcsolatban.
A Hatóság elérhetősége:
posta cím: 1530 Budapest, Pf.: 5.
cím: 1125 Budapest, Szilágyi Erzsébet fasor 22/c
Telefon: +36 (1) 391-1400
Fax: +36 (1) 391-1410
E-mail: ugyfelszolgalat@naih.hu
function bf_calendar_field_schema()
{
$schema['calendar_field'] = array(
'description' => '',
'fields' => array(
'name' => array(
'description' => 'Name',
'type' => 'varchar',
'length' => 255,
'not null' => true,
),
'machine_name' => array(
'description' => 'Machine name',
'type' => 'varchar',
'length' => 32,
'not null' => true,
),
),
'unique keys' => array(
'machine_name' => array('machine_name'),
),
'primary key' => array('machine_name'),
);
return $schema;
}
function bf_personal_feeds_schema()
{
$schema['personal_feeds'] = array(
'description' => '',
'fields' => array(
'uid' => array(
'description' => 'User ID',
'type' => 'int',
'unsigned' => true,
'not null' => true,
),
'node_type' => array(
'description' => 'Node type',
'type' => 'varchar',
'length' => 32,
'not null' => true,
),
'tid' => array(
'description' => 'Term ID',
'type' => 'int',
'unsigned' => true,
'not null' => true,
),
),
'unique keys' => array(
'uid_node_type_tid' => array('uid', 'node_type', 'tid'),
),
//'primary key' => array('aid'),
'foreign keys' => array(
'users' => array(
'table' => 'users',
'columns' => array(
'uid' => 'uid',
),
),
'taxonomy_term_data' => array(
'table' => 'taxonomy_term_data',
'columns' => array(
'tid' => 'tid',
),
),
)
);
$schema['personal_feeds_admin'] = array(
'description' => '',
'fields' => array(
'node_type' => array(
'description' => 'Node type',
'type' => 'varchar',
'length' => 32,
'not null' => true,
),
'tid' => array(
'description' => 'Term ID',
'type' => 'int',
'unsigned' => true,
'not null' => true,
),
),
'unique keys' => array(
'node_type_tid' => array('node_type', 'tid'),
),
//'primary key' => array('aid'),
'foreign keys' => array(
'taxonomy_term_data' => array(
'table' => 'taxonomy_term_data',
'columns' => array(
'tid' => 'tid',
),
),
),
);
return $schema;
}