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

Diff of /contributions/modules/rotor/rotor.module

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

revision 1.2.2.18.2.29, Tue Oct 6 19:49:12 2009 UTC revision 1.2.2.18.2.30, Thu Nov 5 10:22:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: rotor.module,v 1.2.2.18.2.28 2009/05/29 11:49:04 mrfelton Exp $  // $Id: rotor.module,v 1.2.2.18.2.29 2009/10/06 19:49:12 mrfelton Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 105  function rotor_form($node, &$param) { Line 105  function rotor_form($node, &$param) {
105      '#default_value' => $node->url,      '#default_value' => $node->url,
106      '#description' => t('The link that will be actived for this item. Example: http://www.drupal.org, node/3'),      '#description' => t('The link that will be actived for this item. Example: http://www.drupal.org, node/3'),
107      '#weight' => -4,      '#weight' => -4,
108    );    );
109    $form['link_target'] = array(    $form['link_target'] = array(
110      '#type' => 'select',      '#type' => 'select',
111      '#title' => t('Link target'),      '#title' => t('Link target'),
# Line 152  function rotor_form($node, &$param) { Line 152  function rotor_form($node, &$param) {
152      '#description' => t('The content that will be shown in case no image is uploaded.'),      '#description' => t('The content that will be shown in case no image is uploaded.'),
153    );    );
154    $form['body_filter']['filter'] = filter_form($node->format);    $form['body_filter']['filter'] = filter_form($node->format);
155    
156    $form['#attributes']['enctype'] = 'multipart/form-data';    $form['#attributes']['enctype'] = 'multipart/form-data';
157    $form['#submit'] = array('rotor_submit');    $form['#submit'] = array('rotor_submit');
158    return $form;    return $form;
# Line 188  function rotor_nodeapi(&$node, $op, $a3 Line 188  function rotor_nodeapi(&$node, $op, $a3
188          break;          break;
189        case 'view':        case 'view':
190          $node->content['rotor_image'] = array(          $node->content['rotor_image'] = array(
191            '#value' =>            '#value' =>
192              '<div>'. theme('rotor_item', $node) .'</div>',              '<div>'. theme('rotor_item', $node) .'</div>',
193            '#weight' => 10,            '#weight' => 10,
194          );          );
# Line 295  function rotor_theme() { Line 295  function rotor_theme() {
295   */   */
296  function theme_rotor_item($item, $preset_id = NULL) {  function theme_rotor_item($item, $preset_id = NULL) {
297    if ($item->fid) {    if ($item->fid) {
298    
299      // Separate out the anchor if any.      // Separate out the anchor if any.
300      if (strpos($item->url, '#') !== FALSE) {      if (strpos($item->url, '#') !== FALSE) {
301        $fragment = substr($item->url, strpos($item->url, '#') + 1);        $fragment = substr($item->url, strpos($item->url, '#') + 1);
# Line 306  function theme_rotor_item($item, $preset Line 306  function theme_rotor_item($item, $preset
306        $query = substr($item->url, strpos($item->url, '?') + 1);        $query = substr($item->url, strpos($item->url, '?') + 1);
307        $item->url = substr($item->url, 0, strpos($item->url, '?'));        $item->url = substr($item->url, 0, strpos($item->url, '?'));
308      }      }
309    
310      $attributes = $item->link_target? array('target' => $item->link_target) : array();      $attributes = $item->link_target? array('target' => $item->link_target) : array();
311    
312      $output .= $item->url      $output .= $item->url
313        ?l(theme('rotor_image', $item, $preset_id), $item->url, array('query' => $query, 'fragment' => $fragment, 'html' => TRUE, 'attributes' => $attributes))        ?l(theme('rotor_image', $item, $preset_id), $item->url, array('query' => $query, 'fragment' => $fragment, 'html' => TRUE, 'attributes' => $attributes))
314        : theme('rotor_image', $item, $preset_id);        : theme('rotor_image', $item, $preset_id);
# Line 328  function theme_rotor_tabs($items = array Line 328  function theme_rotor_tabs($items = array
328    $output = '<div class="rotor-tabs">';    $output = '<div class="rotor-tabs">';
329    foreach ($items as $item) {    foreach ($items as $item) {
330      $node = node_load($item->nid);      $node = node_load($item->nid);
331      $output .= theme_rotor_tab($node);      $output .= theme('rotor_tab', $node);
332    }    }
333    $output .= '</div>';    $output .= '</div>';
334    return $output;    return $output;

Legend:
Removed from v.1.2.2.18.2.29  
changed lines
  Added in v.1.2.2.18.2.30

  ViewVC Help
Powered by ViewVC 1.1.2