Commit 66dff0a6 authored by Mindiell's avatar Mindiell

Converting to D7

parent 75fb2d26
; $Id$
name = "Latest nodes"
description = Generate lists of (the latest) nodes
core = 6.x
core = 7.x
package = "La Quadrature"
......@@ -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()) {
global $language;
if ($op == 'list') {
function lqdn_latest_nodes_block_list_alter(&$blocks) {
$blocks[0]['info'] = t('The latest news');
$blocks[1]['info'] = t('Latest news');
$blocks[2]['info'] = t('Latest press articles');
$blocks[3]['info'] = t('Latest publications');
$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(
'#type' => 'checkbox',
'#title' => t('Ignore the last news'),
......@@ -189,10 +190,23 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
);
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']);
}
else if ($op == 'view') {
}
/**
* Implementation of hook_block_view().
*/
function lqdn_latest_nodes_block_view($delta = '') {
global $language;
/**
* @todo gestion multilingue
*/
......@@ -202,29 +216,29 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
);
switch($delta) {
case 0:
case '':
$block = array(
'subject' => '',
'content' => _lqdn_latest_nodes_the_latest_news(),
);
break;
case 1:
case '1':
$block = array();
$block['subject'] = t("Quad'news");
$block['content'] = _lqdn_latest_nodes_latest_news();
break;
case 2:
case '2':
$block = array();
$block['subject'] = t('Press review');
$block['content'] = _lqdn_latest_nodes_latest_press_articles();
break;
case 3:
case '3':
$block = array(
'subject' => t('Latest content'),
'content' => _lqdn_latest_nodes_latest_nodes() . '<div style="clear:both;"></div>',
);
break;
case 4:
case '4':
$block = array(
'subject' => '',
'content' => _lqdn_latest_nodes_latest_news_and_press_articles(),
......@@ -237,7 +251,6 @@ function lqdn_latest_nodes_block($op = 'list', $delta = 0, $edit = array()) {
}
return $block;
}
}
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