function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialise variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $elsettings = JComponentHelper::getParams('com_redevent'); //get vars $filter_order = $mainframe->getUserStateFromRequest($option . '.archive.filter_order', 'filter_order', 'x.dates', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.archive.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter = $mainframe->getUserStateFromRequest($option . '.archive.filter', 'filter', '', 'int'); $filter = intval($filter); $search = $mainframe->getUserStateFromRequest($option . '.archive.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $mainframe->getTemplate(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_ARCHIVE')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); JHTML::_('behavior.tooltip'); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_ARCHIVESCREEN'), 'archive'); JToolBarHelper::customX('unarchive', 'redevent_unarchive', 'redevent_unarchive', JText::_('COM_REDEVENT_Unarchive'), true); JToolBarHelper::spacer(); JToolBarHelper::deleteList(); JToolBarHelper::spacer(); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } // Get data from the model $rows =& $this->get('Data'); //$total = & $this->get( 'Total'); $pageNav =& $this->get('Pagination'); //search filter $filters = array(); $filters[] = JHTML::_('select.option', '1', JText::_('COM_REDEVENT_EVENT_TITLE')); $filters[] = JHTML::_('select.option', '2', JText::_('COM_REDEVENT_VENUE')); $filters[] = JHTML::_('select.option', '3', JText::_('COM_REDEVENT_CITY')); $filters[] = JHTML::_('select.option', '4', JText::_('COM_REDEVENT_CATEGORY')); $lists['filter'] = JHTML::_('select.genericlist', $filters, 'filter', 'size="1" class="inputbox"', 'value', 'text', $filter); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; /* Venue and time details */ $eventvenues = $this->get('ArchiveEventVenues'); // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('user', $user); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('template', $template); $this->assignRef('eventvenues', $eventvenues); parent::display($tpl); }
/** * Logic for the Update Check * * @access public * @return object * @since 0.9 */ function getUpdatedata() { $elsettings = ELAdmin::config(); include_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'Snoopy.class.php'; $snoopy = new Snoopy(); //set the source file $file = 'http://update.schlu.net/elupdate.php'; $snoopy->read_timeout = 30; $snoopy->agent = "Mozilla/5.0 (compatible; Konqueror/3.2; Linux 2.6.2) (KHTML, like Gecko)"; $snoopy->fetch($file); $_updatedata = null; if ($snoopy->status != 200 || $snoopy->error) { $_updatedata->failed = 1; } else { $data = explode('|', $snoopy->results); $_updatedata->version = $data[0]; $_updatedata->versiondetail = $data[1]; $_updatedata->date = strftime($elsettings->formatdate, strtotime($data[2])); $_updatedata->info = $data[3]; $_updatedata->download = $data[4]; $_updatedata->notes = $data[5]; $_updatedata->changes = explode(';', $data[6]); $_updatedata->failed = 0; $_updatedata->current = version_compare('0.9.0.0.alpha', $_updatedata->version); } return $_updatedata; }
function display($tpl = null) { //Load pane behavior jimport('joomla.html.pane'); //initialise variables $document =& JFactory::getDocument(); $pane =& JPane::getInstance('sliders'); $user =& JFactory::getUser(); //build toolbar JToolBarHelper::title(JText::_('COM_REDEVENT'), 'home'); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } // Get data from the model $events =& $this->get('Eventsdata'); $venue =& $this->get('Venuesdata'); $category =& $this->get('Categoriesdata'); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_REDEVENT')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); //assign vars to the template $this->assignRef('pane', $pane); $this->assignRef('events', $events); $this->assignRef('venue', $venue); $this->assignRef('category', $category); $this->assignRef('user', $user); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialise variables $user =& JFactory::getUser(); $db =& JFactory::getDBO(); $document =& JFactory::getDocument(); JHTML::_('behavior.tooltip'); //get vars $filter_order = $mainframe->getUserStateFromRequest($option . '.categories.filter_order', 'filter_order', 'c.lft', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.categories.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $mainframe->getUserStateFromRequest($option . '.categories.filter_state', 'filter_state', '*', 'word'); $search = $mainframe->getUserStateFromRequest($option . '.categories.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_VENUESCATEGORIES')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_VENUES_CATEGORIES'), 'venuescategories'); JToolBarHelper::publishList(); JToolBarHelper::spacer(); JToolBarHelper::unpublishList(); JToolBarHelper::spacer(); JToolBarHelper::addNew(); JToolBarHelper::spacer(); JToolBarHelper::editList(); JToolBarHelper::spacer(); JToolBarHelper::deleteList(); JToolBarHelper::spacer(); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } //Get data from the model $rows =& $this->get('Data'); //$total = & $this->get( 'Total'); $pageNav =& $this->get('Pagination'); //publish unpublished filter $lists['state'] = JHTML::_('grid.state', $filter_state); // search filter $lists['search'] = $search; // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $ordering = $lists['order'] == 'c.ordering'; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('ordering', $ordering); $this->assignRef('user', $user); $this->assignRef('filter_order', $filter_order); parent::display($tpl); }
function check() { if (!$this->text_name) { $this->setError(JText::_('COM_REDEVENT_NAME_IS_REQUIRED')); return false; } // check tag unicity $exists = ELAdmin::checkTagExists($this->text_name); if ($exists && !($exists->section == 'library' && $exists->id == $this->id)) { $this->setError(JText::sprintf('COM_REDEVENT_ERROR_TAG_ALREADY_EXISTS', $exists->section)); return false; } return true; }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialise variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $group_id = JRequest::getVar('group_id', 0, '', 'int'); //get vars $filter_order = $mainframe->getUserStateFromRequest($option . '.groupmembers.filter_order', 'filter_order', 'name', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.groupmembers.filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . '.groupmembers.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $mainframe->getTemplate(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_GROUPMEMBERS')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); JHTML::_('behavior.tooltip'); // Get data from the model $rows =& $this->get('Data'); $group =& $this->get('Group'); $pageNav =& $this->get('Pagination'); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_GROUP_MEMBERS') . ' - ' . $group->name, 'accessgroups'); JToolBarHelper::custom('back', 'back', 'back', 'back', false); JToolBarHelper::addNew(); JToolBarHelper::spacer(); JToolBarHelper::editList(); JToolBarHelper::spacer(); JToolBarHelper::deleteList(); JToolBarHelper::spacer(); //JToolBarHelper::help( 'el.listgroups', true ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('user', $user); $this->assignRef('group_id', $group_id); parent::display($tpl); }
function display($tpl = null) { global $mainframe, $option; //initialise variables $db =& JFactory::getDBO(); $elsettings = ELAdmin::config(); $document =& JFactory::getDocument(); JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); //get var $filter_order = $mainframe->getUserStateFromRequest($option . '.eventelement.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.eventelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter = $mainframe->getUserStateFromRequest($option . '.eventelement.filter', 'filter', '', 'int'); $filter_state = $mainframe->getUserStateFromRequest($option . '.eventelement.filter_state', 'filter_state', '*', 'word'); $search = $mainframe->getUserStateFromRequest($option . '.eventelement.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $mainframe->getTemplate(); //prepare the document $document->setTitle(JText::_('SELECTEVENT')); $document->addStyleSheet('templates/' . $template . '/css/general.css'); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); //Get data from the model $rows =& $this->get('Data'); // $total = & $this->get( 'Total'); $pageNav =& $this->get('Pagination'); //publish unpublished filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; //Create the filter selectlist $filters = array(); $filters[] = JHTML::_('select.option', '1', JText::_('EVENT TITLE')); $filters[] = JHTML::_('select.option', '2', JText::_('VENUE')); $filters[] = JHTML::_('select.option', '3', JText::_('CITY')); $filters[] = JHTML::_('select.option', '4', JText::_('CATEGORY')); $lists['filter'] = JHTML::_('select.genericlist', $filters, 'filter', 'size="1" class="inputbox"', 'value', 'text', $filter); // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); parent::display($tpl); }
function display($tpl = null) { //Load filesystem folder and pane behavior jimport('joomla.html.pane'); jimport('joomla.filesystem.folder'); //initialise variables $document =& JFactory::getDocument(); $lang =& JFactory::getLanguage(); $pane =& JPane::getInstance('sliders'); $user =& JFactory::getUser(); //get vars $helpsearch = JRequest::getString('search'); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_HELP'), 'help'); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialise variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $url = JURI::root(); JHTML::_('behavior.mootools'); //prepare document $document->setTitle(JText::_('COM_REDEVENT_TOOLS_CSV')); //add css to document $document->addStyleSheet($url . '/administrator/components/com_redevent/assets/css/redeventbackend.css'); $document->addStyleSheet($url . '/administrator/components/com_redevent/assets/css/csvtool.css'); // js $document->addScript($url . '/administrator/components/com_redevent/assets/js/csvtool.js'); //Create Submenu ELAdmin::setMenu(); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_TOOLS_CSV'), 'tools'); JToolBarHelper::back(); $lists = array(); $forms = $this->get('FormOptions'); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_FORM'))); $options = array_merge($options, $forms); $lists['form_filter'] = JHTML::_('select.genericlist', $options, 'form_filter'); $forms = ELAdmin::getCategoriesOptions(); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_CATEGORY'))); $options = array_merge($options, $forms); $lists['category_filter'] = JHTML::_('select.genericlist', $options, 'category_filter'); $forms = ELAdmin::getVenuesOptions(); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_VENUE'))); $options = array_merge($options, $forms); $lists['venue_filter'] = JHTML::_('select.genericlist', $options, 'venue_filter'); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_STATE_PUBLISHED')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_STATE_ARCHIVED')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_STATE_ALL'))); $lists['state_filter'] = JHTML::_('select.genericlist', $options, 'state_filter'); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_ATTENDEES_STATE_ALL')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_ATTENDEES_STATE_ATTENDING')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_TOOLS_CSV_SELECT_ATTENDEES_STATE_WAITING'))); $lists['filter_attending'] = JHTML::_('select.genericlist', $options, 'filter_attending'); $this->assignRef('lists', $lists); parent::display($tpl); }
function display($tpl = null) { //initialise variables $document =& JFactory::getDocument(); $user =& JFactory::getUser(); //build toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_LOG'), 'log'); JToolBarHelper::custom('clearlog', 'delete', 'delete', 'Clear Log', false); //JToolBarHelper::help( 'el.intro', true ); //create the toolbar // Get data from the model $log =& $this->get('Data'); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_LOG')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); //assign vars to the template $this->assignRef('log', $log); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); //initialise variables $document =& JFactory::getDocument(); $user =& JFactory::getUser(); //only admins have access to this view if (!$user->authorise('com_redevent', 'manage')) { JError::raiseWarning('REDEVENT_GENERIC_ERROR', JText::_('COM_REDEVENT_ALERTNOTAUTH')); $mainframe->redirect('index.php?option=com_redevent&view=redevent'); } $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_TOOLS')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_Tools'), 'tools'); //JToolBarHelper::help( 'redevent.tools', true ); parent::display($tpl); }
/** * logic for uploading an image * * @access public * @return void * @since 0.9 */ function uploadimage() { global $mainframe; // Check for request forgeries JRequest::checkToken() or die('Invalid Token'); $elsettings = ELAdmin::config(); $file = JRequest::getVar('userfile', '', 'files', 'array'); $task = JRequest::getVar('task'); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); //$ftp = JClientHelper::getCredentials('ftp'); //set the target directory if ($task == 'venueimgup') { $base_Dir = JPATH_SITE . DS . 'images' . DS . 'eventlist' . DS . 'venues' . DS; } else { $base_Dir = JPATH_SITE . DS . 'images' . DS . 'eventlist' . DS . 'events' . DS; } //do we have an upload? if (empty($file['name'])) { echo "<script> alert('" . JText::_('IMAGE EMPTY') . "'); window.history.go(-1); </script>\n"; $mainframe->close(); } //check the image $check = ELImage::check($file, $elsettings); if ($check === false) { $mainframe->redirect($_SERVER['HTTP_REFERER']); } //sanitize the image filename $filename = ELImage::sanitize($base_Dir, $file['name']); $filepath = $base_Dir . $filename; //upload the image if (!JFile::upload($file['tmp_name'], $filepath)) { echo "<script> alert('" . JText::_('UPLOAD FAILED') . "'); window.history.go(-1); </script>\n"; $mainframe->close(); } else { echo "<script> alert('" . JText::_('UPLOAD COMPLETE') . "'); window.history.go(-1); window.parent.elSelectImage('{$filename}', '{$filename}'); </script>\n"; $mainframe->close(); } }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); $user =& JFactory::getUser(); $document =& JFactory::getDocument(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_PRICEGROUPS')); $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); // Set toolbar items for the page JToolBarHelper::title(JText::_('COM_REDEVENT_MENU_PRICEGROUPS'), 'pricegroups'); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); // Get data from the model //$model =& $this->getModel( ); //print_r($model); $items =& $this->get('Data'); $total =& $this->get('Total'); $pagination =& $this->get('Pagination'); ELAdmin::setMenu(); /* Call the state object */ $state =& $this->get('state'); $lists = array(); /* Get the values from the state object that were inserted in the model's construct function */ $lists['order_Dir'] = $state->get('filter_order_Dir'); $lists['order'] = $state->get('filter_order'); $lists['search'] = $state->get('search'); $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('request_url', $uri->toString()); parent::display($tpl); }
function _displayImport($tpl = null) { $document =& JFactory::getDocument(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_TEXTLIBRARY_IMPORT')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); JHTML::_('behavior.tooltip'); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_PAGETITLE_TEXTLIBRARY_IMPORT'), 'events'); JToolBarHelper::back(); $lists = array(); //assign data to template $this->assignRef('lists', $lists); parent::display($tpl); }
/** * Method to store the event * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { global $mainframe; $elsettings = ELAdmin::config(); $user =& JFactory::getUser(); $tzoffset = $mainframe->getCfg('offset'); $row =& JTable::getInstance('eventlist_events', ''); // Bind the form fields to the table if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } // Check/sanitize the metatags $row->meta_description = htmlspecialchars(trim(addslashes($row->meta_description))); if (JString::strlen($row->meta_description) > 255) { $row->meta_description = JString::substr($row->meta_description, 0, 254); } $row->meta_keywords = htmlspecialchars(trim(addslashes($row->meta_keywords))); if (JString::strlen($row->meta_keywords) > 200) { $row->meta_keywords = JString::substr($row->meta_keywords, 0, 199); } //Check if image was selected jimport('joomla.filesystem.file'); $format = JFile::getExt('JPATH_SITE/images/eventlist/events/' . $row->datimage); $allowable = array('gif', 'jpg', 'png'); if (in_array($format, $allowable)) { $row->datimage = $row->datimage; } else { $row->datimage = ''; } // sanitise id field $row->id = (int) $row->id; $nullDate = $this->_db->getNullDate(); // Are we saving from an item edit? if ($row->id) { $row->modified = gmdate('Y-m-d H:i:s'); $row->modified_by = $user->get('id'); } else { $row->modified = $nullDate; $row->modified_by = ''; //get IP, time and userid $row->created = gmdate('Y-m-d H:i:s'); $row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED'; $row->created_by = $user->get('id'); } // Make sure the data is valid if (!$row->check($elsettings)) { $this->setError($row->getError()); return false; } // Store the table to the database if (!$row->store(true)) { $this->setError($this->_db->getErrorMsg()); return false; } return $row->id; }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialise variables $db = JFactory::getDBO(); $settings = JComponentHelper::getParams('com_redevent'); $document = JFactory::getDocument(); $user = JFactory::getUser(); $state =& $this->get('State'); //get vars $filter_order = $state->get('filter_order'); $filter_order_Dir = $state->get('filter_order_Dir'); $xref = JRequest::getInt('xref'); // $search = $mainframe->getUserStateFromRequest( $option.'.attendees.search', 'search', '', 'string' ); // $search = $db->getEscaped( trim(JString::strtolower( $search ) ) ); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_REGISTRATIONS')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); // add javascript JHTML::_('behavior.modal', 'a.answersmodal'); //Create Submenu ELAdmin::setMenu(); //add toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_PAGETITLE_REGISTRATIONS'), 'registrations'); if ($state->get('filter_cancelled', 0) == 0) { JToolBarHelper::custom('cancelreg', 'cancel', 'cancel', 'COM_REDEVENT_ATTENDEES_TOOLBAR_CANCEL', true, true); } if ($state->get('filter_cancelled', 0) == 1) { JToolBarHelper::custom('uncancelreg', 'redrestore', 'redrestore', 'COM_REDEVENT_ATTENDEES_TOOLBAR_RESTORE', true, true); JToolBarHelper::deleteList(JText::_('COM_REDEVENT_ATTENDEES_DELETE_WARNING')); } JToolBarHelper::spacer(); JToolBarHelper::back(); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } // Get data from the model $rows = $this->get('Data'); $pageNav = $this->get('Pagination'); //build filter selectlist $filters = array(); // search filter // $lists['search'] = $search; // confirmed filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_ALL')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_CONFIRMED')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_UNCONFIRMED'))); $lists['filter_confirmed'] = JHTML::_('select.genericlist', $options, 'filter_confirmed', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_confirmed')); // waiting list filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_ALL')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_ATTENDING')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_WAITING'))); $lists['filter_waiting'] = JHTML::_('select.genericlist', $options, 'filter_waiting', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_waiting')); // cancelled filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_NOT_CANCELLED')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_CANCELLED')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_ALL'))); $lists['filter_cancelled'] = JHTML::_('select.genericlist', $options, 'filter_cancelled', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_cancelled')); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; //assign to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('user', $user); $this->assignRef('settings', $settings); $this->assignRef('cancelled', $state->get('filter_cancelled')); parent::display($tpl); }
/** * Method to store the venue * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { $elsettings = ELAdmin::config(); $user =& JFactory::getUser(); $config =& JFactory::getConfig(); $tzoffset = $config->getValue('config.offset'); $row =& $this->getTable('eventlist_venues', ''); // bind it to the table if (!$row->bind($data)) { JError::raiseError(500, $this->_db->getErrorMsg()); return false; } // Check if image was selected jimport('joomla.filesystem.file'); $format = JFile::getExt(JPATH_SITE . '/images/eventlist/venues/' . $row->locimage); $allowable = array('gif', 'jpg', 'png'); if (in_array($format, $allowable)) { $row->locimage = $row->locimage; } else { $row->locimage = ''; } // sanitise id field $row->id = (int) $row->id; $nullDate = $this->_db->getNullDate(); // Are we saving from an item edit? if ($row->id) { $row->modified = gmdate('Y-m-d H:i:s'); $row->modified_by = $user->get('id'); } else { $row->modified = $nullDate; $row->modified_by = ''; //get IP, time and userid $row->created = gmdate('Y-m-d H:i:s'); $row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED'; } //uppercase needed by mapservices if ($row->country) { $row->country = JString::strtoupper($row->country); } //update item order if (!$row->id) { $row->ordering = $row->getNextOrder(); } $row->version++; // Make sure the data is valid if (!$row->check($elsettings)) { $this->setError($row->getError()); return false; } // Store it in the db if (!$row->store()) { JError::raiseError(500, $this->_db->getErrorMsg()); return false; } return $row->id; }
/** * Prepares the upload image screen * * @param $tpl * * @since 0.9 */ function _displayuploadimage($tpl = null) { //initialise variables $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); $elsettings = ELAdmin::config(); //get vars $task = JRequest::getVar('task'); //add css $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); //assign data to template $this->assignRef('task', $task); $this->assignRef('elsettings', $elsettings); $this->assignRef('request_url', $uri->toString()); $this->assignRef('ftp', $ftp); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); $params =& JComponentHelper::getParams('com_redevent'); if ($this->getLayout() == 'print') { $this->_displayprint($tpl); return; } if ($this->getLayout() == 'move') { $this->_displaymove($tpl); return; } //initialise variables $db = JFactory::getDBO(); $elsettings = JComponentHelper::getParams('com_redevent'); $document = JFactory::getDocument(); $user = JFactory::getUser(); $state =& $this->get('State'); //get vars $filter_order = $mainframe->getUserStateFromRequest($option . '.attendees.filter_order', 'filter_order', 'u.username', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.attendees.filter_order_Dir', 'filter_order_Dir', '', 'word'); $xref = JRequest::getInt('xref'); // $search = $mainframe->getUserStateFromRequest( $option.'.attendees.search', 'search', '', 'string' ); // $search = $db->getEscaped( trim(JString::strtolower( $search ) ) ); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_ATTENDEES')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); // add javascript JHTML::_('behavior.modal', 'a.answersmodal'); //Create Submenu ELAdmin::setMenu(); //add toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_REGISTRATIONS'), 'registrations'); // JToolBarHelper::custom('submitters', 'redevent_submitters', 'redevent_submitters', JText::_('COM_REDEVENT_Attendees'), false); JToolBarHelper::custom('emailall', 'send.png', 'send.png', 'COM_REDEVENT_ATTENDEES_TOOLBAR_EMAIL_ALL', false, true); JToolBarHelper::custom('email', 'send.png', 'send.png', 'COM_REDEVENT_ATTENDEES_TOOLBAR_EMAIL_SELECTED', true, true); JToolBarHelper::spacer(); JToolBarHelper::addNew(); JToolBarHelper::editList(); JToolBarHelper::custom('move', 'move', 'move', 'COM_REDEVENT_ATTENDEES_TOOLBAR_MOVE', true, true); if ($state->get('filter_cancelled', 0) == 0) { JToolBarHelper::custom('cancelreg', 'cancel', 'cancel', 'COM_REDEVENT_ATTENDEES_TOOLBAR_CANCEL', true, true); } if ($state->get('filter_cancelled', 0) == 1) { JToolBarHelper::custom('uncancelreg', 'redrestore', 'redrestore', 'COM_REDEVENT_ATTENDEES_TOOLBAR_RESTORE', true, true); JToolBarHelper::deleteList(JText::_('COM_REDEVENT_ATTENDEES_DELETE_WARNING')); } JToolBarHelper::spacer(); JToolBarHelper::back(); JToolBarHelper::spacer(); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::preferences('com_redevent', '600', '800'); } // Get data from the model $rows = $this->get('Data'); $pageNav = $this->get('Pagination'); $event = $this->get('Event'); $form = $this->get('Form'); $rf_fields = $this->get('RedFormFrontFields'); $event->dates = redEVENTHelper::isValidDate($event->dates) ? strftime($elsettings->get('backend_formatdate', '%d.%m.%Y'), strtotime($event->dates)) : JText::_('COM_REDEVENT_OPEN_DATE'); //build filter selectlist $datetimelocation = $this->get('DateTimeLocation'); $filters = array(); foreach ($datetimelocation as $key => $value) { /* Get the date */ if (redEVENTHelper::isValidDate($value->dates)) { $date = strftime($elsettings->get('backend_formatdate', '%d.%m.%Y'), strtotime($value->dates)); $enddate = strftime($elsettings->get('backend_formatdate', '%d.%m.%Y'), strtotime($value->enddates)); $displaydate = $date . ' - ' . $enddate; } else { $displaydate = JText::_('COM_REDEVENT_OPEN_DATE'); } /* Get the time */ if ($value->times) { $time = strftime($elsettings->get('formattime', '%H:%M'), strtotime($value->times)); $displaydate .= ' ' . $time; if ($value->endtimes) { $endtimes = strftime($elsettings->get('formattime', '%H:%M'), strtotime($value->endtimes)); $displaydate .= ' - ' . $endtimes; } } $filters[] = JHTML::_('select.option', $value->id, $value->venue . ' ' . $displaydate); } $lists['filter'] = JHTML::_('select.genericlist', $filters, 'xref', 'class="inputbox"', 'value', 'text', $event->xref); // search filter // $lists['search'] = $search; // confirmed filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_ALL')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_CONFIRMED')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CONFIRMED_UNCONFIRMED'))); $lists['filter_confirmed'] = JHTML::_('select.genericlist', $options, 'filter_confirmed', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_confirmed')); // waiting list filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_ALL')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_ATTENDING')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_WAITING_WAITING'))); $lists['filter_waiting'] = JHTML::_('select.genericlist', $options, 'filter_waiting', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_waiting')); // cancelled filter $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_NOT_CANCELLED')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_CANCELLED')), JHTML::_('select.option', 2, JText::_('COM_REDEVENT_ATTENDEES_FILTER_CANCELLED_ALL'))); $lists['filter_cancelled'] = JHTML::_('select.genericlist', $options, 'filter_cancelled', 'class="inputbox" onchange="this.form.submit();"', 'value', 'text', $state->get('filter_cancelled')); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; //assign to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('event', $event); $this->assignRef('rf_fields', $rf_fields); $this->assignRef('form', $form); $this->assignRef('user', $user); $this->assignRef('params', $params); $this->assignRef('cancelled', $state->get('filter_cancelled')); parent::display($tpl); }
/** * Get a option list of all categories */ public function getCategories() { return ELAdmin::getCategoriesOptions(); }
function display($tpl = null) { global $mainframe, $option; //initialise variables $user =& JFactory::getUser(); $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $elsettings = ELAdmin::config(); //get vars $filter_order = $mainframe->getUserStateFromRequest($option . '.events.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.events.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $mainframe->getUserStateFromRequest($option . '.events.filter_state', 'filter_state', '*', 'word'); $filter = $mainframe->getUserStateFromRequest($option . '.events.filter', 'filter', '', 'int'); $search = $mainframe->getUserStateFromRequest($option . '.events.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $mainframe->getTemplate(); //add css and submenu to document $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); //Create Submenu JSubMenuHelper::addEntry(JText::_('EVENTLIST'), 'index.php?option=com_eventlist'); JSubMenuHelper::addEntry(JText::_('EVENTS'), 'index.php?option=com_eventlist&view=events', true); JSubMenuHelper::addEntry(JText::_('VENUES'), 'index.php?option=com_eventlist&view=venues'); JSubMenuHelper::addEntry(JText::_('CATEGORIES'), 'index.php?option=com_eventlist&view=categories'); JSubMenuHelper::addEntry(JText::_('ARCHIVE'), 'index.php?option=com_eventlist&view=archive'); JSubMenuHelper::addEntry(JText::_('GROUPS'), 'index.php?option=com_eventlist&view=groups'); JSubMenuHelper::addEntry(JText::_('HELP'), 'index.php?option=com_eventlist&view=help'); if ($user->get('gid') > 24) { JSubMenuHelper::addEntry(JText::_('SETTINGS'), 'index.php?option=com_eventlist&controller=settings&task=edit'); } JHTML::_('behavior.tooltip'); //create the toolbar JToolBarHelper::title(JText::_('EVENTS'), 'events'); JToolBarHelper::archiveList(); JToolBarHelper::spacer(); JToolBarHelper::publishList(); JToolBarHelper::spacer(); JToolBarHelper::unpublishList(); JToolBarHelper::spacer(); JToolBarHelper::addNew(); JToolBarHelper::spacer(); JToolBarHelper::editList(); JToolBarHelper::spacer(); JToolBarHelper::deleteList(); JToolBarHelper::spacer(); JToolBarHelper::custom('copy', 'copy.png', 'copy_f2.png', 'Copy'); JToolBarHelper::spacer(); JToolBarHelper::help('el.listevents', true); // Get data from the model $rows =& $this->get('Data'); //$total = & $this->get( 'Total'); $pageNav =& $this->get('Pagination'); //publish unpublished filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; //search filter $filters = array(); $filters[] = JHTML::_('select.option', '1', JText::_('EVENT TITLE')); $filters[] = JHTML::_('select.option', '2', JText::_('VENUE')); $filters[] = JHTML::_('select.option', '3', JText::_('CITY')); $filters[] = JHTML::_('select.option', '4', JText::_('CATEGORY')); $lists['filter'] = JHTML::_('select.genericlist', $filters, 'filter', 'size="1" class="inputbox"', 'value', 'text', $filter); // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); $this->assignRef('user', $user); $this->assignRef('template', $template); $this->assignRef('elsettings', $elsettings); parent::display($tpl); }
/** * Prepares the print screen * * @param $tpl * * @since 0.9 */ function _displayprint($tpl = null) { $elsettings = ELAdmin::config(); $document =& JFactory::getDocument(); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); $rows =& $this->get('Data'); $event =& $this->get('Event'); $event->dates = strftime($elsettings->formatdate, strtotime($event->dates)); //assign data to template $this->assignRef('rows', $rows); $this->assignRef('event', $event); parent::display($tpl); }
/** * Creates the output for the add venue screen * * @since 0.9 * */ function _displayaddvenue($tpl) { //initialise variables $editor =& JFactory::getEditor(); $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); $elsettings = ELAdmin::config(); //add css and js to document JHTML::_('behavior.modal', 'a.modal'); JHTML::_('behavior.tooltip'); //Build the image select functionality $js = "\n\t\tfunction elSelectImage(image, imagename) {\n\t\t\tdocument.getElementById('a_image').value = image;\n\t\t\tdocument.getElementById('a_imagename').value = imagename;\n\t\t\tdocument.getElementById('sbox-window').close();\n\t\t}"; $link = 'index.php?option=com_eventlist&view=imagehandler&layout=uploadimage&task=venueimg&tmpl=component'; $link2 = 'index.php?option=com_eventlist&view=imagehandler&task=selectvenueimg&tmpl=component'; $document->addScriptDeclaration($js); $imageselect = "\n<input style=\"background: #ffffff;\" type=\"text\" id=\"a_imagename\" value=\"" . JText::_('SELECTIMAGE') . "\" disabled=\"disabled\" onchange=\"javascript:if (document.forms[0].a_imagename.value!='') {document.imagelib.src='../images/eventlist/venues/' + document.forms[0].a_imagename.value} else {document.imagelib.src='../images/blank.png'}\"; /><br />"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"" . JText::_('Upload') . "\" href=\"{$link}\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">" . JText::_('Upload') . "</a></div></div>\n"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"" . JText::_('SELECTIMAGE') . "\" href=\"{$link2}\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">" . JText::_('SELECTIMAGE') . "</a></div></div>\n"; $imageselect .= "\n <input class=\"inputbox\" type=\"button\" onclick=\"elSelectImage('', '" . JText::_('SELECTIMAGE') . "' );\" value=\"" . JText::_('Reset') . "\" />"; $imageselect .= "\n<input type=\"hidden\" id=\"a_image\" name=\"locimage\" value=\"" . JText::_('SELECTIMAGE') . "\" />"; $countries = array(); $countries[] = JHTML::_('select.option', '', JText::_('Select country')); $countries = array_merge($countries, ELHelper::getCountryOptions()); $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox"', 'value', 'text'); unset($countries); //set published $published = 1; //assign to template $this->assignRef('editor', $editor); $this->assignRef('imageselect', $imageselect); $this->assignRef('published', $published); $this->assignRef('request_url', $uri->toString()); $this->assignRef('elsettings', $elsettings); $this->assignRef('lists', $lists); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); //Load pane behavior jimport('joomla.html.pane'); //initialise variables $editor =& JFactory::getEditor(); $document =& JFactory::getDocument(); $user =& JFactory::getUser(); $pane =& JPane::getInstance('sliders'); //get vars $cid = JRequest::getVar('cid'); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_EDITVENUECATEGORY')); //add css to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //create the toolbar if ($cid) { JToolBarHelper::title(JText::_('COM_REDEVENT_EDIT_VENUES_CATEGORY'), 'venuescategories'); } else { JToolBarHelper::title(JText::_('COM_REDEVENT_ADD_VENUES_CATEGORY'), 'venuescategories'); //set the submenu ELAdmin::setMenu(); } JToolBarHelper::apply(); JToolBarHelper::spacer(); JToolBarHelper::save(); JToolBarHelper::spacer(); JToolBarHelper::media_manager(); JToolBarHelper::spacer(); JToolBarHelper::cancel(); JToolBarHelper::spacer(); //JToolBarHelper::help( 'el.editcategories', true ); //Get data from the model $model =& $this->getModel(); $row =& $this->get('Data'); $form =& $this->get('Form'); $groups =& $this->get('Groups'); // fail if checked out not by 'me' if ($row->id) { if ($model->isCheckedOut($user->get('id'))) { JError::raiseWarning('REDEVENT_GENERIC_ERROR', $row->catname . ' ' . JText::_('COM_REDEVENT_EDITED_BY_ANOTHER_ADMIN')); $mainframe->redirect('index.php?option=com_redevent&view=venuescategories'); } } //clean data JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'description'); /* Initiate the Lists array */ $lists = array(); /* Build a select list for categories */ $lists['categories'] = JHTML::_('select.genericlist', (array) $this->get('Categories'), 'parent_id', 'class="inputbox" size="10"', 'value', 'text', $row->parent_id); //build selectlists //build selectlists $lists['access'] = JHTML::_('list.accesslevel', $row); //build grouplist $grouplist = array(); $grouplist[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_NO_GROUP')); $grouplist = array_merge($grouplist, $groups); $lists['groups'] = JHTML::_('select.genericlist', $grouplist, 'groupid', 'size="1" class="inputbox"', 'value', 'text', $row->groupid); //assign data to template $this->assignRef('lists', $lists); $this->assignRef('row', $row); $this->assignRef('form', $form); $this->assignRef('editor', $editor); $this->assignRef('pane', $pane); parent::display($tpl); }
function _displayExport($tpl = null) { $document =& JFactory::getDocument(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_VENUES_EXPORT')); //add css and submenu to document $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); //Create Submenu ELAdmin::setMenu(); JHTML::_('behavior.tooltip'); //create the toolbar JToolBarHelper::title(JText::_('COM_REDEVENT_PAGETITLE_VENUES_EXPORT'), 'events'); JToolBarHelper::back(); JToolBarHelper::custom('doexport', 'exportevents', 'exportevents', JText::_('COM_REDEVENT_BUTTON_EXPORT'), false); $lists = array(); $lists['categories'] = JHTML::_('select.genericlist', $this->get('CategoriesOptions'), 'categories[]', 'size="15" multiple="multiple"', 'value', 'text'); //assign data to template $this->assignRef('lists', $lists); parent::display($tpl); }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); $user =& JFactory::getUser(); $document =& JFactory::getDocument(); ELAdmin::setMenu(); $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $state =& $this->get('state'); $params = JComponentHelper::getParams('com_redevent'); $filter_order = $state->get('filter_order'); $filter_order_Dir = $state->get('filter_order_Dir'); $search = $state->get('search'); $filter_state = $state->get('filter_state'); $filter_featured = $state->get('filter_featured'); $eventid = $state->get('eventid'); $venueid = $state->get('venueid'); // Get data from the model $items =& $this->get('Data'); $event =& $this->get('Event'); $venue =& $this->get('Venue'); $total =& $this->get('Total'); $pagination =& $this->get('Pagination'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; //publish unpublished filter $options = array(JHTML::_('select.option', '', ' - ' . JText::_('COM_REDEVENT_Select_state') . ' - '), JHTML::_('select.option', 'published', JText::_('COM_REDEVENT_Published')), JHTML::_('select.option', 'unpublished', JText::_('COM_REDEVENT_Unpublished')), JHTML::_('select.option', 'archived', JText::_('COM_REDEVENT_Archived')), JHTML::_('select.option', 'notarchived', JText::_('COM_REDEVENT_Not_archived'))); $lists['state'] = JHTML::_('select.genericlist', $options, 'filter_state', 'class="inputbox" onchange="submitform();" size="1"', 'value', 'text', $filter_state); //featured filter $options = array(JHTML::_('select.option', '', ' - ' . JText::_('COM_REDEVENT_Select_featured') . ' - '), JHTML::_('select.option', 'featured', JText::_('Com_redevent_Featured')), JHTML::_('select.option', 'unfeatured', JText::_('Com_redevent_not_Featured'))); $lists['featured'] = JHTML::_('select.genericlist', $options, 'filter_featured', 'class="inputbox" onchange="submitform();" size="1"', 'value', 'text', $filter_featured); $options = $this->get('groupsoptions'); $options = array_merge(array(JHTML::_('select.option', '', ' - ' . JText::_('COM_REDEVENT_SESSIONS_filter_group_select') . ' - ')), $options); $lists['filter_group'] = JHTML::_('select.genericlist', $options, 'filter_group', 'class="inputbox" onchange="submitform();" size="1"', 'value', 'text', $state->get('filter_group')); $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_SESSIONS_filter_group_select_view')), JHTML::_('select.option', 1, JText::_('COM_REDEVENT_SESSIONS_filter_group_select_manage'))); $lists['filter_group_manage'] = JHTML::_('select.genericlist', $options, 'filter_group_manage', 'class="inputbox" onchange="submitform();" size="1"', 'value', 'text', $state->get('filter_group_manage')); $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); // Set toolbar items for the page if ($eventid) { $document->setTitle(JText::sprintf('COM_REDEVENT_PAGETITLE_SESSIONS_EVENT', $event->title)); JToolBarHelper::title(JText::sprintf('COM_REDEVENT_TITLE_SESSIONS_EVENT', $event->title), 're-sessions'); } else { $document->setTitle(JText::sprintf('COM_REDEVENT_PAGETITLE_SESSIONS')); JToolBarHelper::title(JText::sprintf('COM_REDEVENT_TITLE_SESSIONS'), 're-sessions'); } if ($event && $event->id) { JToolBarHelper::addNewX(); } JToolBarHelper::custom('copy', 'copy', 'copy', 'copy', true); JToolBarHelper::editListX(); JToolBarHelper::deleteList(JText::_('COM_REDEVENT_SESSIONS_REMOVE_CONFIRM_MESSAGE')); JToolBarHelper::spacer(); JToolBarHelper::publish(); JToolBarHelper::unpublish(); JToolBarHelper::archiveList(); JToolBarHelper::spacer(); JToolBarHelper::custom('featured', 'featured', 'featured', 'COM_REDEVENT_FEATURE', true); JToolBarHelper::custom('unfeatured', 'unfeatured', 'unfeatured', 'COM_REDEVENT_UNFEATURE', true); JToolBarHelper::spacer(); JToolBarHelper::custom('back', 'back', 'back', 'COM_REDEVENT_BACK', false); if ($user->authorise('core.admin', 'com_redevent')) { JToolBarHelper::spacer(); JToolBarHelper::preferences('com_redevent', '600', '800'); } // event JHTML::_('behavior.modal', 'a.modal'); $js = "\n\t\twindow.addEvent('domready', function(){\n\t\t\n\t\t\tdocument.id('ev-reset-button').addEvent('click', function(){\n\t\t\t\tdocument.id('eventid').value = 0;\n\t\t\t\tdocument.id('eventid_name').value = '" . JText::_('COM_REDEVENT_SESSIONS_EVENT_FILTER_ALL') . "';\n\t\t\t\tdocument.id('adminForm').submit();\n\t\t\t});\n\t\t\t\n\t\t\tdocument.id('venue-reset-button').addEvent('click', function(){\n\t\t\t\tdocument.id('venueid').value = 0;\n\t\t\t\tdocument.id('venueid_name').value = '" . JText::_('COM_REDEVENT_SESSIONS_VENUE_FILTER_ALL') . "';\n\t\t\t\tdocument.id('adminForm').submit();\n\t\t\t});\n\t\t\t\n\t\t});\n\t\t\n\t\tfunction elSelectEvent(id, title, field) {\n\t\t\tdocument.id('eventid').value = id;\n\t\t\tdocument.id('eventid_name').value = title;\n\t\t\tSqueezeBox.close();\n\t\t\tdocument.id('adminForm').submit();\n\t\t}\n\t\t\n\t\tfunction elSelectVenue(id, title, field) {\n\t\t\tdocument.id('venueid').value = id;\n\t\t\tdocument.id('venueid_name').value = title;\n\t\t\tSqueezeBox.close();\n\t\t\tdocument.id('adminForm').submit();\n\t\t}"; $document->addScriptDeclaration($js); $uri->delVar('eventid'); $uri->delVar('venueid'); $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('event', $event); $this->assignRef('venue', $venue); $this->assignRef('eventid', $eventid); $this->assignRef('venueid', $venueid); $this->assignRef('params', $params); $this->assignRef('pagination', $pagination); $this->assignRef('request_url', $uri->toString()); parent::display($tpl); }
function display($tpl = null) { $app =& JFactory::getApplication(); // Load pane behavior jimport('joomla.html.pane'); JHTML::_('behavior.tooltip'); // Load the form validation behavior JHTML::_('behavior.formvalidation'); //initialise variables $editor =& JFactory::getEditor(); $document =& JFactory::getDocument(); $pane =& JPane::getInstance('sliders'); $user =& JFactory::getUser(); $db =& JFactory::getDBO(); $settings = ELAdmin::config(); $nullDate = $db->getNullDate(); //get vars $cid = JRequest::getInt('cid'); //add css and js to document $document->addScript('../includes/js/joomla/popup.js'); $document->addStyleSheet('../includes/js/joomla/popup.css'); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); // 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('SOME_ERROR_CODE', $row->venue . ' ' . JText::_('EDITED BY ANOTHER ADMIN')); $app->redirect('index.php?option=com_eventlist&view=venues'); } } //create the toolbar if ($cid) { JToolBarHelper::title(JText::_('EDIT VENUE'), 'venuesedit'); //makes data safe JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'locdescription'); } else { JToolBarHelper::title(JText::_('ADD VENUE'), 'venuesedit'); //set the submenu JSubMenuHelper::addEntry(JText::_('EVENTLIST'), 'index.php?option=com_eventlist'); JSubMenuHelper::addEntry(JText::_('EVENTS'), 'index.php?option=com_eventlist&view=events'); JSubMenuHelper::addEntry(JText::_('VENUES'), 'index.php?option=com_eventlist&view=venues'); JSubMenuHelper::addEntry(JText::_('CATEGORIES'), 'index.php?option=com_eventlist&view=categories'); JSubMenuHelper::addEntry(JText::_('ARCHIVESCREEN'), 'index.php?option=com_eventlist&view=archive'); JSubMenuHelper::addEntry(JText::_('GROUPS'), 'index.php?option=com_eventlist&view=groups'); JSubMenuHelper::addEntry(JText::_('HELP'), 'index.php?option=com_eventlist&view=help'); if ($user->get('gid') > 24) { JSubMenuHelper::addEntry(JText::_('SETTINGS'), 'index.php?option=com_eventlist&controller=settings&task=edit'); } } JToolBarHelper::apply(); JToolBarHelper::spacer(); JToolBarHelper::save(); JToolBarHelper::spacer(); JToolBarHelper::cancel(); JToolBarHelper::spacer(); JToolBarHelper::help('el.editvenues', true); //Build the image select functionality $js = "\n\t\tfunction elSelectImage(image, imagename) {\n\t\t\tdocument.getElementById('a_image').value = image;\n\t\t\tdocument.getElementById('a_imagename').value = imagename;\n\t\t\tdocument.getElementById('imagelib').src = '../images/eventlist/venues/' + image;\n\t\t\tdocument.getElementById('sbox-window').close();\n\t\t}"; $link = 'index.php?option=com_eventlist&view=imagehandler&layout=uploadimage&task=venueimg&tmpl=component'; $link2 = 'index.php?option=com_eventlist&view=imagehandler&task=selectvenueimg&tmpl=component'; $document->addScriptDeclaration($js); JHTML::_('behavior.modal', 'a.modal'); $imageselect = "\n<input style=\"background: #ffffff;\" type=\"text\" id=\"a_imagename\" value=\"{$row->locimage}\" disabled=\"disabled\" onchange=\"javascript:if (document.forms[0].a_imagename.value!='') {document.imagelib.src='../images/eventlist/venues/' + document.forms[0].a_imagename.value} else {document.imagelib.src='../images/blank.png'}\"; /><br />"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"" . JText::_('Upload') . "\" href=\"{$link}\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">" . JText::_('Upload') . "</a></div></div>\n"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"" . JText::_('SELECTIMAGE') . "\" href=\"{$link2}\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">" . JText::_('SELECTIMAGE') . "</a></div></div>\n"; $imageselect .= "\n <input class=\"inputbox\" type=\"button\" onclick=\"elSelectImage('', '" . JText::_('SELECTIMAGE') . "' );\" value=\"" . JText::_('Reset') . "\" />"; $imageselect .= "\n<input type=\"hidden\" id=\"a_image\" name=\"locimage\" value=\"{$row->locimage}\" />"; $countries = array(); $countries[] = JHTML::_('select.option', '', JText::_('Select country')); $countries = array_merge($countries, ELHelper::getCountryOptions()); $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox"', 'value', 'text', $row->country); unset($countries); //assign data to template $this->assignRef('row', $row); $this->assignRef('pane', $pane); $this->assignRef('editor', $editor); $this->assignRef('settings', $settings); $this->assignRef('nullDate', $nullDate); $this->assignRef('imageselect', $imageselect); $this->assignRef('lists', $lists); parent::display($tpl); }
/** * Overloaded check method to ensure data integrity * * @access public * @return boolean True on success * @since 1.0 */ function check() { // check that there is only alphanumerics in tag ? // check tag unicity $exists = ELAdmin::checkTagExists($this->tag); if ($exists && !($exists->section == 'custom' && $exists->id == $this->id)) { $this->setError(JText::sprintf('COM_REDEVENT_ERROR_TAG_ALREADY_EXISTS', $exists->section)); return false; } return true; }
?> </b> </td> </tr> <tr> <td> <?php echo JText::_('CATEGORIES TOTAL') . ': '; ?> </td> <td> <b><?php echo $this->category[2]; ?> </b> </td> </tr> </table> <?php echo $this->pane->endPanel(); echo $this->pane->endPane(); ?> </td> </tr> </table> <p class="copyright"> <?php echo ELAdmin::footer(); ?> </p>
/** * Method to store the event * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { //$app = & JFactory::getApplication(); $elsettings = ELAdmin::config(); $user =& JFactory::getUser(); $cats = JRequest::getVar('cid', array(), 'post', 'array'); $row =& JTable::getInstance('eventlist_events', ''); // Bind the form fields to the table if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } //get values from time selectlist and concatenate them accordingly $starthours = JRequest::getCmd('starthours'); $startminutes = JRequest::getCmd('startminutes'); $endhours = JRequest::getCmd('endhours'); $endminutes = JRequest::getCmd('endminutes'); $row->times = $starthours . ':' . $startminutes; $row->endtimes = $endhours . ':' . $endminutes; // Check the metatags if (JString::strlen($row->meta_description) > 255) { $row->meta_description = JString::substr($row->meta_description, 0, 254); } if (JString::strlen($row->meta_keywords) > 200) { $row->meta_keywords = JString::substr($row->meta_keywords, 0, 199); } //Check if image was selected jimport('joomla.filesystem.file'); $format = JFile::getExt('JPATH_SITE/images/eventlist/events/' . $row->datimage); $allowable = array('gif', 'jpg', 'png'); if (in_array($format, $allowable)) { $row->datimage = $row->datimage; } else { $row->datimage = ''; } // sanitise id field $row->id = (int) $row->id; $nullDate = $this->_db->getNullDate(); // Are we saving from an item edit? if ($row->id) { $row->modified = gmdate('Y-m-d H:i:s'); $row->modified_by = $user->get('id'); } else { $row->modified = $nullDate; $row->modified_by = ''; //get IP, time and userid $row->created = gmdate('Y-m-d H:i:s'); $row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED'; } $row->version++; // Make sure the data is valid if (!$row->check($elsettings)) { $this->setError($row->getError()); return false; } // Store the table to the database if (!$row->store(true)) { $this->setError($this->_db->getErrorMsg()); return false; } //store cat relation $query = 'DELETE FROM #__eventlist_cats_event_relations WHERE itemid = ' . $row->id; $this->_db->setQuery($query); $this->_db->query(); foreach ($cats as $cat) { $query = 'INSERT INTO #__eventlist_cats_event_relations (`catid`, `itemid`) VALUES(' . $cat . ',' . $row->id . ')'; $this->_db->setQuery($query); $this->_db->query(); } return $row->id; }