├── .gitignore ├── LICENSE.md ├── README.md ├── badistro.info ├── badistro.install ├── badistro.profile ├── drupal-org-core.make ├── drupal-org.make ├── modules └── custom │ ├── badistro_areas │ ├── badistro_areas.features.field_instance.inc │ ├── badistro_areas.features.inc │ ├── badistro_areas.info │ ├── badistro_areas.module │ └── badistro_areas.pages_default.inc │ ├── badistro_bloques │ ├── badistro_bloques.inc │ ├── badistro_bloques.info │ ├── badistro_bloques.module │ ├── js │ │ ├── fb-sdk.js │ │ └── tw.js │ ├── plugins │ │ └── content_types │ │ │ ├── alerta.inc │ │ │ ├── campo.inc │ │ │ ├── carrousel.inc │ │ │ ├── galeria_imagenes.inc │ │ │ ├── imagen.inc │ │ │ ├── imagen_destacada.inc │ │ │ ├── listado.inc │ │ │ ├── redes_sociales.inc │ │ │ ├── separador.inc │ │ │ ├── shortcut.inc │ │ │ ├── texto.inc │ │ │ └── titulo.inc │ └── templates │ │ ├── badistro_bloques_alerta.tpl.php │ │ ├── badistro_bloques_campo_categoria_noticia.tpl.php │ │ ├── badistro_bloques_campo_costo.tpl.php │ │ ├── badistro_bloques_campo_links_relacionados.tpl.php │ │ ├── badistro_bloques_campo_paginas_relacionadas.tpl.php │ │ ├── badistro_bloques_campo_requisitos.tpl.php │ │ ├── badistro_bloques_campo_siglas_area.tpl.php │ │ ├── badistro_bloques_campo_tags.tpl.php │ │ ├── badistro_bloques_campo_tipo_tramite.tpl.php │ │ ├── badistro_bloques_carrousel.tpl.php │ │ ├── badistro_bloques_galeria_imagenes_min.tpl.php │ │ ├── badistro_bloques_galeria_imagenes_min_item.tpl.php │ │ ├── badistro_bloques_imagen_destacada.tpl.php │ │ ├── badistro_bloques_links.tpl.php │ │ ├── badistro_bloques_listado_con_imagen_horizontal.tpl.php │ │ ├── badistro_bloques_listado_con_imagen_horizontal_item.tpl.php │ │ ├── badistro_bloques_listado_con_imagen_vertical.tpl.php │ │ ├── badistro_bloques_listado_con_imagen_vertical_item.tpl.php │ │ ├── badistro_bloques_listado_destacado_horizontal.tpl.php │ │ ├── badistro_bloques_listado_destacado_horizontal_item.tpl.php │ │ ├── badistro_bloques_listado_destacado_vertical.tpl.php │ │ ├── badistro_bloques_listado_destacado_vertical_item.tpl.php │ │ ├── badistro_bloques_listado_horizontal.tpl.php │ │ ├── badistro_bloques_listado_horizontal_item.tpl.php │ │ ├── badistro_bloques_listado_vacio.tpl.php │ │ ├── badistro_bloques_listado_vertical.tpl.php │ │ ├── badistro_bloques_listado_vertical_item.tpl.php │ │ ├── badistro_bloques_redes_sociales_compartir.tpl.php │ │ ├── badistro_bloques_redes_sociales_timeline_facebook.tpl.php │ │ ├── badistro_bloques_redes_sociales_timeline_twitter.tpl.php │ │ ├── badistro_bloques_separador.tpl.php │ │ ├── badistro_bloques_shortcut.tpl.php │ │ ├── badistro_bloques_texto.tpl.php │ │ └── badistro_bloques_titulo.tpl.php │ ├── badistro_cck │ ├── badistro_cck.features.fe_block_settings.inc │ ├── badistro_cck.features.field_base.inc │ ├── badistro_cck.features.filter.inc │ ├── badistro_cck.features.inc │ ├── badistro_cck.features.menu_custom.inc │ ├── badistro_cck.features.menu_links.inc │ ├── badistro_cck.features.taxonomy.inc │ ├── badistro_cck.features.user_permission.inc │ ├── badistro_cck.features.user_role.inc │ ├── badistro_cck.info │ ├── badistro_cck.module │ ├── badistro_cck.pages_default.inc │ └── badistro_cck.views_default.inc │ ├── badistro_noticias │ ├── badistro_noticias.features.field_instance.inc │ ├── badistro_noticias.features.inc │ ├── badistro_noticias.features.taxonomy.inc │ ├── badistro_noticias.info │ ├── badistro_noticias.module │ └── badistro_noticias.pages_default.inc │ ├── badistro_paginas │ ├── badistro_paginas.features.field_instance.inc │ ├── badistro_paginas.features.inc │ ├── badistro_paginas.info │ ├── badistro_paginas.module │ └── badistro_paginas.pages_default.inc │ └── badistro_tramites │ ├── badistro_tramites.features.field_instance.inc │ ├── badistro_tramites.features.inc │ ├── badistro_tramites.features.taxonomy.inc │ ├── badistro_tramites.info │ ├── badistro_tramites.module │ ├── badistro_tramites.pages_default.inc │ └── badistro_tramites.panelizer.inc ├── scripts └── build.sh ├── themes └── custom │ └── badistrotheme │ ├── badistrotheme.info │ ├── css │ └── BAdistro.css │ ├── favicon.ico │ ├── img │ ├── .DS_Store │ ├── social-cc.png │ ├── social-cc.svg │ ├── social-fb.png │ ├── social-fb.svg │ ├── social-fl.png │ ├── social-fl.svg │ ├── social-gp.png │ ├── social-gp.svg │ ├── social-rss.png │ ├── social-rss.svg │ ├── social-tw.png │ ├── social-tw.svg │ ├── social-user.png │ ├── social-user.svg │ ├── social-yt.png │ └── social-yt.svg │ ├── js │ └── BAdistro.js │ ├── layouts │ ├── columna-sidebar │ │ ├── columna-sidebar.css │ │ ├── columna-sidebar.inc │ │ ├── columna-sidebar.png │ │ └── columna-sidebar.tpl.php │ ├── pagina-principal │ │ ├── pagina-principal.inc │ │ └── pagina-principal.tpl.php │ ├── tres-columnas │ │ ├── tres-columnas.inc │ │ ├── tres-columnas.png │ │ └── tres-columnas.tpl.php │ └── una-columna-estrecha │ │ ├── una-columna-estrecha.inc │ │ └── una-columna-estrecha.tpl.php │ ├── logo.png │ ├── screenshot.png │ ├── template.php │ └── templates │ ├── footer.php │ ├── header.php │ ├── html.tpl.php │ └── page.tpl.php └── translations └── drupal-7.39.es.po /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore configuration files that may contain sensitive information. 2 | sites/*/*settings*.php 3 | 4 | # Ignore paths that contain generated content. 5 | cache/ 6 | files/ 7 | sites/*/files 8 | sites/*/private 9 | 10 | # Ignore default text files 11 | .htaccess 12 | robots.txt 13 | /CHANGELOG.txt 14 | /COPYRIGHT.txt 15 | /INSTALL*.txt 16 | /LICENSE.txt 17 | /MAINTAINERS.txt 18 | /UPGRADE.txt 19 | /README.txt 20 | sites/all/README.txt 21 | sites/all/modules/README.txt 22 | sites/all/themes/README.txt 23 | 24 | # Ignore everything but the "sites" folder ( for non core developer ) 25 | web.config 26 | authorize.php 27 | cron.php 28 | index.php 29 | install.php 30 | update.php 31 | xmlrpc.php 32 | /includes 33 | /misc -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | LICENCIA DE USO 2 | == 3 | 4 | The MIT License (MIT) 5 | Copyright (c) 2015 - GCBA - www.buenosaires.gob.ar 6 | 7 | 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | 31 | https://opensource.org/licenses/MIT -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AR-Distro 2 | 3 | Distribución Drupal gratuita del Gobierno Nacional. 4 | 5 | Desarrollamos AR-Distro como extensión de BAdistro, realizada por el Gobierno de la Ciudad de Buenos Aires. Es un perfil de instalación de Drupal compuesto por un conjunto de módulos para instalar y configurar de forma pre-determinada con la finalidad de que todos los gobiernos tengan acceso a las funcionalidades más importantes de una web gubernamental. 6 | 7 | Basada en la experiencia del equipo del Gobierno de la Ciudad con el sitio web buenosaires.gob.ar, la interacción con los ciudadanos y las necesidades de las diferentes áreas de gobierno, surgió esta intención de contribuir a la comunidad Drupal y a otros gobiernos del país. 8 | 9 | AR-Distro 1.0 contiene: 10 | 11 | * Layout responsive: Diseño adaptable a todo tipo de dispositivo 12 | * Carrousel: Permite filtrar por tipo de contenidos a mostrar, elegir la cantidad de items a presentar y a su vez, por categoría de noticias o tipo de trámite 13 | Alerta: Permite elegir el tipo de alerta (success, danger, warning, info) y personalizar el texto a mostrar (admite full html) 14 | * Shortcut o Atajo: Permite elegir icono, color, título, un texto breve y dónde enlaza 15 | * Listado: Este es el bloque fuerte (la base de la distro), permite elegir un título, el tipo de contenido a mostrar y a su vez filtrarlo por categoría o tipo. Elegir entre 3 formatos de estilo diferentes y su orientación: horizontal o vertical. Además, tiene 2 funcionamientos dinámicos: recientes o relacionados. Recientes lista los items de manera temporal mientras que relacionados combina las otras configuraciones del bloque: 16 | * Si el tipo de contenido es Noticia y el listado se muestra en un Área, muestra las noticias relacionadas al área. 17 | * Si el tipo de contenido es Área y el listado se muestra en un Área, muestra las subáreas. 18 | * Si el tipo de contenido es Noticia y el listado se muestra en una Noticia, muestra noticias de la misma categoría que la noticia original. 19 | * Campo: Permite elegir distintos tipos de campos a mostrar de un contenido determinado 20 | * Redes Sociales: Integra timelines de Facebook o Twitter y agrega links de compartir 21 | * Imagen destacada: Levanta el campo imagen destacada 22 | * Galería de imágenes: Levanta el campo Imágenes de un contenido determinado. Las renderiza en una galería tipo modal (o lightbox) 23 | * Texto: Muestra el texto (campo body) de un contenido o permite mostrar un texto personalizado 24 | * Título: Muestra el texto (campo title) de un contenido o permite mostrar un título personalizado. Además da la opción de elegir el tag entre h1 a h6 25 | 26 | # Requisitos 27 | 28 | Un servidor con: 29 | 30 | * Apache (http://www.apache.org/dyn/closer.cgi) 31 | * MySQL 5.5 (https://www.mysql.com/downloads/) 32 | * PHP 5.6 (http://www.php.net/downloads) 33 | * Drush (http://docs.drush.org/en/master/install/) 34 | 35 | # Instalación 36 | 37 | Dentro de la carpeta que se crea ejecutar: 38 | 39 | sh scripts/build.sh path/al/webroot 40 | 41 | Luego desde el browser entrar a path/al/webroot y seguir los pasos de la instalación de Drupal. 42 | 43 | ## En ARSAT (con Redhat 7) 44 | 45 | Debido a que ARSAT está ofreciendo servidores que tienen instalado el sistema operativo Redhat 7 es necesario hacer una nueva revisión del instructivo de instalación de la distribución. Varios de los siguientes pasos ya estaban presentes en el instructivo de instalación en ARSAT con el sistema operativo CentOs 6, todos los pasos deberán ser ejecutados utilizando un usuario con permisos de administrador. 46 | 47 | Actualizar YUM e instalar algunas herramientas que vamos a necesitar: 48 | 49 | yum update -y 50 | yum install -y iptables-services git 51 | 52 | Instalar Apache: 53 | 54 | yum install -y httpd 55 | service httpd start 56 | 57 | Habilitar el acceso al servidor a través del puerto 80: 58 | 59 | iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT 60 | service iptables save 61 | 62 | Remover instalaciones existentes de MySQL o MariaDB para que no entren en conflicto con la version de MySql que debemos instalar, los servidores de ARSAT ya tienen instalado MariaDB: 63 | 64 | yum remove mariadb mariadb-* 65 | yum remove mysql mysql-* 66 | 67 | Instalar MySQL 5.5: 68 | 69 | rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm 70 | yum install -y mysql55w-server 71 | service mysqld start 72 | /usr/bin/mysql_secure_installation 73 | 74 | Actualizar la lista de repositorios de Redhat 7 ingresando aquellos repositorios que nos permitan instalar la versión 5.6 de PHP y otros paquetes asociados: 75 | 76 | rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 77 | rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 78 | yum clean all 79 | 80 | la ejecución del comando yum clean all es un paso necesario debido a que sin ejecutarlo yum devuelve Requires: libgmp.so.3()(64bit) al instalar PHP 81 | 82 | Instalar PHP 5.6 y algunas extensiones útiles: 83 | 84 | yum install -y php56w php56w-opcache 85 | yum install -y php56w-mbstring php56w-mysql php56w-sqlite php56w-gd php56w-xml php56w-cli 86 | 87 | Verificar el estado de instalación de PHP: 88 | 89 | php -v 90 | 91 | El interprete de PHP mostrará un listado de advertencias y errores relacionados a la librería php56w-mysql, dentro de los cuales se encuentra el siguiente mensaje: 92 | 93 | warning Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' 94 | 95 | Es necesario optar por instalar la librería mysqlnd que es una versión mejorada de la tradicional php-mysql. A continuación deben removerse los archivos instalados de la librería php-mysql e instalar la librería mysqlnd: 96 | 97 | yum remove php56w-mysql 98 | yum install php56w-mysqlnd 99 | 100 | En cualquier directorio **privado** del servidor, clonar el repo de AR-Distro: 101 | 102 | git clone https://github.com/argob/AR-Distro 103 | 104 | Dentro del directorio creado, instalar [Composer](https://getcomposer.org/download/): 105 | 106 | cd AR-Distro 107 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 108 | php composer-setup.php 109 | php -r "unlink('composer-setup.php');" 110 | 111 | Instalar Drush 8.1: 112 | 113 | php composer.phar require drush/drush:8.1 114 | 115 | Ejecutar el script de instalación de AR-Distro, especificando el path al directorio **público** del servidor que usualmente es /var/www/html: 116 | 117 | sh scripts/build.sh /path/al/webroot 118 | 119 | El propietario de los archivos de instalación debe ser el usuario que corre el servicio de apache, en este caso el usuario es apache pero puede ser httpd en otros sistemas, los permisos otorgados a los archivos deben ser de escritura, lectura, modificación y ejecución para el propietario: 120 | 121 | chown -R apache:apache /path/al/webroot 122 | chmod -R 755 /path/al/webroot 123 | 124 | Modificar el archivo de configuración de Apache para que con la opción de acceso AllowOverride All permita el uso del archivo .htaccess que es necesario para efectuar la parte final de la instalación. El archivo de configuración de Apache puede estar localizado en /etc/httpd/conf/httpd.conf 125 | 126 | En el archivo dejar en la sección DocumentRoot "/var/www/html" las siguientes opciones: 127 | 128 | Options FollowSymLinks 129 | AllowOverride All 130 | Require all granted 131 | 132 | Reiniciar apache y el contexto de seguridad para archivos y directorios del webroot 133 | 134 | service httpd restart 135 | restorecon -r /var/www/html 136 | 137 | Luego visitar el sitio con un navegador y seguir las instrucciones de instalación de Drupal. 138 | 139 | ## En ARSAT (Con CentOS 6) 140 | 141 | Para instalar una AR-Distro en ARSAT, lo primero es crear una instancia con el sistema operativo CentOS 6. Luego ejecuta los siguientes comandos via SSH como root. Estos comandos están tomados en parte de [esta guía](https://extravm.com/billing/knowledgebase/34/Install-LAMP-on-CentOS-6-MySQL-55-PHP-56.html). 142 | 143 | Actualizar YUM e instalar algunas herramientas que vamos a necesitar: 144 | 145 | yum update -y 146 | yum install -y iptables-services git 147 | 148 | Instalar Apache: 149 | 150 | yum install -y httpd 151 | service httpd start 152 | 153 | Habilitar el acceso al servidor a través del puerto 80: 154 | 155 | iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT 156 | service iptables save 157 | 158 | Instalar MySQL 5.5: 159 | 160 | rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm 161 | yum remove -y mysql-libs* 162 | yum install -y mysql55w-server 163 | /usr/bin/mysql_secure_installation 164 | 165 | Instalar PHP 5.6 y algunas extensiones útiles: 166 | 167 | yum install -y php56w php56w-mbstring php56w-mysql php56w-sqlite php56w-gd php56w-xml php56w-cli 168 | 169 | En cualquier directorio **privado** del servidor, clonar el repo de AR-Distro: 170 | 171 | git clone https://github.com/argob/AR-Distro 172 | 173 | Dentro del directorio creado, instalar [Composer](https://getcomposer.org/download/): 174 | 175 | cd AR-Distro 176 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 177 | php composer-setup.php 178 | php -r "unlink('composer-setup.php');" 179 | 180 | Instalar Drush: 181 | 182 | php composer.phar require drush/drush 183 | 184 | Ejecutar el script de instalación de AR-Distro, especificando el path al directorio **público** del servidor: 185 | 186 | sh scripts/build.sh /path/al/webroot 187 | 188 | Luego visitar el sitio con un navegador y seguir las instrucciones de instalación de Drupal. 189 | 190 | -------------------------------------------------------------------------------- /badistro.info: -------------------------------------------------------------------------------- 1 | name = BA Distro 2 | description = Description of what the profile does. 3 | core = 7.x 4 | exclusive = 1 5 | 6 | dependencies[] = admin_theme 7 | dependencies[] = badistro_cck 8 | dependencies[] = badistro_areas 9 | dependencies[] = badistro_paginas 10 | dependencies[] = badistro_tramites 11 | dependencies[] = badistro_noticias 12 | dependencies[] = badistro_bloques 13 | dependencies[] = block 14 | dependencies[] = captcha 15 | dependencies[] = color 16 | dependencies[] = ctools 17 | dependencies[] = comment 18 | dependencies[] = contextual 19 | dependencies[] = dashboard 20 | dependencies[] = devel 21 | dependencies[] = devel_generate 22 | dependencies[] = entity 23 | dependencies[] = entityreference 24 | dependencies[] = entityreference_autocomplete 25 | dependencies[] = features 26 | dependencies[] = fe_block 27 | dependencies[] = field_ui 28 | dependencies[] = file 29 | dependencies[] = file_entity 30 | dependencies[] = help 31 | dependencies[] = i18n 32 | dependencies[] = jquery_update 33 | dependencies[] = image 34 | dependencies[] = link 35 | dependencies[] = list 36 | dependencies[] = locale 37 | dependencies[] = menu 38 | dependencies[] = media 39 | dependencies[] = number 40 | dependencies[] = options 41 | dependencies[] = page_manager 42 | dependencies[] = path 43 | dependencies[] = pathauto 44 | dependencies[] = panelizer 45 | dependencies[] = plupload 46 | dependencies[] = pm_existing_pages 47 | dependencies[] = recaptcha 48 | dependencies[] = taxonomy 49 | dependencies[] = dblog 50 | dependencies[] = search 51 | dependencies[] = shortcut 52 | dependencies[] = toolbar 53 | dependencies[] = overlay 54 | dependencies[] = rdf 55 | dependencies[] = rules 56 | dependencies[] = rules_admin 57 | dependencies[] = variable 58 | dependencies[] = views 59 | dependencies[] = views_ui 60 | dependencies[] = wysiwyg 61 | 62 | php_memory_limit = 128M -------------------------------------------------------------------------------- /badistro.install: -------------------------------------------------------------------------------- 1 | t('Habilitar themes'), 15 | 'display' => TRUE, 16 | 'type' => 'normal', 17 | ); 18 | 19 | $tasks['enable_pages'] = array( 20 | 'display_name' => t('Habilitar paneles'), 21 | 'display' => TRUE, 22 | 'type' => 'normal', 23 | ); 24 | 25 | $tasks['revert_features'] = array( 26 | 'display_name' => t('Revertir Features'), 27 | 'display' => TRUE, 28 | 'type' => 'normal', 29 | ); 30 | 31 | return $tasks; 32 | } 33 | 34 | function enable_badistro_themes(){ 35 | 36 | $enable = array( 37 | 'theme_default' => 'badistrotheme', 38 | 'admin_theme' => 'adminimal', 39 | ); 40 | 41 | theme_enable($enable); 42 | 43 | foreach ($enable as $var => $theme) { 44 | if (!is_numeric($var)) { 45 | variable_set($var, $theme); 46 | } 47 | } 48 | 49 | theme_disable(array('bartik')); 50 | } 51 | 52 | // Habilita Node Overview de Page Manager Existing Pages 53 | 54 | function enable_pages(){ 55 | $pages = array("pm_existing_pages-node_overview", "node_view", "page-tramites", "page-noticias", "page-areas", "page-badistro_tutorial"); 56 | foreach ($pages as $item) { 57 | $page = page_manager_get_page_cache($item); 58 | $function = ctools_plugin_get_function($page->subtask, "enable callback"); 59 | $function($page, FALSE); 60 | menu_rebuild(); 61 | } 62 | } 63 | 64 | function revert_features(){ 65 | features_revert( 66 | array( 67 | 'badistro_cck' => array( 68 | 'fe_block_settings' 69 | ) 70 | ) 71 | ); 72 | } 73 | 74 | function badistro_install() { 75 | // Create a default role for site administrators, with all available permissions assigned. 76 | $admin_role = new stdClass(); 77 | $admin_role->name = 'administrator'; 78 | $admin_role->weight = 2; 79 | user_role_save($admin_role); 80 | user_role_grant_permissions($admin_role->rid, array_keys(module_invoke_all('permission'))); 81 | // Set this as the administrator role. 82 | variable_set('user_admin_role', $admin_role->rid); 83 | 84 | // Assign user 1 the "administrator" role. 85 | db_insert('users_roles') 86 | ->fields(array('uid' => 1, 'rid' => $admin_role->rid)) 87 | ->execute(); 88 | } 89 | -------------------------------------------------------------------------------- /badistro.profile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/argob/AR-Distro/fc01a64de9273481221721c3888d0528fcdf499a/badistro.profile -------------------------------------------------------------------------------- /drupal-org-core.make: -------------------------------------------------------------------------------- 1 | api = 2 2 | core = 7.x 3 | projects[drupal][version] = 7.41 -------------------------------------------------------------------------------- /drupal-org.make: -------------------------------------------------------------------------------- 1 | api = 2 2 | core = 7.x 3 | 4 | defaults[projects][subdir] = contrib 5 | 6 | projects[admin_theme][version] = 1.0 7 | 8 | projects[captcha][version] = 1.3 9 | 10 | projects[ctools][version] = 1.7 11 | 12 | projects[devel][version] = 1.5 13 | 14 | projects[entity][version] = 1.6 15 | 16 | projects[entityreference][version] = 1.1 17 | 18 | projects[entityreference_autocomplete][version] = 1.10 19 | 20 | projects[features][version] = 2.6 21 | 22 | projects[features_extra][version] = 1.0 23 | 24 | projects[field_permissions][version] = 1.0-beta2 25 | 26 | projects[file_entity][version] = 2.0-beta2 27 | 28 | projects[i18n][version] = 1.13 29 | 30 | projects[jquery_update][version] = 3.0-alpha2 31 | 32 | projects[link][version] = 1.3 33 | 34 | projects[media][version] = 2.0-beta1 35 | 36 | projects[metatag][version] = 1.7 37 | 38 | projects[multiform][version] = 1.1 39 | 40 | projects[panels][version] = 3.5 41 | 42 | projects[panelizer][version] = 3.1 43 | 44 | projects[pathauto][version] = 1.3 45 | 46 | projects[plupload][version] = 1.7 47 | 48 | projects[pm_existing_pages][version] = 1.4 49 | 50 | projects[recaptcha][version] = 2.0 51 | 52 | projects[rules][version] = 2.9 53 | 54 | projects[token][version] = 1.6 55 | 56 | projects[variable][version] = 2.5 57 | 58 | projects[views][version] = 3.11 59 | 60 | projects[wysiwyg][version] = 2.2 61 | 62 | projects[adminimal_theme][version] = 1.22 63 | 64 | projects[bootstrap][version] = 3.0 65 | 66 | projects[libraries][version] = 2.2 67 | -------------------------------------------------------------------------------- /modules/custom/badistro_areas/badistro_areas.features.inc: -------------------------------------------------------------------------------- 1 | "1"); 13 | } 14 | } 15 | 16 | /** 17 | * Implements hook_node_info(). 18 | */ 19 | function badistro_areas_node_info() { 20 | $items = array( 21 | 'area' => array( 22 | 'name' => t('Área'), 23 | 'base' => 'node_content', 24 | 'description' => '', 25 | 'has_title' => '1', 26 | 'title_label' => t('Nombre'), 27 | 'help' => '', 28 | ), 29 | ); 30 | drupal_alter('node_info', $items); 31 | return $items; 32 | } 33 | -------------------------------------------------------------------------------- /modules/custom/badistro_areas/badistro_areas.info: -------------------------------------------------------------------------------- 1 | name = Áreas 2 | core = 7.x 3 | package = BA Distro 4 | version = 7.x-1.0 5 | dependencies[] = badistro_cck 6 | dependencies[] = ctools 7 | dependencies[] = entityreference 8 | dependencies[] = features 9 | dependencies[] = image 10 | dependencies[] = link 11 | dependencies[] = media 12 | dependencies[] = page_manager 13 | dependencies[] = text 14 | features[ctools][] = page_manager:pages_default:1 15 | features[features_api][] = api:2 16 | features[field_instance][] = node-area-body 17 | features[field_instance][] = node-area-field_area 18 | features[field_instance][] = node-area-field_featured_image 19 | features[field_instance][] = node-area-field_imagenes 20 | features[field_instance][] = node-area-field_links_relacionados 21 | features[field_instance][] = node-area-field_paginas_relacionadas 22 | features[field_instance][] = node-area-field_siglas 23 | features[node][] = area 24 | features[page_manager_handlers][] = node_view__area 25 | features_exclude[field_base][field_imagenes] = field_imagenes 26 | -------------------------------------------------------------------------------- /modules/custom/badistro_areas/badistro_areas.module: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default handler disabled initially */ 15 | $handler->api_version = 1; 16 | $handler->name = 'node_view__area'; 17 | $handler->task = 'node_view'; 18 | $handler->subtask = ''; 19 | $handler->handler = 'panel_context'; 20 | $handler->weight = -97; 21 | $handler->conf = array( 22 | 'title' => 'Área', 23 | 'no_blocks' => 0, 24 | 'pipeline' => 'standard', 25 | 'body_classes_to_remove' => '', 26 | 'body_classes_to_add' => '', 27 | 'css_id' => '', 28 | 'css' => '', 29 | 'contexts' => array(), 30 | 'relationships' => array(), 31 | 'name' => 'area', 32 | 'access' => array( 33 | 'plugins' => array( 34 | 0 => array( 35 | 'name' => 'node_type', 36 | 'settings' => array( 37 | 'type' => array( 38 | 'area' => 'area', 39 | ), 40 | ), 41 | 'context' => 'argument_entity_id:node_1', 42 | 'not' => FALSE, 43 | ), 44 | ), 45 | 'logic' => 'and', 46 | ), 47 | ); 48 | $display = new panels_display(); 49 | $display->layout = 'tres-columnas'; 50 | $display->layout_settings = array(); 51 | $display->panel_settings = array( 52 | 'style_settings' => array( 53 | 'default' => NULL, 54 | 'top' => NULL, 55 | 'bottom' => NULL, 56 | 'body-middle' => NULL, 57 | 'full' => NULL, 58 | 'body-left' => NULL, 59 | 'body-right' => NULL, 60 | ), 61 | ); 62 | $display->cache = array(); 63 | $display->title = ''; 64 | $display->uuid = '511fcd63-a745-4c73-af8e-0dbc7679c8e5'; 65 | $display->content = array(); 66 | $display->panels = array(); 67 | $pane = new stdClass(); 68 | $pane->pid = 'new-324fd34a-e1cb-402e-90b2-758bcf29e4fe'; 69 | $pane->panel = 'body-left'; 70 | $pane->type = 'listado'; 71 | $pane->subtype = 'listado'; 72 | $pane->shown = TRUE; 73 | $pane->access = array(); 74 | $pane->configuration = array( 75 | 'cantidad_links' => '10', 76 | 'tipo_de_listado' => 'relacionados', 77 | 'tipos_de_contenido' => 'area', 78 | 'formato_de_listado' => 'badistro_bloques_listado', 79 | 'titulo' => 'Áreas', 80 | 'icono' => 'glyphicon-paperclip', 81 | 'tipo_noticia' => FALSE, 82 | 'tipo_tramite' => array(), 83 | 'orientacion_de_listado' => 'vertical', 84 | 'todos_los_items' => 0, 85 | 'override_title' => 0, 86 | 'override_title_text' => '', 87 | 'override_title_heading' => 'h2', 88 | ); 89 | $pane->cache = array(); 90 | $pane->style = array( 91 | 'settings' => NULL, 92 | ); 93 | $pane->css = array(); 94 | $pane->extras = array(); 95 | $pane->position = 0; 96 | $pane->locks = array(); 97 | $pane->uuid = '324fd34a-e1cb-402e-90b2-758bcf29e4fe'; 98 | $display->content['new-324fd34a-e1cb-402e-90b2-758bcf29e4fe'] = $pane; 99 | $display->panels['body-left'][0] = 'new-324fd34a-e1cb-402e-90b2-758bcf29e4fe'; 100 | $pane = new stdClass(); 101 | $pane->pid = 'new-f0b7b9d7-f34c-4887-ac46-1b27d1efc673'; 102 | $pane->panel = 'body-middle'; 103 | $pane->type = 'listado'; 104 | $pane->subtype = 'listado'; 105 | $pane->shown = TRUE; 106 | $pane->access = array(); 107 | $pane->configuration = array( 108 | 'cantidad_links' => '10', 109 | 'tipo_de_listado' => 'relacionados', 110 | 'tipos_de_contenido' => 'noticia', 111 | 'formato_de_listado' => 'badistro_bloques_listado_con_imagen', 112 | 'titulo' => 'Noticias', 113 | 'icono' => 'glyphicon-paperclip', 114 | 'tipo_noticia' => FALSE, 115 | 'tipo_tramite' => array(), 116 | 'orientacion_de_listado' => 'vertical', 117 | 'todos_los_items' => 1, 118 | 'override_title' => 0, 119 | 'override_title_text' => '', 120 | 'override_title_heading' => 'h2', 121 | ); 122 | $pane->cache = array(); 123 | $pane->style = array( 124 | 'settings' => NULL, 125 | ); 126 | $pane->css = array(); 127 | $pane->extras = array(); 128 | $pane->position = 0; 129 | $pane->locks = array(); 130 | $pane->uuid = 'f0b7b9d7-f34c-4887-ac46-1b27d1efc673'; 131 | $display->content['new-f0b7b9d7-f34c-4887-ac46-1b27d1efc673'] = $pane; 132 | $display->panels['body-middle'][0] = 'new-f0b7b9d7-f34c-4887-ac46-1b27d1efc673'; 133 | $pane = new stdClass(); 134 | $pane->pid = 'new-8da57751-580e-42a4-aada-0cb70a470b31'; 135 | $pane->panel = 'body-right'; 136 | $pane->type = 'redes_sociales'; 137 | $pane->subtype = 'redes_sociales'; 138 | $pane->shown = TRUE; 139 | $pane->access = array(); 140 | $pane->configuration = array( 141 | 'titulo' => 'Redes Sociales', 142 | 'tipo_widget' => 'timeline', 143 | 'tipo_widget_timeline' => 'facebook', 144 | 'fb_page_url' => 'https://www.facebook.com/facebook', 145 | 'fb_altura' => '500', 146 | 'fb_mostrar_post' => 1, 147 | 'fb_mostrar_fotos_amigos' => 1, 148 | 'fb_ocultar_portada' => 0, 149 | 'tw_widget_id' => '', 150 | 'tw_screen_name' => '', 151 | 'override_title' => 0, 152 | 'override_title_text' => '', 153 | 'override_title_heading' => 'h2', 154 | ); 155 | $pane->cache = array(); 156 | $pane->style = array( 157 | 'settings' => NULL, 158 | ); 159 | $pane->css = array(); 160 | $pane->extras = array(); 161 | $pane->position = 0; 162 | $pane->locks = array(); 163 | $pane->uuid = '8da57751-580e-42a4-aada-0cb70a470b31'; 164 | $display->content['new-8da57751-580e-42a4-aada-0cb70a470b31'] = $pane; 165 | $display->panels['body-right'][0] = 'new-8da57751-580e-42a4-aada-0cb70a470b31'; 166 | $pane = new stdClass(); 167 | $pane->pid = 'new-59fa82a7-1a86-402e-9fdf-50568db273dc'; 168 | $pane->panel = 'full'; 169 | $pane->type = 'imagen_destacada'; 170 | $pane->subtype = 'imagen_destacada'; 171 | $pane->shown = TRUE; 172 | $pane->access = array(); 173 | $pane->configuration = array( 174 | 'imagen_destacada' => NULL, 175 | ); 176 | $pane->cache = array(); 177 | $pane->style = array( 178 | 'settings' => NULL, 179 | ); 180 | $pane->css = array(); 181 | $pane->extras = array(); 182 | $pane->position = 0; 183 | $pane->locks = array(); 184 | $pane->uuid = '59fa82a7-1a86-402e-9fdf-50568db273dc'; 185 | $display->content['new-59fa82a7-1a86-402e-9fdf-50568db273dc'] = $pane; 186 | $display->panels['full'][0] = 'new-59fa82a7-1a86-402e-9fdf-50568db273dc'; 187 | $pane = new stdClass(); 188 | $pane->pid = 'new-d84f2e6f-93fc-4521-9a79-9382140003b7'; 189 | $pane->panel = 'top'; 190 | $pane->type = 'texto'; 191 | $pane->subtype = 'texto'; 192 | $pane->shown = TRUE; 193 | $pane->access = array(); 194 | $pane->configuration = array( 195 | 'destacado' => 0, 196 | 'texto' => array( 197 | 'value' => '', 198 | 'format' => 'full_html', 199 | ), 200 | 'sobreescribir' => 0, 201 | 'cuerpo_o_resumen' => 'body', 202 | 'override_title' => 0, 203 | 'override_title_text' => '', 204 | 'override_title_heading' => 'h2', 205 | ); 206 | $pane->cache = array(); 207 | $pane->style = array( 208 | 'settings' => NULL, 209 | ); 210 | $pane->css = array(); 211 | $pane->extras = array(); 212 | $pane->position = 0; 213 | $pane->locks = array(); 214 | $pane->uuid = 'd84f2e6f-93fc-4521-9a79-9382140003b7'; 215 | $display->content['new-d84f2e6f-93fc-4521-9a79-9382140003b7'] = $pane; 216 | $display->panels['top'][0] = 'new-d84f2e6f-93fc-4521-9a79-9382140003b7'; 217 | $display->hide_title = PANELS_TITLE_FIXED; 218 | $display->title_pane = '0'; 219 | $handler->conf['display'] = $display; 220 | $export['node_view__area'] = $handler; 221 | 222 | return $export; 223 | } 224 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/badistro_bloques.inc: -------------------------------------------------------------------------------- 1 | type == $tipo); 17 | } 18 | $badistro_iconos = array( 19 | 'glyphicon-home' => t('Casa'), 20 | 'glyphicon-paperclip' => t('Clip'), 21 | 'glyphicon-star' => t('Estrella'), 22 | 'glyphicon-heart' => t('Corazón'), 23 | 'glyphicon-music' => t('Música'), 24 | 'glyphicon-info-sign' => t('Información'), 25 | 'glyphicon-fire' => t('Fuego'), 26 | 'glyphicon-tree-deciduous' => t('Árbol'), 27 | 'glyphicon-gift' => t('Regalo'), 28 | 'glyphicon-ok-sign' => t('OK'), 29 | 'glyphicon-remove-sign' => t('Error'), 30 | 'glyphicon-search' => t('Buscar'), 31 | 'glyphicon-lock' => t('Candado'), 32 | 'glyphicon-cog' => t('Configuración'), 33 | 'glyphicon-plus' => t('Más'), 34 | 'glyphicon-minus' => t('Menos'), 35 | 'glyphicon-envelope' => t('Correo'), 36 | 'glyphicon-share-alt' => t('Compartir'), 37 | 'glyphicon-chevron-right' => t('Flecha Derecha'), 38 | 'glyphicon-chevron-left' => t('Flecha Izquierda'), 39 | 'glyphicon-question-sign' => t('Signo de interrogación'), 40 | 'glyphicon-calendar' => t('Calendario'), 41 | 'glyphicon-certificate' => t('Certificado'), 42 | 'glyphicon-link' => t('Link'), 43 | 'glyphicon-briefcase' => t('Maletín'), 44 | 'glyphicon-send' => t('Enviar'), 45 | 'glyphicon-earphone' => t('Teléfono'), 46 | 'glyphicon-alert' => t('Alerta'), 47 | 'glyphicon-piggy-bank' => t('Ahorro'), 48 | 'glyphicon-education' => t('Educación'), 49 | 'glyphicon-grain' => t('Campo'), 50 | 'glyphicon-globe' => t('Planeta'), 51 | 'glyphicon-shopping-cart' => t('Carrito de compra'), 52 | 'glyphicon-comment' => t('Diálogo'), 53 | 'glyphicon-gift' => t('Regalo'), 54 | 'glyphicon-map-marker' => t('Marcador'), 55 | 'glyphicon-flag' => t('Bandera'), 56 | 'glyphicon-list-alt' => t('Listado'), 57 | 'glyphicon-cloud' => t('Nube'), 58 | 'glyphicon-time' => t('Reloj'), 59 | 'glyphicon-camera' => t('Cámara'), 60 | 'glyphicon-leaf' => t('Hoja'), 61 | 'glyphicon-warning-sign' => t('Peligro'), 62 | 'glyphicon-usd' => t('Dinero'), 63 | 'glyphicon-flash' => t('Rayo'), 64 | 'glyphicon-transfer' => t('Transferencia'), 65 | 'glyphicon glyphicon-book' => t('Libro'), 66 | ); 67 | function obtenerCampo($nodo, $tipo_campo) { 68 | switch ($tipo_campo) { 69 | case 'costo': 70 | $campo = field_get_items('node', $nodo, 'field_tramite_costo', NULL); 71 | $campo = $campo[0]['safe_value']; 72 | break; 73 | case 'requisitos': 74 | $campo = field_get_items('node', $nodo, 'field_requisitos', NULL); 75 | $campo = $campo[0]['safe_value']; 76 | break; 77 | case 'siglas_area': 78 | $campo = field_get_items('node', $nodo, 'field_siglas', NULL); 79 | $campo = $campo[0]['safe_value']; 80 | break; 81 | case 'links_relacionados': 82 | $campo = field_get_items('node', $nodo, 'field_links_relacionados', NULL); 83 | $campo = obtener($tipo_campo, $campo); 84 | break; 85 | case 'paginas_relacionadas': 86 | $campo = field_get_items('node', $nodo, 'field_paginas_relacionadas', NULL); 87 | $campo = obtener($tipo_campo, $campo); 88 | break; 89 | case 'tipo_tramite': 90 | $campo = field_get_items('node', $nodo, 'field_tramite_tipo', NULL); 91 | $campo = isset($campo) ? taxonomy_term_load($campo[0]["target_id"]) : NULL; 92 | $campo = isset($campo) ? $campo->name : NULL; 93 | break; 94 | case 'categoria_noticia': 95 | $campo = field_get_items('node', $nodo, 'field_categoria', NULL); 96 | $campo = isset($campo) ? taxonomy_term_load($campo[0]["target_id"]) : NULL; 97 | $campo = isset($campo) ? $campo->name : NULL; 98 | break; 99 | case 'tags': 100 | $campo = field_get_items('node', $nodo, 'field_tags', NULL); 101 | $campo = obtener($tipo_campo, $campo); 102 | default: 103 | # code... 104 | break; 105 | } 106 | return $campo; 107 | } 108 | 109 | function obtener($nombreCampo, $campo){ 110 | $items = array(); 111 | switch ($nombreCampo) { 112 | case 'tags': 113 | foreach ($campo as $item) { 114 | $items[] = $item['taxonomy_term']->name; 115 | } 116 | break; 117 | case 'paginas_relacionadas': 118 | foreach ($campo as $item) { 119 | $items[] = $item; 120 | } 121 | break; 122 | case 'links_relacionados': 123 | foreach ($campo as $item) { 124 | $items[] = $item; 125 | } 126 | break; 127 | default: 128 | # code... 129 | break; 130 | } 131 | return $items; 132 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/badistro_bloques.info: -------------------------------------------------------------------------------- 1 | name = Bloques 2 | core = 7.x 3 | package = BA Distro -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/badistro_bloques.module: -------------------------------------------------------------------------------- 1 | array( 17 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 18 | 'template' => 'badistro_bloques_alerta' 19 | ), 20 | 'badistro_bloques_carrousel' => array( 21 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 22 | 'template' => 'badistro_bloques_carrousel' 23 | ), 24 | 'badistro_bloques_campo_categoria_noticia' => array( 25 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 26 | 'template' => 'badistro_bloques_campo_categoria_noticia' 27 | ), 28 | 'badistro_bloques_campo_costo' => array( 29 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 30 | 'template' => 'badistro_bloques_campo_costo' 31 | ), 32 | 'badistro_bloques_campo_links_relacionados' => array( 33 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 34 | 'template' => 'badistro_bloques_campo_links_relacionados' 35 | ), 36 | 'badistro_bloques_campo_paginas_relacionadas' => array( 37 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 38 | 'template' => 'badistro_bloques_campo_paginas_relacionadas' 39 | ), 40 | 'badistro_bloques_campo_requisitos' => array( 41 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 42 | 'template' => 'badistro_bloques_campo_requisitos' 43 | ), 44 | 'badistro_bloques_campo_siglas_area' => array( 45 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 46 | 'template' => 'badistro_bloques_campo_siglas_area' 47 | ), 48 | 'badistro_bloques_campo_tags' => array( 49 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 50 | 'template' => 'badistro_bloques_campo_tags' 51 | ), 52 | 'badistro_bloques_campo_tipo_tramite' => array( 53 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 54 | 'template' => 'badistro_bloques_campo_tipo_tramite' 55 | ), 56 | 'badistro_bloques_galeria_imagenes_min' => array( 57 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 58 | 'template' => 'badistro_bloques_galeria_imagenes_min' 59 | ), 60 | 'badistro_bloques_galeria_imagenes_min_item' => array( 61 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 62 | 'template' => 'badistro_bloques_galeria_imagenes_min_item' 63 | ), 64 | 'badistro_bloques_listado_vertical' => array( 65 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 66 | 'template' => 'badistro_bloques_listado_vertical' 67 | ), 68 | 'badistro_bloques_listado_vertical_item' => array( 69 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 70 | 'template' => 'badistro_bloques_listado_vertical_item' 71 | ), 72 | 'badistro_bloques_listado_horizontal' => array( 73 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 74 | 'template' => 'badistro_bloques_listado_horizontal' 75 | ), 76 | 'badistro_bloques_listado_horizontal_item' => array( 77 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 78 | 'template' => 'badistro_bloques_listado_horizontal_item' 79 | ), 80 | 'badistro_bloques_listado_destacado_vertical' => array( 81 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 82 | 'template' => 'badistro_bloques_listado_destacado_vertical' 83 | ), 84 | 'badistro_bloques_listado_destacado_vertical_item' => array( 85 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 86 | 'template' => 'badistro_bloques_listado_destacado_vertical_item' 87 | ), 88 | 'badistro_bloques_listado_destacado_horizontal' => array( 89 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 90 | 'template' => 'badistro_bloques_listado_destacado_horizontal' 91 | ), 92 | 'badistro_bloques_listado_destacado_horizontal_item' => array( 93 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 94 | 'template' => 'badistro_bloques_listado_destacado_horizontal_item' 95 | ), 96 | 'badistro_bloques_listado_con_imagen_vertical' => array( 97 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 98 | 'template' => 'badistro_bloques_listado_con_imagen_vertical' 99 | ), 100 | 'badistro_bloques_listado_con_imagen_vertical_item' => array( 101 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 102 | 'template' => 'badistro_bloques_listado_con_imagen_vertical_item' 103 | ), 104 | 'badistro_bloques_listado_con_imagen_horizontal' => array( 105 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 106 | 'template' => 'badistro_bloques_listado_con_imagen_horizontal' 107 | ), 108 | 'badistro_bloques_listado_con_imagen_horizontal_item' => array( 109 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 110 | 'template' => 'badistro_bloques_listado_con_imagen_horizontal_item' 111 | ), 112 | 'badistro_bloques_listado_vacio' => array( 113 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 114 | 'template' => 'badistro_bloques_listado_vacio' 115 | ), 116 | 'badistro_bloques_imagen_destacada' => array( 117 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 118 | 'template' => 'badistro_bloques_imagen_destacada' 119 | ), 120 | 'badistro_bloques_titulo' => array( 121 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 122 | 'template' => 'badistro_bloques_titulo' 123 | ), 124 | 'badistro_bloques_texto' => array( 125 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 126 | 'template' => 'badistro_bloques_texto' 127 | ), 128 | 'badistro_bloques_shortcut' => array( 129 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 130 | 'template' => 'badistro_bloques_shortcut' 131 | ), 132 | 'badistro_bloques_separador' => array( 133 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 134 | 'template' => 'badistro_bloques_separador' 135 | ), 136 | 'badistro_bloques_redes_sociales_compartir' => array( 137 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 138 | 'template' => 'badistro_bloques_redes_sociales_compartir' 139 | ), 140 | 'badistro_bloques_redes_sociales_timeline_facebook' => array( 141 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 142 | 'template' => 'badistro_bloques_redes_sociales_timeline_facebook' 143 | ), 144 | 'badistro_bloques_redes_sociales_timeline_twitter' => array( 145 | 'path' => drupal_get_path('module', 'badistro_bloques') . '/templates', 146 | 'template' => 'badistro_bloques_redes_sociales_timeline_twitter' 147 | ), 148 | ); 149 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/js/fb-sdk.js: -------------------------------------------------------------------------------- 1 | (function(d, s, id) { 2 | var js, fjs = d.getElementsByTagName(s)[0]; 3 | if (d.getElementById(id)) return; 4 | js = d.createElement(s); js.id = id; 5 | js.src = "//connect.facebook.net/es_ES/sdk.js#xfbml=1&version=v2.5"; 6 | fjs.parentNode.insertBefore(js, fjs); 7 | }(document, 'script', 'facebook-jssdk')); -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/js/tw.js: -------------------------------------------------------------------------------- 1 | !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); 2 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/alerta.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Alerta'), 6 | 'description' => t('Muetra una alerta.'), 7 | 'category' => t('BA Distro'), 8 | 'edit form' => 'badistro_bloques_alerta_edit_form', 9 | 'render callback' => 'badistro_bloques_alerta_render', 10 | 'admin info' => 'badistro_bloques_alerta_admin_info', 11 | 'defaults' => array( 12 | 'tipo' => 'success', 13 | 'texto' => NULL, 14 | ) 15 | ); 16 | 17 | /** 18 | * 'admin info' callback for panel pane. 19 | */ 20 | function badistro_bloques_alerta_admin_info($subtype, $conf, $contexts) { 21 | if (!empty($conf)) { 22 | $block = new stdClass; 23 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Alerta'); 24 | $block->content = t('Alerta tipo @tipo.', array('@tipo' => $conf['tipo'])); 25 | return $block; 26 | } 27 | } 28 | 29 | /** 30 | * 'Edit form' callback for the content type. 31 | */ 32 | function badistro_bloques_alerta_edit_form($form, &$form_state) { 33 | 34 | $form['tipo'] = array( 35 | '#title' => t('Tipo de alerta'), 36 | '#type' => 'select', 37 | '#default_value' => $form_state['conf']['tipo'], 38 | '#options' => array( 39 | 'success' => t('Success'), 40 | 'info' => t('Info'), 41 | 'warning' => t('Warning'), 42 | 'danger' => t('Danger'), 43 | 'default' => t('Default'), 44 | ), 45 | ); 46 | 47 | $form['texto'] = array( 48 | '#title' => t('Contenido'), 49 | '#type' => 'text_format', 50 | '#format' => 'full_html', 51 | '#default_value' => $form_state['conf']['texto']['value'], 52 | '#required' => TRUE, 53 | ); 54 | 55 | return $form; 56 | } 57 | 58 | /** 59 | * The submit form stores the data in $conf. 60 | */ 61 | function badistro_bloques_alerta_edit_form_submit($form, &$form_state) { 62 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 63 | if (isset($form_state['values'][$key])) { 64 | $form_state['conf'][$key] = $form_state['values'][$key]; 65 | } 66 | } 67 | } 68 | function badistro_bloques_alerta_render($subtype, $conf, $panel_args, $context = NULL){ 69 | $block = new stdClass(); 70 | $block->title = ''; 71 | $block->content = theme('badistro_bloques_alerta', array('titulo' => $conf["override_title"] ? $conf["override_title_text"] : '', 'tipo' => $conf['tipo'], 'texto' => $conf['texto']['value'])); 72 | return $block; 73 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/campo.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Campo'), 6 | 'description' => t('Renderiza un campo del nodo'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_campo_render', 9 | 'edit form' => 'badistro_bloques_campo_edit_form', 10 | 'admin info' => 'badistro_bloques_campo_admin_info', 11 | 'defaults' => array( 12 | 'campo' => '', 13 | ), 14 | ); 15 | 16 | /** 17 | * 'admin info' callback for panel pane. 18 | */ 19 | function badistro_bloques_campo_admin_info($subtype, $conf, $contexts) { 20 | if (!empty($conf)) { 21 | $block = new stdClass; 22 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : $conf['campo']; 23 | $block->content = $conf['campo']; 24 | return $block; 25 | } 26 | } 27 | 28 | /** 29 | * 'Edit form' callback for the content type. 30 | */ 31 | function badistro_bloques_campo_edit_form($form, &$form_state) { 32 | 33 | $form['campo'] = array( 34 | '#type' => 'select', 35 | '#title' => t('Campo'), 36 | '#required' => TRUE, 37 | '#options' => array( 38 | 'costo' => t('Costo de trámite'), 39 | 'requisitos' => t('Requisitos de trámite'), 40 | 'tipo_tramite' => t('Tipo de trámite'), 41 | 'categoria_noticia' => t('Categoría de noticia'), 42 | 'siglas_area' => t('Siglas de Área'), 43 | 'tags' => t('Tags'), 44 | 'links_relacionados' => t('Links relacionados'), 45 | 'paginas_relacionadas' => t('Páginas relacionadas'), 46 | ), 47 | '#default_value' => $form_state['conf']['campo'], 48 | '#description' => t('Campo a mostrar'), 49 | ); 50 | 51 | return $form; 52 | } 53 | 54 | /** 55 | * The submit form stores the data in $conf. 56 | */ 57 | function badistro_bloques_campo_edit_form_submit($form, &$form_state) { 58 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 59 | if (isset($form_state['values'][$key])) { 60 | $form_state['conf'][$key] = $form_state['values'][$key]; 61 | } 62 | } 63 | } 64 | 65 | function badistro_bloques_campo_render($subtype, $conf, $panel_args, $context = NULL){ 66 | $block = new stdClass(); 67 | $block->title = ''; 68 | $block->content = theme('badistro_bloques_campo_' . $conf['campo'], array('campo' => obtenerCampo(node_load(arg(1)), $conf['campo']))); 69 | return $block; 70 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/carrousel.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Carrousel'), 6 | 'description' => t('Muestra la imagen destacada.'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_carrousel_render', 9 | 'edit form' => 'badistro_bloques_carrousel_edit_form', 10 | 'admin info' => 'badistro_bloques_carrousel_admin_info', 11 | 'defaults' => array( 12 | 'tipos_de_contenido' => array(), 13 | 'cantidad_de_slides' => 3, 14 | 'tipo_noticia' => 'all', 15 | 'tipo_tramite' => 'all', 16 | ) 17 | ); 18 | 19 | /** 20 | * 'admin info' callback for panel pane. 21 | */ 22 | function badistro_bloques_carrousel_admin_info($subtype, $conf, $contexts) { 23 | if (!empty($conf)) { 24 | $block = new stdClass; 25 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Carrousel'); 26 | $block->content = t('Carrousel'); 27 | return $block; 28 | } 29 | } 30 | 31 | /** 32 | * 'Edit form' callback for the content type. 33 | */ 34 | function badistro_bloques_carrousel_edit_form($form, &$form_state) { 35 | foreach (node_type_get_types() as $item) { 36 | $tiposDeContenido[$item->type] = $item->name; 37 | } 38 | $form['cantidad_de_slides'] = array( 39 | '#type' => 'textfield', 40 | '#title' => t('Cantidad de slides'), 41 | '#default_value' => $form_state['conf']['cantidad_de_slides'], 42 | '#element_validate' => array('element_validate_integer_positive'), 43 | ); 44 | $form['tipos_de_contenido'] = array( 45 | '#title' => t('Tipos de contenido'), 46 | '#type' => 'checkboxes', 47 | '#default_value' => $form_state['conf']['tipos_de_contenido'], 48 | '#required' => TRUE, 49 | '#options' => $tiposDeContenido, 50 | ); 51 | $form['tipo_tramite'] = array( 52 | '#type' => 'entityreference', 53 | '#title' => t('Tipo de Trámites'), 54 | '#description' => t('Filtrar por tipo de trámite. Dejar vacío para listar todos los trámites'), 55 | '#required' => FALSE, 56 | '#states' => array( 57 | 'visible' => array( 58 | ':input[name="tipos_de_contenido[tramite]"]' => array('checked' => TRUE), 59 | ), 60 | ), 61 | '#era_entity_type' => 'taxonomy_term', // Mandatory. 62 | '#era_bundles' => array('tramites'), // Optional (Any bundle by default). 63 | '#era_cardinality' => 2, // Optional (1 By default). 64 | ); 65 | $form['tipo_noticia'] = array( 66 | '#type' => 'entityreference', 67 | '#title' => t('Categoría de Noticias'), 68 | '#description' => t('Filtrar por categoría de noticias. Dejar vacío para listar todos los noticias'), 69 | '#required' => FALSE, 70 | '#states' => array( 71 | 'visible' => array( 72 | ':input[name="tipos_de_contenido[noticia]"]' => array('checked' => TRUE), 73 | ), 74 | ), 75 | '#era_entity_type' => 'taxonomy_term', // Mandatory. 76 | '#era_bundles' => array('noticias'), // Optional (Any bundle by default). 77 | '#era_cardinality' => 1, // Optional (1 By default). 78 | ); 79 | 80 | return $form; 81 | } 82 | 83 | /** 84 | * The submit form stores the data in $conf. 85 | */ 86 | function badistro_bloques_carrousel_edit_form_submit($form, &$form_state) { 87 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 88 | if (isset($form_state['values'][$key])) { 89 | $form_state['conf'][$key] = $form_state['values'][$key]; 90 | } 91 | } 92 | } 93 | function badistro_bloques_carrousel_render($subtype, $conf, $panel_args, $context = NULL){ 94 | $block = new stdClass(); 95 | $block->title = ''; 96 | $view = views_get_view('listado_de_contenido'); 97 | $view->set_display('default'); 98 | $tipoNoticia = !empty($conf['tipo_noticia']) ? reset($conf['tipo_noticia']) : array(); 99 | $tipoTramite = !empty($conf['tipo_tramite']) ? reset($conf['tipo_tramite']) : array(); 100 | $view->set_arguments( 101 | array( 102 | tiposDeContenidoElegidos($conf["tipos_de_contenido"]), 103 | !(empty($conf['tipo_noticia'])) ? $tipoNoticia['entity_id'] : 'all', 104 | !(empty($conf['tipo_tramite'])) ? $tipoTramite['entity_id'] : 'all', 105 | 'all', 106 | 'all' 107 | ) 108 | ); 109 | $view->set_items_per_page($conf["cantidad_de_slides"]); 110 | $view->execute(); 111 | foreach ($view->result as $key => $item) { 112 | $slides[] = crearSlide($item); 113 | } 114 | $block->content = !empty($slides) && sizeof($slides) > 0 ? theme('badistro_bloques_carrousel', array('slides' => $slides)) : FALSE; 115 | return $block; 116 | } 117 | function crearSlide($item){ 118 | $slide = new stdClass(); 119 | $slide->id = $item->nid; 120 | $slide->titulo = $item->node_title; 121 | $slide->caption = field_get_items('node', $item->_field_data["nid"]["entity"], 'body', NULL); 122 | $slide->caption = $slide->caption[0]["summary"]; 123 | $slide->imagen = field_get_items('node', $item->_field_data["nid"]["entity"], 'field_featured_image', NULL); 124 | $slide->imagen = theme_image_style(array('style_name' => 'wide', 'path' => $slide->imagen[0]["uri"], 'width' => '', 'height' => '')); 125 | $slide->imagen = l($slide->imagen, 'node/' . $slide->id, array('html' => TRUE)); 126 | return $slide; 127 | } 128 | function tiposDeContenidoElegidos($tiposDeContenido){ 129 | $tiposDeContenidoElegidos = array(); 130 | foreach ($tiposDeContenido as $key => $value) { 131 | if(!$value == 0) { 132 | $tiposDeContenidoElegidos[] = $key; 133 | } 134 | } 135 | return implode('+', $tiposDeContenidoElegidos); 136 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/galeria_imagenes.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Galería de Imágenes'), 6 | 'description' => t('Muestra las imágenes de una noticia y/o trámite.'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_galeria_imagenes_render', 9 | 'edit form' => 'badistro_bloques_galeria_imagenes_edit_form', 10 | 'admin info' => 'badistro_bloques_galeria_imagenes_admin_info', 11 | 'defaults' => array( 12 | 'tipo' => 'min' 13 | ) 14 | ); 15 | 16 | /** 17 | * 'admin info' callback for panel pane. 18 | */ 19 | function badistro_bloques_galeria_imagenes_admin_info($subtype, $conf, $contexts) { 20 | if (!empty($conf)) { 21 | $block = new stdClass; 22 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Galería de imágenes'); 23 | $block->content = t('Galería de imágenes'); 24 | return $block; 25 | } 26 | } 27 | 28 | /** 29 | * 'Edit form' callback for the content type. 30 | */ 31 | function badistro_bloques_galeria_imagenes_edit_form($form, &$form_state) { 32 | 33 | $form['tipo'] = array( 34 | '#type' => 'select', 35 | '#title' => t('Tipo'), 36 | '#default_value' => $form_state['conf']['tipo'], 37 | '#options' => array( 38 | 'min' => t('Miniatura'), 39 | ), 40 | ); 41 | 42 | return $form; 43 | } 44 | 45 | /** 46 | * The submit form stores the data in $conf. 47 | */ 48 | function badistro_bloques_galeria_imagenes_edit_form_submit($form, &$form_state) { 49 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 50 | if (isset($form_state['values'][$key])) { 51 | $form_state['conf'][$key] = $form_state['values'][$key]; 52 | } 53 | } 54 | } 55 | function badistro_bloques_galeria_imagenes_render($subtype, $conf, $panel_args, $context = NULL){ 56 | $block = new stdClass(); 57 | $block->title = ''; 58 | 59 | if(arg(0) == 'node' && is_numeric(arg(1))){ 60 | $node = node_load(arg(1)); 61 | if(isset($node->field_imagenes) && !empty($node->field_imagenes)){ 62 | foreach (field_get_items('node', $node, 'field_imagenes', NULL) as $key => $imagen) { 63 | $imagenes[$key]['thumb'] = theme_image_style( 64 | array( 65 | 'style_name' => 'gallery_thumb', 66 | 'path' => $imagen['uri'], 67 | 'width' => '', 68 | 'height' => '', 69 | 'attributes' => array( 70 | 'data-toggle' => "modal", 71 | 'data-target' => ".badistro-bloques-galeria-imagenes-" . $key 72 | ) 73 | ) 74 | ); 75 | $imagenes[$key]['original'] = theme_image_style( 76 | array( 77 | 'style_name' => 'gallery_large', 78 | 'path' => $imagen['uri'], 79 | 'width' => '', 80 | 'height' => '', 81 | 'attributes' => array() 82 | ) 83 | ); 84 | $imagenes[$key]['render'] = theme( 85 | 'badistro_bloques_galeria_imagenes_' . $conf['tipo'] . '_item', 86 | array( 87 | "thumb" => $imagenes[$key]['thumb'], 88 | "original" => $imagenes[$key]['original'], 89 | "key" => $key 90 | ) 91 | ); 92 | } 93 | $block->content = theme( 94 | 'badistro_bloques_galeria_imagenes_' . $conf['tipo'], 95 | array('imagenes' => $imagenes) 96 | ); 97 | } else { 98 | $block->content = ''; 99 | } 100 | } else { 101 | $block->content = ''; 102 | } 103 | return $block; 104 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/imagen.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Imagen'), 6 | 'description' => t('Crea una imagen.'), 7 | 'category' => t('BA Distro'), 8 | 'edit form' => 'badistro_bloques_imagen_edit_form', 9 | 'render callback' => 'badistro_bloques_imagen_render', 10 | 'admin info' => 'badistro_bloques_imagen_admin_info', 11 | 'defaults' => array( 12 | 'formato' => '', 13 | 'imagen' => '', 14 | ) 15 | ); 16 | 17 | /** 18 | * 'admin info' callback for panel pane. 19 | */ 20 | function badistro_bloques_imagen_admin_info($subtype, $conf, $contexts) { 21 | if (!empty($conf)) { 22 | $block = new stdClass; 23 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Alerta'); 24 | $block->content = t('Imagen formato @formato.', array('@tipo' => $conf['formato'])); 25 | return $block; 26 | } 27 | } 28 | 29 | /** 30 | * 'Edit form' callback for the content type. 31 | */ 32 | function badistro_bloques_imagen_edit_form($form, &$form_state) { 33 | 34 | $form['imagen'] = array( 35 | '#title' => t('Imagen'), 36 | '#type' => 'managed_file', 37 | '#description' => t('The uploaded image will be displayed on this page using the image style choosen below.'), 38 | '#default_value' => variable_get('imagen_example', ''), 39 | '#upload_location' => 'public://', 40 | '#suffix' => '
' 41 | ); 42 | 43 | return $form; 44 | } 45 | 46 | /** 47 | * The submit form stores the data in $conf. 48 | */ 49 | function badistro_bloques_imagen_edit_form_submit($form, &$form_state) { 50 | // Load the file via file.fid. 51 | $file = file_load($form_state['values']['imagen']); 52 | var_dump($file); 53 | // Change status to permanent. 54 | $file->status = FILE_STATUS_PERMANENT; 55 | // Save. 56 | file_save($file); 57 | // Record that the module (in this example, user module) is using the file. 58 | file_usage_add($file, 'badistro_bloques', 'badistro_bloques_imagen', $file->uid); 59 | 60 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 61 | if (isset($form_state['values'][$key])) { 62 | $form_state['conf'][$key] = $form_state['values'][$key]; 63 | } 64 | } 65 | } 66 | function badistro_bloques_imagen_render($subtype, $conf, $panel_args, $context = NULL){ 67 | $block = new stdClass(); 68 | $block->title = ''; 69 | $block->content = 'hola'; 70 | return $block; 71 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/imagen_destacada.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Imagen destacada'), 6 | 'description' => t('Muestra la imagen destacada.'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_imagen_destacada_render', 9 | 'admin info' => 'badistro_bloques_imagen_destacada_admin_info', 10 | 'defaults' => array( 11 | 'imagen_destacada' => NULL, 12 | ) 13 | ); 14 | 15 | /** 16 | * 'admin info' callback for panel pane. 17 | */ 18 | function badistro_bloques_imagen_destacada_admin_info($subtype, $conf, $contexts) { 19 | if (!empty($conf)) { 20 | $block = new stdClass; 21 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Imagen destacada'); 22 | $block->content = t('Imagen destacada.'); 23 | return $block; 24 | } 25 | } 26 | function badistro_bloques_imagen_destacada_render($subtype, $conf, $panel_args, $context = NULL){ 27 | $block = new stdClass(); 28 | $block->title = ''; 29 | if(arg(0) == 'node' && is_numeric(arg(1))){ 30 | $node = node_load(arg(1)); 31 | if(isset($node->field_featured_image) && !empty($node->field_featured_image)){ 32 | $imagen = field_get_items('node', $node, 'field_featured_image', NULL); 33 | $texto = field_get_items('node', $node, 'body', NULL); 34 | $block->content = theme( 35 | 'badistro_bloques_imagen_destacada', array( 36 | 'imagen' => theme_image_style( 37 | array( 38 | 'style_name' => 'imagen_destacada', 39 | 'path' => $imagen[0]['uri'], 40 | 'width' => '', 41 | 'height' => '', 42 | 'attributes' => array() 43 | ) 44 | ), 45 | 'titulo' => $node->title, 46 | 'texto' => $texto[0]['summary'] 47 | ) 48 | ); 49 | } else { 50 | $block->content = ''; 51 | } 52 | } else { 53 | $block->content = ''; 54 | } 55 | 56 | return $block; 57 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/listado.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Listado'), 6 | 'description' => t('Crea un listado de contenido configurable'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_listado_render', 9 | 'edit form' => 'badistro_bloques_listado_edit_form', 10 | 'admin info' => 'badistro_bloques_listado_admin_info', 11 | 'defaults' => array( 12 | 'cantidad_links' => 5, 13 | 'tipo_de_listado' => 'recientes', 14 | 'tipos_de_contenido' => 'noticia', 15 | 'formato_de_listado' => 'solo_texto', 16 | 'titulo' => t('Listado'), 17 | 'icono' => 'glyphicon-paperclip', 18 | 'tipo_noticia' => 'all', 19 | 'tipo_tramite' => 'all', 20 | 'orientacion_de_listado' => 'vertical', 21 | 'todos_los_items' => TRUE, 22 | ) 23 | ); 24 | 25 | /** 26 | * 'admin info' callback for panel pane. 27 | */ 28 | function badistro_bloques_listado_admin_info($subtype, $conf, $contexts) { 29 | if (!empty($conf)) { 30 | $block = new stdClass; 31 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Listado'); 32 | $block->content = t('Listado'); 33 | return $block; 34 | } 35 | } 36 | 37 | /** 38 | * 'Edit form' callback for the content type. 39 | */ 40 | function badistro_bloques_listado_edit_form($form, &$form_state) { 41 | 42 | foreach (node_type_get_types() as $item) { 43 | $tiposDeContenido[$item->type] = $item->name; 44 | } 45 | $form['titulo'] = array( 46 | '#title' => t('Título'), 47 | '#type' => 'textfield', 48 | '#default_value' => $form_state['conf']['titulo'], 49 | '#required' => TRUE, 50 | ); 51 | $form['cantidad_links'] = array( 52 | '#type' => 'textfield', 53 | '#title' => t('Cantidad'), 54 | '#default_value' => $form_state['conf']['cantidad_links'], 55 | '#element_validate' => array('element_validate_integer_positive'), 56 | '#description' => t('Cantidad máxima de items del listado'), 57 | ); 58 | $form['todos_los_items'] = array( 59 | '#type' => 'checkbox', 60 | '#title' => t('Incluír opción "Todos los items"'), 61 | '#default_value' => $form_state['conf']['todos_los_items'], 62 | '#description' => t('Si está tildado se mostrará un link a todos los items del tipo de contenido seleccionado'), 63 | ); 64 | $form['tipos_de_contenido'] = array( 65 | '#title' => t('Tipo de contenido'), 66 | '#type' => 'radios', 67 | '#default_value' => $form_state['conf']['tipos_de_contenido'], 68 | '#required' => TRUE, 69 | '#options' => $tiposDeContenido, 70 | '#description' => t('Tipo de contenido a listar'), 71 | ); 72 | $form['tipo_tramite'] = array( 73 | '#type' => 'entityreference', 74 | '#title' => t('Tipo de Trámites'), 75 | '#description' => t('Filtrar por tipo de trámite. Dejar vacío para listar todos los trámites'), 76 | '#required' => FALSE, 77 | '#states' => array( 78 | 'visible' => array( 79 | ':input[name="tipos_de_contenido"]' => array('value' => 'tramite'), 80 | ), 81 | ), 82 | '#era_entity_type' => 'taxonomy_term', // Mandatory. 83 | '#era_bundles' => array('tramites'), // Optional (Any bundle by default). 84 | '#era_cardinality' => 2, // Optional (1 By default). 85 | ); 86 | $form['tipo_noticia'] = array( 87 | '#type' => 'entityreference', 88 | '#title' => t('Categoría de Noticias'), 89 | '#description' => t('Filtrar por categoría de noticias. Dejar vacío para listar todos los noticias'), 90 | '#required' => FALSE, 91 | '#states' => array( 92 | 'visible' => array( 93 | ':input[name="tipos_de_contenido"]' => array('value' => 'noticia'), 94 | ), 95 | ), 96 | '#era_entity_type' => 'taxonomy_term', // Mandatory. 97 | '#era_bundles' => array('noticias'), // Optional (Any bundle by default). 98 | '#era_cardinality' => 1, // Optional (1 By default). 99 | ); 100 | $form['tipo_de_listado'] = array( 101 | '#type' => 'select', 102 | '#title' => t('Tipo de listado'), 103 | '#options' => array( 104 | 'recientes' => t('Recientes'), 105 | 'relacionados' => t('Relacionados'), 106 | ), 107 | '#default_value' => $form_state['conf']['tipo_de_listado'], 108 | '#description' => t('Cada tipo de listado tiene un comportamiento diferente'), 109 | ); 110 | $form['formato_de_listado'] = array( 111 | '#type' => 'select', 112 | '#title' => t('Formato de listado'), 113 | '#options' => array( 114 | 'badistro_bloques_listado' => t('Sólo texto'), 115 | 'badistro_bloques_listado_con_imagen' => t('Imagen y texto'), 116 | 'badistro_bloques_listado_destacado' => t('Destacado'), 117 | ), 118 | '#default_value' => $form_state['conf']['formato_de_listado'], 119 | '#description' => t('Cada tipo de listado tiene un comportamiento diferente'), 120 | ); 121 | $form['orientacion_de_listado'] = array( 122 | '#title' => t('Orientación'), 123 | '#type' => 'radios', 124 | '#default_value' => $form_state['conf']['orientacion_de_listado'], 125 | '#required' => TRUE, 126 | '#options' => array( 127 | 'vertical' => t("Vertical"), 128 | 'horizontal' => t("Horizontal") 129 | ), 130 | ); 131 | $form['icono'] = array( 132 | '#title' => t('Ícono'), 133 | '#type' => 'select', 134 | '#default_value' => $form_state['conf']['icono'], 135 | '#options' => array( 136 | 'glyphicon-home' => t('Casa'), 137 | 'glyphicon-paperclip' => t('Clip'), 138 | 'glyphicon-star' => t('Estrella'), 139 | 'glyphicon-heart' => t('Corazón'), 140 | ), 141 | '#states' => array( 142 | 'visible' => array( 143 | ':input[name="formato_de_listado"]' => array('value' => 'badistro_bloques_listado_destacado'), 144 | ), 145 | ), 146 | ); 147 | 148 | return $form; 149 | } 150 | 151 | /** 152 | * The submit form stores the data in $conf. 153 | */ 154 | function badistro_bloques_listado_edit_form_submit($form, &$form_state) { 155 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 156 | if (isset($form_state['values'][$key])) { 157 | $form_state['conf'][$key] = $form_state['values'][$key]; 158 | } 159 | } 160 | } 161 | function badistro_bloques_listado_render($subtype, $conf, $panel_args, $context = NULL){ 162 | $tipoNoticia = !empty($conf['tipo_noticia']) ? reset($conf['tipo_noticia']) : array(); 163 | $tipoTramite = !empty($conf['tipo_tramite']) ? reset($conf['tipo_tramite']) : array(); 164 | $block = new stdClass(); 165 | $block->title = ''; 166 | $view = views_get_view('listado_de_contenido'); 167 | $view->set_display('default'); 168 | $view->set_arguments( 169 | array( 170 | $conf["tipos_de_contenido"], 171 | !(empty($conf['tipo_noticia'])) ? $tipoNoticia['entity_id'] : 'all', 172 | !(empty($conf['tipo_tramite'])) ? $tipoTramite['entity_id'] : 'all', 173 | $conf['tipo_de_listado'] == 'relacionados' && (esNoticia() || esTramite()) ? arg(1) : 'all', 174 | $conf['tipo_de_listado'] == 'relacionados' && esArea() ? arg(1) : 'all' 175 | ) 176 | ); 177 | $view->set_items_per_page($conf["cantidad_links"]); 178 | $view->execute(); 179 | foreach ($view->result as $key => $item) { 180 | $links[] = crearLink($item, $conf["formato_de_listado"] . '_' . $conf["orientacion_de_listado"], $conf); 181 | } 182 | $block->content = !empty($links) && sizeof($links) > 0 ? theme( 183 | $conf["formato_de_listado"] . '_' . $conf["orientacion_de_listado"], 184 | array( 185 | "titulo" => $conf["titulo"], 186 | 'links' => $links, 187 | 'icono' => $conf['icono'], 188 | 'boton' => $conf['tipos_de_contenido'] != 'pagina' && $conf['todos_los_items'] ? l(t('Ver todos'), '/' . $conf['tipos_de_contenido'] . 's', array('attributes' => array('class' => array('btn', 'btn-default', 'btn-lg', 'btn-block')))) : NULL 189 | ) 190 | ) : theme( 191 | 'badistro_bloques_listado_vacio', 192 | array( 193 | "titulo" => $conf["titulo"] 194 | ) 195 | ); 196 | return $block; 197 | } 198 | function crearLink($item, $theme, $conf = NULL){ 199 | $link = new stdClass(); 200 | $link->id = $item->nid; 201 | $link->texto = field_get_items('node', $item->_field_data["nid"]["entity"], 'body', NULL); 202 | $link->texto = $link->texto[0]["summary"]; 203 | $link->imagen = field_get_items('node', $item->_field_data["nid"]["entity"], 'field_featured_image', NULL); 204 | $link->imagen = theme_image_style(array('style_name' => 'list', 'path' => $link->imagen[0]["uri"], 'width' => '', 'height' => '', 'attributes' => array('class' => array('media-object', 'img-rounded')))); 205 | $link->type = $item->_field_data["nid"]["entity"]->type; 206 | $link->category = ($link->type == 'tramite' || $link->type == 'noticia') && isset($item->_field_data["nid"]["entity"]) ? obtenerTaxonomia($item, $link->type) : NULL; 207 | $link->category = isset($link->category) ? taxonomy_term_load($link->category[0]["target_id"]) : NULL; 208 | $link->category = isset($link->category) && !empty($link->category) ? l($link->category->name, 'taxonomy/term/' . $link->category->tid) : NULL; 209 | 210 | return l( 211 | theme( 212 | $theme . '_item', 213 | array( 214 | 'titulo' => $item->node_title, 215 | 'texto' => views_trim_text( 216 | array( 217 | 'max_length' => 90, 218 | 'ellipsis' => TRUE, 219 | 'word_boundary' => TRUE, 220 | 'html' => TRUE, 221 | ), 222 | $link->texto 223 | ), 224 | 'imagen' => $link->imagen, 225 | 'icono' => $conf['icono'] 226 | ) 227 | ), 228 | 'node/' . $item->nid, 229 | array( 230 | 'html' => TRUE, 231 | 'attributes' => array( 232 | 'class' => array(), 233 | ) 234 | ) 235 | ); 236 | } 237 | 238 | function obtenerTaxonomia($item, $tipo){ 239 | return $tipo == 'tramite' ? field_get_items('node', $item->_field_data["nid"]["entity"], 'field_tramite_tipo', NULL) : field_get_items('node', $item->_field_data["nid"]["entity"], 'field_categoria', NULL); 240 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/redes_sociales.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Redes Sociales'), 6 | 'description' => t('Crea un listado de contenido configurable'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_redes_sociales_render', 9 | 'edit form' => 'badistro_bloques_redes_sociales_edit_form', 10 | 'admin info' => 'badistro_bloques_redes_sociales_admin_info', 11 | 'defaults' => array( 12 | 'titulo' => t('Redes Sociales'), 13 | 'tipo_widget' => 'share', 14 | 'tipo_widget_timeline' => 'facebook', 15 | 'fb_page_url' => '', 16 | 'fb_altura' => 70, 17 | 'fb_mostrar_post' => TRUE, 18 | 'fb_mostrar_fotos_amigos' => TRUE, 19 | 'fb_ocultar_portada' => FALSE, 20 | 'tw_widget_id' => '', 21 | 'tw_screen_name' => '' 22 | ) 23 | ); 24 | 25 | /** 26 | * 'admin info' callback for panel pane. 27 | */ 28 | function badistro_bloques_redes_sociales_admin_info($subtype, $conf, $contexts) { 29 | if (!empty($conf)) { 30 | $block = new stdClass; 31 | $block->title = $conf['titulo']; 32 | $block->content = $conf['tipo_widget'] == 'share' ? t('Compartir') : t('Línea de tiempo'); 33 | return $block; 34 | } 35 | } 36 | 37 | /** 38 | * 'Edit form' callback for the content type. 39 | */ 40 | function badistro_bloques_redes_sociales_edit_form($form, &$form_state) { 41 | 42 | $form['titulo'] = array( 43 | '#title' => t('Título'), 44 | '#type' => 'textfield', 45 | '#default_value' => $form_state['conf']['titulo'], 46 | '#required' => FALSE, 47 | ); 48 | $form['tipo_widget'] = array( 49 | '#title' => t('Tipo de widget'), 50 | '#type' => 'radios', 51 | '#default_value' => $form_state['conf']['tipo_widget'], 52 | '#required' => TRUE, 53 | '#options' => array( 54 | 'share' => t('Compartir'), 55 | 'timeline' => t('Línea de tiempo') 56 | ), 57 | '#description' => t('Tipo de widget'), 58 | ); 59 | $form['tipo_widget_timeline'] = array( 60 | '#title' => t('Tipo de widget'), 61 | '#type' => 'radios', 62 | '#default_value' => $form_state['conf']['tipo_widget_timeline'], 63 | '#required' => TRUE, 64 | '#options' => array( 65 | 'facebook' => t('Facebook'), 66 | 'twitter' => t('Twitter') 67 | ), 68 | '#states' => array( 69 | 'visible' => array( 70 | ':input[name="tipo_widget"]' => array('value' => 'timeline'), 71 | ), 72 | ), 73 | ); 74 | $form['fb_timeline'] = array( 75 | '#type' => 'fieldset', 76 | '#attributes' => array(), 77 | '#title' => t('Facebook'), 78 | '#states' => array( 79 | 'visible' => array( 80 | ':input[name="tipo_widget_timeline"]' => array('value' => 'facebook'), 81 | ':input[name="tipo_widget"]' => array('value' => 'timeline'), 82 | ), 83 | ), 84 | ); 85 | $form['tw_timeline'] = array( 86 | '#type' => 'fieldset', 87 | '#attributes' => array(), 88 | '#title' => t('Twitter'), 89 | '#states' => array( 90 | 'visible' => array( 91 | ':input[name="tipo_widget_timeline"]' => array('value' => 'twitter'), 92 | ':input[name="tipo_widget"]' => array('value' => 'timeline'), 93 | ), 94 | ), 95 | ); 96 | $form['tw_timeline']['tw_widget_id'] = array( 97 | '#title' => t('Widget ID'), 98 | '#type' => 'textfield', 99 | '#default_value' => $form_state['conf']['tw_widget_id'], 100 | '#description' => t('Debes crear un ' . l('widget desde tu cuenta', 'https://twitter.com/settings/widgets/')), 101 | ); 102 | $form['tw_timeline']['tw_screen_name'] = array( 103 | '#title' => t('Usuario'), 104 | '#type' => 'textfield', 105 | '#default_value' => $form_state['conf']['tw_screen_name'], 106 | '#description' => t('Debes crear un ' . l('widget desde tu cuenta', 'https://twitter.com/settings/widgets/')), 107 | ); 108 | $form['fb_timeline']['fb_page_url'] = array( 109 | '#title' => t('URL de la página en Facebook'), 110 | '#type' => 'textfield', 111 | '#default_value' => $form_state['conf']['fb_page_url'], 112 | ); 113 | $form['fb_timeline']['fb_altura'] = array( 114 | '#title' => t('Altura'), 115 | '#type' => 'textfield', 116 | '#default_value' => $form_state['conf']['fb_altura'], 117 | '#description' => t('Mín. 70'), 118 | ); 119 | $form['fb_timeline']['fb_mostrar_post'] = array( 120 | '#type' => 'checkbox', 121 | '#title' => t('Mostrar posts'), 122 | '#default_value' => $form_state['conf']['fb_mostrar_post'], 123 | '#description' => t('Default: TRUE'), 124 | ); 125 | $form['fb_timeline']['fb_ocultar_portada'] = array( 126 | '#type' => 'checkbox', 127 | '#title' => t('Ocultar imagen de portada'), 128 | '#default_value' => $form_state['conf']['fb_ocultar_portada'], 129 | '#description' => t('Default: FALSE'), 130 | ); 131 | $form['fb_timeline']['fb_mostrar_fotos_amigos'] = array( 132 | '#type' => 'checkbox', 133 | '#title' => t('Mostrar foto de amigos'), 134 | '#default_value' => $form_state['conf']['fb_mostrar_fotos_amigos'], 135 | '#description' => t('Default: TRUE'), 136 | ); 137 | 138 | return $form; 139 | } 140 | 141 | /** 142 | * The submit form stores the data in $conf. 143 | */ 144 | function badistro_bloques_redes_sociales_edit_form_submit($form, &$form_state) { 145 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 146 | if (isset($form_state['values'][$key])) { 147 | $form_state['conf'][$key] = $form_state['values'][$key]; 148 | } 149 | } 150 | } 151 | function badistro_bloques_redes_sociales_render($subtype, $conf, $panel_args, $context = NULL){ 152 | $block = new stdClass; 153 | $block->title = ''; 154 | $block->content = $conf['tipo_widget'] == 'share' ? theme('badistro_bloques_redes_sociales_compartir', array('titulo' => $conf['titulo'])) : theme('badistro_bloques_redes_sociales_' . $conf['tipo_widget'] . '_' . $conf['tipo_widget_timeline'], array('configuraciones' => $conf)); 155 | drupal_add_js(drupal_get_path('module', 'badistro_bloques') . '/js/fb-sdk.js'); 156 | drupal_add_js(drupal_get_path('module', 'badistro_bloques') . '/js/tw.js'); 157 | return $block; 158 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/separador.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Separador'), 6 | 'description' => t('Crea un separador'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_separador_render', 9 | 'admin info' => 'badistro_bloques_separador_admin_info', 10 | 'defaults' => array() 11 | ); 12 | 13 | 14 | /** 15 | * 'admin info' callback for panel pane. 16 | */ 17 | function badistro_bloques_separador_admin_info($subtype, $conf, $contexts) { 18 | if (!empty($conf)) { 19 | $block = new stdClass; 20 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Separador'); 21 | $block->content = t('Separador'); 22 | return $block; 23 | } 24 | } 25 | function badistro_bloques_separador_render($subtype, $conf, $panel_args, $context = NULL){ 26 | $block = new stdClass(); 27 | $block->title = ''; 28 | $block->content = theme('badistro_bloques_separador'); 29 | return $block; 30 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/shortcut.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Shortcut'), 6 | 'description' => t('Crea un acceso directo'), 7 | 'category' => t('BA Distro'), 8 | 'render callback' => 'badistro_bloques_shortcut_render', 9 | 'edit form' => 'badistro_bloques_shortcut_edit_form', 10 | 'admin info' => 'badistro_bloques_shortcut_admin_info', 11 | 'defaults' => array( 12 | 'color_fondo' => 'shortcut-azul', 13 | 'icono' => 'glyphicon-home', 14 | 'titulo' => '', 15 | 'texto' => '', 16 | 'referencia' => array(), 17 | 'link' => '' 18 | ) 19 | ); 20 | 21 | /** 22 | * 'admin info' callback for panel pane. 23 | */ 24 | function badistro_bloques_shortcut_admin_info($subtype, $conf, $contexts) { 25 | if (!empty($conf)) { 26 | $block = new stdClass; 27 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : $conf['titulo']; 28 | $block->content = $conf['texto']; 29 | return $block; 30 | } 31 | } 32 | 33 | /** 34 | * 'Edit form' callback for the content type. 35 | */ 36 | function badistro_bloques_shortcut_edit_form($form, &$form_state) { 37 | $form['titulo'] = array( 38 | '#title' => t('Título'), 39 | '#type' => 'textfield', 40 | '#default_value' => $form_state['conf']['titulo'], 41 | '#required' => TRUE, 42 | ); 43 | $form['texto'] = array( 44 | '#title' => t('Texto'), 45 | '#type' => 'textfield', 46 | '#default_value' => $form_state['conf']['texto'], 47 | '#required' => FALSE, 48 | ); 49 | $form['color_fondo'] = array( 50 | '#title' => t('Color de fondo'), 51 | '#type' => 'select', 52 | '#default_value' => $form_state['conf']['color_fondo'], 53 | '#options' => array( 54 | 'shortcut-naranja' => t('Naranja'), 55 | 'shortcut-azul' => t('Azul'), 56 | 'shortcut-rojo' => t('Rojo'), 57 | 'shortcut-verde' => t('Verde') 58 | ), 59 | ); 60 | $form['icono'] = array( 61 | '#title' => t('Color de fondo'), 62 | '#type' => 'select', 63 | '#default_value' => $form_state['conf']['icono'], 64 | '#options' => $badistro_iconos, 65 | ); 66 | $form['referencia'] = array( 67 | '#type' => 'entityreference', 68 | '#title' => t('Página, trámite o noticia'), 69 | '#required' => FALSE, 70 | '#era_entity_type' => 'node', // Mandatory. 71 | '#era_bundles' => array(), // Optional (Any bundle by default). 72 | '#era_cardinality' => 1, // Optional (1 By default). 73 | '#states' => array( 74 | 'invisible' => array( 75 | ':input[name="link"]' => array('filled' => TRUE), 76 | ), 77 | ), 78 | '#description' => t('Usar este campo para referenciar contenido'), 79 | ); 80 | $form['link'] = array( 81 | '#type' => 'textfield', 82 | '#title' => t('Link'), 83 | '#required' => FALSE, 84 | '#states' => array( 85 | 'invisible' => array( 86 | ':input[name="referencia"]' => array('filled' => TRUE), 87 | ), 88 | ), 89 | '#description' => t('Usar este campo para crear un link personalizado'), 90 | ); 91 | return $form; 92 | } 93 | 94 | /** 95 | * The submit form stores the data in $conf. 96 | */ 97 | function badistro_bloques_shortcut_edit_form_submit($form, &$form_state) { 98 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 99 | if (isset($form_state['values'][$key])) { 100 | $form_state['conf'][$key] = $form_state['values'][$key]; 101 | } 102 | } 103 | } 104 | function badistro_bloques_shortcut_render($subtype, $conf, $panel_args, $context = NULL){ 105 | 106 | $block = new stdClass(); 107 | $block->title = ''; 108 | $block->content = !empty($conf['referencia']) || !empty($conf['link']) ? l( 109 | theme( 110 | 'badistro_bloques_shortcut', 111 | array( 112 | 'color' => $conf['color_fondo'], 113 | 'icono' => $conf['icono'], 114 | 'texto' => $conf['texto'], 115 | 'titulo' => $conf['titulo'], 116 | 'css' => '' 117 | ) 118 | ), 119 | !empty($conf['referencia']) ? 'node/' . $conf['referencia']['entity_id'] : $conf['link'], 120 | array( 121 | 'html' => TRUE, 122 | 'attributes' => array( 123 | 'class' => array( 124 | 'col-sm-6', 125 | 'col-md-3' 126 | ) 127 | ), 128 | ) 129 | ) : theme( 130 | 'badistro_bloques_shortcut', 131 | array( 132 | 'color' => $conf['color_fondo'], 133 | 'icono' => $conf['icono'], 134 | 'texto' => $conf['texto'], 135 | 'titulo' => $conf['titulo'], 136 | 'css' => 'col-sm-6 col-md-3' 137 | ) 138 | ); 139 | return $block; 140 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/texto.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Texto'), 6 | 'description' => t('Crea un párrafo.'), 7 | 'category' => t('BA Distro'), 8 | 'edit form' => 'badistro_bloques_texto_edit_form', 9 | 'render callback' => 'badistro_bloques_texto_render', 10 | 'admin info' => 'badistro_bloques_texto_admin_info', 11 | 'defaults' => array( 12 | 'destacado' => 0, 13 | 'texto' => NULL, 14 | 'sobreescribir' => 0, 15 | 'cuerpo_o_resumen' => 'body' 16 | ) 17 | ); 18 | 19 | function badistro_bloques_texto_edit_form($form, &$form_state){ 20 | 21 | $form['destacado'] = array( 22 | '#type' => 'checkbox', 23 | '#title' => t('Texto destacado'), 24 | ); 25 | $form['cuerpo_o_resumen'] = array( 26 | '#type' => 'radios', 27 | '#title' => t('Cantidad de texto'), 28 | '#default_value' => $form_state['conf']['cuerpo_o_resumen'], 29 | '#options' => array('body' => 'Texto completo', 'summary' => 'Resumen'), 30 | ); 31 | $form['sobreescribir'] = array( 32 | '#title' => t('¿Personalizar texto?'), 33 | '#type' => 'checkbox', 34 | '#default_value' => $form_state['conf']['sobreescribir'], 35 | ); 36 | $form['texto'] = array( 37 | '#title' => t('Contenido'), 38 | '#type' => 'text_format', 39 | '#format' => 'full_html', 40 | '#default_value' => $form_state['conf']['texto']['value'], 41 | '#required' => FALSE, 42 | '#states' => array( 43 | 'disabled' => array( 44 | ':input[name="sobreescribir"]' => array('checked' => FALSE), 45 | ), 46 | 'required' => array( 47 | ':input[name="sobreescribir"]' => array('checked' => TRUE), 48 | ) 49 | ), 50 | ); 51 | 52 | return $form; 53 | } 54 | 55 | /** 56 | * The submit form stores the data in $conf. 57 | */ 58 | function badistro_bloques_texto_edit_form_submit($form, &$form_state) { 59 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 60 | if (isset($form_state['values'][$key])) { 61 | $form_state['conf'][$key] = $form_state['values'][$key]; 62 | } 63 | } 64 | } 65 | 66 | function badistro_bloques_texto_render($subtype, $conf, $panel_args, $context = NULL){ 67 | $block = new stdClass(); 68 | $block->title = ''; 69 | $texto = $conf['sobreescribir'] ? $conf['texto'] : (esNodo() ? field_get_items('node', node_load(arg(1)), 'body', NULL) : ''); 70 | $texto = $conf['sobreescribir'] ? $texto['value'] : ($conf['cuerpo_o_resumen'] == 'body' ? $texto[0]['safe_value'] : resumen($texto)); 71 | 72 | $block->content = theme( 73 | 'badistro_bloques_texto', 74 | array( 75 | 'tag' => theme( 76 | 'html_tag', 77 | array( 78 | 'element' => array( 79 | '#tag' => 'div', 80 | '#attributes' => array( 81 | 'class' => $conf['destacado'] ? 'lead' : '' 82 | ), 83 | '#value' => $texto, 84 | ), 85 | ) 86 | ) 87 | ) 88 | ); 89 | return $block; 90 | } 91 | 92 | function badistro_bloques_texto_admin_info($subtype, $conf, $contexts){ 93 | if (!empty($conf)) { 94 | $block = new stdClass; 95 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Texto'); 96 | $block->content = t('@texto.', array('@texto' => $conf['texto'])); 97 | return $block; 98 | } 99 | } 100 | function nodoDisponible($sobreescribir){ 101 | return (!$sobreescribir && arg(0) == 'node' && is_numeric(arg(1))); 102 | } 103 | function resumen($campo){ 104 | return empty($campo[0]['safe_summary']) ? views_trim_text(array('max_length' => 200, 'ellipsis' => TRUE, 'word_boundary' => TRUE,'html' => TRUE), $campo[0]['safe_value']) : $campo[0]['safe_summary']; 105 | } -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/plugins/content_types/titulo.inc: -------------------------------------------------------------------------------- 1 | TRUE, 5 | 'title' => t('Título'), 6 | 'description' => t('Crea un encabezado h1-h6.'), 7 | 'category' => t('BA Distro'), 8 | 'edit form' => 'badistro_bloques_titulo_edit_form', 9 | 'render callback' => 'badistro_bloques_titulo_render', 10 | 'admin info' => 'badistro_bloques_titulo_admin_info', 11 | 'defaults' => array( 12 | 'tag' => 'success', 13 | 'texto' => NULL, 14 | 'sobreescribir_titulo' => 0 15 | ) 16 | ); 17 | 18 | function badistro_bloques_titulo_edit_form($form, &$form_state){ 19 | $form['tag'] = array( 20 | '#title' => t('Tag'), 21 | '#type' => 'select', 22 | '#default_value' => $form_state['conf']['tag'], 23 | '#options' => array( 24 | 'h1' => t('H1'), 25 | 'h2' => t('H2'), 26 | 'h3' => t('H3'), 27 | 'h4' => t('H4'), 28 | 'h5' => t('H5'), 29 | 'h6' => t('H6'), 30 | ), 31 | ); 32 | 33 | $form['sobreescribir_titulo'] = array( 34 | '#title' => t('Sobreescribir título'), 35 | '#type' => 'checkbox', 36 | '#default_value' => $form_state['conf']['sobreescribir_titulo'], 37 | ); 38 | 39 | $form['texto'] = array( 40 | '#title' => t('Contenido'), 41 | '#type' => 'textfield', 42 | '#default_value' => $form_state['conf']['texto'], 43 | '#states' => array( 44 | 'disabled' => array( 45 | ':input[name="sobreescribir_titulo"]' => array('checked' => FALSE), 46 | ), 47 | 'required' => array( 48 | ':input[name="sobreescribir_titulo"]' => array('checked' => TRUE), 49 | ) 50 | ), 51 | ); 52 | 53 | return $form; 54 | } 55 | 56 | /** 57 | * The submit form stores the data in $conf. 58 | */ 59 | function badistro_bloques_titulo_edit_form_submit($form, &$form_state) { 60 | foreach (array_keys($form_state['plugin']['defaults']) as $key) { 61 | if (isset($form_state['values'][$key])) { 62 | $form_state['conf'][$key] = $form_state['values'][$key]; 63 | } 64 | } 65 | } 66 | 67 | function badistro_bloques_titulo_render($subtype, $conf, $panel_args, $context = NULL){ 68 | $block = new stdClass(); 69 | $block->title = ''; 70 | $node = tituloDeNodoDisponible($conf['sobreescribir_titulo']) ? node_load(arg(1)) : ''; 71 | $block->content = theme( 72 | 'badistro_bloques_titulo', 73 | array( 74 | 'tag' => theme('html_tag', array('element' => array('#tag' => $conf['tag'], '#attributes' => array('class' => 'activities-sidbar'), '#value' => tituloDeNodoDisponible($conf['sobreescribir_titulo']) ? $node->title : $conf['texto'], 75 | ), 76 | ) 77 | ) 78 | ) 79 | ); 80 | return $block; 81 | } 82 | 83 | function tituloDeNodoDisponible($sobreescribir){ 84 | return (!$sobreescribir && arg(0) == 'node' && is_numeric(arg(1))); 85 | } 86 | 87 | function badistro_bloques_titulo_admin_info($subtype, $conf, $contexts){ 88 | if (!empty($conf)) { 89 | $block = new stdClass; 90 | $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Título'); 91 | $block->content = t('@texto.', array('@texto' => $conf['texto'])); 92 | return $block; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_alerta.tpl.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_categoria_noticia.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_costo.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
Costo del trámite
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_links_relacionados.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 11 |
12 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_paginas_relacionadas.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 11 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_requisitos.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Requisitos

4 |
5 |
6 |

7 |
8 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_siglas_area.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_tags.tpl.php: -------------------------------------------------------------------------------- 1 | 0) { ?> 2 |
3 |
Etiquetas
4 |
5 | 6 | 7 | 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_campo_tipo_tramite.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |

Tipo de trámite

6 |
7 |
8 | 9 |
10 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_carrousel.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_galeria_imagenes_min.tpl.php: -------------------------------------------------------------------------------- 1 | $row) { ?> 2 |
3 | $item) { ?> 4 |
5 | 6 |
7 | 8 |
9 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_galeria_imagenes_min_item.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 10 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_imagen_destacada.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

6 |

7 |
8 |
9 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_links.tpl.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/argob/AR-Distro/fc01a64de9273481221721c3888d0528fcdf499a/modules/custom/badistro_bloques/templates/badistro_bloques_links.tpl.php -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_con_imagen_horizontal.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | $row) { ?> 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_con_imagen_horizontal_item.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |

7 |

8 |
9 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_con_imagen_vertical.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | $link) { ?> 3 |
4 | 5 |
6 | 7 |
8 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_con_imagen_vertical_item.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |

7 |

8 |
9 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_destacado_horizontal.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 |
8 | $row) { ?> 9 |
10 | 11 | 12 | 13 |
14 | 15 |
16 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_destacado_horizontal_item.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |

4 | 5 |

6 | 7 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_destacado_vertical.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 |
8 | $row) { ?> 9 |
10 |
11 | 12 | 13 | 14 |
15 |
16 | 17 |
18 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_destacado_vertical_item.tpl.php: -------------------------------------------------------------------------------- 1 |

2 |

3 | 4 |

5 | 6 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_horizontal.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | 13 | 14 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_horizontal_item.tpl.php: -------------------------------------------------------------------------------- 1 |

2 |

-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_vacio.tpl.php: -------------------------------------------------------------------------------- 1 |

2 |
3 | 4 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_vertical.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | 9 | 10 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_listado_vertical_item.tpl.php: -------------------------------------------------------------------------------- 1 |

-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_redes_sociales_compartir.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 | 5 |
6 | Tweet 7 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_redes_sociales_timeline_facebook.tpl.php: -------------------------------------------------------------------------------- 1 |

2 |
3 |
4 |
5 | Facebook 6 |
7 |
8 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_redes_sociales_timeline_twitter.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | Tweets por el array('target' => '_blank'))); ?> 3 | -------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_separador.tpl.php: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_shortcut.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |

6 |

7 |
-------------------------------------------------------------------------------- /modules/custom/badistro_bloques/templates/badistro_bloques_texto.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/custom/badistro_cck/badistro_cck.features.fe_block_settings.inc: -------------------------------------------------------------------------------- 1 | -1, 17 | 'custom' => 0, 18 | 'delta' => 'devel', 19 | 'module' => 'menu', 20 | 'node_types' => array(), 21 | 'pages' => '', 22 | 'roles' => array(), 23 | 'themes' => array( 24 | 'adminimal' => array( 25 | 'region' => '', 26 | 'status' => 0, 27 | 'theme' => 'adminimal', 28 | 'weight' => 0, 29 | ), 30 | 'badistrotheme' => array( 31 | 'region' => '', 32 | 'status' => 0, 33 | 'theme' => 'badistrotheme', 34 | 'weight' => 0, 35 | ), 36 | ), 37 | 'title' => '', 38 | 'visibility' => 0, 39 | ); 40 | 41 | $export['menu-menu-acerca-de-este-sitio'] = array( 42 | 'cache' => -1, 43 | 'custom' => 0, 44 | 'delta' => 'menu-acerca-de-este-sitio', 45 | 'module' => 'menu', 46 | 'node_types' => array(), 47 | 'pages' => '', 48 | 'roles' => array(), 49 | 'themes' => array( 50 | 'adminimal' => array( 51 | 'region' => '', 52 | 'status' => 0, 53 | 'theme' => 'adminimal', 54 | 'weight' => 0, 55 | ), 56 | 'badistrotheme' => array( 57 | 'region' => 'footer_left', 58 | 'status' => 1, 59 | 'theme' => 'badistrotheme', 60 | 'weight' => -11, 61 | ), 62 | ), 63 | 'title' => '', 64 | 'visibility' => 0, 65 | ); 66 | 67 | $export['menu-menu-paginas-relacionadas'] = array( 68 | 'cache' => -1, 69 | 'custom' => 0, 70 | 'delta' => 'menu-paginas-relacionadas', 71 | 'module' => 'menu', 72 | 'node_types' => array(), 73 | 'pages' => '', 74 | 'roles' => array(), 75 | 'themes' => array( 76 | 'adminimal' => array( 77 | 'region' => '', 78 | 'status' => 0, 79 | 'theme' => 'adminimal', 80 | 'weight' => 0, 81 | ), 82 | 'badistrotheme' => array( 83 | 'region' => 'footer_right', 84 | 'status' => 1, 85 | 'theme' => 'badistrotheme', 86 | 'weight' => 0, 87 | ), 88 | ), 89 | 'title' => '', 90 | 'visibility' => 0, 91 | ); 92 | 93 | $export['menu-menu-redes-sociales'] = array( 94 | 'cache' => -1, 95 | 'custom' => 0, 96 | 'delta' => 'menu-redes-sociales', 97 | 'module' => 'menu', 98 | 'node_types' => array(), 99 | 'pages' => '', 100 | 'roles' => array(), 101 | 'themes' => array( 102 | 'adminimal' => array( 103 | 'region' => '', 104 | 'status' => 0, 105 | 'theme' => 'adminimal', 106 | 'weight' => 0, 107 | ), 108 | 'badistrotheme' => array( 109 | 'region' => 'footer_left', 110 | 'status' => 1, 111 | 'theme' => 'badistrotheme', 112 | 'weight' => -12, 113 | ), 114 | ), 115 | 'title' => '', 116 | 'visibility' => 0, 117 | ); 118 | 119 | $export['search-form'] = array( 120 | 'cache' => -1, 121 | 'custom' => 0, 122 | 'delta' => 'form', 123 | 'module' => 'search', 124 | 'node_types' => array(), 125 | 'pages' => '', 126 | 'roles' => array(), 127 | 'themes' => array( 128 | 'adminimal' => array( 129 | 'region' => 'dashboard_inactive', 130 | 'status' => 1, 131 | 'theme' => 'adminimal', 132 | 'weight' => 0, 133 | ), 134 | 'badistrotheme' => array( 135 | 'region' => 'header_right', 136 | 'status' => 1, 137 | 'theme' => 'badistrotheme', 138 | 'weight' => 0, 139 | ), 140 | ), 141 | 'title' => '', 142 | 'visibility' => 0, 143 | ); 144 | 145 | $export['system-main'] = array( 146 | 'cache' => -1, 147 | 'custom' => 0, 148 | 'delta' => 'main', 149 | 'module' => 'system', 150 | 'node_types' => array(), 151 | 'pages' => '', 152 | 'roles' => array(), 153 | 'themes' => array( 154 | 'adminimal' => array( 155 | 'region' => 'content', 156 | 'status' => 1, 157 | 'theme' => 'adminimal', 158 | 'weight' => 0, 159 | ), 160 | 'badistrotheme' => array( 161 | 'region' => 'content', 162 | 'status' => 1, 163 | 'theme' => 'badistrotheme', 164 | 'weight' => 0, 165 | ), 166 | ), 167 | 'title' => '', 168 | 'visibility' => 0, 169 | ); 170 | 171 | $export['system-main-menu'] = array( 172 | 'cache' => -1, 173 | 'custom' => 0, 174 | 'delta' => 'main-menu', 175 | 'module' => 'system', 176 | 'node_types' => array(), 177 | 'pages' => '', 178 | 'roles' => array(), 179 | 'themes' => array( 180 | 'adminimal' => array( 181 | 'region' => '', 182 | 'status' => 0, 183 | 'theme' => 'adminimal', 184 | 'weight' => 0, 185 | ), 186 | 'badistrotheme' => array( 187 | 'region' => 'header_left', 188 | 'status' => 1, 189 | 'theme' => 'badistrotheme', 190 | 'weight' => 0, 191 | ), 192 | ), 193 | 'title' => '', 194 | 'visibility' => 0, 195 | ); 196 | 197 | $export['system-management'] = array( 198 | 'cache' => -1, 199 | 'custom' => 0, 200 | 'delta' => 'management', 201 | 'module' => 'system', 202 | 'node_types' => array(), 203 | 'pages' => '', 204 | 'roles' => array(), 205 | 'themes' => array( 206 | 'adminimal' => array( 207 | 'region' => '', 208 | 'status' => 0, 209 | 'theme' => 'adminimal', 210 | 'weight' => 0, 211 | ), 212 | 'badistrotheme' => array( 213 | 'region' => '', 214 | 'status' => 0, 215 | 'theme' => 'badistrotheme', 216 | 'weight' => 0, 217 | ), 218 | ), 219 | 'title' => '', 220 | 'visibility' => 0, 221 | ); 222 | 223 | $export['system-navigation'] = array( 224 | 'cache' => -1, 225 | 'custom' => 0, 226 | 'delta' => 'navigation', 227 | 'module' => 'system', 228 | 'node_types' => array(), 229 | 'pages' => '', 230 | 'roles' => array(), 231 | 'themes' => array( 232 | 'adminimal' => array( 233 | 'region' => '', 234 | 'status' => 0, 235 | 'theme' => 'adminimal', 236 | 'weight' => 0, 237 | ), 238 | 'badistrotheme' => array( 239 | 'region' => '', 240 | 'status' => 0, 241 | 'theme' => 'badistrotheme', 242 | 'weight' => 0, 243 | ), 244 | ), 245 | 'title' => '', 246 | 'visibility' => 0, 247 | ); 248 | 249 | $export['system-user-menu'] = array( 250 | 'cache' => -1, 251 | 'custom' => 0, 252 | 'delta' => 'user-menu', 253 | 'module' => 'system', 254 | 'node_types' => array(), 255 | 'pages' => '', 256 | 'roles' => array(), 257 | 'themes' => array( 258 | 'adminimal' => array( 259 | 'region' => '', 260 | 'status' => 0, 261 | 'theme' => 'adminimal', 262 | 'weight' => 0, 263 | ), 264 | 'badistrotheme' => array( 265 | 'region' => '', 266 | 'status' => 0, 267 | 'theme' => 'badistrotheme', 268 | 'weight' => 0, 269 | ), 270 | ), 271 | 'title' => '', 272 | 'visibility' => 0, 273 | ); 274 | 275 | return $export; 276 | } 277 | -------------------------------------------------------------------------------- /modules/custom/badistro_cck/badistro_cck.features.filter.inc: -------------------------------------------------------------------------------- 1 | 'filtered_html', 16 | 'name' => 'Filtered HTML', 17 | 'cache' => 1, 18 | 'status' => 1, 19 | 'weight' => 0, 20 | 'filters' => array( 21 | 'filter_url' => array( 22 | 'weight' => 0, 23 | 'status' => 1, 24 | 'settings' => array( 25 | 'filter_url_length' => 72, 26 | ), 27 | ), 28 | 'filter_html' => array( 29 | 'weight' => 1, 30 | 'status' => 1, 31 | 'settings' => array( 32 | 'allowed_html' => '