Commit b24767ec authored by Mindiell's avatar Mindiell

Converting to D7

parent e0dc66a6
; $Id$ ; $Id$
name = "Modifie le champ date pour la revue de presse" name = "Modifie le champ date pour la revue de presse"
description = Modifie le champ date pour la revue de presse description = Modifie le champ date pour la revue de presse
core = 6.x core = 7.x
package = "La Quadrature" package = "La Quadrature"
...@@ -25,35 +25,33 @@ function lqdn_rp_date_submit($form, &$form_state) { ...@@ -25,35 +25,33 @@ function lqdn_rp_date_submit($form, &$form_state) {
unset($form_state['values']['date_time']); unset($form_state['values']['date_time']);
} }
function lqdn_rp_db_rewrite_sql($query, $primary_table, $primary_field, $args) { function lqdn_rp_query_alter($query) {
if ($primary_table == 'n' && $primary_field == 'nid' && // If node access
substr($_GET['q'], 0, 14) == 'taxonomy/term/') { if ($query->hasTag('node_access') && substr($_GET['q'], 0, 14) == 'taxonomy/term/') {
$rp= trim($_GET['rp']); $rp= trim($_GET['rp']);
switch ($rp) switch ($rp)
{ {
case 'only': case 'only':
$return['where'] = "n.type = 'revue_de_presse'"; $query->where("n.type=:n_type", array("n_type"=>"revue_de_presse"));
return $return;
break; break;
case 'yes': case 'yes':
break; break;
default: default:
$return['where'] = "n.type <> 'revue_de_presse'"; $query->where("n.type <> :n_type", array("n_type"=>"revue_de_presse"));
return $return;
} }
} }
} }
function lqdn_rp_block ($op = 'list', $delta = 0, $edit = array()) { function lqdn_rp_block_list_alter (&$blocks) {
if ($op == 'list') { //t: Revue de presse d'une étiquette
$blocks[0]['info'] = t('Press Review of a tag'); $blocks[0]['info'] = t('Press Review of a tag');
$blocks[0]['region'] = 'region-right'; $blocks[0]['region'] = 'region-right';
$blocks[0]['visibility'] = 1; $blocks[0]['visibility'] = 1;
$blocks[0]['pages'] = 'taxonomy/term/*'; $blocks[0]['pages'] = 'taxonomy/term/*';
//t: Revue de presse d'une étiquette }
return $blocks;
} function lqdn_rp_block_view ($delta = '') {
elseif ($op == 'view' && $delta == 0 && substr($_GET['q'], 0, 14) == 'taxonomy/term/') { if ($delta == '' && substr($_GET['q'], 0, 14) == 'taxonomy/term/') {
$tid = intval(substr($_GET['q'], 14)); $tid = intval(substr($_GET['q'], 14));
if ($tid > 0) { if ($tid > 0) {
$dossier = new stdClass; $dossier = new stdClass;
......
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