| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: taxonomy_sifter.module,v 1.3.2.3 2008/11/15 11:12:08 tbarregren Exp $ |
// $Id: taxonomy_sifter.module,v 1.3.2.4 2008/11/15 15:43:31 tbarregren Exp $ |
| 4 |
|
|
| 5 |
|
|
| 6 |
/** |
/** |
| 65 |
case 'admin/modules#description': |
case 'admin/modules#description': |
| 66 |
return t('Provides a block with terms which <em>any</em> or <em>all</em> selected must apply to a node for it to be listed when viewing a taxonomy term page, e.g. <code>taxonomy/term/...</code>'); |
return t('Provides a block with terms which <em>any</em> or <em>all</em> selected must apply to a node for it to be listed when viewing a taxonomy term page, e.g. <code>taxonomy/term/...</code>'); |
| 67 |
case 'admin/help#taxonomy_sifter': |
case 'admin/help#taxonomy_sifter': |
| 68 |
return _taxonomy_sifter_help(); |
return t('<a href="http://drupal.org/project/taxonomy_sifter">Taxonomy Sifter</a> provides a block where the user can select terms that will automatically be combined with the terms in every request of the form <code>taxonomy/term/...</code> for the duration of their session. The selected terms are combined with the same operator already used in the request. If no operator is used, that is a single term is given, the sifter uses the operator given in the module\'s settings. The vocabularies of the terms presented in the sifter block is also configurable. For further documentation, see the <a href="http://drupal.org/node/22273">handbook</a>.'); |
| 69 |
} |
} |
| 70 |
} |
} |
| 71 |
|
|
| 373 |
function _taxonomy_sifter_session_set_terms($form_id, $terms = array()) { |
function _taxonomy_sifter_session_set_terms($form_id, $terms = array()) { |
| 374 |
$_SESSION['taxonomy_sifter_terms'] = $terms; |
$_SESSION['taxonomy_sifter_terms'] = $terms; |
| 375 |
} |
} |
|
|
|
|
|
|
|
/***************************************************************************** |
|
|
* HELP |
|
|
*****************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Returns full help text. |
|
|
*/ |
|
|
function _taxonomy_sifter_help() { |
|
|
|
|
|
// Load the help text. |
|
|
$help = file_get_contents('taxonomy_sifter.help', FILE_USE_INCLUDE_PATH); |
|
|
|
|
|
// Abort if we can't find the file. |
|
|
if (!$help) return; |
|
|
|
|
|
// Substitute variables and translate. |
|
|
$version = str_replace(array('$Re'.'vision:', ' $'), array('', ''), '$Revision: 1.3.2.3 $'); |
|
|
$year = substr('$Date: 2008/11/15 11:12:08 $', 7, 4); |
|
|
$help = t($help, array('!version' => $version, '!year' => $year)); |
|
|
|
|
|
// Add some style. (This is really dirty, but...) |
|
|
$style = <<<EOT |
|
|
<style type="text/css" media="all"> |
|
|
/*<![CDATA[*/ |
|
|
code, kbd, pre { padding: 1px; font-family: "Bitstream Vera Sans Mono", Monaco, "Lucida Console", monospace; background-color: #EDF1F3; } |
|
|
/*]]>*/ |
|
|
</style> |
|
|
EOT; |
|
|
$help = $style . $help; |
|
|
|
|
|
return $help; |
|
|
|
|
|
} |
|