From 96f6051c34f68206c2e8d0c5e557dbc7bb8b19e4 Mon Sep 17 00:00:00 2001
From: Manuel Cillero
Date: Wed, 26 Jul 2017 13:22:53 +0200
Subject: [PATCH] New module 'Content Taxonomy'
---
.../all/modules/content_taxonomy/LICENSE.txt | 274 ++++++++
sites/all/modules/content_taxonomy/README.txt | 48 ++
.../content_taxonomy/content_taxonomy.info | 15 +
.../content_taxonomy/content_taxonomy.install | 210 ++++++
.../content_taxonomy/content_taxonomy.module | 540 +++++++++++++++
.../content_taxonomy_autocomplete.info | 15 +
.../content_taxonomy_autocomplete.install | 38 ++
.../content_taxonomy_autocomplete.module | 423 ++++++++++++
.../content_taxonomy_options.info | 17 +
.../content_taxonomy_options.install | 38 ++
.../content_taxonomy_options.module | 101 +++
.../content_taxonomy_tree.info | 16 +
.../content_taxonomy_tree.install | 39 ++
.../content_taxonomy_tree.module | 201 ++++++
.../includes/content_taxonomy.token.inc | 56 ++
.../includes/views/content_taxonomy.views.inc | 17 +
...nt_taxonomy_handler_filter_many_to_one.inc | 21 +
.../tests/content_taxonomy.test | 642 ++++++++++++++++++
.../content_taxonomy/translations/fr.po | 298 ++++++++
.../content_taxonomy/translations/hu.po | 413 +++++++++++
.../content_taxonomy/translations/ja.po | 222 ++++++
21 files changed, 3644 insertions(+)
create mode 100644 sites/all/modules/content_taxonomy/LICENSE.txt
create mode 100644 sites/all/modules/content_taxonomy/README.txt
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy.info
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy.install
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy.module
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.info
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.install
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.module
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_options.info
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_options.install
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_options.module
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_tree.info
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_tree.install
create mode 100644 sites/all/modules/content_taxonomy/content_taxonomy_tree.module
create mode 100644 sites/all/modules/content_taxonomy/includes/content_taxonomy.token.inc
create mode 100644 sites/all/modules/content_taxonomy/includes/views/content_taxonomy.views.inc
create mode 100644 sites/all/modules/content_taxonomy/includes/views/content_taxonomy_handler_filter_many_to_one.inc
create mode 100644 sites/all/modules/content_taxonomy/tests/content_taxonomy.test
create mode 100644 sites/all/modules/content_taxonomy/translations/fr.po
create mode 100644 sites/all/modules/content_taxonomy/translations/hu.po
create mode 100644 sites/all/modules/content_taxonomy/translations/ja.po
diff --git a/sites/all/modules/content_taxonomy/LICENSE.txt b/sites/all/modules/content_taxonomy/LICENSE.txt
new file mode 100644
index 0000000..2c095c8
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/LICENSE.txt
@@ -0,0 +1,274 @@
+GNU GENERAL PUBLIC LICENSE
+
+ Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
+Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
+verbatim copies of this license document, but changing it is not allowed.
+
+ Preamble
+
+The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software--to
+make sure the software is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software and to any other
+program whose authors commit to using it. (Some other Free Software
+Foundation software is covered by the GNU Library General Public License
+instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you have the
+freedom to distribute copies of free software (and charge for this service if
+you wish), that you receive source code or can get it if you want it, that you
+can change the software or use pieces of it in new free programs; and that
+you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to
+deny you these rights or to ask you to surrender the rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have. You must make
+sure that they, too, receive or can get the source code. And you must show
+them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software. If the
+software is modified by someone else and passed on, we want its recipients
+to know that what they have is not the original, so that any problems
+introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We
+wish to avoid the danger that redistributors of a free program will individually
+obtain patent licenses, in effect making the program proprietary. To prevent
+this, we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
+ MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms
+of this General Public License. The "Program", below, refers to any such
+program or work, and a "work based on the Program" means either the
+Program or any derivative work under copyright law: that is to say, a work
+containing the Program or a portion of it, either verbatim or with
+modifications and/or translated into another language. (Hereinafter, translation
+is included without limitation in the term "modification".) Each licensee is
+addressed as "you".
+
+Activities other than copying, distribution and modification are not covered
+by this License; they are outside its scope. The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made
+by running the Program). Whether that is true depends on what the Program
+does.
+
+1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you
+may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it,
+thus forming a work based on the Program, and copy and distribute such
+modifications or work under the terms of Section 1 above, provided that you
+also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that
+you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in
+part contains or is derived from the Program or any part thereof, to be
+licensed as a whole at no charge to all third parties under the terms of this
+License.
+
+c) If the modified program normally reads commands interactively when run,
+you must cause it, when started running for such interactive use in the most
+ordinary way, to print or display an announcement including an appropriate
+copyright notice and a notice that there is no warranty (or else, saying that
+you provide a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this License.
+(Exception: if the Program itself is interactive but does not normally print such
+an announcement, your work based on the Program is not required to print
+an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable
+sections of that work are not derived from the Program, and can be
+reasonably considered independent and separate works in themselves, then
+this License, and its terms, do not apply to those sections when you distribute
+them as separate works. But when you distribute the same sections as part
+of a whole which is a work based on the Program, the distribution of the
+whole must be on the terms of this License, whose permissions for other
+licensees extend to the entire whole, and thus to each and every part
+regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to
+work written entirely by you; rather, the intent is to exercise the right to
+control the distribution of derivative or collective works based on the
+Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the scope
+of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1
+and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source
+code, which must be distributed under the terms of Sections 1 and 2 above
+on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give
+any third party, for a charge no more than your cost of physically performing
+source distribution, a complete machine-readable copy of the corresponding
+source code, to be distributed under the terms of Sections 1 and 2 above on
+a medium customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer to distribute
+corresponding source code. (This alternative is allowed only for
+noncommercial distribution and only if you received the program in object
+code or executable form with such an offer, in accord with Subsection b
+above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source code
+means all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation and
+installation of the executable. However, as a special exception, the source
+code distributed need not include anything that is normally distributed (in
+either source or binary form) with the major components (compiler, kernel,
+and so on) of the operating system on which the executable runs, unless that
+component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to
+copy from a designated place, then offering equivalent access to copy the
+source code from the same place counts as distribution of the source code,
+even though third parties are not compelled to copy the source along with the
+object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License. Any attempt otherwise to copy,
+modify, sublicense or distribute the Program is void, and will automatically
+terminate your rights under this License. However, parties who have received
+copies, or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the
+Program or its derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or distributing the
+Program (or any work based on the Program), you indicate your acceptance
+of this License to do so, and all its terms and conditions for copying,
+distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these terms and
+conditions. You may not impose any further restrictions on the recipients'
+exercise of the rights granted herein. You are not responsible for enforcing
+compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices. Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose
+that choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original copyright
+holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded. In such
+case, this License incorporates the limitation as if written in the body of this
+License.
+
+9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will be
+similar in spirit to the present version, but may differ in detail to address new
+problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies
+a version number of this License which applies to it and "any later version",
+you have the option of following the terms and conditions either of that
+version or of any later version published by the Free Software Foundation. If
+the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission. For software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we sometimes make
+exceptions for this. Our decision will be guided by the two goals of
+preserving the free status of all derivatives of our free software and of
+promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
+PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
+AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
+ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE
+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
+OR DATA BEING RENDERED INACCURATE OR LOSSES
+SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
+IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/sites/all/modules/content_taxonomy/README.txt b/sites/all/modules/content_taxonomy/README.txt
new file mode 100644
index 0000000..5e26196
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/README.txt
@@ -0,0 +1,48 @@
+Content Taxonomy:
+*****************
+
+This module provides a field type for cck for referencing taxonomy terms.
+
+The content_taxonomy.module implements all basic field functions.
+The other modules offer different widgets (selects,..)
+
+Installation:
+-------------
+1. Install this files into the modules directory of your choice (for example, sites/yoursite.com/modules/content_taxonomy).
+2. Enable content_taxonomy.module in the admin/modules page
+3. Enable wanted widgets in admin/modules (e.g. content_taxonomy_select.module) Note: all require content_taxonomy.module!
+4. Optional enable content_taxonomy_views.module for improved taxonomy-views support
+
+Settings:
+---------
+For every field you have to select the vocabulary and optional a parent term in the field settings.
+If a parent is selected, only children of this parent will be given to the form, else the whole vocabulary.
+Additional you can choose whether the term is saved as a real tag in the term_node table (standard)
+or the term is only saved in a cck-table (so not a real term - node connection)
+
+
+
+content_taxonomy_options:
+-------------------------
+ provides a options widget type
+ this includes:
+ - radios/checkboxes (depends on single/multiple)
+ - multiple/single select field (opt-groups are possible)
+
+content_taxonomy_autocomplete:
+------------------------------
+ provides autocomplete. synonyms are considered by this autocomplete. Optional you can restrict the
+ saving of new terms.
+
+content_taxonomy_activeselect:
+------------------------------
+ requires the activeselect.module
+ offers dependent selects, at the moment 2-3 bars are possible
+
+
+
+Author:
+-------
+Matthias Hutterer
+mh86@drupal.org
+m_hutterer@hotmail.com
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy.info b/sites/all/modules/content_taxonomy/content_taxonomy.info
new file mode 100644
index 0000000..c20c6c1
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy.info
@@ -0,0 +1,15 @@
+; $Id: content_taxonomy.info,v 1.1.2.2.2.1 2008/04/30 08:05:19 mh86 Exp $
+name = Content Taxonomy
+description = Defines a field type for taxonomy terms
+dependencies[] = content
+dependencies[] = taxonomy
+package = CCK
+core = 6.x
+
+
+; Information added by drupal.org packaging script on 2009-08-19
+version = "6.x-1.0-rc2"
+core = "6.x"
+project = "content_taxonomy"
+datestamp = "1250688034"
+
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy.install b/sites/all/modules/content_taxonomy/content_taxonomy.install
new file mode 100644
index 0000000..88f752f
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy.install
@@ -0,0 +1,210 @@
+ $fields) {
+ foreach ($fields as $field) {
+ switch ($field['type']) {
+ case 'content_taxonomy':
+ $db_info = content_database_info($field);
+ $table = $db_info['table'];
+
+ //fix old settings first and map them to the new ones.
+ $result = db_query("SELECT * FROM {". content_field_tablename() ."} WHERE type = 'content_taxonomy' AND field_name = '%s'", $field['field_name']);
+ while ($field = db_fetch_array($result)) {
+ $field_settings = unserialize($field['global_settings']);
+ $field_settings['save_term_node'] = isset($field_settings['save_term_node']) ? $field_settings['save_term_node'] : 0;
+ if ($field_settings['save'] == 'tag') {
+ $field_settings['save_term_node'] = 1;
+ $field['type_name'] = $type_name;
+ $field['columns'] = $db_info['columns'];
+ content_alter_schema(array(), $field);
+
+ $sql_nodes = db_query("SELECT * FROM {node} WHERE type = '%s'", $type_name);
+ while ($node = db_fetch_object($sql_nodes)) {
+ $tids = content_taxonomy_install_terms_by_field($node, $field_settings);
+ foreach ($tids as $tid) {
+ $record = array();
+ foreach ($db_info['columns'] as $column => $attributes) {
+ $record[$attributes['column']] = $tid;
+ }
+ $record['nid'] = $node->nid;
+ $record['vid'] = $node->vid;
+ if ($field['multiple']) {
+ $record['delta'] = $tid;
+ }
+ if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE vid = %d", $node->vid))) {
+ content_write_record($table, $record, array('vid'));
+ }
+ else {
+ content_write_record($table, $record);
+ }
+ }
+ }
+ }
+ if ($field_settings['save'] == 'both') {
+ $field_settings['save_term_node'] = 1;
+ }
+ unset($field_settings['save']);
+ $field_settings['hide_taxonomy_fields'] = isset($field_settings['hide_taxonomy_fields']) ? $field_settings['hide_taxonomy_fields'] : TRUE;
+ $field_settings['parent'] = $field_settings['tid'];
+
+ $field['global_settings'] = array();
+ $setting_names = module_invoke($field['module'], 'field_settings', 'save', $field);
+ if (is_array($setting_names)) {
+ foreach ($setting_names as $setting) {
+ $field['global_settings'][$setting] = isset($field_settings[$setting]) ? $field_settings[$setting] : '';
+ }
+ }
+ // 'columns' is a reserved word in MySQL4, so our column is named 'db_columns'.
+ $field['db_columns'] = $field['columns'];
+ drupal_write_record(content_field_tablename(), $field, 'field_name');
+ }
+
+ foreach ($db_info['columns'] as $column => $attributes) {
+ $attributes['not null'] = FALSE;
+ $column = $attributes['column'];
+ db_change_field($ret, $table, $column, $column, $attributes);
+ db_field_set_no_default($ret, $table, $column);
+ $ret[] = update_sql("UPDATE {". $table ."} SET ". $column ." = NULL WHERE ". $column ." = 0");
+
+ }
+ break;
+ }
+ }
+ }
+ content_associate_fields('content_taxonomy');
+ content_associate_fields('content_autocomplete');
+ content_associate_fields('content_options');
+ content_clear_type_cache(TRUE);
+ return $ret;
+}
+
+/**
+ * Implemenation of hook_update_N().
+ *
+ * Renaming of the Parent setting
+ */
+function content_taxonomy_update_6001() {
+ drupal_load('module', 'content');
+ $result = db_query("SELECT * FROM {". content_field_tablename() ."} WHERE type = 'content_taxonomy'");
+ while ($field = db_fetch_array($result)) {
+ $field['global_settings'] = unserialize($field['global_settings']);
+ if (!is_null($field['global_settings']['tid'])) {
+ $field['global_settings']['parent'] = $field['global_settings']['tid'];
+ unset($field['global_settings']['tid']);
+ }
+ // 'columns' is a reserved word in MySQL4, so our column is named 'db_columns'.
+ $field['db_columns'] = $field['columns'];
+ drupal_write_record(content_field_tablename(), $field, 'field_name');
+ }
+ $result = db_query("SELECT * FROM {". content_instance_tablename() ."} WHERE widget_type = 'content_taxonomy_select'");
+ while ($field = db_fetch_array($result)) {
+ $field['widget_settings'] = unserialize($field['widget_settings']);
+ $field['widget_settings']['group_parent'] = $field['widget_settings']['group_tid'];
+ unset($field['widget_settings']['group_tid']);
+ drupal_write_record(content_instance_tablename(), $field, array('field_name', 'type_name'));
+ }
+ return array();
+}
+
+/**
+ * Implemenation of hook_update_N().
+ *
+ * Fixing parent setting
+ */
+function content_taxonomy_update_6002() {
+ drupal_load('module', 'content');
+ $result = db_query("SELECT * FROM {". content_field_tablename() ."} WHERE type = 'content_taxonomy'");
+ while ($field = db_fetch_array($result)) {
+ $field['global_settings'] = unserialize($field['global_settings']);
+ if (!$field['global_settings']['parent']) {
+ $field['global_settings']['parent'] = 0;
+ }
+ // 'columns' is a reserved word in MySQL4, so our column is named 'db_columns'.
+ $field['db_columns'] = $field['columns'];
+ drupal_write_record(content_field_tablename(), $field, 'field_name');
+ }
+ return array();
+}
+/**
+ * Helper function to get values from term_node table
+ * needed in update from 5.x to 6.x
+ */
+function content_taxonomy_install_terms_by_field($node, $field) {
+ $terms = array();
+ if (is_numeric($field['tid']) && $field['tid'] > 0 && $field['depth'] == 1) {
+ $result = db_query("SELECT n.tid FROM {term_hierarchy} h, {term_node} n, {term_data} td WHERE
+ n.nid = %d AND n.tid = h.tid AND h.parent = %d AND td.tid=n.tid AND td.vid=%d",
+ $node->nid, $field['tid'], $field['vid']);
+
+ while ($data = db_fetch_array($result)) {
+ $terms[$data["tid"]] = $data["tid"];
+ }
+ }
+ else {
+ $result = taxonomy_node_get_terms_by_vocabulary($node, $field['vid']);
+ foreach ($result as $tid => $term) {
+ $terms[$tid] = $tid;
+ }
+ }
+
+ return $terms;
+}
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy.module b/sites/all/modules/content_taxonomy/content_taxonomy.module
new file mode 100644
index 0000000..537f3d0
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy.module
@@ -0,0 +1,540 @@
+'. t('Defines a CCK field type for referencing taxonomy terms. The fields are independent from vocabulary settings and can be configured through the CCK admin field pages. The Content Taxonomy Module provides different widget types, at the moment including Option Widgets (Radios / Checkboxes, Selects), Autocompletes, Tree). The widget modules have to be enabled separately.') .'
';
+ }
+}
+
+/**
+ * Implementation of hook_init().
+ */
+function content_taxonomy_init() {
+ if (module_exists('token')) {
+ module_load_include('inc', 'content_taxonomy', 'includes/content_taxonomy.token');
+ }
+}
+
+/**
+ * Implementation of hook_theme().
+ */
+function content_taxonomy_theme() {
+ return array(
+ 'content_taxonomy_formatter_default' => array(
+ 'arguments' => array('element' => NULL),
+ ),
+ 'content_taxonomy_formatter_link' => array(
+ 'arguments' => array('element' => NULL),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_field_info().
+ */
+function content_taxonomy_field_info() {
+ return array(
+ 'content_taxonomy' => array(
+ 'label' => t('Content Taxonomy Fields'),
+ 'description' => t('Stores terms for nodes in the database.'),
+ 'callbacks' => array(
+ 'tables' => CONTENT_CALLBACK_DEFAULT,
+ 'arguments' => CONTENT_CALLBACK_DEFAULT,
+ ),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_field_settings().
+ */
+function content_taxonomy_field_settings($op, $field) {
+ switch ($op) {
+ case 'form':
+ $form = array();
+
+ $form['save_term_node'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Save values additionally to the core taxonomy system (into the \'term_node\' table).'),
+ '#default_value' => is_numeric($field['save_term_node']) ? $field['save_term_node'] : 0,
+ '#description' => t('If this option is set, saving of terms is additionally handled by the taxonomy module. So saved terms from Content Taxonomy fields will appear as any other terms saved by the core taxonomy module. Set this option if you are using any other taxonomy application, like tagadelic. Otherwise terms are only saved in the cck tables and can only be accessed via the node or a view'),
+ );
+
+ $options_voc = array();
+ foreach (taxonomy_get_vocabularies() as $voc) {
+ _content_taxonomy_localize_vocabulary($voc);
+ $options_voc[$voc->vid] = $voc->name;
+ }
+
+ $form['vid'] = array(
+ '#title' => t('Vocabulary'),
+ '#type' => 'select',
+ '#default_value' => is_numeric($field['vid']) ? $field['vid'] : 0,
+ '#options' => $options_voc,
+ '#description' => t('Terms of the selected vocabulary get exposed to the field'),
+ );
+
+ $form['hierarchical_vocabulary'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Advanced settings for hierarchical vocabularies'),
+ '#collapsible' => TRUE,
+ );
+
+ $form['hierarchical_vocabulary']['parent'] = array(
+ '#title' => t('Parent Term'),
+ '#type' => 'select',
+ '#default_value' => is_numeric($field['parent']) ? $field['parent'] : 0,
+ '#options' => _content_taxonomy_get_all_terms(),
+ '#description' => t('If any term is selected here, only child terms of the selected are going to be exposed the field. Otherwise the whole vocabulary selected above'),
+ );
+ $form['hierarchical_vocabulary']['parent_php_code_fieldset'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Advanced PHP code'),
+ '#collapsible' => TRUE,
+ '#collapsed' => empty($field['parent_php_code']) ,
+ );
+ $form['hierarchical_vocabulary']['parent_php_code_fieldset']['parent_php_code'] = array(
+ '#title' => t('PHP Code for selecting the parent term'),
+ '#type' => 'textarea',
+ '#default_value' => !empty($field['parent_php_code']) ? $field['parent_php_code'] : '',
+ '#rows' => 3,
+ '#description' => t('Advanced usage only: PHP code that returns the parent term ID. Should not include <?php ?> delimiters. If this field is filled out, the ID returned by this code will override the selected parent above.'),
+ );
+
+ $form['hierarchical_vocabulary']['depth'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Depth of taxonomy tree'),
+ '#default_value' => is_numeric($field['depth']) ? $field['depth'] : '',
+ '#description' => t('By setting a numeric value, the depth of the hierarchy shown can be limited. Leave this field blank to show the whole hierarchy.'),
+ );
+
+
+ return $form;
+
+ case 'save':
+ return array('save_term_node', 'vid', 'parent', 'parent_php_code', 'depth');
+
+ case 'database columns':
+ return array(
+ 'value' => array('type' => 'int', 'not null' => FALSE, 'sortable' => FALSE),
+ );
+
+ case 'views data':
+ $data = content_views_field_views_data($field);
+ $table_alias = content_views_tablename($field);
+
+ // Add a relation to the taxonomy term table.
+ $data[$table_alias][$field['field_name'] .'_value']['relationship'] = array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'term_data',
+ 'field' => 'tid',
+ 'label' => t('@field-title term', array('@field-title' => check_plain(t($field['widget']['label'])))),
+ );
+
+ // Swap the filter handler to the 'in' operator.
+ $data[$table_alias][$field['field_name'] .'_value']['filter']['handler'] = 'content_taxonomy_handler_filter_many_to_one';
+ return $data;
+ }
+}
+
+/**
+ * Implementation of hook_field().
+ */
+function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
+ switch ($op) {
+ case 'presave':
+ if ($field['save_term_node']) {
+ static $_content_taxonomy_array_cleared;
+ if (!is_array($_content_taxonomy_array_cleared) || !$_content_taxonomy_array_cleared[$node->nid][$field['vid']]) {
+ _content_taxonomy_taxonomy_unset($node->taxonomy, array($field['vid']));
+ $_content_taxonomy_array_cleared[$node->nid][$field['vid']] = TRUE;
+ }
+
+ foreach ($items as $key => $entry) {
+ if ($entry['value']) {
+ if (is_object($node->taxonomy[$entry['value']])
+ || (is_array($node->taxonomy) && in_array($entry['value'], $node->taxonomy))
+ || (isset($entry['_remove']) && $entry['_remove'] == 1)) {
+ continue;
+ }
+ elseif (is_array($node->taxonomy[$field['vid']])) {
+ if (!in_array($entry['value'], $node->taxonomy[$field['vid']])) {
+ $node->taxonomy[$field['vid']][] = $entry['value'];
+ }
+ }
+ // when saving an existing node without presenting a form to the user,
+ // the terms are objects keyed by tid. there's no need to re-set these
+ // terms, and to do so causes php warnings because the database rejects
+ // the row insert because of primary key constraints.
+ else {
+ $node->taxonomy[$field['vid']] = array($entry['value']);
+ }
+ }
+ }
+ // the $node->taxonomy array should never be empty, because in this case the
+ // taxonomy nodeapi doesn't call taxonomy_node_save which handles removing
+ // and inserting of terms
+ if (empty($node->taxonomy)) {
+ $node->taxonomy[$field['vid']] = NULL;
+ }
+ }
+ break;
+ }
+}
+
+
+/**
+ * Implementation of hook_field_formatter_info().
+ */
+function content_taxonomy_field_formatter_info() {
+ return array(
+ 'default' => array(
+ 'label' => t('As Text'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_CORE,
+ ),
+ 'link' => array(
+ 'label' => t('As Link'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_CORE,
+ ),
+ );
+}
+
+
+/**
+ * Theme function for 'default' text field formatter.
+ */
+function theme_content_taxonomy_formatter_default($element) {
+ if (!empty($element['#item']['value'])) {
+ $term = taxonomy_get_term($element['#item']['value']);
+ _content_taxonomy_localize_term($term);
+ return check_plain($term->name);
+ }
+}
+
+
+/**
+ * Theme function for 'link' text field formatter.
+ */
+function theme_content_taxonomy_formatter_link($element) {
+ if (!empty($element['#item']['value'])) {
+ $term = taxonomy_get_term($element['#item']['value']);
+ _content_taxonomy_localize_term($term);
+ return l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => $term->description)));
+ }
+}
+
+/**
+ * Implementation of hook_content_is_empty().
+ */
+function content_taxonomy_content_is_empty($item, $field) {
+ if (empty($item['value']) || $item['value'] == 0) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * Called by content_allowed_values to create the $options array for the content_taxonomy_options
+ */
+function content_taxonomy_allowed_values($field) {
+ $options = array();
+
+ //for opt groups call different function
+ if (isset($field['widget']['group_parent']) && $field['widget']['group_parent'] > 0) {
+ return content_taxonomy_allowed_values_groups($field);
+ }
+
+ $depth = (is_numeric($field['depth'])) ? $field['depth'] : NULL;
+
+ $tree = taxonomy_get_tree($field['vid'], content_taxonomy_field_get_parent($field), -1, $depth);
+
+ if (is_array($tree)) {
+ foreach ($tree as $term) {
+ _content_taxonomy_localize_term($term);
+ if ($field['widget']['show_depth']) {
+ $value = str_repeat(' - ', $term->depth) . $term->name;
+ }
+ else {
+ $value = $term->name;
+ }
+ //do a check_plain except for selects because form api does that
+ $options[$term->tid] = ($field['widget']['type'] == 'content_taxonomy_select') ? $value : check_plain($value);
+ }
+ }
+ if (($field['widget']['type'] == 'content_taxonomy_select' && !$field['multiple']) || ($field['widget']['type'] == 'content_taxonomy_options' && !$field['multiple'] && !$field['required'])) {
+ $options = array('' => theme('content_taxonomy_options_widgets_none', $field)) + $options;
+ }
+ return $options;
+}
+
+/**
+ * Creating Opt Groups for content_taxonomy_options
+ */
+function content_taxonomy_allowed_values_groups($field) {
+ $options = array();
+ $parent = content_taxonomy_field_get_parent($field);
+ $group_parent = $field['widget']['group_parent'];
+
+ //if children in no group
+ $default_terms = taxonomy_get_children($parent, $field['vid']);
+ foreach ($default_terms as $default_term) {
+ _content_taxonomy_localize_term($default_term);
+ $options[$default_term->tid] = check_plain($default_term->name);
+ }
+ foreach (taxonomy_get_children($group_parent) as $group) {
+ foreach (taxonomy_get_children($group->tid) as $term) {
+ _content_taxonomy_localize_term($term);
+ $options[$group->name][$term->tid] = check_plain($term->name);
+ unset($options[$term->tid]);
+ }
+ unset($options[$group->tid]);
+ }
+ return $options;
+}
+
+/**
+ * Returns the parent term ID for one field
+ * can be 0 is no parent is selected or if the php code returns 0
+ *
+ * use this function instead of directly accessing $field['parent'] because of possible php code
+ *
+ * @param $field The Content Taxonomy Field
+ */
+function content_taxonomy_field_get_parent($field) {
+ if (!empty($field['parent_php_code'])) {
+ return eval($field['parent_php_code']);
+ }
+ return $field['parent'];
+}
+
+
+/**
+ * Implementation of hook_form_alter().
+ *
+ * hides the taxonomy form if there exists a content taxonomy field, which is set to 'hide default taxonomy fields'
+ */
+function content_taxonomy_form_alter(&$form, $form_state, $form_id) {
+ if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id && isset($form['taxonomy'])) {
+ if (!is_array($form['taxonomy'])) {
+ // empty taxonomy arrays can cause errors on preview
+ if ($form_state['post']['op'] == t('Preview')) {
+ $form['taxonomy'] = array('#tree' => TRUE);
+ $form['taxonomy']['key'] = array('#type' => 'value', '#value' => '');
+ return;
+ }
+ }
+ $_content_taxonomy_vids = array();
+ $info = _content_type_info();
+ $content_type = $info['content types'][$form['type']['#value']];
+ foreach ($content_type['fields'] as $field) {
+ if ($field['type'] == 'content_taxonomy' && (!in_array($field['vid'], $_content_taxonomy_vids))) {
+ $_content_taxonomy_vids[] = $field['vid'];
+ }
+ }
+ _content_taxonomy_taxonomy_unset($form['taxonomy'], $_content_taxonomy_vids);
+
+ //hide empty 'Vocabularies' fieldsets
+ $empty_fieldset = TRUE;
+ if (is_array($form['taxonomy'])) {
+ foreach ($form['taxonomy'] as $key => $value) {
+ if (is_array($value) && !empty($value)) {
+ $empty_fieldset = FALSE;
+ break;
+ }
+ }
+ }
+ if ($empty_fieldset) {
+ // creating an empty taxonomy array is causing errors on preview in the taxonomy module
+ // so we create an empty value field as placeholder, which is going to prevent the errors
+ $form['taxonomy'] = array('#tree' => TRUE);
+ $form['taxonomy']['key'] = array('#type' => 'value', '#value' => '');
+ }
+ }
+}
+
+/**
+ * Implementation of hook_taxonomy().
+ */
+function content_taxonomy_taxonomy($op, $type, $array = NULL) {
+ //keep the database consistent when either a voc or a term is deleted
+ //in case of voc: delete all associated fields and its data
+ //in case of term: delete all its entries
+ if ($op == 'delete') {
+ $vid = $array['vid'];
+ $needs_refresh = FALSE;
+ foreach (content_taxonomy_fields() as $type_name => $ct_type) {
+ foreach ($ct_type['fields'] as $field_name => $field) {
+ if ($field['vid'] == $vid) {
+ if ($type == 'vocabulary') {
+ module_load_include('inc', 'content', 'includes/content.crud');
+ content_field_instance_delete($field_name, $field['type_name']);
+ $needs_refresh = TRUE;
+ watchdog('content', 'Deleted field %field_name and its data.', array('%field_name' => $field_name));
+ }
+ else {
+ $tid = $array['tid'];
+ if ($tid) {
+ $db_info = content_database_info($field);
+ if ($field['multiple']) {
+ db_query('DELETE FROM {'. $db_info['table'] .'} WHERE '. $db_info['columns']['value']['column'] .' = %d', $tid);
+ }
+ else {
+ db_query('UPDATE {'. $db_info['table'] .'} SET '. $db_info['columns']['value']['column'] .'= NULL WHERE '. $db_info['columns']['value']['column'] .' = %d', $tid);
+ }
+ $needs_refresh = TRUE;
+ watchdog('content', 'Entries with term id = %tid have been deleted out of %table for field %field_name.', array('%tid' => $tid, '%table' => $db_info['table'], '%field_name' => $field_name));
+ }
+ }
+ }
+ }
+ }
+ if ($needs_refresh) {
+ content_clear_type_cache(TRUE);
+ }
+ }
+}
+
+/**
+ * Implementation of hook_views_api().
+ */
+function content_taxonomy_views_api() {
+ return array(
+ 'api' => 2,
+ 'path' => drupal_get_path('module', 'content_taxonomy') . '/includes/views',
+ );
+}
+
+
+/**
+ * Helper function that returns all content taxonomy fields, nested in their content types
+ */
+function content_taxonomy_fields() {
+ static $ct_fields;
+
+ if (!is_array($ct_fields)) {
+ $ct_fields = array();
+ foreach (content_types() as $type_name => $type) {
+ foreach ($type['fields'] as $field_name => $field) {
+ if ($field['type'] == 'content_taxonomy') {
+ $ct_fields[$type_name]['fields'][$field_name] = $field;
+ }
+ }
+ }
+ }
+ return $ct_fields;
+}
+
+
+/**
+ * Helper functions that returns all terms group by their vocabulary
+ *
+ * needed for some settings forms
+ */
+function _content_taxonomy_get_all_terms() {
+ static $options = array();
+ if (!count($options)) {
+ $options[0] = '---';
+ foreach (taxonomy_get_vocabularies() as $voc) {
+ foreach (taxonomy_get_tree($voc->vid) as $term) {
+ _content_taxonomy_localize_term($term);
+ $options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
+ }
+ }
+ }
+ return $options;
+}
+
+/**
+ * Localize a term by replacing its name attribute with its localized version
+ * for the current language.
+ *
+ * @param $term
+ * The term to localize.
+ *
+ * This is based on i18ntaxonomy_localize_terms(), but with less overhead.
+ */
+function _content_taxonomy_localize_term(&$term) {
+ // If this term's vocabulary supports localization.
+ if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
+ $term->name = tt("taxonomy:term:$term->tid:name", $term->name);
+ }
+}
+
+/**
+ * Localize a vocabulary by replacing its name attribute with its localized
+ * version for the current language.
+ *
+ * @param $vocabulary
+ * The vocabulary to localize.
+ */
+function _content_taxonomy_localize_vocabulary(&$vocabulary) {
+ // If this vocabulary supports localization.
+ if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($vocabulary->vid) == I18N_TAXONOMY_LOCALIZE) {
+ $vocabulary->name = tt("taxonomy:vocabulary:$vocabulary->vid:name", $vocabulary->name);
+ }
+}
+
+/**
+ * carefully unsets node or node form taxonomy items
+ *
+ *
+ * @param $form the node or node form's taxonomy selections. nodes are objects and forms are arrays, so only the actual taxonomy value or property is passed
+ * @param $vids an array containing a list of vocabulary IDs whose terms should be unset
+ */
+function _content_taxonomy_taxonomy_unset(&$form, $vids) {
+ if (empty($vids) || !is_array($form)) {
+ return;
+ }
+ foreach ($form as $key => $value) {
+ if ($key == 'tags') {
+ _content_taxonomy_taxonomy_unset($form[$key], $vids);
+ }
+ elseif (is_object($value) && in_array($value->vid, $vids)) {
+ unset($form[$key]);
+ }
+ elseif (in_array($key, $vids)) {
+ unset($form[$key]);
+ }
+ }
+}
+
+/**
+ * Implementation of hook_content_multigroup_allowed_widgets().
+ */
+function content_taxonomy_content_multigroup_allowed_widgets() {
+ return array('content_taxonomy_autocomplete', 'content_taxonomy_options', 'content_taxonomy_select');
+}
+
+/**
+ * Implementation of hook_content_multigroup_no_remove_widgets().
+ */
+function content_taxonomy_content_multigroup_no_remove_widgets() {
+ return array('content_taxonomy_autocomplete', 'content_taxonomy_options', 'content_taxonomy_select');
+}
+
+/**
+ * Implementation of hook_content_diff_values
+ */
+function content_taxonomy_content_diff_values($node, $field, $items) {
+ $return = array();
+ foreach ($items as $item) {
+ if (isset($item['value']) && is_numeric($item['value'])) {
+ $term = taxonomy_get_term($item['value']);
+ $return[] = $term->name;
+ }
+ }
+ return $return;
+}
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.info b/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.info
new file mode 100644
index 0000000..eb54b68
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.info
@@ -0,0 +1,15 @@
+; $Id: content_taxonomy_autocomplete.info,v 1.1.2.4.2.1 2008/04/30 08:05:19 mh86 Exp $
+name = Content Taxonomy Autocomplete
+description = Defines a autocomplete widget type for content_taxonomy
+dependencies[] = content
+dependencies[] = content_taxonomy
+dependencies[] = taxonomy
+package = CCK
+core = 6.x
+
+; Information added by drupal.org packaging script on 2009-08-19
+version = "6.x-1.0-rc2"
+core = "6.x"
+project = "content_taxonomy"
+datestamp = "1250688034"
+
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.install b/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.install
new file mode 100644
index 0000000..eb129c0
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_autocomplete.install
@@ -0,0 +1,38 @@
+ array(
+ 'arguments' => array('element' => NULL),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_menu
+ */
+function content_taxonomy_autocomplete_menu() {
+ $items['content_taxonomy/autocomplete'] = array(
+ 'title' => 'Autocomplete',
+ 'page callback' => 'content_taxonomy_autocomplete_load',
+ 'access arguments' => array('access content'),
+ 'type' => MENU_CALLBACK
+ );
+ return $items;
+}
+
+/**
+ * Implementation of hook_widget_info().
+ */
+function content_taxonomy_autocomplete_widget_info() {
+ return array(
+ 'content_taxonomy_autocomplete' => array(
+ 'label' => t('Autocomplete (Freetagging)'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_MODULE,
+ 'callbacks' => array(
+ 'default value' => CONTENT_CALLBACK_DEFAULT,
+ ),
+ ),
+ );
+ return $items;
+}
+
+/**
+ * Implementation of hook_widget_settings
+ */
+function content_taxonomy_autocomplete_widget_settings($op, $widget) {
+ switch ($op) {
+ case 'form':
+ $form['autocomplete'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Settings for Autocompletes'),
+ '#collapsible' => TRUE,
+ '#weight' => 10,
+ );
+ $form['autocomplete']['new_terms'] = array(
+ '#type' => 'radios',
+ '#title' => t('Freetagging settings'),
+ '#default_value' => isset($widget['new_terms']) ? $widget['new_terms'] : 'insert',
+ '#options' => array('insert' => t('Allow and insert new terms by the user into the vocabulary'),
+ 'deny' => t('Deny any new terms'),
+ ),
+ );
+ $form['autocomplete']['extra_parent'] = array(
+ '#type' => 'select',
+ '#title' => t('Extra Parent for new terms'),
+ '#options' => _content_taxonomy_get_all_terms(),
+ '#default_value' => (isset($widget['extra_parent']) && is_numeric($widget['extra_parent'])) ? $widget['extra_parent'] : 0,
+ '#description' => t('This setting is only relevant if you have selected "Allow and insert new terms by the user into the vocabulary". If you select any term here, new terms will get children of the selected one, otherwise new terms get children of the parent term (root, if no parent selected) selected in the global settings.'),
+ );
+
+ $form['autocomplete']['maxlength'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Maximum length of autocomplete'),
+ '#default_value' => (isset($widget['maxlength']) && is_numeric($widget['maxlength'])) ? $widget['maxlength'] : 255,
+ '#element_validate' => array('_content_taxonomy_autocomplete_widget_settings_maxlength_validate'),
+ '#required' => TRUE,
+ '#description' => t('Defines how many characters can be typed into the autocomplete field. For values higher than 255, remember that one term name can not be longer than 255 (would be cutted), nevertheless it\'s not a problem for multiple values, separated by commas.'),
+ );
+ if (module_exists('active_tags')) {
+ $form['autocomplete']['active_tags'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use Active Tags style widget'),
+ '#default_value' => isset($widget['active_tags']) ? $widget['active_tags'] : 0,
+ '#description' => t('Use the Active Tags module to improve the usability of this autocomplete widget.'),
+ );
+ }
+ return $form;
+
+ case 'save':
+ return array('new_terms', 'extra_parent', 'maxlength', 'active_tags');
+ }
+}
+
+function _content_taxonomy_autocomplete_widget_settings_maxlength_validate($element, &$form_state) {
+ $value = $form_state['values']['maxlength'];
+ if (!is_numeric($value) || intval($value) != $value || $value <= 0) {
+ form_error($element, t('"Maximum length" must be a positive integer.'));
+ }
+}
+
+/**
+ * Implementation of FAPI hook_elements().
+ *
+ * Any FAPI callbacks needed for individual widgets can be declared here,
+ * and the element will be passed to those callbacks for processing.
+ *
+ * Drupal will automatically theme the element using a theme with
+ * the same name as the hook_elements key.
+ *
+ * Autocomplete_path is not used by text_widget but other widgets can use it
+ * (see nodereference and userreference).
+ */
+function content_taxonomy_autocomplete_elements() {
+ return array(
+ 'content_taxonomy_autocomplete' => array(
+ '#input' => TRUE,
+ '#columns' => array('value'),
+ '#delta' => 0,
+ '#process' => array('content_taxonomy_autocomplete_process'),
+ '#autocomplete_path' => FALSE,
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_widget().
+ */
+function content_taxonomy_autocomplete_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
+ $element = array(
+ '#type' => 'content_taxonomy_autocomplete',
+ '#default_value' => isset($items) ? $items : NULL,
+ '#value_callback' => 'content_taxonomy_autocomplete_value',
+ '#vid' => $field['vid'],
+ );
+ return $element;
+}
+
+/**
+ * Value for a content taxonomy autocomplete field
+ *
+ * returns the taxonomy term name for term ids
+ */
+function content_taxonomy_autocomplete_value($element, $edit = FALSE) {
+ $field_key = $element['#columns'][0];
+ $terms = array();
+ if (count($element['#default_value'])) {
+ foreach ($element['#default_value'] as $delta => $entry) {
+ $terms[] = taxonomy_get_term($entry[$field_key]);
+ }
+ }
+ $value = content_taxonomy_autocomplete_merge_tags($terms, $element['#vid']);
+ $value = !empty($value) ? $value : NULL;
+ return array($field_key => $value);
+}
+
+
+/**
+ * Process an individual element.
+ *
+ * Build the form element. When creating a form using FAPI #process,
+ * note that $element['#value'] is already set.
+ *
+ */
+function content_taxonomy_autocomplete_process($element, $edit, $form_state, $form) {
+ $field_name = $element['#field_name'];
+ $field = $form['#field_info'][$field_name];
+ $field_key = $element['#columns'][0];
+
+ $element[$field_key] = array(
+ '#type' => 'textfield',
+ '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : '',
+ '#autocomplete_path' => 'content_taxonomy/autocomplete/'. $element['#field_name'],
+ '#title' => $element['#title'],
+ '#required' => $element['#required'],
+ '#description' => $element['#description'],
+ '#field_name' => $element['#field_name'],
+ '#type_name' => $element['#type_name'],
+ '#delta' => $element['#delta'],
+ '#columns' => $element['#columns'],
+ '#maxlength' => !empty($field['widget']['maxlength']) ? $field['widget']['maxlength'] : 255,
+ );
+
+ if (empty($element[$field_key]['#element_validate'])) {
+ $element[$field_key]['#element_validate'] = array();
+ }
+ array_unshift($element[$field_key]['#element_validate'], 'content_taxonomy_autocomplete_validate');
+
+ if (module_exists('active_tags') && $field['widget']['active_tags']) {
+ active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper');
+ }
+
+ return $element;
+}
+
+/**
+ * Validation function for the content_taxonomy_autocomplete element
+ *
+ * parses input, handles new terms (depending on settings) and sets the values as needed for storing the data
+ */
+function content_taxonomy_autocomplete_validate($element, &$form_state) {
+ $field_name = $element['#field_name'];
+ $field = content_fields($field_name, $element['#type_name']);
+ $field_key = $element['#columns'][0];
+
+ //if the element parents array contains the field key, we have to remove it
+ //because otherwise form_set_value won't work. (still the question why is it in)
+ if ($element['#parents'][count($element['#parents'])-1] == $field_key) {
+ array_pop($element['#parents']);
+ array_pop($element['#array_parents']);
+ }
+
+ $value = $element['#value'];
+
+ $extracted_ids = content_taxonomy_autocomplete_tags_get_tids($value, $field['vid'], content_taxonomy_field_get_parent($field), $field['widget']['extra_parent']);
+
+ if (!$field['multiple'] && count(content_taxonomy_autocomplete_split_tags($value, $field['vid'])) > 1) {
+ form_set_error($field['field_name'] .'][value', t('You can provide only one value'));
+ return;
+ }
+ else if (($field['multiple'] >= 2) && (count(content_taxonomy_autocomplete_split_tags($value, $field['vid'])) > $field['multiple'])) {
+ form_set_error($field['field_name'] .'][value', t('%name: this field cannot hold more than @count values.', array('%name' => t($field['widget']['label']), '@count' => $field['multiple'])));
+ }
+ if ($field['widget']['new_terms'] == 'deny') {
+ if (is_array($extracted_ids['non_existing_terms'])) {
+ form_set_error($field['field_name'] .'][value', t('New tags are not allowed'));
+ return;
+ }
+ }
+
+ $values = content_taxonomy_autocomplete_form2data($extracted_ids, $field, $element);
+ form_set_value($element, $values, $form_state);
+}
+
+/**
+ * Helper function to transpose the values returned by submitting the content_taxonomy_autcomplete
+ * to the format to be stored in the field
+ */
+function content_taxonomy_autocomplete_form2data($extracted_ids, $field, $element) {
+ $existing_tids = is_array($extracted_ids['existing_tids']) ? $extracted_ids['existing_tids'] : array();
+ $new_tids = array();
+ if (is_array($extracted_ids['non_existing_terms'])) {
+ if ($field['widget']['extra_parent']) {
+ $new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], $field['widget']['extra_parent']);
+ }
+ else {
+ $new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], content_taxonomy_field_get_parent($field));
+ }
+ }
+ return content_transpose_array_rows_cols(array($element['#columns'][0] => array_merge($existing_tids, $new_tids)));
+
+}
+
+
+/**
+ * Retrieve a pipe delimited string of autocomplete suggestions
+ *
+ * @param String Fieldname
+ * @param Integer TID of a parent (optional)
+ * @param BOOLEAN whether a multiple field or not
+ * @param STRING typed input
+ */
+function content_taxonomy_autocomplete_load($field_name, $string = '') {
+ // The user enters a comma-separated list of tags. We only autocomplete the last tag.
+ // This regexp allows the following types of user input:
+ // this, "somecmpany, llc", "and ""this"" w,o.rks", foo bar
+ $content_type_info = _content_type_info();
+ $vid = $content_type_info['fields'][$field_name]['vid'];
+ $tid = content_taxonomy_field_get_parent($content_type_info['fields'][$field_name]);
+
+ // If the menu system has splitted the search text because of slashes, glue it back.
+ if (func_num_args() > 2) {
+ $args = func_get_args();
+ $string .= '/'. implode('/', array_slice($args, 2));
+ }
+
+ // The user enters a comma-separated list of tags. We only autocomplete the last tag.
+ $array = drupal_explode_tags($string);
+
+ // Fetch last tag
+ $last_string = trim(array_pop($array));
+ $matches = array();
+ if ($last_string != '') {
+ if ($tid) {
+ $result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
+ LEFT JOIN {term_synonym} s ON t.tid = s.tid
+ INNER JOIN {term_hierarchy} h ON t.tid = h.tid
+ WHERE h.parent = %d
+ AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
+ $tid,$last_string,$last_string,0,10);
+ }
+ else {
+ $result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
+ LEFT JOIN {term_synonym} s ON t.tid = s.tid
+ WHERE t.vid = %d
+ AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
+ $vid, $last_string, $last_string, 0, 10);
+ }
+ $prefix = count($array) ? '"'. implode('", "', $array) .'", ' : '';
+
+ while ($tag = db_fetch_object($result)) {
+ $n = $tag->name;
+ // Commas and quotes in terms are special cases, so encode 'em.
+ if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
+ $n = '"'. str_replace('"', '""', $tag->name) .'"';
+ }
+ $matches[$prefix . $n] = check_plain($tag->name);
+ }
+ }
+
+ drupal_json($matches);
+}
+
+/**
+ * Get TIDs for freetagging tags
+ * Free tagging vocabularies do not send their tids in the form,
+ * so we'll detect them here and process them independently.
+ * @param $typed_input A string containing all comma separated tags. As the user typed it.
+ */
+function content_taxonomy_autocomplete_tags_get_tids($typed_input, $vid, $parent = 0, $extra_parent = 0) {
+ // This regexp allows the following types of user input:
+ // this, "somecmpany, llc", "and ""this"" w,o.rks", foo bar
+ $typed_terms = content_taxonomy_autocomplete_split_tags($typed_input);
+
+ foreach ($typed_terms as $typed_term) {
+ // If a user has escaped a term (to demonstrate that it is a group,
+ // or includes a comma or quote character), we remove the escape
+ // formatting so to save the term into the DB as the user intends.
+ $typed_term = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $typed_term)));
+ if ($typed_term == "") { continue; }
+
+ // See if the term exists in the chosen vocabulary
+ // and return the tid, otherwise, add a new record.
+ $possibilities = taxonomy_get_term_by_name($typed_term);
+
+ $typed_term_tid = NULL; // tid match if any.
+ foreach ($possibilities as $possibility) {
+ if ($possibility->vid == $vid) {
+ if ($parent) {
+ $parents = array();
+ $parents = taxonomy_get_parents($possibility->tid);
+ if (in_array($parent, array_keys($parents)) || in_array($extra_parent, array_keys($parents))) {
+ $result['existing_tids'][$possibility->tid] = $possibility->tid;
+ $typed_term_tid = $possibility->tid;
+ }
+ }
+ else {
+ $result['existing_tids'][$possibility->tid] = $possibility->tid;
+ $typed_term_tid = $possibility->tid;
+ }
+ }
+ }
+
+ if (!$typed_term_tid) {
+ $result['non_existing_terms'][] = array(
+ 'name' => $typed_term,
+ 'vid' => $vid,
+ );
+ }
+ }
+
+ return $result;
+}
+
+/**
+ * Insert new tags
+ *
+ * @param $nid the node id
+ * @param $terms an array of all nonexisting terms.
+ * @return an array of newly inserted term ids
+ */
+function content_taxonomy_autocomplete_insert_tags($terms, $parent = NULL) {
+ foreach ($terms as $term) {
+ $edit = array('vid' => $term['vid'], 'name' => $term['name']);
+ if ($parent) $edit['parent'] = $parent;
+ $status = taxonomy_save_term($edit);
+ $saved_terms[$edit['tid']] = $edit['tid'];
+ }
+ return $saved_terms;
+}
+
+/**
+ * Helper function to split the tags
+ */
+function content_taxonomy_autocomplete_split_tags($typed_input) {
+ $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';
+ preg_match_all($regexp, $typed_input, $matches);
+ return $matches[1];
+}
+
+/**
+ * Helper function to merge the tags, to prefill the fields when editing a node.
+ */
+function content_taxonomy_autocomplete_merge_tags($terms, $vid) {
+ $typed_terms = array();
+ if (!empty($terms)) {
+ foreach ($terms as $term) {
+ // Extract terms belonging to the vocabulary in question.
+ if ($term->vid == $vid) {
+ //if ($tid && in_array($term->tid,drupal_map_assoc(array_keys((taxonomy_get_children($tid,$vid)))))) {
+ // Commas and quotes in terms are special cases, so encode 'em.
+ $name = $term->name;
+ if (preg_match('/,/', $term->name) || preg_match('/"/', $term->name)) {
+ $name = '"'. preg_replace('/"/', '""', $name) .'"';
+ }
+ $typed_terms[] = $name;
+ // }
+ }
+ }
+ }
+ return implode(', ', $typed_terms);
+}
+
+function theme_content_taxonomy_autocomplete($element) {
+ return $element['#children'];
+}
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_options.info b/sites/all/modules/content_taxonomy/content_taxonomy_options.info
new file mode 100644
index 0000000..ddfc3d1
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_options.info
@@ -0,0 +1,17 @@
+; $Id: content_taxonomy_options.info,v 1.1.2.5.2.1 2008/04/30 08:05:19 mh86 Exp $
+name = Content Taxonomy Options
+description = Defines a option widget type for content_taxonomy for selects, radios/checkboxes
+dependencies[] = content
+dependencies[] = content_taxonomy
+dependencies[] = taxonomy
+dependencies[] = optionwidgets
+package = CCK
+core = 6.x
+
+
+; Information added by drupal.org packaging script on 2009-08-19
+version = "6.x-1.0-rc2"
+core = "6.x"
+project = "content_taxonomy"
+datestamp = "1250688034"
+
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_options.install b/sites/all/modules/content_taxonomy/content_taxonomy_options.install
new file mode 100644
index 0000000..05dd6df
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_options.install
@@ -0,0 +1,38 @@
+ array(
+ 'arguments' => array('field' => NULL),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_widget_info().
+ */
+function content_taxonomy_options_widget_info() {
+ return array(
+ 'content_taxonomy_options' => array(
+ 'label' => t('Checkboxes/Radios'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_MODULE,
+ 'callbacks' => array(
+ 'default value' => CONTENT_CALLBACK_DEFAULT,
+ ),
+ ),
+ 'content_taxonomy_select' => array(
+ 'label' => t('Select List'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_MODULE,
+ 'callbacks' => array(
+ 'default value' => CONTENT_CALLBACK_DEFAULT,
+ ),
+ ),
+ );
+ return $items;
+}
+
+/**
+ * Implementation of hook_widget_settings
+ */
+function content_taxonomy_options_widget_settings($op, $widget) {
+ switch ($op) {
+ case 'form':
+ $form['settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Settings for Options'),
+ '#collapsible' => TRUE,
+ '#weight' => 10,
+ );
+ $form['settings']['show_depth'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Indent child terms with \' - \' signs'),
+ '#default_value' => is_numeric($widget['show_depth']) ? $widget['show_depth'] : 1,
+ '#description' => t('If this option is checked, a hierarchy gets visualized by indenting child terms, otherwise it\'s a flat list'),
+ );
+ $form['settings']['group_parent'] = array(
+ '#title' => t('Parent term for OptGroups in select fields'),
+ '#type' => 'select',
+ '#default_value' => isset($widget['group_parent']) ? $widget['group_parent'] : 0,
+ '#options' => _content_taxonomy_get_all_terms(),
+ '#description' => t('This settings applies only for select fields. Select a parent term containg the grouping terms. Grouping terms should be parents of the selected terms (from the Global Settings).'),
+ );
+ return $form;
+
+ case 'save':
+ return array('group_parent', 'show_depth');
+ }
+}
+
+/**
+ * Implementation of hook_widget().
+ */
+function content_taxonomy_options_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
+ $element = array(
+ '#type' => ($field['widget']['type'] == 'content_taxonomy_select') ? 'optionwidgets_select' : 'optionwidgets_buttons',
+ '#default_value' => !empty($items) ? $items : array(),
+ );
+ return $element;
+}
+
+/**
+ * Theme the label for the empty value for options (for optional radios and single selects).
+ */
+function theme_content_taxonomy_options_widgets_none($field) {
+ switch ($field['widget']['type']) {
+ case 'content_taxonomy_options':
+ return t('N/A');
+ case 'content_taxonomy_select':
+ return t('- None -');
+ default :
+ return '';
+ }
+}
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_tree.info b/sites/all/modules/content_taxonomy/content_taxonomy_tree.info
new file mode 100644
index 0000000..a56c669
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_tree.info
@@ -0,0 +1,16 @@
+; $Id: content_taxonomy_tree.info,v 1.1.2.1 2008/04/30 08:05:19 mh86 Exp $
+name = Content Taxonomy Tree
+description = Defines a dynamic tree widget for Content Taxonomy
+dependencies[] = content
+dependencies[] = content_taxonomy
+dependencies[] = taxonomy
+dependencies[] = taxonomy_manager
+package = CCK
+core = 6.x
+
+; Information added by drupal.org packaging script on 2009-08-19
+version = "6.x-1.0-rc2"
+core = "6.x"
+project = "content_taxonomy"
+datestamp = "1250688034"
+
diff --git a/sites/all/modules/content_taxonomy/content_taxonomy_tree.install b/sites/all/modules/content_taxonomy/content_taxonomy_tree.install
new file mode 100644
index 0000000..dc750f1
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/content_taxonomy_tree.install
@@ -0,0 +1,39 @@
+ array(
+ 'arguments' => array('element' => NULL),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_widget_info().
+ */
+function content_taxonomy_tree_widget_info() {
+ return array(
+ 'content_taxonomy_tree' => array(
+ 'label' => t('Tree'),
+ 'field types' => array('content_taxonomy'),
+ 'multiple values' => CONTENT_HANDLE_MODULE,
+ 'callbacks' => array(
+ 'default value' => CONTENT_CALLBACK_DEFAULT,
+ ),
+ ),
+ );
+ return $items;
+}
+
+/**
+ * Implementation of hook_widget_settings
+ */
+function content_taxonomy_tree_widget_settings($op, $widget) {
+ switch ($op) {
+ case 'form':
+ $form['settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Settings for Trees'),
+ '#collapsible' => TRUE,
+ '#weight' => 10,
+ );
+ $form['settings']['expand_all'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Expand whole tree by default'),
+ '#default_value' => isset($widget['expand_all']) ? $widget['expand_all'] : 0,
+ '#description' => t('Otherwise only branches, where a term is selected get expanded by default'),
+ );
+ return $form;
+
+ case 'save':
+ return array('expand_all');
+ }
+}
+
+/**
+ * Implementation of hook_elements().
+ */
+function content_taxonomy_tree_elements() {
+ return array(
+ 'content_taxonomy_tree' => array(
+ '#input' => TRUE,
+ '#columns' => array('value'),
+ '#delta' => 0,
+ '#process' => array('content_taxonomy_tree_process'),
+ '#element_validate' => array('content_taxonomy_tree_validate'),
+ '#autocomplete_path' => FALSE,
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_widget().
+ */
+function content_taxonomy_tree_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
+ $element = array(
+ '#type' => 'content_taxonomy_tree',
+ '#default_value' => !empty($items) ? $items : array(),
+ );
+ return $element;
+}
+
+/**
+ * Processes the content_taxonomy_tree form element
+ *
+ * uses the 'taxonomy_manager_tree' element type
+ */
+function content_taxonomy_tree_process($element, $edit, &$form_state, $form) {
+ $field_name = $element['#field_name'];
+ $field = $form['#field_info'][$field_name];
+ $field_key = $element['#columns'][0];
+
+ if (is_array($element['#value'])) {
+ if (array_key_exists($field_key, $element['#value'])) {
+ //validation function where values are set haven't been called yet for this form element
+ //because some other element might have caused an validation error
+ //so we have to do the processing of the values here
+ if ($field['multiple']) {
+ $selected_terms = _taxonomy_manager_tree_get_selected_terms($element['#value']['value']);
+ $element['#value'] = content_transpose_array_rows_cols(array($field_key => array_values($selected_terms)));
+ }
+ }
+ $element['#value'] = content_taxonomy_tree_data2form($element, $element['#value'], $field);
+ }
+
+ $element[$field_key] = array(
+ '#type' => 'taxonomy_manager_tree',
+ '#default_value' => isset($element['#value']) ? $element['#value'] : '',
+ '#vid' => $field['vid'],
+ '#parent' => content_taxonomy_field_get_parent($field),
+ '#default_value' => is_array($element['#value']) ? $element['#value'] : array(),
+ '#render_whole_tree' => TRUE,
+ '#pager' => FALSE,
+ '#add_term_info' => FALSE,
+ '#expand_all' => $field['widget']['expand_all'],
+ '#tree_is_required' => $field['required'], //using tree_is_required instead of required, prevents that error messages are shown twice
+ '#required' => FALSE,
+ '#multiple' => isset($field['multiple']) ? $field['multiple'] : FALSE,
+ '#field_name' => $element['#field_name'],
+ '#delta' => $element['#delta'],
+ '#columns' => $element['#columns'],
+ '#title' => $element['#title'],
+ '#description' => $element['#description'],
+ );
+
+
+ // Make sure field info will be available to the validator which
+ // does not get the values in $form.
+ $form_state['#field_info'][$field['field_name']] = $field;
+
+ return $element;
+}
+
+/**
+ * Validation function for the content_taxonomy_tree element
+ *
+ * assigns the selected terms to the element
+ * additionally checks if terms are selected for required fields (if this check isn't already done by form.inc)
+ */
+function content_taxonomy_tree_validate($element, &$form_state) {
+ $field = $form_state['#field_info'][$element['#field_name']];
+ $field_key = $element['#columns'][0];
+
+ $values = content_taxonomy_tree_form2data($element, $form_state, $field);
+
+ //check for required fields
+ //if $element['#value'] is empty, it's validated by form.inc
+ //otherwise we have to check this by our own
+ if ($field['required'] && is_null($values[0]['value']) && !empty($element['#value'])) {
+ form_error($element[$field_key], t('!name field is required.', array('!name' => $element['#title'])));
+ }
+ if (($field['multiple'] >= 2) && (count($element['#value']) > $field['multiple'])) {
+ form_error($element[$field_key], t('%name: this field cannot hold more than @count values.', array('%name' => t($field['widget']['label']), '@count' => $field['multiple'])));
+ }
+
+ form_set_value($element, $values, $form_state);
+
+}
+
+/**
+ * Helper function to transpose the values as stored in the database
+ * to the format the content_taxonomy_tree needs to select the values
+ */
+function content_taxonomy_tree_data2form($element, $values, $field) {
+ $terms = array();
+ foreach ($values as $delta => $entry) {
+ if ($entry['value']) {
+ $terms[] = $entry['value'];
+ }
+ }
+ return $terms;
+}
+
+/**
+ * Helper function to transpose the values returned by submitting the content_taxonomy_tree
+ * to the format to be stored in the field
+ */
+function content_taxonomy_tree_form2data($element, &$form_state, $field) {
+ $field_key = $element['#columns'][0];
+ $selected_terms = $form_state['values'][$element['#field_name']][$field_key]['selected_terms'];
+
+ if (!is_array($selected_terms) || !count($selected_terms)) {
+ $selected_terms[] = NULL;
+ }
+
+ $form_state['#field_info'][$field['field_name']] = $field;
+ return content_transpose_array_rows_cols(array($element['#columns'][0] => array_values($selected_terms)));
+}
+
+/**
+ * FAPI theme for content_taxonomy_tree
+ *
+ * element already rendered by taxonomy_manager_tree
+ */
+function theme_content_taxonomy_tree($element) {
+ return $element['#children'];
+}
diff --git a/sites/all/modules/content_taxonomy/includes/content_taxonomy.token.inc b/sites/all/modules/content_taxonomy/includes/content_taxonomy.token.inc
new file mode 100644
index 0000000..9b8d59b
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/includes/content_taxonomy.token.inc
@@ -0,0 +1,56 @@
+name;
+ $vid = $term->vid;
+ }
+ }
+ if ($vid) {
+ $vocabulary = taxonomy_vocabulary_load($vid);
+ }
+
+ $tokens['terms-raw'] = implode(', ', $terms);
+ $tokens['terms'] = check_plain($tokens['terms-raw']);
+ $tokens['tids'] = implode(', ', $tids);
+ $tokens['term-raw'] = $terms[0];
+ $tokens['term'] = check_plain($tokens['term-raw']);
+ $tokens['tid'] = $tids[0];
+ $tokens['vocab'] = isset($vocabulary) ? $vocabulary->name : '';
+ $tokens['vid'] = $vid;
+
+ return $tokens;
+ }
+}
diff --git a/sites/all/modules/content_taxonomy/includes/views/content_taxonomy.views.inc b/sites/all/modules/content_taxonomy/includes/views/content_taxonomy.views.inc
new file mode 100644
index 0000000..81b12b0
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/includes/views/content_taxonomy.views.inc
@@ -0,0 +1,17 @@
+ array(
+ 'path' => drupal_get_path('module', 'content_taxonomy') . '/includes/views',
+ ),
+ 'handlers' => array(
+ 'content_taxonomy_handler_filter_many_to_one' => array(
+ 'parent' => 'content_handler_filter_many_to_one',
+ ),
+ ),
+ );
+}
diff --git a/sites/all/modules/content_taxonomy/includes/views/content_taxonomy_handler_filter_many_to_one.inc b/sites/all/modules/content_taxonomy/includes/views/content_taxonomy_handler_filter_many_to_one.inc
new file mode 100644
index 0000000..8bb3530
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/includes/views/content_taxonomy_handler_filter_many_to_one.inc
@@ -0,0 +1,21 @@
+content_field);
+ unset($options['']);
+ $this->value_options = $options;
+ }
+}
diff --git a/sites/all/modules/content_taxonomy/tests/content_taxonomy.test b/sites/all/modules/content_taxonomy/tests/content_taxonomy.test
new file mode 100644
index 0000000..c1a99a7
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/tests/content_taxonomy.test
@@ -0,0 +1,642 @@
+loginWithPermissions();
+ $this->acquireContentTypes(2);
+ }
+
+ /**
+ * helper function to create a vocabulary and terms
+ */
+ function createTerms($count = 1) {
+ $edit['name'] = $this->randomName(200);
+ $edit['hierarchy'] = 2; // Hierarchy 0,1,2
+ $edit['multiple'] = 1; // multiple 0,1
+ $edit['required'] = 0; // required 0,1
+ $edit['relations'] = 0;
+ $edit['tags'] = 1;
+ // exec save function
+ taxonomy_save_vocabulary($edit);
+ $vid = $edit['vid'];
+
+ for ($i = 0; $i < $count; $i++) {
+ // create term
+ $termname = $this->randomName(20);
+ $data = array('name' => $termname, 'vid' => $vid);
+ taxonomy_save_term($data);
+ $terms[] = taxonomy_get_term($data['tid']);
+ }
+ return $terms;
+
+ }
+
+ /**
+ * helper assertion function, which checks if the node field array is built correctly
+ */
+ function assertNodeMultiValues($node, $field_name, $terms_in = array(), $terms_out = array()) {
+ $tids = array();
+ if (is_array($node->{$field_name})) {
+ foreach ($node->{$field_name} as $key => $value) {
+ $tids[$value['value']] = $value['value'];
+ }
+ }
+ foreach ($terms_in as $term) {
+ $this->assertTrue(in_array($term->tid, $tids), 'Term correctly in node field');
+ }
+
+ foreach ($terms_out as $term) {
+ $this->assertTrue(!in_array($term->tid, $tids), 'Term correctly in node field');
+ }
+ }
+}
+
+
+/**
+ * Base Class for testing Content Taxonomy,
+ * extends the ContentCrudTestCase Class from CCK, which provides many useful helper functions
+ */
+class ContentTaxonomyTest extends ContentTaxonomyTestCase {
+
+ function getInfo() {
+ return array(
+ 'name' => t('Content Taxonomy - Saving'),
+ 'description' => t('Tests basic saving'),
+ 'group' => t('Content Taxonomy'),
+ );
+ }
+
+ function setUp() {
+ parent::setUp();
+ }
+
+
+ function testContentTaxonomySaving() {
+ $type = $this->content_types[0];
+ $type_url = str_replace('_', '-', $type->type);
+
+ $terms = $this->createTerms(4);
+
+ $settings = array(
+ 'type' => 'content_taxonomy',
+ 'widget_type' => 'content_taxonomy_options',
+ 'vid' => $terms[0]->vid,
+ 'parent' => 0,
+ 'parent_php_code' => '',
+ 'show_depth' => 0,
+ 'save_term_node' => FALSE,
+ 'depth' => NULL,
+ 'hide_taxonomy_fields' => TRUE,
+ );
+
+ $field = $this->createField($settings, 0);
+ $field_name = $field['field_name'];
+
+ //Check if field get's exposed to the content type
+ $this->drupalGET('node/add/'. $type_url);
+ $this->assertRaw($field_name, 'Field found on content type form');
+ $this->assertRaw($terms[0]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[1]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[2]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[3]->name, 'Option value found on content type form');
+
+ // Create a node with one value selected
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->tid;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $this->assertEqual($node->{$field_name}[0]['value'], $terms[0]->tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertNoText($terms[1]->name, 'Term not displayed');
+
+ //Edit the node and select a different value
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $this->assertIdentical($node->{$field_name}[0]['value'], $terms[1]->tid, 'Terms updated');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term not displayed');
+
+ //Edit the node and unselect the value (selecting '- None -').
+ $edit = array();
+ $edit[$field_name.'[value]'] = '';
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $this->assertIdentical($node->{$field_name}[0]['value'], NULL, 'Terms deleted');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertNoText($terms[0]->name, 'Terms not displayed');
+ $this->assertNoText($terms[1]->name, 'Terms not displayed');
+
+
+ //CREATE NEW FIELD MULTIPLE
+ $settings['multiple'] = TRUE;
+ $field = $this->createField($settings, 0);
+ $field_name = $field['field_name'];
+
+ //Check if field get's exposed to the content type
+ $this->drupalGET('node/add/'. $type_url);
+ $this->assertRaw($field_name, 'Field found on content type form');
+ $this->assertRaw($terms[0]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[1]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[2]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[3]->name, 'Option value found on content type form');
+
+ // Edit the node and select multiple values.
+ $edit[$field_name .'[value]['. $terms[0]->tid .']'] = $terms[0]->tid;
+ $edit[$field_name .'[value]['. $terms[1]->tid .']'] = $terms[1]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $tids = array();
+ foreach ($node->{$field_name} as $key => $value) {
+ $tids[$value['value']] = $value['value'];
+ }
+ if (!in_array($terms[0]->tid, $tids) || !in_array($terms[1]->tid, $tids)) {
+ $this->fail("Terms saved");
+ }
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[2]->name, 'Term not displayed');
+
+ //Edit the node and select different values
+ $edit = array();
+ $edit[$field_name.'[value]['. $terms[0]->tid .']'] = FALSE;
+ $edit[$field_name.'[value]['. $terms[1]->tid .']'] = $terms[1]->tid;
+ $edit[$field_name.'[value]['. $terms[2]->tid .']'] = $terms[2]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $tids = array();
+ foreach ($node->{$field_name} as $key => $value) {
+ $tids[$value['value']] = $value['value'];
+ }
+ if (!in_array($terms[2]->tid, $tids) || !in_array($terms[1]->tid, $tids)) {
+ $this->fail("Terms updated");
+ }
+ if (in_array($terms[0]->tid, $tids)) {
+ $this->fail("Terms updated");
+ }
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertText($terms[2]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term1 not displayed');
+
+ //Edit the node and unselect values
+ $edit = array();
+ $edit[$field_name.'[value]['. $terms[1]->tid .']'] = FALSE;
+ $edit[$field_name.'[value]['. $terms[2]->tid .']'] = FALSE;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms not in term_node table");
+ $tids = array();
+ foreach ($node->{$field_name} as $key => $value) {
+ $tids[$value['value']] = $value['value'];
+ }
+ if (in_array($terms[2]->tid, $tids) || in_array($terms[1]->tid, $tids) || in_array($terms[0]->tid, $tids)) {
+ $this->fail("Terms deleted");
+ }
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertNoText($terms[1]->name, 'Terms not displayed');
+ $this->assertNoText($terms[2]->name, 'Terms not displayed');
+ $this->assertNoText($terms[0]->name, 'Terms not displayed');
+
+
+ /**
+ * Tests Saving in Term Node
+ */
+ $ct = $this->content_types[1];
+ $ct_url = str_replace('_', '-', $ct->type);
+
+ $settings['save_term_node'] = TRUE;
+ $settings['multiple'] = FALSE;
+
+ //$terms = $this->createTerms(4);
+ $field = $this->createField($settings, 1);
+ $field_name = $field['field_name'];
+
+ //Check if field get's exposed to the content type
+ $this->drupalGET('node/add/'. $ct_url);
+ $this->assertRaw($field_name, 'Field found on content type form');
+ $this->assertRaw($terms[0]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[1]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[2]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[3]->name, 'Option value found on content type form');
+
+ // Create a node with one value selected
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->tid;
+ $this->drupalPost('node/add/'. $ct_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertEqual($in_term_node, $terms[0]->tid, "Terms saved in term_node table");
+ $this->assertEqual($node->{$field_name}[0]['value'], $terms[0]->tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertNoText($terms[1]->name, 'Term not displayed');
+
+ //Edit the node and select a different value
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertEqual($in_term_node, $terms[1]->tid, "Terms updated in term_node table");
+ $this->assertEqual($node->{$field_name}[0]['value'], $terms[1]->tid, 'Terms updated');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term not displayed');
+
+ //Edit the node and unselect the value (selecting '- None -').
+ $edit = array();
+ $edit[$field_name.'[value]'] = '';
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d", $node->nid));
+ $this->assertFalse($in_term_node, "Terms deleted from term_node table");
+ $this->assertIdentical($node->{$field_name}[0]['value'], NULL, 'Terms deleted');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertNoText($terms[0]->name, 'Terms not displayed');
+ $this->assertNoText($terms[1]->name, 'Terms not displayed');
+
+ //CREATE NEW FIELD MULTIPLE
+ $settings['multiple'] = TRUE;
+ $field = $this->createField($settings, 1);
+ $field_name = $field['field_name'];
+
+ //Check if field get's exposed to the content type
+ $this->drupalGET('node/add/'. $ct_url);
+ $this->assertRaw($field_name, 'Field found on content type form');
+ $this->assertRaw($terms[0]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[1]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[2]->name, 'Option value found on content type form');
+ $this->assertRaw($terms[3]->name, 'Option value found on content type form');
+
+ // Edit the node and select multiple values.
+ $edit[$field_name .'[value]['. $terms[0]->tid .']'] = $terms[0]->tid;
+ $edit[$field_name .'[value]['. $terms[1]->tid .']'] = $terms[1]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node1 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[0]->tid));
+ $this->assertEqual($in_term_node1, $terms[0]->tid, "Terms updated in term_node table");
+ $in_term_node2 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[1]->tid));
+ $this->assertEqual($in_term_node2, $terms[1]->tid, "Terms updated in term_node table");
+ $this->assertNodeMultiValues($node, $field_name, array($terms[0], $terms[1]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[2]->name, 'Term not displayed');
+
+ //Edit the node and select different values
+ $edit = array();
+ $edit[$field_name.'[value]['. $terms[0]->tid .']'] = FALSE;
+ $edit[$field_name.'[value]['. $terms[1]->tid .']'] = $terms[1]->tid;
+ $edit[$field_name.'[value]['. $terms[2]->tid .']'] = $terms[2]->tid;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[0]->tid));
+ $this->assertFalse($in_term_node, "Term deleted term_node table");
+ $in_term_node3 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[2]->tid));
+ $this->assertEqual($in_term_node3, $terms[2]->tid, "Terms updated in term_node table");
+ $in_term_node2 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[1]->tid));
+ $this->assertEqual($in_term_node2, $terms[1]->tid, "Terms updated in term_node table");
+ $this->assertNodeMultiValues($node, $field_name, array($terms[1], $terms[2]), array($terms[0]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertText($terms[2]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term1 not displayed');
+
+ //Edit the node and unselect values
+ $edit = array();
+ $edit[$field_name.'[value]['. $terms[1]->tid .']'] = FALSE;
+ $edit[$field_name.'[value]['. $terms[2]->tid .']'] = FALSE;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $in_term_node1 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[0]->tid));
+ $this->assertFalse($in_term_node1, "Term deleted term_node table");
+ $in_term_node2 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[1]->tid));
+ $this->assertFalse($in_term_node2, "Term deleted term_node table");
+ $in_term_node3 = db_result(db_query("SELECT tid FROM {term_node} WHERE nid = %d AND tid = %d", $node->nid, $terms[2]->tid));
+ $this->assertFalse($in_term_node3, "Term deleted term_node table");
+ $this->assertNodeMultiValues($node, $field_name, array(), array($terms[0], $terms[1], $terms[2]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertNoText($terms[1]->name, 'Terms not displayed');
+ $this->assertNoText($terms[2]->name, 'Terms not displayed');
+ $this->assertNoText($terms[0]->name, 'Terms not displayed');
+ }
+}
+
+
+/**
+ * Test Cases for Content Taxonomy Autocomplete
+ */
+class ContentTaxonomyAutocompleteTest extends ContentTaxonomyTestCase {
+
+ function getInfo() {
+ return array(
+ 'name' => t('Content Taxonomy - Autocomplete'),
+ 'description' => t('Tests freetagging widget'),
+ 'group' => t('Content Taxonomy'),
+ );
+ }
+
+ function setUp() {
+ parent::setUp("diff");
+ }
+
+ function testAutocomplete() {
+ $type = $this->content_types[1];
+ $type_url = str_replace('_', '-', $type->type);
+ $terms = $this->createTerms(4);
+
+ //single field
+ $settings = array(
+ 'type' => 'content_taxonomy',
+ 'widget_type' => 'content_taxonomy_autocomplete',
+ 'vid' => $terms[0]->vid,
+ 'parent' => 0,
+ 'parent_php_code' => '',
+ 'show_depth' => 0,
+ 'save_term_node' => FALSE,
+ 'depth' => NULL,
+ 'hide_taxonomy_fields' => TRUE,
+ );
+
+ $field = $this->createField($settings, 1);
+ $field_name = $field['field_name'];
+
+ // Create a node with one value
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertEqual($node->{$field_name}[0]['value'], $terms[0]->tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertNoText($terms[1]->name, 'Term not displayed');
+
+ //Edit the node and select a different value
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertIdentical($node->{$field_name}[0]['value'], $terms[1]->tid, 'Terms updated');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term not displayed');
+
+ //Edit the node and select 2 values for single field
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->name .", ". $terms[0]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $this->assertText('You can provide only one value', 'Validated');
+ $edit[$field_name.'[value]'] = $terms[1]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertIdentical($node->{$field_name}[0]['value'], $terms[1]->tid, 'Terms updated');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term not displayed');
+
+ //Add a new term
+ $edit = array();
+ $new_term_name = 'test';
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $new_term_name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $new_term_tid = db_result(db_query("SELECT tid FROM {term_data} WHERE name = '%s' AND vid = %d", $new_term_name, $settings['vid']));
+ $this->assertTrue(($new_term_tid > 0), "New term added to vocabulary");
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertEqual($node->{$field_name}[0]['value'], $new_term_tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($new_term_name, 'Terms displayed');
+
+ //test Multi Field
+ $type = $this->content_types[0];
+ $type_url = str_replace('_', '-', $type->type);
+
+ //multi field
+ $settings = array(
+ 'type' => 'content_taxonomy',
+ 'widget_type' => 'content_taxonomy_autocomplete',
+ 'vid' => $terms[0]->vid,
+ 'parent' => 0,
+ 'parent_php_code' => '',
+ 'show_depth' => 0,
+ 'save_term_node' => FALSE,
+ 'depth' => NULL,
+ 'hide_taxonomy_fields' => TRUE,
+ 'multiple' => TRUE,
+ );
+
+
+ $field = $this->createField($settings, 0);
+ $field_name = $field['field_name'];
+
+ // Create a node with one value
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertNodeMultiValues($node, $field_name, array($terms[0]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertNoText($terms[1]->name, 'Term not displayed');
+
+ //Edit the node and select a different value
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertNodeMultiValues($node, $field_name, array($terms[1]), array($terms[0]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertNoText($terms[0]->name, 'Term not displayed');
+
+ //Edit the node and select a second value
+ $edit = array();
+ $edit[$field_name.'[value]'] = $terms[1]->name .", ". $terms[0]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertNodeMultiValues($node, $field_name, array($terms[0], $terms[1]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+ $this->assertText($terms[0]->name, 'Terms displayed');
+
+ // Create a node with one value and test preview
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Preview');
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertNodeMultiValues($node, $field_name, array($terms[0]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+
+ // Create a node with one value and test preview with a new term
+ $new_term_name = 'test2';
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $new_term_name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Preview');
+ $new_term_tid = db_result(db_query("SELECT tid FROM {term_data} WHERE name = '%s' AND vid = %d", $new_term_name, $settings['vid']));
+ $this->assertTrue(($new_term_tid > 0), "Term in added to vocabulary");
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertNodeMultiValues($node, $field_name, array(taxonomy_get_term($new_term_tid)));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($new_term_name, 'Terms displayed');
+
+ // Create a node with one value and test preview diff
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+
+ $edit = array();
+ $edit['title'] = $node->title;
+ $edit['body'] = str_replace('', '', $node->body);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Preview changes');
+ $this->assertText('No visible changes', 'No visible changes');
+ $this->assertRaw($terms[0]->name, 'Term in field');
+ /* $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertNodeMultiValues($node, $field_name, array($terms[0]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');*/
+
+ //CREATE NEW REQUIRED FIELD
+ $settings['required'] = TRUE;
+ $field = $this->createField($settings, 0);
+ $field_name = $field['field_name'];
+
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name.'[value]'] = '';
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $this->assertText($field_name .' field is required', 'Validated required field');
+ $edit[$field_name.'[value]'] = $terms[1]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $this->assertNoText($field_name .' field is required', 'Validation for required field successfully passed');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertNodeMultiValues($node, $field_name, array($terms[1]));
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[1]->name, 'Terms displayed');
+
+ }
+}
+
+/**
+ * Test Cases for Content Taxonomy Autocomplete
+ */
+class ContentTaxonomyAutocompletePermissionsTest extends ContentTaxonomyTestCase {
+
+ function getInfo() {
+ return array(
+ 'name' => t('Content Taxonomy - Autocomplete with Permissions'),
+ 'description' => t('Tests freetagging widget with content permissions'),
+ 'group' => t('Content Taxonomy'),
+ );
+ }
+
+ function setUp() {
+ parent::setUp("content_permissions");
+ }
+
+ function testAutocomplete() {
+ $type = $this->content_types[1];
+ $type_url = str_replace('_', '-', $type->type);
+ $terms = $this->createTerms(4);
+
+ //single field
+ $settings = array(
+ 'type' => 'content_taxonomy',
+ 'widget_type' => 'content_taxonomy_autocomplete',
+ 'vid' => $terms[0]->vid,
+ 'parent' => 0,
+ 'parent_php_code' => '',
+ 'show_depth' => 0,
+ 'save_term_node' => FALSE,
+ 'depth' => NULL,
+ 'hide_taxonomy_fields' => TRUE,
+ );
+
+ $field = $this->createField($settings, 1);
+ $field_name = $field['field_name'];
+
+ $permissions = array('edit '. $field_name, 'view '. $field_name);
+ $rids = db_query("SELECT rid FROM {role}");
+ while($obj = db_fetch_object($rids)) {
+ db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $obj->rid, implode(', ', $permissions));
+ }
+
+ // Create a node with one value with edit permissions
+ $edit = array();
+ $edit['title'] = $this->randomName(20);
+ $edit['body'] = $this->randomName(20);
+ $edit[$field_name .'[value]'] = $terms[0]->name;
+ $this->drupalPost('node/add/'. $type_url, $edit, 'Save');
+ $node = node_load(array('title' => $edit['title']));
+ $this->assertEqual($node->{$field_name}[0]['value'], $terms[0]->tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ $this->assertNoText($terms[1]->name, 'Term not displayed');
+
+ //delete edit field perm
+ $permissions_old = array('edit '. $field_name, 'view '. $field_name);
+ $permissions_new = array('view '. $field_name);
+ $rids = db_query("SELECT rid FROM {role}");
+ while($obj = db_fetch_object($rids)) {
+ db_query("DELETE FROM {permission WHERE rid = %d AND perm = '%s'", $obj->rid, implode(', ', $permissions_old));
+ db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $obj->rid, implode(', ', $permissions_new));
+ }
+
+ //Edit the node, but without perm
+ $edit = array();
+ $this->drupalPost('node/'. $node->nid .'/edit', $edit, 'Save');
+ $this->drupalGet('node/'. $node->nid .'/edit');
+ $this->assertNoRaw($field_name, "Field hidden");
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertIdentical($node->{$field_name}[0]['value'], $terms[0]->tid, 'Terms saved');
+ $this->drupalGet('node/'. $node->nid);
+ $this->assertText($terms[0]->name, 'Terms displayed');
+ }
+}
diff --git a/sites/all/modules/content_taxonomy/translations/fr.po b/sites/all/modules/content_taxonomy/translations/fr.po
new file mode 100644
index 0000000..486922f
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/translations/fr.po
@@ -0,0 +1,298 @@
+# $Id: fr.po,v 1.1.2.1 2009/04/07 10:52:21 slybud Exp $
+#
+# French translation of Drupal (general)
+# Copyright YEAR NAME
+# Generated from files:
+# content_taxonomy.module,v 1.2.2.15.2.17 2009/02/02 18:07:50 mh86
+# content_taxonomy_autocomplete.module,v 1.2.2.4.2.12 2009/02/02 17:26:38 mh86
+# content_taxonomy_options.module,v 1.1.4.7.2.4 2008/12/27 11:25:27 mh86
+# content_taxonomy_tree.module,v 1.1.2.4 2008/08/20 16:54:36 mh86
+# content_taxonomy.info,v 1.1.2.2.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_autocomplete.info,v 1.1.2.4.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_options.info,v 1.1.2.5.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_tree.info,v 1.1.2.1 2008/04/30 08:05:19 mh86
+# includes/content_taxonomy.token.inc: n/a
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: french translation for drupal6 content_taxonomy module\n"
+"POT-Creation-Date: 2009-04-07 11:50+0200\n"
+"PO-Revision-Date: 2009-04-07 12:48+0100\n"
+"Last-Translator: Sylvain Moreau \n"
+"Language-Team: Sylvain Moreau, OWS \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n>1);\n"
+
+#: content_taxonomy.module:16
+msgid "Defines a CCK field type for referencing taxonomy terms. The fields are independent from vocabulary settings and can be configured through the CCK admin field pages. The Content Taxonomy Module provides different widget types, at the moment including Option Widgets (Radios / Checkboxes, Selects), Autocompletes, Tree). The widget modules have to be enabled separately."
+msgstr "Définit un type de champ CCK pour référencer les termes de taxonomie. Les champs sont indépendant des paramètres de vocabulaire et peuvent être configurés par les pages d'admin du champ CCK. Le module Content Taxonomy fournit différents types de widget, incluant pour le moment les Widgets Option (Boutons Radio/Cases à Cocher, Listes déroulantes), AutoComplétion et Arborescence. Les modules de wisget doivent être activés séparément."
+
+#: content_taxonomy.module:49
+msgid "Content Taxonomy Fields"
+msgstr "Content Taxonomy Fields"
+
+#: content_taxonomy.module:50
+msgid "Stores terms for nodes in the database."
+msgstr "Stocke des termes pour les noeuds dans la base de données."
+
+#: content_taxonomy.module:69
+msgid "Save values additionally to the core taxonomy system (into the 'term_node' table)."
+msgstr "Enregistrer les valeurs en plus dans le système core de taxonomie (dans la table 'term_node')."
+
+#: content_taxonomy.module:71
+msgid "If this option is set, saving of terms is additionally handled by the taxonomy module. So saved terms from Content Taxonomy fields will appear as any other terms saved by the core taxonomy module. Set this option if you are using any other taxonomy application, like tagadelic. Otherwise terms are only saved in the cck tables and can only be accessed via the node or a view"
+msgstr "Si cette option est activée, l'enregistrement des termes est géré en plus par le module taxonomy. Ainsi, les termes enregistrés dans les champs Content Taxonomy apparaîtront comme n'importe quels autres termes enregistrées par le module taxonomy. Activez cette option si vous utilisez d'autres appicatifs de taxonomie, tel que tagadelic. Dans le cas contraire, les termes sont uniquement enregistrés dans les tables cck, et ne peuvent être accessibles qu'au travers du noeud ou d'une vue."
+
+#: content_taxonomy.module:80
+msgid "Vocabulary"
+msgstr "Vocabulaire"
+
+#: content_taxonomy.module:84
+msgid "Terms of the selected vocabulary get exposed to the field"
+msgstr "Les termes du vocabulaire sélectionné sont exposés dans le champ"
+
+#: content_taxonomy.module:89
+msgid "Advanced settings for hierarchical vocabularies"
+msgstr "Paramètres avancés pour des vocabulaires hiérarchiques"
+
+#: content_taxonomy.module:94
+msgid "Parent Term"
+msgstr "Terme Parent"
+
+#: content_taxonomy.module:98
+msgid "If any term is selected here, only child terms of the selected are going to be exposed the field. Otherwise the whole vocabulary selected above"
+msgstr "Si un terme est sélectionné ici, seuls les termes enfants de celui-ci seront exposés dans le filtre. Autrement, le vocabulaire complet sélectionné ci-dessus"
+
+#: content_taxonomy.module:102
+msgid "Advanced PHP code"
+msgstr "code PHP avancé"
+
+#: content_taxonomy.module:107
+msgid "PHP Code for selecting the parent term"
+msgstr "Code PHP pour la sélection du terme parent"
+
+#: content_taxonomy.module:111
+msgid "Advanced usage only: PHP code that returns the parent term ID. Should not include <?php ?> delimiters. If this field is filled out, the ID returned by this code will override the selected parent above."
+msgstr "Usage avancé uniquement : code PHP retournant l'ID du terme parent. Ne doit pas contenir les délimiteurs <?php ?>. Si ce champ est rempli, l'ID retourné par ce code remplacera le parent sélectionné ci-dessus."
+
+#: content_taxonomy.module:116
+msgid "Depth of taxonomy tree"
+msgstr "Profondeur de l'arbre de taxonomie"
+
+#: content_taxonomy.module:118
+msgid "By setting a numeric value, the depth of the hierarchy shown can be limited. Leave this field blank to show the whole hierarchy."
+msgstr "En définissant une valeur numérique, la profondeur de la hiérarchie affichée peut être limitée. Laissez ce champ vide pour afficher la hiérarchie complète."
+
+#: content_taxonomy.module:141
+msgid "@field-title term"
+msgstr "Terme @field-title"
+
+#: content_taxonomy.module:198
+msgid "As Text"
+msgstr "En tant que Texte"
+
+#: content_taxonomy.module:203
+msgid "As Link"
+msgstr "En tant que Lien"
+
+#: content_taxonomy.module:354;362
+msgid "content"
+msgstr "contenu"
+
+#: content_taxonomy.module:354
+msgid "Deleted field %field_name and its data."
+msgstr "Le champ %field_name et ses données ont été supprimés."
+
+#: content_taxonomy.module:362
+msgid "Entries with term id = %tid have been deleted out of %table for field %field_name."
+msgstr "Les enregistrements avec l'id de terme = %tid ont été supprimés de la table %table pour le champ %field_name."
+
+#: content_taxonomy.module:0
+msgid "content_taxonomy"
+msgstr "content_taxonomy"
+
+#: content_taxonomy_autocomplete.module:40
+msgid "Autocomplete (Freetagging)"
+msgstr "Autocomplétion (Étiquetage libre/Freetagging)"
+
+#: content_taxonomy_autocomplete.module:59
+msgid "Settings for Autocompletes"
+msgstr "Paramètres pour les Autocomplétions"
+
+#: content_taxonomy_autocomplete.module:65
+msgid "Freetagging settings"
+msgstr "Paramètres d'Etiquetage libre (Freetagging)"
+
+#: content_taxonomy_autocomplete.module:67
+msgid "Allow and insert new terms by the user into the vocabulary"
+msgstr "Autoriser et insérer de nouveaux termes par l'utilisateur dans le vocabulaire"
+
+#: content_taxonomy_autocomplete.module:68
+msgid "Deny any new terms"
+msgstr "Refuser tout nouveau terme"
+
+#: content_taxonomy_autocomplete.module:73
+msgid "Extra Parent for new terms"
+msgstr "Extra Parent pour les nouveaux termes"
+
+#: content_taxonomy_autocomplete.module:76
+msgid "This setting is only relevant if you have selected \"Allow and insert new terms by the user into the vocabulary\". If you select any term here, new terms will get children of the selected one, otherwise new terms get children of the parent term (root, if no parent selected) selected in the global settings."
+msgstr "Ce paramètre n'est significatif que si vous avez sélectionné \"Autoriser et insérer de nouveaux termes par l'utilisateur dans le vocabulaire\". Si vous sélectionner un terme ici, les nouveaux termes seront des enfants de celui-ci, sinon les nouveaux termes seront des enfants du terme parent (racine, si aucun parent sélectionné) sélectionné dans les paramètres globaux."
+
+#: content_taxonomy_autocomplete.module:81
+msgid "Maximum length of autocomplete"
+msgstr "Longueur maximale de l'autocomplétion"
+
+#: content_taxonomy_autocomplete.module:85
+msgid "Defines how many characters can be typed into the autocomplete field. For values higher than 255, remember that one term name can not be longer than 255 (would be cutted), nevertheless it's not a problem for multiple values, separated by commas."
+msgstr "Définit combien de caractères peuvent être tapés dans le champ a autocomplétion. Pour des valeurs supérieures à 255, souvenez-vous qu'un nom de terme ne peut être plus long que 255 caractères (il sera coupé), cependant, ceci ne constitue pas un problème pour des valeurs multiples, séparées par des virgules."
+
+#: content_taxonomy_autocomplete.module:97
+msgid "\"Maximum length\" must be a positive integer."
+msgstr "\"Longueur maximale\" doit être un entier positif."
+
+#: content_taxonomy_autocomplete.module:214
+msgid "You can provide only one value"
+msgstr "Vous ne pouvez fournir qu'une seule valeur"
+
+#: content_taxonomy_autocomplete.module:219
+msgid "New tags are not allowed"
+msgstr "Les nouveaux tags ne sont pas autorisés"
+
+#: content_taxonomy_autocomplete.module:26
+msgid "Autocomplete"
+msgstr "Autocomplétion"
+
+#: content_taxonomy_autocomplete.module:0
+msgid "content_taxonomy_autocomplete"
+msgstr "content_taxonomy_autocomplete"
+
+#: content_taxonomy_options.module:27
+msgid "Checkboxes/Radios"
+msgstr "Cases à cocher/Boutons Radio"
+
+#: content_taxonomy_options.module:35
+msgid "Select List"
+msgstr "Liste Déroulante"
+
+#: content_taxonomy_options.module:54
+msgid "Settings for Options"
+msgstr "Paramètres des Options"
+
+#: content_taxonomy_options.module:60
+msgid "Indent child terms with ' - ' signs"
+msgstr "Indenter les termes enfants avec des signes ' - '"
+
+#: content_taxonomy_options.module:62
+msgid "If this option is checked, a hierarchy gets visualized by indenting child terms, otherwise it's a flat list"
+msgstr "Si cette option est cochée, une hiérarchie est rendue visuelle par l'indentation des termes enfants, sinon ce sera une liste à plat"
+
+#: content_taxonomy_options.module:65
+msgid "Parent term for OptGroups in select fields"
+msgstr "Terme parent pour les Groupes d'Options (OptGroups) dans les champs menu déroulant"
+
+#: content_taxonomy_options.module:69
+msgid "This settings applies only for select fields. Select a parent term containg the grouping terms. Grouping terms should be parents of the selected terms (from the Global Settings)."
+msgstr "Ce paramètre s'applique uniquement pour les champs liste déroulante. Sélectionner un terme parent contenant les termes à grouper. Les termes à grouper doivent être parents des termes sélectionnés (dans la partie Paramètres Globaux)"
+
+#: content_taxonomy_options.module:95
+msgid "N/A"
+msgstr "N/A"
+
+#: content_taxonomy_options.module:97
+msgid "- None -"
+msgstr "- Aucun -"
+
+#: content_taxonomy_options.module:0
+msgid "content_taxonomy_options"
+msgstr "content_taxonomy_options"
+
+#: content_taxonomy_tree.module:24
+msgid "Tree"
+msgstr "Arborescence"
+
+#: content_taxonomy_tree.module:43
+msgid "Settings for Trees"
+msgstr "Paramètres pour les Arborescences"
+
+#: content_taxonomy_tree.module:49
+msgid "Expand whole tree by default"
+msgstr "Dérouler l'arborescence complète par défaut"
+
+#: content_taxonomy_tree.module:51
+msgid "Otherwise only branches, where a term is selected get expanded by default"
+msgstr "Sinon, seules les branches où un terme est sélectionné sont déroulées par défaut"
+
+#: content_taxonomy_tree.module:153
+msgid "!name field is required."
+msgstr "Le champ !name est obligatoire."
+
+#: content_taxonomy_tree.module:0
+msgid "content_taxonomy_tree"
+msgstr "content_taxonomy_tree"
+
+#: content_taxonomy.info:0
+msgid "Content Taxonomy"
+msgstr "Content Taxonomy"
+
+#: content_taxonomy.info:0
+msgid "Defines a field type for taxonomy terms"
+msgstr "Définit un type de champ pour les termes de taxonomie"
+
+#: content_taxonomy.info:0
+#: content_taxonomy_autocomplete.info:0
+#: content_taxonomy_options.info:0
+#: content_taxonomy_tree.info:0
+msgid "CCK"
+msgstr "CCK"
+
+#: content_taxonomy_autocomplete.info:0
+msgid "Content Taxonomy Autocomplete"
+msgstr "Content Taxonomy Autocomplete"
+
+#: content_taxonomy_autocomplete.info:0
+msgid "Defines a autocomplete widget type for content_taxonomy"
+msgstr "Définit un type de widget à autocomplétion pour content_taxonomy"
+
+#: content_taxonomy_options.info:0
+msgid "Content Taxonomy Options"
+msgstr "Content Taxonomy Options"
+
+#: content_taxonomy_options.info:0
+msgid "Defines a option widget type for content_taxonomy for selects, radios/checkboxes"
+msgstr "Définit un type de widget option pour content_taxonomy pour les listes déroulantes, les boutons radio et les cases à cocher"
+
+#: content_taxonomy_tree.info:0
+msgid "Content Taxonomy Tree"
+msgstr "Content Taxonomy Tree"
+
+#: content_taxonomy_tree.info:0
+msgid "Defines a dynamic tree widget for Content Taxonomy"
+msgstr "Définit un widget arborescence dynamique pour Content Taxonomy"
+
+#: includes/content_taxonomy.token.inc:10
+msgid "Name of top taxonomy term"
+msgstr "Nom du terme de taxonomie le plus haut"
+
+#: includes/content_taxonomy.token.inc:11
+msgid "ID of top taxonomy term"
+msgstr "ID du terme de taxonomie le plus haut"
+
+#: includes/content_taxonomy.token.inc:12
+msgid "Names of all taxonomy terms separated by commas"
+msgstr "Noms de tous les termes de taxonomie, séparés par des virgules"
+
+#: includes/content_taxonomy.token.inc:13
+msgid "IDs of all taxonomy terms separated by commas"
+msgstr "IDs de tous les termes de taxonomie, séparés par des virgules"
+
+#: includes/content_taxonomy.token.inc:14
+msgid "Name of terms vocabulary"
+msgstr "Nom du vocabulaire des termes"
+
+#: includes/content_taxonomy.token.inc:15
+msgid "ID of terms vocabulary"
+msgstr "ID du vocabulaire des termes"
+
diff --git a/sites/all/modules/content_taxonomy/translations/hu.po b/sites/all/modules/content_taxonomy/translations/hu.po
new file mode 100644
index 0000000..55304f6
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/translations/hu.po
@@ -0,0 +1,413 @@
+# Hungarian translation of content_taxonomy (6.x-1.0-rc1)
+# Copyright (c) 2009 by the Hungarian translation team
+# Generated from files:
+# content_taxonomy_tree.module,v 1.1.2.5 2009/05/14 16:58:22 mh86
+# content_taxonomy.module,v 1.2.2.15.2.23 2009/05/14 14:03:11 mh86
+# content_taxonomy_options.module,v 1.1.4.7.2.4 2008/12/27 11:25:27 mh86
+# content_taxonomy/includes/content_taxonomy.token.inc: n/a
+# content_taxonomy_autocomplete.module,v 1.2.2.4.2.15 2009/05/14 17:10:13 mh86
+# content_taxonomy.info,v 1.1.2.2.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_autocomplete.info,v 1.1.2.4.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_options.info,v 1.1.2.5.2.1 2008/04/30 08:05:19 mh86
+# content_taxonomy_tree.info,v 1.1.2.1 2008/04/30 08:05:19 mh86
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: content_taxonomy (6.x-1.0-rc1)\n"
+"POT-Creation-Date: 2009-05-16 15:49+0200\n"
+"PO-Revision-Date: 2009-05-15 09:43+0200\n"
+"Last-Translator: Balogh Zoltán\n"
+"Language-Team: Hungarian http://forditas.mindworks.hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\n"
+
+#: content_taxonomy_tree.module:154
+msgid "!name field is required."
+msgstr "!name mező nincs kitöltve."
+
+#: content_taxonomy.module:377,390
+msgid "content"
+msgstr "tartalom"
+
+#: content_taxonomy_options.module:97
+msgid "- None -"
+msgstr "- Nincs -"
+
+#: content_taxonomy_options.module:95
+msgid "N/A"
+msgstr "Nincs adat"
+
+#: includes/content_taxonomy.token.inc:10
+msgid "Name of top taxonomy term"
+msgstr "Legelső taxonómiakifejezés neve"
+
+#: includes/content_taxonomy.token.inc:11
+msgid "Unfiltered name of top taxonomy term. WARNING - raw user input."
+msgstr ""
+"A legelső taxonómiakifejezés szűretlen neve. Figyelem - nyers "
+"felhasználói bevitel."
+
+#: includes/content_taxonomy.token.inc:12
+msgid "ID of top taxonomy term"
+msgstr "A legelső taxonómiakifejezés azonosítója"
+
+#: content_taxonomy.module:81
+msgid "Vocabulary"
+msgstr "Szótár"
+
+#: content_taxonomy_autocomplete.module:26
+msgid "Autocomplete"
+msgstr "Automatikus kiegészítés"
+
+#: content_taxonomy.info:0; content_taxonomy_autocomplete.info:0; content_taxonomy_options.info:0; content_taxonomy_tree.info:0
+msgid "CCK"
+msgstr "CCK"
+
+#: content_taxonomy.module:16
+msgid ""
+"Defines a CCK field type for referencing taxonomy terms. The fields "
+"are independent from vocabulary settings and can be configured through "
+"the CCK admin field pages. The Content Taxonomy Module provides "
+"different widget types, at the moment including Option Widgets (Radios "
+"/ Checkboxes, Selects), Autocompletes, Tree). The widget modules have "
+"to be enabled separately."
+msgstr ""
+"Egy CCK mezőtípust ad, mely taxonómiakifejezésekre "
+"hivatkozik. A mezők függetlenek a szótárbeállításoktól, a "
+"CCK adminisztrációs oldalain lehet ezeket beállítani. A "
+"Content Taxonomy modul különböző felületi elemeket "
+"szolgáltat, jelenleg választógombok, jelölőnégyzetek, "
+"legördülő listák, automatikusan kiegészülő mezők és fák "
+"állnak rendelkezésre. A felületi elem modulokat külön kell "
+"engedélyezni."
+
+#: content_taxonomy.module:49
+msgid "Content Taxonomy Fields"
+msgstr "Content Taxonomy mezők"
+
+#: content_taxonomy.module:50
+msgid "Stores terms for nodes in the database."
+msgstr "A kifejezések tárolása a tartalomhoz az adatbázisban."
+
+#: content_taxonomy.module:69
+msgid ""
+"Save values additionally to the core taxonomy system (into the "
+"'term_node' table)."
+msgstr ""
+"Az értékek mentése az alap taxonómia rendszerbe is (a "
+"„term_node” táblába)."
+
+#: content_taxonomy.module:71
+msgid ""
+"If this option is set, saving of terms is additionally handled by the "
+"taxonomy module. So saved terms from Content Taxonomy fields will "
+"appear as any other terms saved by the core taxonomy module. Set this "
+"option if you are using any other taxonomy application, like "
+"tagadelic. Otherwise terms are only saved in the cck tables and can "
+"only be accessed via the node or a view"
+msgstr ""
+"Ha ez a lehetőség be van kapcsolva, a mentett kifejezések "
+"hozzáadódnak a taxonómia modulhoz is. Így a Content "
+"Taxonomy mezőkben elmentett kifejezések ugyanúgy fognak "
+"viselkedni, mint az alap taxonómia modullal elmentett bármelyik "
+"másik kifejezés. Be kell kapcsolni, ha bármilyen egyéb taxonómia "
+"alkalmazás is használatban van, mint például a tagadelic. "
+"Ellenkező esetben a kifejezések csak a CCK tábláiba "
+"lesznek elmentve, így ezeket csak a tartalommal vagy egy nézettel "
+"lehet elérni."
+
+#: content_taxonomy.module:85
+msgid "Terms of the selected vocabulary get exposed to the field"
+msgstr "A kiválasztott szótár kifejezései megjelennek a mezőben"
+
+#: content_taxonomy.module:90
+msgid "Advanced settings for hierarchical vocabularies"
+msgstr "Haladó beállítások hierarhikus szótáraknak"
+
+#: content_taxonomy.module:95
+msgid "Parent Term"
+msgstr "Szülő kifejezés"
+
+#: content_taxonomy.module:99
+msgid ""
+"If any term is selected here, only child terms of the selected are "
+"going to be exposed the field. Otherwise the whole vocabulary selected "
+"above"
+msgstr ""
+"Ha itt bármilyen kifejezés ki van választva, akkor csak ennek a "
+"gyermekei fognak megjelenni a mezőben. Egyébként a feljebb "
+"kiválasztott teljes szótár."
+
+#: content_taxonomy.module:103
+msgid "Advanced PHP code"
+msgstr "Haladó PHP kód"
+
+#: content_taxonomy.module:108
+msgid "PHP Code for selecting the parent term"
+msgstr "PHP kód a szülő kifejezés kiválasztásához"
+
+#: content_taxonomy.module:112
+msgid ""
+"Advanced usage only: PHP code that returns the parent term ID. Should "
+"not include <?php ?> delimiters. If this field is filled out, "
+"the ID returned by this code will override the selected parent above."
+msgstr ""
+"Csak haladóknak: PHP kód, ami visszaadja a szülő kifejezés "
+"azonosítóját. Nem szükséges <?php ?> elemek közé zárni. "
+"Ha ez a mező ki van töltve, akkor a kód által visszaadott "
+"azonosító felülír minden fentebb kiválasztott szülő értéket."
+
+#: content_taxonomy.module:117
+msgid "Depth of taxonomy tree"
+msgstr "A taxonómia fa mélysége"
+
+#: content_taxonomy.module:119
+msgid ""
+"By setting a numeric value, the depth of the hierarchy shown can be "
+"limited. Leave this field blank to show the whole hierarchy."
+msgstr ""
+"Egy numerikus értéket megadva a megjelenő hierarhia mélysége "
+"korlátozható. Üresen hagyva megjelenik a teljes hierarhia."
+
+#: content_taxonomy.module:201
+msgid "As Text"
+msgstr "Mint szöveg"
+
+#: content_taxonomy.module:206
+msgid "As Link"
+msgstr "Mint hivatkozás"
+
+#: content_taxonomy.module:377
+msgid "Deleted field %field_name and its data."
+msgstr "%field_name mező az adataival együtt törölve."
+
+#: content_taxonomy.module:390
+msgid ""
+"Entries with term id = %tid have been deleted out of %table for field "
+"%field_name."
+msgstr ""
+"%tid azonosítójú bejegyzések törölve lettek (Tábla: %table, "
+"mezőnév: %field_name)."
+
+#: content_taxonomy.module:0
+msgid "content_taxonomy"
+msgstr "content_taxonomy"
+
+#: content_taxonomy_autocomplete.module:40
+msgid "Autocomplete (Freetagging)"
+msgstr "Automatikus kiegészítés (szabadszavas cimkézés)"
+
+#: content_taxonomy_autocomplete.module:59
+msgid "Settings for Autocompletes"
+msgstr "Beállítások az automatikus kiegészítéshez"
+
+#: content_taxonomy_autocomplete.module:65
+msgid "Freetagging settings"
+msgstr "Szabadszavas cimkézés beállítások"
+
+#: content_taxonomy_autocomplete.module:67
+msgid "Allow and insert new terms by the user into the vocabulary"
+msgstr ""
+"Engedélyezi, hogy felhasználók új kifejezéseket adjanak a "
+"szótárhoz"
+
+#: content_taxonomy_autocomplete.module:68
+msgid "Deny any new terms"
+msgstr "Új kifejezések tiltása"
+
+#: content_taxonomy_autocomplete.module:73
+msgid "Extra Parent for new terms"
+msgstr "Extra szülő az új kifejezéseknek"
+
+#: content_taxonomy_autocomplete.module:76
+msgid ""
+"This setting is only relevant if you have selected \"Allow and insert "
+"new terms by the user into the vocabulary\". If you select any term "
+"here, new terms will get children of the selected one, otherwise new "
+"terms get children of the parent term (root, if no parent selected) "
+"selected in the global settings."
+msgstr ""
+"Ez a beállítás csak akkor hatásos, ha az „Engedélyezi, hogy "
+"felhasználók új kifejezéseket adjanak a szótárhoz” lehetőség "
+"van kiválasztva. Ha itt bármilyen kifejezés ki van választva, "
+"akkor az új kifejezések a kiválasztott kifejezés gyermekei "
+"lesznek, ellenkező esetben a szülőt az általános beállítások "
+"határozzák meg. Ha nincs szülő kiválasztva, akkor a gyökér lesz "
+"az."
+
+#: content_taxonomy_autocomplete.module:81
+msgid "Maximum length of autocomplete"
+msgstr "Az automatikus kiegészítés maximális hossza"
+
+#: content_taxonomy_autocomplete.module:85
+msgid ""
+"Defines how many characters can be typed into the autocomplete field. "
+"For values higher than 255, remember that one term name can not be "
+"longer than 255 (would be cutted), nevertheless it's not a problem for "
+"multiple values, separated by commas."
+msgstr ""
+"Megadható, hogy hány karaktert lehessen begépelni az automatikusan "
+"kiegészülő mezőbe. 255-nél nagyobb érték megadásakor tudni "
+"kell, hogy a kifejezés nem lehet 255 karakternél hosszabb (le lesz "
+"vágva). Azonban ez nem jelent problémát a vesszővel elválasztott, "
+"többszörös értékek esetén."
+
+#: content_taxonomy_autocomplete.module:97
+msgid "\"Maximum length\" must be a positive integer."
+msgstr "A „maximális hossz” értéknek pozitív egésznek kell lennie."
+
+#: content_taxonomy_autocomplete.module:213
+msgid "You can provide only one value"
+msgstr "Csak egy értéket lehet megadni"
+
+#: content_taxonomy_autocomplete.module:221
+msgid "New tags are not allowed"
+msgstr "Az új elemek nem engedélyezettek"
+
+#: content_taxonomy_autocomplete.module:0
+msgid "content_taxonomy_autocomplete"
+msgstr "content_taxonomy_autocomplete"
+
+#: content_taxonomy_options.module:27
+msgid "Checkboxes/Radios"
+msgstr "Jelölőnégyzetek/választógombok"
+
+#: content_taxonomy_options.module:35
+msgid "Select List"
+msgstr "Legördülő lista"
+
+#: content_taxonomy_options.module:54
+msgid "Settings for Options"
+msgstr "Lehetőségek beállítása"
+
+#: content_taxonomy_options.module:60
+msgid "Indent child terms with ' - ' signs"
+msgstr "Gyermek kifejezések bekezdése „ - ” jelekkel"
+
+#: content_taxonomy_options.module:62
+msgid ""
+"If this option is checked, a hierarchy gets visualized by indenting "
+"child terms, otherwise it's a flat list"
+msgstr ""
+"Ha ez a lehetőség be van kapcsolva, a hierarhia megjelenítésekor a "
+"gyermek kifejezések bekezdve jelennek meg, ellenkező esetben csak "
+"egyszerű lista lesz."
+
+#: content_taxonomy_options.module:65
+msgid "Parent term for OptGroups in select fields"
+msgstr ""
+"Szülő kifejezés az OptGroups számára a legördülő "
+"listákban"
+
+#: content_taxonomy_options.module:69
+msgid ""
+"This settings applies only for select fields. Select a parent term "
+"containg the grouping terms. Grouping terms should be parents of the "
+"selected terms (from the Global Settings)."
+msgstr ""
+"Ezek a beállítások csak a legördülő listákra vonatkoznak. Ki "
+"lehet választani egy szülő kifejezést a kifejezések "
+"csoportosításához. A kifejezések csoportosításához kellenek "
+"szülők a kiválasztott kifejezéseknek (az általános "
+"beállításokból)."
+
+#: content_taxonomy_options.module:0
+msgid "content_taxonomy_options"
+msgstr "content_taxonomy_options"
+
+#: content_taxonomy_tree.module:24
+msgid "Tree"
+msgstr "Fa"
+
+#: content_taxonomy_tree.module:43
+msgid "Settings for Trees"
+msgstr "Fa beállítások"
+
+#: content_taxonomy_tree.module:49
+msgid "Expand whole tree by default"
+msgstr "Alapértelmezésben kibontja a teljes fát"
+
+#: content_taxonomy_tree.module:51
+msgid ""
+"Otherwise only branches, where a term is selected get expanded by "
+"default"
+msgstr ""
+"Különben csak azok a csoportok nyílnak ki alapértelmezéseben, "
+"ahol a kifejezés ki van választva"
+
+#: content_taxonomy_tree.module:0
+msgid "content_taxonomy_tree"
+msgstr "content_taxonomy_tree"
+
+#: content_taxonomy.info:0
+msgid "Content Taxonomy"
+msgstr "Content Taxonomy"
+
+#: content_taxonomy.info:0
+msgid "Defines a field type for taxonomy terms"
+msgstr "Mezőtípust ad a taxonómiakifejezéseknek"
+
+#: content_taxonomy_autocomplete.info:0
+msgid "Content Taxonomy Autocomplete"
+msgstr "Content Taxonomy automatikus kiegészítéssel"
+
+#: content_taxonomy_autocomplete.info:0
+msgid "Defines a autocomplete widget type for content_taxonomy"
+msgstr ""
+"Automatikusan kiegészülő mező felületi elemet ad a Content "
+"Taxonomy modulhoz"
+
+#: content_taxonomy_options.info:0
+msgid "Content Taxonomy Options"
+msgstr "Content Taxonomy lehetőségek"
+
+#: content_taxonomy_options.info:0
+msgid ""
+"Defines a option widget type for content_taxonomy for selects, "
+"radios/checkboxes"
+msgstr ""
+"Legördülő lista, választógomb és jelölőnégyzet felületi "
+"elemeket ad a Content Taxonomy modulhoz"
+
+#: content_taxonomy_tree.info:0
+msgid "Content Taxonomy Tree"
+msgstr "Content Taxonomy Tree"
+
+#: content_taxonomy_tree.info:0
+msgid "Defines a dynamic tree widget for Content Taxonomy"
+msgstr "Dinamikus fa felületi elemet ad a Content Taxonomy modulhoz"
+
+#: includes/content_taxonomy.token.inc:13
+msgid "Names of all taxonomy terms separated by commas"
+msgstr "Minden taxonómiakifejezés neve, vesszőkkel elválasztva"
+
+#: includes/content_taxonomy.token.inc:15
+msgid "IDs of all taxonomy terms separated by commas"
+msgstr "Minden taxonómiakifejezés azonosítója, vesszőkkel elválasztva"
+
+#: includes/content_taxonomy.token.inc:16
+msgid "Name of terms vocabulary"
+msgstr "A kifejezések szótárának neve"
+
+#: includes/content_taxonomy.token.inc:17
+msgid "ID of terms vocabulary"
+msgstr "A kifejezések szótárának azonosítója"
+
+#: content_taxonomy.module:142
+msgid "@field-title term"
+msgstr "@field-title kifejezés"
+
+#: content_taxonomy_autocomplete.module:217; content_taxonomy_tree.module:157
+msgid "%name: this field cannot hold more than @count values."
+msgstr "%name: ez a mező nem tartalmazhat több, mint @count értéket."
+
+#: includes/content_taxonomy.token.inc:14
+msgid ""
+"Unfiltered names of all taxonomy terms separated by commas. WARNING - "
+"raw user input."
+msgstr ""
+"Vesszőkkel elválasztva minden taxonómiakifejezés szűretlen neve. "
+"Figyelem - nyers felhasználói bevitel."
+
diff --git a/sites/all/modules/content_taxonomy/translations/ja.po b/sites/all/modules/content_taxonomy/translations/ja.po
new file mode 100644
index 0000000..86de054
--- /dev/null
+++ b/sites/all/modules/content_taxonomy/translations/ja.po
@@ -0,0 +1,222 @@
+# $Id: ja.po,v 1.1.2.1 2008/05/31 08:16:58 imagine Exp $
+#
+# Japanese translation of Drupal (content_taxonomy)
+# Copyright 2008 0829
+# Generated from files:
+# content_taxonomy.info,v 1.1.2.2.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy.module,v 1.2.2.15.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_autocomplete.info,v 1.1.2.4.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_autocomplete.module,v 1.2.2.4.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_options.info,v 1.1.2.5.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_options.module,v 1.1.4.7.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_tree.info,v 1.1.2.1 2008/04/30 08:05:19 mh86 Exp
+# content_taxonomy_tree.module,v 1.1.2.1 2008/04/30 08:05:19 mh86 Exp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 6.x\n"
+"POT-Creation-Date: 2008-05-11 16:35+0900\n"
+"PO-Revision-Date: 2008-05-22 01:27+0900\n"
+"Last-Translator: 0829 \n"
+"Language-Team: DRUPAL*DRUPAL \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\n"
+
+#: modules/content_taxonomy/content_taxonomy.info:0
+msgid "Content Taxonomy"
+msgstr "コンテンツタクソノミー"
+
+#: modules/content_taxonomy/content_taxonomy.info:0
+msgid "Defines a field type for taxonomy terms"
+msgstr "タクソノミータームのフィールドタイプを定義します。"
+
+#: modules/content_taxonomy/content_taxonomy.info:0
+#: modules/content_taxonomy/content_taxonomy_autocomplete.info:0
+#: modules/content_taxonomy/content_taxonomy_options.info:0
+#: modules/content_taxonomy/content_taxonomy_tree.info:0
+msgid "CCK"
+msgstr "CCK"
+
+#: modules/content_taxonomy/content_taxonomy.module:16
+msgid "Defines a field type for referencing a taxonomy term. Note: Requires content.module."
+msgstr "タクソノミータームを参照するためのフィールドタイプを定義します。 注: コンテンツモジュール(CCK)が必要です。"
+
+#: modules/content_taxonomy/content_taxonomy.module:40
+msgid "Content Taxonomy Fields"
+msgstr "コンテンツタクソノミーフィールド"
+
+#: modules/content_taxonomy/content_taxonomy.module:41
+msgid "Stores terms for the nodes in the database."
+msgstr "ノードに関連付けられたタームをデータベースに保存します。"
+
+#: modules/content_taxonomy/content_taxonomy.module:60
+msgid "Save values additionally in the term_node table."
+msgstr "term_node テーブルにも値を追加保存する"
+
+#: modules/content_taxonomy/content_taxonomy.module:62
+msgid "If this option is set, saving of terms is additionally handled by the taxonomy module. So saved terms from Content Taxonomy fields will appear as any other terms saved by the core taxonomy module. Set this option if you are using any other taxonomy application, like tagadelic. Otherwise terms are only saved in the cck tables and can only be accessed via the node or a view"
+msgstr "このオプションをセットした場合、タームの保存はタクソノミーモジュールによってさらに処理されます。 そのため、コンテンツタクソノミーフィールドを使用して保存されたタームはコアのタクソノミーモジュールによって保存された他のタームと同様に扱われます。 Tagadelic モジュールのような他のタクソノミー関連モジュールを使用している場合は、このオプションをセットしてください。 セットしない場合、タームは cck テーブルだけに保存され、ノードやビューを通してのみアクセス可能となります。"
+
+#: modules/content_taxonomy/content_taxonomy.module:67
+msgid "Specify terms to show"
+msgstr "表示するタームの指定"
+
+#: modules/content_taxonomy/content_taxonomy.module:82
+msgid "Vocabulary"
+msgstr "ボキャブラリ"
+
+#: modules/content_taxonomy/content_taxonomy.module:89
+msgid "Terms"
+msgstr "ターム"
+
+#: modules/content_taxonomy/content_taxonomy.module:93
+msgid "If any term is selected here, only child terms of the selected are going to be shown in the field. Otherwise the whole vocabulary selected above"
+msgstr "ここでタームを選択した場合は、選択したタームの下位タームのみがフィールドに表示されます。 選択していない場合は、上で選択したボキャブラリ内のすべてのタームが表示されます。"
+
+#: modules/content_taxonomy/content_taxonomy.module:98
+msgid "Depth of taxonomy tree"
+msgstr "タクソノミー階層の深さ"
+
+#: modules/content_taxonomy/content_taxonomy.module:100
+msgid "leave blank for unlimited depth"
+msgstr "タクソノミー階層の深さに制限を設けたくない場合は空欄のままにしてください。"
+
+#: modules/content_taxonomy/content_taxonomy.module:105
+msgid "Indent child terms with ' - ' signs"
+msgstr "下位のタームを ' - ' 記号でインデントする"
+
+#: modules/content_taxonomy/content_taxonomy.module:151
+msgid "As Text"
+msgstr "テキスト"
+
+#: modules/content_taxonomy/content_taxonomy.module:156
+msgid "As Link"
+msgstr "リンクを設定する"
+
+#: modules/content_taxonomy/content_taxonomy.module:0
+msgid "content_taxonomy"
+msgstr "コンテンツタクソノミー"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.info:0
+msgid "Content Taxonomy Autocomplete"
+msgstr "コンテンツタクソノミーオートコンプリート"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.info:0
+msgid "Defines a autocomplete widget type for content_taxonomy"
+msgstr "コンテンツタクソノミーのためにオートコンプリートタイプのウィジェットを定義します。"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:15
+msgid "Defines a widget type for content_taxonomy with autocomplete. Note: Requires content.module."
+msgstr "コンテンツタクソノミーでオートコンプリートを行うためのウィジェットタイプを定義します。 注: コンテンツモジュール(CCK)が必要です。"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:50;71;36
+msgid "Autocomplete"
+msgstr "オートコンプリート"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:77
+msgid "New terms from to user:"
+msgstr "ユーザからの新しいターム"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:79
+msgid "Allow and insert new terms into the taxonomy tree"
+msgstr "新しいタームの追加およびタクソノミーツリーへの挿入を許可する"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:80
+msgid "Deny any new terms"
+msgstr "新しいタームの追加はすべて拒否する"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:92
+msgid "Extra Parent for new terms"
+msgstr "新しいタームの特別な上位"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:94
+msgid "This setting is only relevant if you have set \"Allow and insert new terms into the taxonomy tree\". If you select any term here, new terms will get children of the selected one, otherwise new terms get children of the parent term selected in the data settings"
+msgstr "この設定は \"新しいタームの追加およびタクソノミーツリーへの挿入を許可する\" を選択した場合にのみ関連します。 ここで何らかのタームを選択した場合、新しく追加されたタームは選択したタームの下位タームとして追加されます。 どのタームも選択していない場合、新しく追加されたタームはデータ設定で選択したタームの下位タームとして追加されます。"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:153
+#: modules/content_taxonomy/content_taxonomy_tree.module:96
+msgid "Preview"
+msgstr "プレビュー"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:180
+msgid "You can provide only one value"
+msgstr "1つの値のみが設定できます"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:185
+msgid "New tags are not allowed"
+msgstr "新しいタグは許可されていません"
+
+#: modules/content_taxonomy/content_taxonomy_autocomplete.module:0
+msgid "content_taxonomy_autocomplete"
+msgstr "コンテンツタクソノミーオートコンプリート"
+
+#: modules/content_taxonomy/content_taxonomy_options.info:0
+msgid "Content Taxonomy Options"
+msgstr "コンテンツタクソノミーオプション"
+
+#: modules/content_taxonomy/content_taxonomy_options.info:0
+msgid "Defines a option widget type for content_taxonomy for selects, radios/checkboxes"
+msgstr "コンテンツタクソノミーのために、選択リスト, ラジオボタン, チェックボックスのタイプのオプションウィジェットを定義します。"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:16
+msgid "Defines a widget type for content_taxonomy for options (selects, radios/checkboxes). Note: Requires content.module."
+msgstr "コンテンツタクソノミーでオプションウィジェットタイプ(選択リスト, ラジオボタン, チェックボックス)を定義します。 注: コンテンツモジュール(CCK)が必要です。"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:26
+msgid "Checkboxes/Radios"
+msgstr "チェックボックス/ラジオボタン"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:34
+msgid "Select List"
+msgstr "選択リスト"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:62
+msgid "OptGroups"
+msgstr "グループ選択"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:65
+msgid "This setting is optional and only relevant for select lists"
+msgstr "この設定はオプションで、選択リストの場合にのみ関連します。 "
+
+#: modules/content_taxonomy/content_taxonomy_options.module:70
+msgid "Parent for grouping in first bar"
+msgstr "1番目のバーでグループ化するための上位ターム"
+
+#: modules/content_taxonomy/content_taxonomy_options.module:0
+msgid "content_taxonomy_options"
+msgstr "コンテンツタクソノミーオプション"
+
+#: modules/content_taxonomy/content_taxonomy_tree.info:0
+msgid "Content Taxonomy Tree"
+msgstr "コンテンツタクソノミーツリー"
+
+#: modules/content_taxonomy/content_taxonomy_tree.info:0
+msgid "Defines a dynamic tree widget for Content Taxonomy"
+msgstr "コンテンツタクソノミーのためにダイナミックなツリー表示のウィジェットを定義します。"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:11
+msgid "Defines a widget type for content_taxonomy with a tree form. Note: Requires content.module and the taxonomy manager."
+msgstr "コンテンツタクソノミーをツリー表示するためのウィジェットタイプを定義します。 注: コンテンツモジュール(CCK)が必要です。"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:34
+msgid "Tree"
+msgstr "ツリー"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:54
+msgid "Expand whole tree by default"
+msgstr "デフォルトですべてのツリーを展開する"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:56
+msgid "Otherwise only branches, where a term is selected get expanded by default"
+msgstr "チェックした場合、タームの選択部分がデフォルトで展開されたツリー表示となります。 チェックしない場合、分岐されているだけの閉じたツリー表示となります。"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:128
+msgid "This field is required"
+msgstr "このフィールドは必須です。"
+
+#: modules/content_taxonomy/content_taxonomy_tree.module:0
+msgid "content_taxonomy_tree"
+msgstr "コンテンツタクソノミーツリー"
+