コード例 #1
0
ファイル: view.html.php プロジェクト: julienV/testrepo
 /**
  * Creates the output for venue submissions
  *
  * @since 0.5
  * @param int $tpl
  */
 function display($tpl = null)
 {
     $app =& JFactory::getApplication();
     $user =& JFactory::getUser();
     if (!$user->id) {
         $app->redirect(JRoute::_($_SERVER["HTTP_REFERER"]), JText::_('Please login to be able to submit venues'), 'error');
     }
     $editor =& JFactory::getEditor();
     $doc =& JFactory::getDocument();
     $elsettings =& ELHelper::config();
     // Get requests
     $id = JRequest::getInt('id');
     //Get Data from the model
     $row = $this->Get('Venue');
     JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'locdescription');
     JHTML::_('behavior.formvalidation');
     JHTML::_('behavior.tooltip');
     //add css file
     $doc->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css');
     $doc->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->');
     // Get the menu object of the active menu item
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $app->getParams('com_eventlist');
     $id ? $title = JText::_('EDIT VENUE') : ($title = JText::_('ADD VENUE'));
     //pathway
     $pathway =& $app->getPathWay();
     $pathway->setItemName(1, $item->name);
     $pathway->addItem($title, '');
     //Set Title
     $doc->setTitle($title);
     //editor user
     $editoruser = ELUser::editoruser();
     //transform <br /> and <br> back to \r\n for non editorusers
     if (!$editoruser) {
         $row->locdescription = ELHelper::br2break($row->locdescription);
     }
     //Get image
     $limage = ELImage::flyercreator($row->locimage);
     //Set the info image
     $infoimage = JHTML::_('image', 'components/com_eventlist/assets/images/icon-16-hint.png', JText::_('NOTES'));
     // country list
     $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);
     $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('item', $item);
     $this->assignRef('params', $params);
     $this->assignRef('lists', $lists);
     $this->assignRef('title', $title);
     $this->assignRef('mode', JRequest::getVar('mode', ''));
     parent::display($tpl);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: julienV/testrepo
 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&amp;view=imagehandler&amp;layout=uploadimage&amp;task=venueimg&amp;tmpl=component';
     $link2 = 'index.php?option=com_eventlist&amp;view=imagehandler&amp;task=selectvenueimg&amp;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&nbsp;<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);
 }
コード例 #3
0
ファイル: view.html.php プロジェクト: julienV/testrepo
 /**
  * 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&amp;view=imagehandler&amp;layout=uploadimage&amp;task=venueimg&amp;tmpl=component';
     $link2 = 'index.php?option=com_eventlist&amp;view=imagehandler&amp;task=selectvenueimg&amp;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&nbsp;<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);
 }