Conjunto 465d726 en sipes
- Fecha y hora:
- 08/09/2017 10:15:03 (hace 7 años)
- Branches:
- stable
- Children:
- 4b26eb0
- Parents:
- c57e2d8
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-modules/politicas_proyectos/politicas_proyectos.module
rde06505 r465d726 564 564 ), 565 565 'politicas_proyectos_formatter_pndes_0' => array( 566 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 567 'function' => 'theme_politicas_proyectos_formatter_generic', 568 ), 569 'politicas_proyectos_formatter_pndes_1' => array( 570 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 571 'function' => 'theme_politicas_proyectos_formatter_generic', 572 ), 573 'politicas_proyectos_formatter_pndes_2' => array( 574 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 575 'function' => 'theme_politicas_proyectos_formatter_generic', 576 ), 577 'politicas_proyectos_formatter_pndes_3' => array( 578 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 579 'function' => 'theme_politicas_proyectos_formatter_generic', 580 ), 581 'politicas_proyectos_formatter_pndeso_0' => array( 566 582 'arguments' => array('element' => NULL), 583 'function' => 'theme_politicas_proyectoso_formatter_generic', 584 ), 585 'politicas_proyectos_formatter_pndeso_1' => array( 586 'arguments' => array('element' => NULL), 587 'function' => 'theme_politicas_proyectoso_formatter_generic', 588 ), 589 'politicas_proyectos_formatter_pndeso_2' => array( 590 'arguments' => array('element' => NULL), 591 'function' => 'theme_politicas_proyectoso_formatter_generic', 592 ), 593 'politicas_proyectos_formatter_pndeso_3' => array( 594 'arguments' => array('element' => NULL), 595 'function' => 'theme_politicas_proyectoso_formatter_generic', 596 ), 597 'politicas_proyectos_formatter_pndesc_0' => array( 598 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 567 599 'function' => 'theme_politicas_proyectos_formatter_generic', 568 600 ), 569 'politicas_proyectos_formatter_pndes _1' => array(570 'arguments' => array('element' => NULL ),601 'politicas_proyectos_formatter_pndesc_1' => array( 602 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 571 603 'function' => 'theme_politicas_proyectos_formatter_generic', 572 604 ), 573 'politicas_proyectos_formatter_pndes _2' => array(574 'arguments' => array('element' => NULL ),605 'politicas_proyectos_formatter_pndesc_2' => array( 606 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 575 607 'function' => 'theme_politicas_proyectos_formatter_generic', 576 608 ), 577 'politicas_proyectos_formatter_pndes_3' => array(578 'arguments' => array('element' => NULL),579 'function' => 'theme_politicas_proyectos_formatter_generic',580 ),581 'politicas_proyectos_formatter_pndesc_0' => array(582 'arguments' => array('element' => NULL),583 'function' => 'theme_politicas_proyectos_formatter_generic',584 ),585 'politicas_proyectos_formatter_pndesc_1' => array(586 'arguments' => array('element' => NULL),587 'function' => 'theme_politicas_proyectos_formatter_generic',588 ),589 'politicas_proyectos_formatter_pndesc_2' => array(590 'arguments' => array('element' => NULL),591 'function' => 'theme_politicas_proyectos_formatter_generic',592 ),593 609 'politicas_proyectos_formatter_pndesc_3' => array( 594 'arguments' => array('element' => NULL ),610 'arguments' => array('element' => NULL, $html = TRUE, $unique = FALSE), 595 611 'function' => 'theme_politicas_proyectos_formatter_generic', 596 612 ), … … 598 614 'arguments' => array('element' => NULL), 599 615 'function' => 'theme_politicas_proyectos_formatter_metaspcc', 600 ),601 'politicas_proyectos_row' => array(602 'arguments' => array('row' => NULL, 'type' => NULL),603 616 ), 604 617 ); … … 656 669 } 657 670 671 658 672 /** 659 673 * Theme function for HS Content Taxonomy formatters. 660 674 * 661 675 */ 662 function theme_politicas_proyectos_formatter_generic($element) { 676 function theme_politicas_proyectoso_formatter_generic($element) { 677 list($formatter, $level) = explode('_', $element['#formatter']); 678 $output = theme('politicas_proyectos_formatter_pndes_' . $level, $element, FALSE, TRUE); 679 return $output; 680 } 681 682 683 /** 684 * Theme function for HS Content Taxonomy formatters. 685 * 686 */ 687 function theme_politicas_proyectos_formatter_generic($element, $html = TRUE, $unique = FALSE) { 663 688 $output = ''; 664 689 if (module_exists('hierarchical_select')) { … … 702 727 $flip = array('even' => 'odd', 'odd' => 'even'); 703 728 $class = 'even'; 704 $output = '<ul class="hierarchical-select-lineages">'; 729 $terms = array(); 730 list($formatter, $level) = explode('_', $element['#formatter']); 731 $sufix = $html? '</li>' : ''; 705 732 foreach ($dropbox->lineages as $i => $lineage) { 706 $ class = $flip[$class];707 $classes = ' '. $class;708 if ($i == 0) {709 $classes .= ' first';710 711 if ($i == $num_items - 1) {712 $classes .= ' last';713 }714 $ output .= '<li class="lineage-'. $i . $classes .'">';715 $ output .= theme('politicas_proyectos_row', $lineage, $element['#formatter']);716 $ output .= '</li>';717 } 718 $output .= '</ul>';733 $term = isset($lineage[$level]['value']) ? taxonomy_get_term($lineage[$level]['value']) : 0; 734 if ($term && $term->tid) { 735 $terms[$term->tid] .= $formatter == 'pndes' || 'pndeso'? $term->name : $term->name . HS_CONTENT_TAXONOMY_DESCRIPTION_SEP . $term->description; 736 } 737 } 738 if ($unique) { 739 //extract first element 740 $key = key($terms); 741 $new_array = array(); 742 $new_array[$key] = $terms[$key]; 743 $terms = $new_array; 744 } 745 $output = implode(' | ',$terms); 719 746 // Add the CSS. 720 drupal_add_css(drupal_get_path('module', 'hierarchical_select') .'/hierarchical_select.css'); 721 } 722 return $output; 723 } 724 725 /** 726 * Theme function to output single row (lineage) of CT field 727 * 728 * Giving levels different classes so some funny theming is possible: 729 * for example, different font size depending on level (like tagadelic) 730 */ 731 function theme_politicas_proyectos_row($row, $type) { 732 list($formatter, $level) = explode('_', $type); 733 $separator = '<span class="politicas-proyectos-pndes-item-separator">âº</span>'; 734 $output = ''; 735 if (empty($row)) { 736 return $output; 737 } 738 $items = array(); 739 $term = isset($row[$level]['value']) ? taxonomy_get_term($row[$level]['value']) : 0; 740 $output = ''; 741 if ($term) { 742 switch ($formatter) { 743 case 'pndes': 744 $output .= $term->name; 745 break; 746 case 'pndesc': 747 $output .= $term->name . HS_CONTENT_TAXONOMY_DESCRIPTION_SEP . $term->description; 748 break; 749 } 747 //drupal_add_css(drupal_get_path('module', 'hierarchical_select') .'/hierarchical_select.css'); 750 748 } 751 749 return $output; … … 766 764 } 767 765 768 769 770 771 766 //---------------------------------------------------------------------------- 772 767 // CCK hooks. … … 799 794 ), 800 795 'pndes_0' => array( 801 'label' => t(' Objetivo Histórico'),796 'label' => t('Nivel 0'), 802 797 'field types' => array('content_taxonomy'), 803 798 'multiple values' => CONTENT_HANDLE_MODULE, 804 799 ), 805 800 'pndes_1' => array( 806 'label' => t(' Objetivo Nacional'),801 'label' => t('Nivel 1'), 807 802 'field types' => array('content_taxonomy'), 808 803 'multiple values' => CONTENT_HANDLE_MODULE, 809 804 ), 810 805 'pndes_2' => array( 811 'label' => t(' Objetivo Estratégico'),806 'label' => t('Nivel 2'), 812 807 'field types' => array('content_taxonomy'), 813 808 'multiple values' => CONTENT_HANDLE_MODULE, 814 809 ), 815 810 'pndes_3' => array( 816 'label' => t('Objetivo General'), 817 'field types' => array('content_taxonomy'), 818 'multiple values' => CONTENT_HANDLE_MODULE, 819 ), 811 'label' => t('Nivel 3'), 812 'field types' => array('content_taxonomy'), 813 'multiple values' => CONTENT_HANDLE_MODULE, 814 ), 815 816 817 'pndeso_0' => array( 818 'label' => t('Nivel 0 (ONAPRE)'), 819 'field types' => array('content_taxonomy'), 820 'multiple values' => CONTENT_HANDLE_MODULE, 821 ), 822 'pndeso_1' => array( 823 'label' => t('Nivel 1 (ONAPRE)'), 824 'field types' => array('content_taxonomy'), 825 'multiple values' => CONTENT_HANDLE_MODULE, 826 ), 827 'pndeso_2' => array( 828 'label' => t('Nivel 2 (ONAPRE)'), 829 'field types' => array('content_taxonomy'), 830 'multiple values' => CONTENT_HANDLE_MODULE, 831 ), 832 'pndeso_3' => array( 833 'label' => t('Nivel 3 (ONAPRE)'), 834 'field types' => array('content_taxonomy'), 835 'multiple values' => CONTENT_HANDLE_MODULE, 836 ), 837 838 820 839 'pndesc_0' => array( 821 'label' => t(' Objetivo Histórico(Con Descripción)'),840 'label' => t('Nivel 0 (Con Descripción)'), 822 841 'field types' => array('content_taxonomy'), 823 842 'multiple values' => CONTENT_HANDLE_MODULE, 824 843 ), 825 844 'pndesc_1' => array( 826 'label' => t(' Objetivo Nacional(Con Descripción)'),845 'label' => t('Nivel 1 (Con Descripción)'), 827 846 'field types' => array('content_taxonomy'), 828 847 'multiple values' => CONTENT_HANDLE_MODULE, 829 848 ), 830 849 'pndesc_2' => array( 831 'label' => t(' Objetivo Estratégico(Con Descripción)'),850 'label' => t('Nivel 2 (Con Descripción)'), 832 851 'field types' => array('content_taxonomy'), 833 852 'multiple values' => CONTENT_HANDLE_MODULE, 834 853 ), 835 854 'pndesc_3' => array( 836 'label' => t(' Objetivo General(Con Descripción)'),855 'label' => t('Nivel 3 (Con Descripción)'), 837 856 'field types' => array('content_taxonomy'), 838 857 'multiple values' => CONTENT_HANDLE_MODULE,
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.