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); }
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); }
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); }
/** * 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; }
$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) { if ($zonal || $zonal->id != 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; }