function display($tpl = null)
 {
     $option = JRequest::getCMD('option');
     $mainframe = JFactory::getApplication();
     $app =& JFactory::getApplication();
     $helper = new comZonalesHelper();
     // url de retorno según sección del menu actual
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $return = $item ? $item->link . '&Itemid=' . $item->id : 'index.php';
     // si debe retornarse una respuesta mediante ajax
     $this->ajax = JRequest::getBool('ajax');
     $this->task = JRequest::getBool('ajax') ? 'setZonalAjax' : 'setZonal';
     $zName = $helper->getZonal();
     $this->zonal = is_object($zName) ? $zName->name : $zName;
     // parametros - alto y ancho
     $zonalesParams =& JFactory::getApplication('site')->getParams('com_zonales');
     $this->width = $zonalesParams->get('width_mapa_flash', '');
     $this->height = $zonalesParams->get('height_mapa_flash', '');
     $this->flashfile = $zonalesParams->get('flash_file', '');
     $this->assignRef('j2f', $helper->getZif2SifMap());
     $this->assignRef('template', $app->getTemplate());
     $this->assignRef('return', $return);
     parent::display($tpl);
 }
/**
 * Retorna un join para buscar artículos asociados al zonal actual
 * @return string sentencia inner join para utilizar en un where
 */
function _buildCustomPropertiesJoin()
{
    $join = ' INNER JOIN #__custom_properties p ON a.id = p.content_id';
    $helper = new comZonalesHelper();
    $zonal = $helper->getZonal();
    if ($zonal) {
        $join .= ' AND p.field_id = ' . $zonal->id;
    }
    return $join;
}
Beispiel #3
0
 /**
  * Genera un inner join con la tabla #__custom_properties, para usar
  * en un SELECT que requiera filtrar tambien por el zonal actual:
  *
  * INNER JOIN #__custom_properties <alias> ON  <id_field> = <alias>.content_id'
  *            AND <alias>.field_id = <zonal>;
  *
  * @param String $id_field id de la tabla
  * @param String $alias alias para la tabla #__custom_properties, por defecto jcp
  * @param String $ref_table tabla en donde esta el contenido marcado, por defecto 'content'
  * @return String sentencia inner join
  */
 function _buildCustomPropertiesJoinByTable($id_field, $ref_table = 'content', $alias = 'jcp')
 {
     $join = ' INNER JOIN #__custom_properties ' . $alias . ' ON ' . $id_field . ' = ' . $alias . '.content_id' . ' AND ' . $alias . '.ref_table = \'' . $ref_table . '\' ';
     $helper = new comZonalesHelper();
     $zonal = $helper->getZonal();
     if ($zonal) {
         $join .= ' AND ' . $alias . '.field_id = ' . $zonal->id;
     }
     return $join;
 }
        $inputData[$provider->name][] = array('type' => $data[0], 'name' => $data[1], 'message' => $data[2], 'callback' => $data[3]);
    }
}
// averiguamos el zonal actual
$helper = new comZonalesHelper();
$zActual = $helper->getZonalActual();
//        $zName = $helper->getZonal($zActual);
//        $zonalCurrentMessage = ($zActual == NULL) ? JText::_('SYSTEM_ZONAL_CHOOSE') : $zName->label;
//        $zonalesParams = &JFactory::getApplication('site')->getParams('com_zonales');
//        $width = $zonalesParams->get('width_mapa_flash', '');
//        $height = $zonalesParams->get('height_mapa_flash', '');
$zonalUserMessage = JText::_('SYSTEM_ZONAL_CURRENT_MESSAGE');
$chooseZonalMessage = JText::_('SYSTEM_ZONAL_CHOOSE');
$chooseZonal = UserHelper::ZONAL_NOT_DEFINED;
$zonas = $helper->getValuesZonales();
$zonal = $helper->getZonal();
$selectedOption = 0;
$localidades = array();
$selectedParent = 0;
if ($zonal != null) {
    if ($zonal || $zonal->id != 0) {
        $selectedOption = $zonal->id;
    }
    $selectedParent = $zonal->parent_id;
}
// parametros
$root = $helper->getRoot();
// crea select de zonales disponibles
$parents = $helper->getItems($root);
$lists['provincias_select'] = JHTML::_('select.genericlist', $parents, 'reg_provincias', 'size="1" class="reg_provincias_select required"', 'id', 'label', $selectedParent);
$showColapsed = $params->get('show_colapsed');
Beispiel #5
0
<?php

require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
$helper = new comZonalesHelper();
//$view = 'component.php'; Comentado por Nacho
if (is_null($helper->getZonal()) && !$helper->isAuthenticationOnProgress() && $helper->showMap()) {
    // si no se ha seleccionado un zonal o no hay ninguna autenticacion en progreso
    //$view = 'component_map.php';
    $view = 'component.php';
} else {
    $view = 'component.php';
}
include dirname(__FILE__) . DIRECTORY_SEPARATOR . $view;