Esempio n. 1
0
 function display($tpl = null)
 {
     $option = JRequest::getCMD('option');
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         // Redirect to login
         $uri = JFactory::getURI();
         $mainframe->redirect('index.php?option=com_users&view=login&return=' . base64_encode($uri), null);
         return;
     } else {
         $groups = JUserHelper::getUserGroups($user->get('id'));
         if (!in_array(4, $groups)) {
             JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
             return;
         }
     }
     $document =& JFactory::getDocument();
     //$document->addScript( '/media/system/js/viewutils.js');
     //$document->addScript('/media/system/js/mootools1.js');
     //$document->addStyleSheet('/media/system/css/global.css');
     //$document->addStyleSheet('/media/system/css/content.css');
     $document->addStylesheet('/media/system/css/ZoneStyle.css');
     $helper = new comZonalesHelper();
     $this->assignRef('template', $mainframe->getTemplate());
     $this->assignRef('user', $user);
     $host = 'localhost';
     $this->assignRef('tomcat_host', $host);
     $port = '38080';
     $this->assignRef('tomcat_port', $port);
     $this->assignRef('zonal_id', ucwords(str_replace("_", "+", $helper->getZonalActual())));
     parent::display($tpl);
 }
Esempio n. 2
0
 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;
}
Esempio n. 4
0
 function display($tpl = null)
 {
     $option = JRequest::getCMD('option');
     $mainframe = JFactory::getApplication();
     $app =& JFactory::getApplication();
     $helper = new comZonalesHelper();
     $this->assignRef('template', $app->getTemplate());
     $this->assignRef('zonales', $helper->getZonales());
     $this->assignRef('zonal_id', $helper->getZonalActual());
     parent::display($tpl);
 }
Esempio n. 5
0
 function display($tpl = null)
 {
     $option = JRequest::getCMD('option');
     $mainframe = JFactory::getApplication();
     $document =& JFactory::getDocument();
     //$document->addScript( '/media/system/js/viewutils.js');
     //$document->addScript( '/media/system/js/zgram.js');
     //$document->addScript('/media/system/js/mootools1.js');
     //$document->addStyleSheet('/media/system/css/global.css');
     //$document->addStyleSheet('/media/system/css/content.css');
     $document->addStyleSheet('/media/system/css/ZoneStyle.css');
     $app =& JFactory::getApplication();
     $helper = new comZonalesHelper();
     $this->assignRef('template', $app->getTemplate());
     $this->assignRef('zonal_id', ucwords(str_replace("_", "+", $helper->getZonalActual())));
     parent::display($tpl);
 }
Esempio n. 6
0
 /**
  * Una vez que el contenido es creado o actualizado, se reindexa el contenido
  * en Solr.
  *
  * @param 	object		A JTableContent object
  * @param 	bool		If the content is just about to be created
  * @return	void
  */
 function onAfterContentSave(&$article = null, $isNew = null)
 {
     $user =& JFactory::getUser();
     global $cp_config;
     include_once JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_customproperties' . DS . 'cp_config.php';
     if ($user->get('gid') < $cp_config['publishing_group']) {
         $app = JFactory::getApplication();
         if ($app->isAdmin()) {
             $file = '..' . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
         } else {
             $file = 'components' . DS . 'com_zonales' . DS . 'helper.php';
         }
         require_once $file;
         $helper = new comZonalesHelper();
         $zonal = $helper->getZonalActual();
         $query = "REPLACE INTO #__custom_properties (ref_table, content_id,field_id,value_id)\n\t\t\t\t\t\n                                        SELECT 'content','{$article->id}',v.field_id, ae.value\n                                            FROM #__aapu_attribute_entity ae join #__aapu_attributes a ON(a.id = ae.attribute_id) JOIN #__custom_properties_values v ON(v.id = ae.value)\n                                            WHERE a.name = 'zonal'\n                                            AND ae.object_type = 'TABLE'\n                                            AND ae.object_name = '#__users'\n                                            AND ae.object_id = " . $user->get('id');
         $database = JFactory::getDBO();
         $database->setQuery($query);
         $database->query();
     }
     return true;
 }
Esempio n. 7
0
 /**
  * Genera un select html listando todos los values que sean hijos directos
  * del tag con el identificador $id.
  *
  * @param int $id identificador tag padre
  * @param string $name id y nombre del select html
  * @return String select html
  */
 function getItemsAjax($id = null, $name = null, $selected = null, $class = null)
 {
     if (is_null($id)) {
         $id = JRequest::getVar('id', NULL, 'get', 'int');
     }
     if (is_null($name)) {
         $name = JRequest::getVar('name', NULL, 'get', 'string');
     }
     if (is_null($selected)) {
         $selected = JRequest::getVar('selected', NULL, 'get', 'string');
     }
     if (is_null($class)) {
         $class = JRequest::getVar('class', 'item_ajax_select', 'get', 'string');
     }
     // helper zonales
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
     $helper = new comZonalesHelper();
     $parents = $helper->getItems($id);
     echo JHTML::_('select.genericlist', $parents, $name, 'size="1" class="' . $class . ' required"', 'id', 'label', $selected);
     return;
 }
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
require JPATH_BASE . DS . 'components' . DS . 'com_eqzonales' . DS . 'helper.php';
require_once JPATH_BASE . DS . 'components' . DS . 'com_eqzonales' . DS . 'controllers' . DS . 'eq.php';
require_once JPATH_BASE . DS . 'components' . DS . 'com_eqzonales' . DS . 'controllers' . DS . 'band.php';
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'helper' . DS . 'helper.php';
JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'tables');
setlocale(LC_ALL, 'es_AR.utf8');
setlocale(LC_ALL, "es_ES@america", "es_ES", "buenos_aires");
$eq_z_com = new EqZonalesControllerEq();
$eq_z_com->addModelPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'models');
$user =& JFactory::getUser();
$eq_actual = $eq_z_com->retrieveUserEqImpl($user->id);
if (!$zonal) {
    $zonal_com = new comZonalesHelper();
    $zonal_actual_label = $zonal_com->getZonalActualLabel();
} else {
    $zonal_actual_label = $zonal->label;
}
include 'nocache.php';
$mainframe = JFactory::getApplication();
?>
<!-- 26042011 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo $this->language;
?>
" lang="<?php 
echo $this->language;
?>
Esempio n. 9
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;
<?php

// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
// parametros
$showHeader = $params->get('show_header');
$useCustomHeader = $params->get('custom_header');
$customHeaderText = $params->get('header_text');
$useSubmitButton = $params->get('use_submit_button');
// lista de zonales, zonal actualmente seleccionado
$helper = new comZonalesHelper();
$zonales =& $helper->getZonales();
$zonal = $helper->getZonal();
// js
$js = !$useSubmitButton ? 'OnChange="document.setZonalModForm.submit()"' : '';
// crea opcion nula para el select
$blank_option[] = JHTML::_('select.option', '', JText::_('SELECCIONE_ZONAL'), 'name', 'label');
// crea select de zonales disponibles
$zonales_list = array_merge($blank_option, $zonales);
$lists['zonales_select'] = JHTML::_('select.genericlist', $zonales_list, 'zname', 'class="cmb" size="1" ' . $js, 'name', 'label', $zonal->name);
// template
$app =& JFactory::getApplication();
$template = $app->getTemplate();
// 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';
require JModuleHelper::getLayoutPath('mod_seleccionazonal');
 * @package	Zonales
 * @copyright	Copyright (C) 2009 Mediabit. All rights reserved.
 * @license	GNU/GPL, see LICENSE.php
 *
 * Zonales is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
jimport('joomla.filesystem.file');
// parametros
$showLabel = $params->get('show_label', 'show_label');
$labelText = $params->get('label_text', 'label_text');
// lista de zonales, zonal actualmente seleccionado
$helper = new comZonalesHelper();
$zonal = $helper->getZonal();
$zonalName = $zonal ? $zonal->label : $params->get('nozonal_text');
// template
$app =& JFactory::getApplication();
$template = $app->getTemplate();
// valores para los parametros del template
$tparams = new JParameter(JFile::read(JPATH_BASE . DS . 'templates' . DS . $template . DS . 'params.ini'));
$mainColor = $tparams->get('mainColor', null);
if ($mainColor) {
    $mainColor = '_' . $mainColor;
}
require JModuleHelper::getLayoutPath('mod_zonalactual');
Esempio n. 12
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     // Initialize some variables
     $user =& JFactory::getUser();
     $uri =& JFactory::getURI();
     $document =& JFactory::getDocument();
     $pathway =& $mainframe->getPathway();
     // Get the menu item object
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // Get the page/component configuration
     $params = clone $mainframe->getParams('com_content');
     // Request variables
     $layout = JRequest::getCmd('layout');
     $task = JRequest::getCmd('task');
     // Parameters
     $params->def('num_leading_articles', 1);
     $params->def('num_intro_articles', 4);
     $params->def('num_columns', 2);
     $params->def('num_links', 4);
     $params->def('show_headings', 1);
     $params->def('show_pagination', 2);
     $params->def('show_pagination_results', 1);
     $params->def('show_pagination_limit', 1);
     $params->def('filter', 1);
     if ($params->def('filter_type', 'title') != 'hits' && $params->def('filter_type', 'title') != 'author') {
         $params->set('filter_type', 'title');
     }
     $intro = $params->get('num_intro_articles');
     $leading = $params->get('num_leading_articles');
     $links = $params->get('num_links');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     if ($layout == 'blog') {
         $default_limit = $intro + $leading + $links;
     } else {
         $params->def('display_num', $mainframe->getCfg('list_limit'));
         $default_limit = $params->get('display_num');
     }
     $limit = $mainframe->getUserStateFromRequest('com_content.' . $this->getLayout() . '.limit', 'limit', $default_limit, 'int');
     JRequest::setVar('limit', (int) $limit);
     $contentConfig =& JComponentHelper::getParams('com_content');
     $params->def('show_page_title', $contentConfig->get('show_title'));
     // Get some data from the model
     $items =& $this->get('Data');
     $total =& $this->get('Total');
     $category =& $this->get('Category');
     //add alternate feed link
     if ($params->get('show_feed_link', 1) == 1) {
         $link = '&format=feed&limitstart=';
         $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
         $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
         $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
         $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     }
     // Create a user access object for the user
     $access = new stdClass();
     $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all');
     $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own');
     $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all');
     // Set page title per category
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     /*if (is_object( $menu )) {
     			$menu_params = new JParameter( $menu->params );
     			if (!$menu_params->get( 'page_title')) {
     				$params->set('page_title',	$category->title);
     			}
     		} else {
     			$params->set('page_title',	$category->title);
     		}*/
     // Zonal - lista de zonales, zonal actualmente seleccionado
     require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
     $helper = new comZonalesHelper();
     $zonal = $helper->getZonalActualLabel();
     $banda = JRequest::getVar('banda', null);
     $document->setTitle(JText::_('Zonales - ') . ($zonal ? $zonal : JText::_('Portada')));
     $this->assignRef('zonal', $zonal);
     $this->assignRef('banda', $banda);
     //set breadcrumbs
     if (is_object($menu) && $menu->query['view'] != 'category') {
         $pathway->addItem($category->title, '');
     }
     // Prepare category description
     $category->description = JHTML::_('content.prepare', $category->description);
     $params->def('date_format', JText::_('DATE_FORMAT_LC2'));
     // Keep a copy for safe keeping this is soooooo dirty -- must deal with in a later version
     // @todo -- oh my god we need to find this reference issue in 1.6 :)
     $this->_params = $params->toArray();
     jimport('joomla.html.pagination');
     //In case we are in a blog view set the limit
     if ($layout == 'blog') {
         $pagination = new JPagination($total, $limitstart, $limit - $links);
     } else {
         $pagination = new JPagination($total, $limitstart, $limit);
     }
     $this->assign('total', $total);
     $this->assign('action', str_replace('&', '&amp;', $uri->toString()));
     $this->assignRef('items', $items);
     $this->assignRef('params', $params);
     $this->assignRef('category', $category);
     $this->assignRef('user', $user);
     $this->assignRef('access', $access);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
    function render($id, $value = null, $label = null, $required = null, $params = null)
    {
        $req = $required == null ? '' : $required == 0 ? '' : 'required';
        $req == 'required' ? $reqLabel = '*' : ($reqLabel = '');
        //$value = explode(',', $value);
        $attrib = array('class' => $req, 'onChange' => "validate_attr(attr_{$id})");
        // helper zonales
        require_once JPATH_ROOT . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
        //require_once (JPATH_BASE.DS.'components'.DS.'com_zonales'.DS.'controller.php');
        //$zController = new ZonalesController();
        $helper = new comZonalesHelper();
        $selection = new stdClass();
        $zonal = $helper->getZonalById($value);
        $localidades = array();
        if ($zonal != null) {
            $selectedOption = $zonal->id;
            $selectedParent = $zonal->parent_id;
        } else {
            $selectedOption = 0;
            $selectedParent = 0;
        }
        // parametros
        $root = $helper->getRoot();
        // crea select de zonales disponibles
        $parents = $helper->getItems($root);
        $provincias = JHTML::_('select.genericlist', $parents, 'aapu_provincias', 'size="1" class="aapu_provincias_select required"', 'id', 'label', $selectedParent);
        $return = '<div class="render">
                <div id="aapu_z_provincias_container">
                    <td class="key">
                        <p><label class="combo_zonal_label">Provincia</label></p>
                    </td>
                    <td colspan="2">' . $provincias . '
                    </td>
                </div>
                </tr>
                <tr>
                <div id="aapu_municipio_container" style="display: none;">
                    <td class="key">
                        <p><label class="combo_zonal_label">Municipio</label></p>
                    </td>
                    <td colspan="2">
                        <div id="aapu_z_localidad_container"></div>
                    </td>
                    <br/>
                </div>
            </div>
            <script language="javascript" type="text/javascript">
                <!--

                window.addEvent(\'domready\', function() {
                    $(\'aapu_provincias\').addEvent(\'change\', function() {
                        aapu_loadMunicipios();
                    });

                    aapu_loadMunicipios(' . $selectedOption . ');
                });

                function aapu_loadMunicipios(selected){
                    $(\'aapu_z_localidad_container\').empty().addClass(\'ajax-loading\');
                    var url=\'index.php?option=com_zonales&format=raw&task=getItemsAjax&id=\'+$(\'aapu_provincias\').value+\'&name=attr_' . $id . '&selected=\'+selected;
                    new Ajax(url, {
                        method: \'get\',
                        onComplete: function(response) {
                            $(\'aapu_z_localidad_container\').removeClass(\'ajax-loading\').setHTML(response);
                            $(\'aapu_municipio_container\').setStyle(\'display\',\'block\');
                        }
                    }).request();
                }
                //-->
            </script>';
        return $return;
    }
Esempio n. 14
0
 function getZCtx()
 {
     comZonalesHelper::getZCtx();
 }
$db->setQuery($selectProviders);
$providerslist = $db->loadObjectList();
// parsea e interpreta la entrada requerida por cada proveedor
// se lograra crear los elementos html necesarios de entrada
// (algo asi como armar la pantalla al vuelo ;)
$inputData = array();
foreach ($providerslist as $provider) {
    $req_inputs = explode('/', $provider->required_input);
    $inputData[$provider->name] = array();
    foreach ($req_inputs as $input) {
        $data = explode(':', $input);
        $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) {
Esempio n. 16
0
 function _buildQuery()
 {
     global $mainframe;
     // Get the page/component configuration
     $params =& $mainframe->getParams();
     // If voting is turned on, get voting data as well for the content items
     $voting = ContentHelperQuery::buildVotingQuery($params);
     // Get the WHERE and ORDER BY clauses for the query $where		= $this->_buildContentWhere();
     $orderby = $this->_buildContentOrderBy();
     // Custom Properties join
     $helper = new comZonalesHelper();
     $cpjoin = $helper->_buildCustomPropertiesJoin();
     $query = 'SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,' . ' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.attribs, a.hits, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access, cc.title AS category, s.title AS section,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,' . ' CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups' . $voting['select'] . ' FROM #__content AS a' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' LEFT JOIN #__sections AS s ON s.id = a.sectionid' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id' . $cpjoin . $voting['join'] . $where . ' GROUP BY a.id' . $orderby;
     return $query;
 }
if (!$user->guest) {
    // helper zonales
    require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
    // parametros
    $showColapsed = $params->get('show_colapsed');
    $showEmail = $params->get('show_email');
    $showPhone = $params->get('show_phone');
    $captchaTextNew = $params->get('captchaTextNew');
    $captchaTextSnd = $params->get('captchaTextSnd');
    $captchaTextImg = $params->get('captchaTextImg');
    $captchaTextHelp = $params->get('captchaTextHelp');
    $root = $params->get('root_value');
    $zonalesParams =& JFactory::getApplication('site')->getParams('com_zonales');
    $captcha_publickey = $zonalesParams->get('recaptcha_publickey', null);
    // lista de zonales, zonal actualmente seleccionado
    $helper = new comZonalesHelper();
    $selection = new stdClass();
    $zonales =& $helper->getZonales();
    $zonal = $helper->getZonal();
    $selectedOption = 0;
    $localidades = array();
    if (!$zonal || $zonal->id == 0) {
        $selection->id = 0;
        $selection->label = "Seleccione un partido";
        array_unshift($zonales, $selection);
    } else {
        $localidades = $helper->getFieldValues($zonal->id);
        $selectedOption = $zonal->id;
    }
    $parents = $helper->getItems($root);
    $lists['provincias_select'] = JHTML::_('select.genericlist', $parents, 'provincias_sc', 'size="1" class="provincias_select required"', 'id', 'label', $zonal ? $zonal->parent_id : 0);
Esempio n. 18
0
 function login($epUserdata = null)
 {
     $credentials = array();
     $options = array();
     if ($epUserdata == null) {
         // Check for request forgeries
         //JRequest::checkToken('request') or jexit( 'Invalid Token' );
         $credentials['provider'] = JRequest::getVar('provider', null, 'method', 'string');
         $credentials['username'] = JRequest::getVar('username', '', 'method', 'username');
         $credentials['userid'] = JRequest::getInt('userid', '0', 'method');
         $credentials['session'] = JRequest::getVar('session', '', 'method', 'string');
         $credentials['oauth_token'] = JRequest::getVar('oauth_token', '', 'method', 'string');
     } else {
         $credentials['provider'] = $epUserdata['epprovider'];
         $credentials['username'] = $epUserdata['epusername'];
         $options['userid'] = $epUserdata['userid'];
     }
     $credentials['provider'] = trim($credentials['provider']);
     $credentials['username'] = trim($credentials['username']);
     global $mainframe;
     $user =& JFactory::getUser();
     $registerNewAlias = !$user->guest;
     if ($return = JRequest::getVar('return', '', 'method', 'base64')) {
         $return = base64_decode($return);
         if (!JURI::isInternal($return)) {
             $return = '';
         }
     }
     $options['remember'] = JRequest::getBool('remember', false);
     $options['return'] = $return;
     $credentials['password'] = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
     # agregado por G2P
     $options['providerid'] = JRequest::getInt('providerid', '0', 'method');
     $options['externalid'] = JRequest::getVar('externalid', '', 'method', 'string');
     $options['email'] = JRequest::getVar('email', '', 'method', 'string');
     $options['label'] = JRequest::getVar('label', '', 'method', 'string');
     ##### testing ##########
     $db =& JFactory::getDBO();
     //preform the login action
     $error = $mainframe->login($credentials, $options);
     $this->endAuthentication();
     if (!JError::isError($error)) {
         // Redirect if the return url is not registration or login
         if (!$return) {
             $return = 'index.php?option=com_user';
         }
         if ($credentials['userid'] == 0) {
             $this->aliasreg($options['providerid'], $options['externalid'], $options['label'], $options['email']);
         } else {
             try {
                 $session =& JFactory::getSession();
                 $selectProvider = 'select p.id from #__providers p where p.name = "' . $credentials['provider'] . '"';
                 $db->setQuery($selectProvider);
                 $dbprovider = $db->loadObject();
                 $this->insertAlias(0, $credentials['userid'], $session->get('externalidentifier'), $dbprovider->id, $session->get('label'), $session->get('email'));
             } catch (Exception $ex) {
                 $message = JText::_("SYSTEM_ALIAS_REGISTERED");
                 UserHelper::showMessage(ERROR, $message);
             }
         }
         $zonal = UserHelper::getUsersZonal();
         require_once JPATH_ROOT . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
         comZonalesHelper::setZonal($zonal);
         $i18nKey = $registerNewAlias ? 'SYSTEM_MESSAGE_SUCCESS_ALIAS_ADDED' : 'SYSTEM_MESSAGE_SUCCESS_LOGIN';
         $message = JText::_($i18nKey);
         UserHelper::showMessage(SUCCESS, $message);
     } else {
         $i18nKey = $registerNewAlias ? 'SYSTEM_MESSAGE_ERROR_ALIAS_NOT_ADDED' : 'SYSTEM_MESSAGE_ERROR_LOGIN';
         $message = JText::_($i18nKey);
         UserHelper::showMessage(ERROR, $message);
     }
 }
<?php

// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
// parametros
$height = $params->get('height');
$width = $params->get('width');
$wmode = $params->get('wmode', false);
// template
$app =& JFactory::getApplication();
$template = $app->getTemplate();
$helper = new comZonalesHelper();
$j2f = $helper->getZif2SifMap();
require JModuleHelper::getLayoutPath('mod_mapainicio');
Esempio n. 20
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;
 }
Esempio n. 21
0
 /**
  * Genera los parámetros necesarios para recuperar los contenidos de acuerdo
  * a la configuración de Joomla: artículos publicados, nivel de acceso, etc.
  *
  * @global $mainframe
  * @return String query con parámetros solr para la búsqueda
  */
 function getWhere($stateFrom = '1', $stateTo = '1')
 {
     global $mainframe;
     // usuario
     $user =& JFactory::getUser();
     $gid = $user->get('aid', 0);
     // fecha
     $jnow =& JFactory::getDate();
     $now = $jnow->toMySQL();
     // Get the page/component configuration
     $params =& $mainframe->getParams();
     $noauth = !$params->get('show_noauth');
     //$nullDate = $this->_db->getNullDate();
     $where = "";
     // Does the user have access to view the items?
     if ($noauth) {
         $where .= "+access:[* TO {$gid}]";
     }
     $where .= "+state:[{$stateFrom} TO {$stateTo}]";
     $where .= '+(hasPublishUpDate:false OR publish_up:[* TO NOW])';
     $where .= '+(hasPublishDownDate:false OR publish_down:[NOW TO *])';
     // Zonal - lista de zonales, zonal actualmente seleccionado
     require_once JPATH_BASE . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
     $helper = new comZonalesHelper();
     $zonal = $helper->getZonalActual();
     // Si se recupera correctamente el zonal actual, se compone la lista
     // de zonales de preferencia para el usuario
     if ($zonal != null) {
         /*$localidades = $helper->getLocalidadesByPartido($zonal->id);
         
                     $localidadesList = array();
                     foreach($localidades as $localidad) {
                         $localidadesList[] = $localidad->name;
                     }*/
         $where .= "+tags_values:{$zonal}";
         //('.implode(" ",$localidadesList).')';
     } else {
         //si no estoy buscando la vista myarchive, agrego el tag de portada
         if (JRequest::getString('view', NULL, 'get') != 'myarchive') {
             $where .= '+tags_values:portada';
         }
     }
     return $where;
 }