You are here

opigno_pdf_viewer.install in Opigno Quiz App 7

File

includes/opigno_pdf_viewer/opigno_pdf_viewer.install
View source
<?php

function opigno_pdf_viewer_install() {
  $field = field_info_field('slide_pdf');
  if (empty($field)) {
    field_create_field(array(
      'active' => 1,
      'cardinality' => 1,
      'deleted' => 0,
      'entity_types' => array(),
      'field_name' => 'slide_pdf',
      'foreign keys' => array(
        'fid' => array(
          'columns' => array(
            'fid' => 'fid',
          ),
          'table' => 'file_managed',
        ),
      ),
      'indexes' => array(
        'fid' => array(
          0 => 'fid',
        ),
      ),
      'locked' => 0,
      'module' => 'file',
      'settings' => array(
        'display_default' => 0,
        'display_field' => 0,
        'uri_scheme' => 'public',
      ),
      'translatable' => 0,
      'type' => 'file',
    ));
  }
  $instance = field_info_instance('node', 'slide_pdf', 'quiz_directions');
  if (empty($instance)) {
    field_create_instance(array(
      'bundle' => 'quiz_directions',
      'deleted' => 0,
      'description' => 'The file uploaded here will be displayed inside the slide',
      'display' => array(
        'default' => array(
          'label' => 'hidden',
          'module' => 'pdf',
          'settings' => array(
            'height' => '600px',
            'keep_pdfjs' => TRUE,
            'width' => '100%',
          ),
          'type' => 'pdf_default',
          'weight' => 2,
        ),
        'teaser' => array(
          'label' => 'hidden',
          'module' => 'pdf',
          'settings' => array(
            'height' => '600px',
            'keep_pdfjs' => 1,
            'width' => '100%',
          ),
          'type' => 'pdf_default',
          'weight' => 1,
        ),
        'question' => array(
          'label' => 'hidden',
          'module' => 'pdf',
          'settings' => array(
            'height' => '600px',
            'keep_pdfjs' => 1,
            'width' => '100%',
          ),
          'type' => 'pdf_default',
          'weight' => 10,
        ),
      ),
      'entity_type' => 'node',
      'field_name' => 'slide_pdf',
      'label' => 'PDF',
      'required' => 0,
      'settings' => array(
        'description_field' => 0,
        'file_directory' => '',
        'file_extensions' => 'pdf',
        'max_filesize' => '',
        'user_register_form' => FALSE,
      ),
      'widget' => array(
        'active' => 1,
        'module' => 'file',
        'settings' => array(
          'progress_indicator' => 'throbber',
        ),
        'type' => 'file_generic',
        'weight' => -3,
      ),
    ));
  }
}

/**
 * Put in this function all the strings that are not in a t() or st() function.
 */
function opigno_pdf_viewer_install_translations() {

  //
  // --- FIELDS
  // opigno_pdf_viewer.install
  t('The file uploaded here will be displayed inside the slide');
  t('PDF');
}

Functions

Namesort descending Description
opigno_pdf_viewer_install
opigno_pdf_viewer_install_translations Put in this function all the strings that are not in a t() or st() function.