You are here

function filedepot_newversion_form in filedepot 7

1 string reference to 'filedepot_newversion_form'
filedepot_mainpage.tpl.php in theme/filedepot_mainpage.tpl.php
page.tpl.php

File

./filedepot.module, line 2630
filedepot.module Filedepot: File Management Module developed by Nextide www.nextide.ca Full featured document managment module with a desktop application feel. Integrated Organic Group, Role and User permissions to secure folders, automated…

Code

function filedepot_newversion_form($form, &$form_state) {
  global $user;
  $filedepot = filedepot_filedepot();

  // Using the ctools cache functionality to save which folder the user has selected
  ctools_include('object-cache');
  $cid = ctools_object_cache_get('filedepot', 'folder');
  module_load_include('php', 'filedepot', 'lib-common');
  $default_filter = 'jpg png doc docx xls xlsx pdf ppt pptx';
  $filter = variable_get('filedepot_filetype_filter', $default_filter);
  $form['filedepot_fid'] = array(
    '#type' => 'hidden',
  );
  $form['filedepot_file'] = array(
    '#type' => 'managed_file',
    '#title' => t('Choose a file'),
    '#size' => 22,
    '#upload_validators' => array(
      'file_validate_extensions' => array(
        $filter,
      ),
    ),
  );
  $form['filedepot_filetags'] = array(
    '#type' => 'textfield',
    '#title' => t('Tags'),
    '#size' => 34,
  );
  $form['filedepot_version_note'] = array(
    '#type' => 'textarea',
    '#title' => t('Version Notes'),
    '#rows' => 2,
  );
  $form['filedepot_email_notification'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Email Notification'),
    '#options' => array(
      'yes' => t('Yes'),
    ),
    '#default_value' => array(
      'yes' => 'yes',
    ),
  );
  $form['buttons'] = array(
    '#prefix' => '<div style="text-align:center;">',
    '#suffix' => '</div>',
  );
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Upload File'),
  );
  $form['buttons']['cancel'] = array(
    '#type' => 'button',
    '#access' => TRUE,
    '#value' => t('Cancel'),
    '#weight' => 60,
    '#attributes' => array(
      'onclick' => 'YAHOO.container.newfiledialog.hide(); return false;',
    ),
  );
  $form['buttons']['submit']['#submit'][] = 'filedepot_newversion_submit';
  return $form;
}