Commit 66dff0a6 authored by Mindiell's avatar Mindiell

Converting to D7

parent 75fb2d26
; $Id$ ; $Id$
name = "Latest nodes" name = "Latest nodes"
description = Generate lists of (the latest) nodes description = Generate lists of (the latest) nodes
core = 6.x core = 7.x
package = "La Quadrature" package = "La Quadrature"
...@@ -168,20 +168,21 @@ function lqdn_latest_nodes_list($_type, $_dossier = NULL, $_title = NULL, $_nb = ...@@ -168,20 +168,21 @@ function lqdn_latest_nodes_list($_type, $_dossier = NULL, $_title = NULL, $_nb =
} }
/** /**
* Implementation of hook_block(). * Implementation of hook_blocki_list_alter().
*/ */
function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) { function lqdn_latest_nodes_block_list_alter(&$blocks) {
global $language;
if ($op == 'list') {
$blocks[0]['info'] = t('The latest news'); $blocks[0]['info'] = t('The latest news');
$blocks[1]['info'] = t('Latest news'); $blocks[1]['info'] = t('Latest news');
$blocks[2]['info'] = t('Latest press articles'); $blocks[2]['info'] = t('Latest press articles');
$blocks[3]['info'] = t('Latest publications'); $blocks[3]['info'] = t('Latest publications');
$blocks[4]['info'] = t('Latest publications (news and press articles)'); $blocks[4]['info'] = t('Latest publications (news and press articles)');
return $blocks; }
}
else if ($op == 'configure' && $delta == 1) { /**
* Implementation of hook_block_configure().
*/
function lqdn_latest_nodes_block_configure($delta = '') {
if ($delta == '1') {
$form['ignore_the_latest_news'] = array( $form['ignore_the_latest_news'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('Ignore the last news'), '#title' => t('Ignore the last news'),
...@@ -189,10 +190,23 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -189,10 +190,23 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
); );
return $form; return $form;
} }
else if ($op == 'save' && $delta == 1) { }
/**
* Implementation of hook_block_save().
*/
function lqdn_latest_nodes_block_save($delta = '', edit=array()) {
if ($delta == '1') {
variable_set('ignore_the_latest_news', $edit['ignore_the_latest_news']); variable_set('ignore_the_latest_news', $edit['ignore_the_latest_news']);
} }
else if ($op == 'view') { }
/**
* Implementation of hook_block_view().
*/
function lqdn_latest_nodes_block_view($delta = '') {
global $language;
/** /**
* @todo gestion multilingue * @todo gestion multilingue
*/ */
...@@ -202,29 +216,29 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -202,29 +216,29 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
); );
switch($delta) { switch($delta) {
case 0: case '':
$block = array( $block = array(
'subject' => '', 'subject' => '',
'content' => _lqdn_latest_nodes_the_latest_news(), 'content' => _lqdn_latest_nodes_the_latest_news(),
); );
break; break;
case 1: case '1':
$block = array(); $block = array();
$block['subject'] = t("Quad'news"); $block['subject'] = t("Quad'news");
$block['content'] = _lqdn_latest_nodes_latest_news(); $block['content'] = _lqdn_latest_nodes_latest_news();
break; break;
case 2: case '2':
$block = array(); $block = array();
$block['subject'] = t('Press review'); $block['subject'] = t('Press review');
$block['content'] = _lqdn_latest_nodes_latest_press_articles(); $block['content'] = _lqdn_latest_nodes_latest_press_articles();
break; break;
case 3: case '3':
$block = array( $block = array(
'subject' => t('Latest content'), 'subject' => t('Latest content'),
'content' => _lqdn_latest_nodes_latest_nodes() . '<div style="clear:both;"></div>', 'content' => _lqdn_latest_nodes_latest_nodes() . '<div style="clear:both;"></div>',
); );
break; break;
case 4: case '4':
$block = array( $block = array(
'subject' => '', 'subject' => '',
'content' => _lqdn_latest_nodes_latest_news_and_press_articles(), 'content' => _lqdn_latest_nodes_latest_news_and_press_articles(),
...@@ -237,7 +251,6 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -237,7 +251,6 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
} }
return $block; return $block;
}
} }
function _lqdn_latest_nodes_the_latest_news() { function _lqdn_latest_nodes_the_latest_news() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment