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

Diff of /contributions/modules/last_node/last_node.module

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

revision 1.1.4.1.2.5, Thu Sep 20 08:37:43 2007 UTC revision 1.1.4.1.2.6, Mon Jun 30 14:36:05 2008 UTC
# Line 145  function _last_node_contents($which_bloc Line 145  function _last_node_contents($which_bloc
145        $output[] = l($node->title,'node/'. $node->nid);        $output[] = l($node->title,'node/'. $node->nid);
146      }      }
147      $output = theme_item_list($output);      $output = theme_item_list($output);
148      $output .= "<div class=\"more-link\"><a href=\"?q=last_node/$which_block\" title=\"". t("Read More") ."\">". t("Read More...") ."</a></div>";      $output .= "<div class=\"more-link\">". l( t("Read More"),'last_node/'. $which_block,array('title'=>t('Read More...'))) ."</div>";
149      drupal_add_css(drupal_get_path("module","last_node") ."/last_node.css");      drupal_add_css(drupal_get_path("module","last_node") ."/last_node.css");
150      return $output;      return $output;
151    }    }
# Line 194  function lastnode_imgdisplay($title = "" Line 194  function lastnode_imgdisplay($title = ""
194  function _last_node_normalize_title($title,$node_type)  {  function _last_node_normalize_title($title,$node_type)  {
195    $image = variable_get('last_node_imagenode_'. $node_type,'');    $image = variable_get('last_node_imagenode_'. $node_type,'');
196    if ($image) {    if ($image) {
197      $title = " &curren; <img class=\"last_node-imagenode\" src=\"$image\" alt=\"$title\" /> ". $title;      $title = theme('image',$image,$title,$title,array('class'=>'last_node-imagenode'),TRUE) . $title;
198    }    }
   else $title = " &curren; ". $title;  
199    return $title;    return $title;
200  }  }
201    
202  function _last_node_normalize_linkblock($title,$node_type)  {  function _last_node_normalize_linkblock($title,$node_type)  {
203    $image = variable_get('last_node_imagenode_'. $node_type,'');    $image = variable_get('last_node_imagenode_'. $node_type,'');
204    if ($image) {    if ($image) {
205      $title = "<img class=\"last_node-imagelinkblock\" src=\"$image\" alt=\"$title\" /> ". $title;      $title = theme('image',$image,$title,$title,array('class'=>'last_node-imagelinkblock'),TRUE) . $title;
206    }    }
   else $title = " &curren; ". $title;  
207    return $title;    return $title;
208  }  }
209    
# Line 236  function last_node_menu($may_cache) { Line 234  function last_node_menu($may_cache) {
234            $title = variable_get("last_node_labelnode_$value",$value);            $title = variable_get("last_node_labelnode_$value",$value);
235            $items[] = array('path' => "last_node/$value", 'title' => $title,            $items[] = array('path' => "last_node/$value", 'title' => $title,
236                             'access' => user_access('access content'),                             'access' => user_access('access content'),
237                              'type' => MENU_NORMAL_ITEM);                             'type' => MENU_NORMAL_ITEM);
238          }          }
239        }        }
240      }      }
# Line 265  function _last_node_feed($type) { Line 263  function _last_node_feed($type) {
263    $channel['title'] = variable_get('site_name', 'drupal') ." ". variable_get('last_node_labelnode_'. $type, $type);    $channel['title'] = variable_get('site_name', 'drupal') ." ". variable_get('last_node_labelnode_'. $type, $type);
264    $channel['link'] = url('last_node/'.$type, NULL, NULL, TRUE);    $channel['link'] = url('last_node/'.$type, NULL, NULL, TRUE);
265    $channel['description'] = variable_get('site_name', 'drupal') ." Sezione ". variable_get('last_node_labelnode_'. $type, $type);    $channel['description'] = variable_get('site_name', 'drupal') ." Sezione ". variable_get('last_node_labelnode_'. $type, $type);
266    $channel['language'] = 'it';  
267    node_feed($result, $channel);    node_feed($result, $channel);
268  }  }
269    
# Line 319  function _last_node_page($type = NULL) { Line 317  function _last_node_page($type = NULL) {
317   */   */
318  function last_node_admin_settings() {  function last_node_admin_settings() {
319    $nodes_types = node_get_types();    $nodes_types = node_get_types();
320    
321     $form['last_node_labels'] = array(
322        '#type' => 'fieldset',
323        '#collapsible' => TRUE,
324        '#collapsed' => TRUE,
325        '#title' => t('Labels for your nodes'));
326    
327      $form['last_node_images'] = array(
328        '#type' => 'fieldset',
329        '#collapsible' => TRUE,
330        '#collapsed' => TRUE,
331        '#title' => t('Images for your nodes (Relative path)') );
332    
333    foreach ($nodes_types as $v => $k) {    foreach ($nodes_types as $v => $k) {
334      $nodes[$v] = $v;      $nodes[$v] = $v;
335      $form["last_node_labelnode_$v"] = array('#type' => 'textfield',      $form['last_node_labels']["last_node_labelnode_$v"] = array('#type' => 'textfield',
336            '#title' => t('Label for ') . $v,            '#title' => t('Label for ') . $v,
337            '#default_value' => variable_get('last_node_labelnode_'. $v,$v),            '#default_value' => variable_get('last_node_labelnode_'. $v,$v),
338            '#size' => 32,'#maxlength' => 128,            '#size' => 32,'#maxlength' => 128,
339            '#description' => t('It\'s the name for <em>') . $v . t('</em> node type that display in your last_node page'));            '#description' => t('It\'s the name for <em>') . $v . t('</em> node type that display in your last_node page'));
340    
341      $form["last_node_imagenode_$v"] = array('#type' => 'textfield',      $form['last_node_images']["last_node_imagenode_$v"] = array('#type' => 'textfield',
342            '#title' => t('Image for ') . $v .' <em>(Relative path)</em>',            '#title' => t('Image for ') . $v .' <em>(Relative path)</em>',
343            '#default_value' => variable_get('last_node_imagenode_'. $v, ''),            '#default_value' => variable_get('last_node_imagenode_'. $v, ''),
344            '#size' => 32,'#maxlength' => 128,            '#size' => 32,'#maxlength' => 128,
345            '#description' => t('It\'s the Image associated for <em>') . $v . t('</em> node type that display in your last_node page'));            '#description' => t('It\'s the Image associated for <em>') . $v . t('</em> node type that display in your last_node page'));
346    }    }
347    
348    $form['last_node_check'] = array('#type' => 'checkboxes',    $form['last_node_choice'] = array(
349        '#type' => 'fieldset',
350        '#collapsible' => TRUE,
351        '#collapsed' => TRUE,
352        '#title' => t('Choice your nodes'));
353    
354      $form['last_node_choice']['last_node_check'] = array('#type' => 'checkboxes',
355          '#title' => t('Nodes included when you point at <em>last_node/</em> node and in <em>Last 10</em> block.<br />Here active too your block of last 10 nodes for type.'),          '#title' => t('Nodes included when you point at <em>last_node/</em> node and in <em>Last 10</em> block.<br />Here active too your block of last 10 nodes for type.'),
356          '#default_value' => variable_get('last_node_check', array()),          '#default_value' => variable_get('last_node_check', array()),
357          '#options' => $nodes, '#required' => TRUE);          '#options' => $nodes, '#required' => TRUE);
358    
359    $form['last_node_blockhide'] = array('#type' => 'checkbox',    $form['last_node_other'] = array(
360        '#type' => 'fieldset',
361        '#collapsible' => TRUE,
362        '#collapsed' => TRUE,
363        '#title' => t('Other Settings'));
364    
365      $form['last_node_other']['last_node_blockhide'] = array('#type' => 'checkbox',
366          '#title' => t('<em>Auto-Hide</em> your block Last 10 for type, these will show only for node of same type display'),          '#title' => t('<em>Auto-Hide</em> your block Last 10 for type, these will show only for node of same type display'),
367          '#default_value' => variable_get('last_node_blockhide', FALSE));          '#default_value' => variable_get('last_node_blockhide', FALSE));
368    

Legend:
Removed from v.1.1.4.1.2.5  
changed lines
  Added in v.1.1.4.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2