Example #1
0
 function _displayGmap($tpl = null)
 {
     $row = $this->Get('Data');
     //		echo '<pre>';print_r($row); echo '</pre>';exit;
     $address = array();
     if ($row->street) {
         $address[] = $row->street;
     }
     if ($row->city) {
         $address[] = $row->city;
     }
     if ($row->country) {
         $address[] = redEVENTHelperCountries::getCountryName($row->country);
     }
     $address = implode(',', $address);
     $resp = new stdclass();
     $resp->name = $row->venue;
     $resp->address = $address;
     $resp->latitude = $row->latitude || $row->longitude ? $row->latitude : 'null';
     $resp->longitude = $row->latitude || $row->longitude ? $row->longitude : 'null';
     if (function_exists('json_encode')) {
         echo json_encode($resp);
     } else {
         echo JText::_('COM_REDEVENT_ERROR_JSON_IS_NOT_ENABLED');
     }
     exit;
 }
Example #2
0
 function _displayGmap($tpl = null)
 {
     $params =& JFactory::getApplication()->getParams();
     JHTML::_('behavior.mootools');
     $document =& JFactory::getDocument();
     $document->addScript('http://maps.google.com/maps/api/js?sensor=false');
     $document->addScript(JURI::root() . '/components/com_redevent/assets/js/venuemap.js');
     JText::script("COM_REDEVENT_GET_DIRECTIONS");
     //add css file
     if (!$params->get('custom_css')) {
         $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css');
     } else {
         $document->addStyleSheet($params->get('custom_css'));
     }
     //Get Data from the model
     $row = $this->Get('Data');
     //		echo '<pre>';print_r($row); echo '</pre>';exit;
     $address = array();
     if ($row->street) {
         $address[] = $row->street;
     }
     if ($row->city) {
         $address[] = $row->city;
     }
     if ($row->country) {
         $address[] = redEVENTHelperCountries::getCountryName($row->country);
     }
     $address = implode(',', $address);
     JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, array('locdescription', 'locmage', 'countryimg', 'targetlink'));
     $row->target = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $row->slug);
     $this->assignRef('row', $row);
     $this->assignRef('address', $address);
     parent::display($tpl);
 }
Example #3
0
 /**
  * Method to get the Venues
  *
  * @access public
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $menu->getParams($item->id);
     $elsettings =& redEVENTHelper::config();
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         // Get a reference to the global cache object.
         $cache =& JFactory::getCache('redevent');
         $this->_data = $cache->call(array('RedeventModelCountriesmap', '_getResultList'), $query);
         $countrycoords = redEVENTHelperCountries::getCountrycoordArray();
         $k = 0;
         for ($i = 0; $i < count($this->_data); $i++) {
             $country =& $this->_data[$i];
             $country->flag = REOutput::getFlag($country->iso2);
             $country->flagurl = REOutput::getFlagUrl($country->iso2);
             $country->latitude = $countrycoords[$country->iso2][0];
             $country->longitude = $countrycoords[$country->iso2][1];
             //create target link
             $country->targetlink = JRoute::_(JURI::base() . 'index.php?option=com_redevent&view=countryevents&filter_country=' . $country->iso2);
             $k = 1 - $k;
         }
     }
     return $this->_data;
 }
Example #4
0
        ?>
    			</dd>
				<?php 
    }
    ?>

				<?php 
    if ($this->row->country) {
        ?>
				<dt class="venue_country"><?php 
        echo JText::_('COM_REDEVENT_COUNTRY') . ':';
        ?>
</dt>
    			<dd class="venue_country">
    				<?php 
        echo redEVENTHelperCountries::getCountryFlag($this->row->country);
        ?>
    			</dd>
    		<?php 
    }
    ?>
		</dl>

		<?php 
    if ($this->row->locdescription) {
        ?>
			<h2 class="location_desc"><?php 
        echo JText::_('COM_REDEVENT_DESCRIPTION');
        ?>
</h2>
  			<div class="description location_desc">
Example #5
0
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $params = JComponentHelper::getParams('com_redevent');
     // Load pane behavior
     jimport('joomla.html.pane');
     JHTML::_('behavior.framework');
     //initialise variables
     $editor =& JFactory::getEditor();
     $document =& JFactory::getDocument();
     $pane =& JPane::getInstance('sliders');
     $tabs =& JPane::getInstance('tabs');
     $user =& JFactory::getUser();
     $settings = JComponentHelper::getParams('com_redevent');
     //get vars
     $cid = JRequest::getVar('cid');
     $url = JURI::root();
     $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_EDITVENUE'));
     //add css and js to document
     $document->addScript('../includes/js/joomla/popup.js');
     $document->addStyleSheet('../includes/js/joomla/popup.css');
     $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css');
     $document->addScript($url . '/components/com_redevent/assets/js/attachments.js');
     $document->addScriptDeclaration('var removemsg = "' . JText::_('COM_REDEVENT_ATTACHMENT_CONFIRM_MSG') . '";');
     // Get data from the model
     $model =& $this->getModel();
     $row =& $this->get('Data');
     // fail if checked out not by 'me'
     if ($row->id) {
         if ($model->isCheckedOut($user->get('id'))) {
             JError::raiseWarning('REDEVENT_GENERIC_ERROR', $row->venue . ' ' . JText::_('COM_REDEVENT_EDITED_BY_ANOTHER_ADMIN'));
             $mainframe->redirect('index.php?option=com_redevent&view=venues');
         }
     }
     $task = JRequest::getVar('task');
     //create the toolbar
     if ($task == 'copy') {
         JToolBarHelper::title(JText::_('COM_REDEVENT_COPY_VENUE'), 'venuesedit');
     } elseif ($cid) {
         JToolBarHelper::title(JText::_('COM_REDEVENT_EDIT_VENUE'), 'venuesedit');
         //makes data safe
         JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'locdescription');
     } else {
         JToolBarHelper::title(JText::_('COM_REDEVENT_ADD_VENUE'), 'venuesedit');
         //set the submenu
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT'), 'index.php?option=com_redevent');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_EVENTS'), 'index.php?option=com_redevent&view=events');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_VENUES'), 'index.php?option=com_redevent&view=venues');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_CATEGORIES'), 'index.php?option=com_redevent&view=categories');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_ARCHIVESCREEN'), 'index.php?option=com_redevent&view=archive');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_GROUPS'), 'index.php?option=com_redevent&view=groups');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_HELP'), 'index.php?option=com_redevent&view=help');
     }
     JToolBarHelper::apply();
     JToolBarHelper::spacer();
     JToolBarHelper::save();
     JToolBarHelper::spacer();
     JToolBarHelper::cancel();
     JToolBarHelper::spacer();
     //JToolBarHelper::help( 'el.editvenues', true );
     $lists = array();
     // categories selector
     $selected = array();
     foreach ((array) $row->categories as $cat) {
         $selected[] = $cat;
     }
     $lists['categories'] = JHTML::_('select.genericlist', (array) $this->get('Categories'), 'categories[]', 'class="inputbox" multiple="multiple" size="10"', 'value', 'text', $selected);
     $countries = array();
     $countries[] = JHTML::_('select.option', '', JText::_('COM_REDEVENT_Select_country'));
     $countries = array_merge($countries, redEVENTHelperCountries::getCountryOptions());
     $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox"', 'value', 'text', $row->country);
     unset($countries);
     $pinpointicon = REOutput::pinpointicon($row);
     if ($task == 'copy') {
         $row->id = null;
         $row->venue .= ' ' . JText::_('COM_REDEVENT_copy');
         $row->alias = '';
     }
     //assign data to template
     $this->assignRef('row', $row);
     $this->assignRef('pane', $pane);
     $this->assignRef('tabs', $tabs);
     $this->assignRef('editor', $editor);
     $this->assignRef('settings', $settings);
     $this->assignRef('params', $params);
     $this->assignRef('lists', $lists);
     $this->assignRef('imageselect', $imageselect);
     $this->assignRef('pinpointicon', $pinpointicon);
     $this->assignRef('access', redEVENTHelper::getAccesslevelOptions());
     $this->assignRef('form', $this->get('form'));
     parent::display($tpl);
 }
Example #6
0
				<?php 
                case 'country':
                    ?>
					<td class="re_country"><?php 
                    echo $row->country ? redEVENTHelperCountries::getShortCountryName($row->country) : '';
                    ?>
</td>
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'countryflag':
                    ?>
					<td class="re_countryflag"><?php 
                    echo $row->country ? redEVENTHelperCountries::getCountryFlag($row->country) : '';
                    ?>
</td>
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'state':
                    ?>
					<td class="re_state"><?php 
                    echo $row->state ? $this->escape($row->state) : '-';
                    ?>
</td>
				<?php 
                    break;
Example #7
0
 function _getTag_venue_countryflag()
 {
     return redEVENTHelperCountries::getCountryFlag($this->getEvent()->getData()->country);
 }
Example #8
0
 /**
  * get venues countries
  * @return array
  */
 function getCountries()
 {
     $venues = $this->getData();
     $countries = array();
     foreach ((array) $venues as $v) {
         $countries[] = $v->country;
     }
     if (!count($countries)) {
         return array();
     }
     $countries = array_unique($countries);
     $countrycoords = redEVENTHelperCountries::getCountrycoordArray();
     $res = array();
     foreach ($countries as $c) {
         $country = new stdclass();
         $country->name = redEVENTHelperCountries::getCountryName($c);
         $country->flag = redEVENTHelperCountries::getCountryFlag($c);
         $country->flagurl = redEVENTHelperCountries::getIsoFlag($c);
         $country->latitude = redEVENTHelperCountries::getLatitude($c);
         $country->longitude = redEVENTHelperCountries::getLongitude($c);
         $res[] = $country;
     }
     return $res;
 }
Example #9
0
 /**
  * Creates the output for venue submissions
  *
  * @since 0.5
  * @param int $tpl
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $editor =& JFactory::getEditor();
     $document =& JFactory::getDocument();
     $elsettings =& redEVENTHelper::config();
     $params =& $mainframe->getParams();
     $acl = UserAcl::getInstance();
     // Get requests
     $id = JRequest::getInt('id');
     if ($id && !$acl->canEditVenue($id)) {
         echo JText::_('COM_REDEVENT_USER_NOT_ALLOWED_TO_EDIT_THIS_VENUE');
         return;
     } else {
         if (!$id && !$acl->canAddVenue()) {
             echo JText::_('COM_REDEVENT_USER_NOT_ALLOWED_TO_ADD_VENUE');
             return;
         }
     }
     //Get Data from the model
     $row = $this->Get('Venue');
     JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'locdescription');
     JHTML::_('behavior.formvalidation');
     JHTML::_('behavior.tooltip');
     JHTML::_('behavior.mootools');
     //add css file
     if (!$params->get('custom_css')) {
         $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css');
     } else {
         $document->addStyleSheet($params->get('custom_css'));
     }
     $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->');
     $document->addScript('components/com_redevent/assets/js/attachments.js');
     $document->addScriptDeclaration('var removemsg = "' . JText::_('COM_REDEVENT_ATTACHMENT_CONFIRM_MSG') . '";');
     // Get the menu object of the active menu item
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $mainframe->getParams('com_redevent');
     $id ? $title = JText::_('COM_REDEVENT_EDIT_VENUE') : ($title = JText::_('COM_REDEVENT_ADD_VENUE'));
     //pathway
     $pathway =& $mainframe->getPathWay();
     $pathway->addItem($title, '');
     //Set Title
     $document->setTitle($title);
     //editor user
     //		$editoruser = ELUser::editoruser();
     $editoruser = true;
     //transform <br /> and <br> back to \r\n for non editorusers
     if (!$editoruser) {
         $row->locdescription = redEVENTHelper::br2break($row->locdescription);
     }
     //Get image
     $limage = redEVENTImage::flyercreator($row->locimage);
     //Set the info image
     $infoimage = JHTML::_('image', 'components/com_redevent/assets/images/icon-16-hint.png', JText::_('COM_REDEVENT_NOTES'));
     $lists = array();
     // categories selector
     $selected = array();
     foreach ((array) $row->categories as $cat) {
         $selected[] = $cat;
     }
     $options = (array) $this->get('CategoryOptions');
     $lists['categories'] = JHTML::_('select.genericlist', $options, 'categories[]', 'class="inputbox validate-categories" multiple="multiple" size="' . min(3, max(10, count($options))) . '"', 'value', 'text', $selected);
     // country
     $options = redEVENTHelperCountries::getCountryOptions('value', 'text', true);
     $lists['country'] = JHTML::_('select.genericlist', $options, 'country', '', 'value', 'text', $row->country);
     // published state selector
     $canpublish = $acl->canPublishVenue($id);
     $published = array(JHTML::_('select.option', '1', JText::_('COM_REDEVENT_PUBLISHED')), JHTML::_('select.option', '0', JText::_('COM_REDEVENT_UNPUBLISHED')));
     $lists['published'] = JHTML::_('select.radiolist', $published, 'published', '', 'value', 'text', $row->published);
     $this->assignRef('row', $row);
     $this->assignRef('editor', $editor);
     $this->assignRef('editoruser', $editoruser);
     $this->assignRef('limage', $limage);
     $this->assignRef('infoimage', $infoimage);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('lists', $lists);
     $this->assignRef('item', $item);
     $this->assignRef('params', $params);
     $this->assignRef('canpublish', $canpublish);
     $this->assignRef('access', redEVENTHelper::getAccesslevelOptions());
     parent::display($tpl);
 }