Removing translation directories
[project/ctools.git] / plugins / content_types / node_form / node_form_taxonomy.inc
CommitLineData
22f375ca 1<?php
22f375ca 2
bd6a9b2c
EM
3if (module_exists('taxonomy')) {
4 /**
5 * Plugins are described by creating a $plugin array which will be used
6 * by the system that includes this file.
7 */
8 $plugin = array(
9 'single' => TRUE,
10 'icon' => 'icon_node_form.png',
11 'title' => t('Node form categories'),
12 'description' => t('Taxonomy categories for the node.'),
13 'required context' => new ctools_context_required(t('Form'), 'node_form'),
14 'category' => t('Form'),
15 );
22f375ca
EM
16}
17
18function ctools_node_form_taxonomy_content_type_render($subtype, $conf, $panel_args, &$context) {
19 $block = new stdClass();
20 $block->module = t('node_form');
21
22 $block->title = t('Categories');
23 $block->delta = 'url-path-options';
24
25 if (isset($context->form)) {
aeed3fef 26 if (!empty($context->form['form_id']) && !empty($context->form['taxonomy'])) {
22f375ca
EM
27 // remove the fieldset
28 unset($context->form['taxonomy']['#type']);
29 $block->content = drupal_render($context->form['taxonomy']);
30 }
31 }
32 else {
33 $block->content = t('Categories.');
34 }
35 return $block;
36}
37
38function ctools_node_form_taxonomy_content_type_admin_title($subtype, $conf, $context) {
39 return t('"@s" node form select taxonomy', array('@s' => $context->identifier));
40}
41
a40482ac 42function ctools_node_form_taxonomy_content_type_edit_form($form, &$form_state) {
22f375ca 43 // provide a blank form so we have a place to have context setting.
a40482ac 44 return $form;
22f375ca 45}