Commit b24767ec authored by Mindiell's avatar Mindiell

Converting to D7

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