/[drupal]/contributions/modules/zoomify/zoomify.module
ViewVC logotype

Diff of /contributions/modules/zoomify/zoomify.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2.2.2.2.8, Sun Mar 22 04:39:54 2009 UTC revision 1.1.2.2.2.2.2.9, Fri May 1 02:54:47 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: zoomify.module,v 1.1.2.2.2.2.2.7 2009/02/25 01:22:58 kratib Exp $  // $Id: zoomify.module,v 1.1.2.2.2.2.2.8 2009/03/22 04:39:54 kratib Exp $
3    
4  require_once('pathinfo_filename.inc');  require_once('pathinfo_filename.inc');
5  require_once('rrmdir.inc');  require_once('rrmdir.inc');
# Line 13  function zoomify_requirements($phase) { Line 13  function zoomify_requirements($phase) {
13    
14  function zoomify_menu() {  function zoomify_menu() {
15    $items['admin/settings/zoomify'] = array(    $items['admin/settings/zoomify'] = array(
16      'title' => 'Zoomify',      'title' => 'Zoomify settings',
17      'page callback' => 'drupal_get_form',      'page callback' => 'drupal_get_form',
18      'page arguments' => array('zoomify_admin_settings'),      'page arguments' => array('zoomify_admin_settings'),
19      'access arguments' => array('administer site configuration'),      'access arguments' => array('administer site configuration'),
# Line 43  function zoomify_load($nid) { Line 43  function zoomify_load($nid) {
43  }  }
44    
45  function zoomify_admin_settings() {  function zoomify_admin_settings() {
46      global $base_url;
47      $form['zoomify_applet'] = array(
48        '#type' => 'textfield',
49        '#title' => t('URL to Flash applet'),
50        '#default_value' => variable_get('zoomify_applet', $base_url .'/'. drupal_get_path('module', 'zoomify') .'/ZoomifyViewer.swf'),
51        '#description' => t('The URL that leads to the Zoomify Flash applet as accessed from a browser. Note that the domain name should be the same as your Drupal site to avoid Flash security problems.'),
52      );
53    $form['zoomify_minimum_width'] = array(    $form['zoomify_minimum_width'] = array(
54      '#type' => 'textfield',      '#type' => 'textfield',
55      '#title' => t('Minimum width'),      '#title' => t('Minimum width'),
# Line 84  function zoomify_admin_settings() { Line 91  function zoomify_admin_settings() {
91    return system_settings_form($form);    return system_settings_form($form);
92  }  }
93    
94    function zoomify_admin_settings_validate($form, $form_state) {
95      $path = $form_state['values']['zoomify_applet'];
96      if (!$handle = @fopen($path, 'r')) {
97        form_set_error('zoomify_applet', t('The URL %path does not exist. Please type a valid URL to the Zoomify Flash applet.', array('%path' => $path)));
98      }
99      else {
100        fclose($handle);
101      }
102    }
103    
104  function zoomify_theme() {  function zoomify_theme() {
105    return array(    return array(
106      'zoomify_admin_settings' => array(      'zoomify_admin_settings' => array(
# Line 98  function zoomify_theme() { Line 115  function zoomify_theme() {
115  function theme_zoomify_admin_settings($form) {  function theme_zoomify_admin_settings($form) {
116    $output  = '';    $output  = '';
117    $output .= drupal_render($form);    $output .= drupal_render($form);
118    $output .= '<p class="cvs-version">$Id: zoomify.module,v 1.1.2.2.2.2.2.7 2009/02/25 01:22:58 kratib Exp $</p>';    $output .= '<p class="cvs-version">$Id: zoomify.module,v 1.1.2.2.2.2.2.8 2009/03/22 04:39:54 kratib Exp $</p>';
119    return $output;    return $output;
120  }  }
121    
# Line 136  function theme_zoomify($node, $images, $ Line 153  function theme_zoomify($node, $images, $
153    
154    drupal_set_title($node->title);    drupal_set_title($node->title);
155    global $base_url;    global $base_url;
156    $viewer = $base_url .'/'. drupal_get_path('module', 'zoomify') .'/zoomifyViewer.swf';    $viewer = variable_get('zoomify_applet', $base_url .'/'. drupal_get_path('module', 'zoomify') .'/ZoomifyViewer.swf');
157    $fids = array_keys($images);    $fids = array_keys($images);
158    $image = file_create_url(_zoomify_filepath($node, $fids[$index]));    $image = file_create_url(_zoomify_filepath($node, $fids[$index]));
159    $width = variable_get('zoomify_width', 800);    $width = variable_get('zoomify_width', 800);

Legend:
Removed from v.1.1.2.2.2.2.2.8  
changed lines
  Added in v.1.1.2.2.2.2.2.9

  ViewVC Help
Powered by ViewVC 1.1.2