AAAAcontact/edit_metadata.php000066600000002631151371522610011506 0ustar00form->getFieldsets('metadata'); foreach ($fieldSets as $name => $fieldSet) : echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '

'.$this->escape(JText::_($fieldSet->description)).'

'; endif; ?>
label); ?>
contact/.htaccess000066600000000177151371522610010011 0ustar00 Order allow,deny Deny from all contact/edit_params.php000066600000001725151371522610011214 0ustar00form->getFieldsets('params'); foreach ($fieldSets as $name => $fieldSet) : echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-params'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '

'.$this->escape(JText::_($fieldSet->description)).'

'; endif; ?>
label); ?>
contact/index.html000066600000000037151371522610010203 0ustar00 contact/edit.php000066600000014336151371522610007653 0ustar00
item->id) ? JText::_('COM_CONTACT_NEW_CONTACT') : JText::sprintf('COM_CONTACT_EDIT_CONTACT', $this->item->id); ?>
  • form->getLabel('name'); ?> form->getInput('name'); ?>
  • form->getLabel('alias'); ?> form->getInput('alias'); ?>
  • form->getLabel('user_id'); ?> form->getInput('user_id'); ?>
  • form->getLabel('catid'); ?> form->getInput('catid'); ?>
  • form->getLabel('published'); ?> form->getInput('published'); ?>
  • form->getLabel('access'); ?> form->getInput('access'); ?>
  • form->getLabel('ordering'); ?> form->getInput('ordering'); ?>
  • form->getLabel('featured'); ?> form->getInput('featured'); ?>
  • form->getLabel('language'); ?> form->getInput('language'); ?>
  • form->getLabel('id'); ?> form->getInput('id'); ?>
form->getLabel('misc'); ?>
form->getInput('misc'); ?>
  • form->getLabel('created_by'); ?> form->getInput('created_by'); ?>
  • form->getLabel('created_by_alias'); ?> form->getInput('created_by_alias'); ?>
  • form->getLabel('created'); ?> form->getInput('created'); ?>
  • form->getLabel('publish_up'); ?> form->getInput('publish_up'); ?>
  • form->getLabel('publish_down'); ?> form->getInput('publish_down'); ?>
  • item->modified_by) : ?>
  • form->getLabel('modified_by'); ?> form->getInput('modified_by'); ?>
  • form->getLabel('modified'); ?> form->getInput('modified'); ?>

item->id) ? JText::_('COM_CONTACT_DETAILS') : JText::sprintf('COM_CONTACT_EDIT_DETAILS', $this->item->id); ?>

  • form->getLabel('image'); ?> form->getInput('image'); ?>
  • form->getLabel('con_position'); ?> form->getInput('con_position'); ?>
  • form->getLabel('email_to'); ?> form->getInput('email_to'); ?>
  • form->getLabel('address'); ?> form->getInput('address'); ?>
  • form->getLabel('suburb'); ?> form->getInput('suburb'); ?>
  • form->getLabel('state'); ?> form->getInput('state'); ?>
  • form->getLabel('postcode'); ?> form->getInput('postcode'); ?>
  • form->getLabel('country'); ?> form->getInput('country'); ?>
  • form->getLabel('telephone'); ?> form->getInput('telephone'); ?>
  • form->getLabel('mobile'); ?> form->getInput('mobile'); ?>
  • form->getLabel('fax'); ?> form->getInput('fax'); ?>
  • form->getLabel('webpage'); ?> form->getInput('webpage'); ?>
  • form->getLabel('sortname1'); ?> form->getInput('sortname1'); ?>
  • form->getLabel('sortname2'); ?> form->getInput('sortname2'); ?>
  • form->getLabel('sortname3'); ?> form->getInput('sortname3'); ?>
loadTemplate('params'); ?> loadTemplate('metadata'); ?>
contacts/.htaccess000066600000000177151371522610010174 0ustar00 Order allow,deny Deny from all contacts/modal.php000066600000013004151371522610010174 0ustar00escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?>
items as $i => $item) : ?> pagination->getListFooter(); ?>
contacts/index.html000066600000000037151371522610010366 0ustar00 contacts/default.php000066600000022345151371522610010534 0ustar00get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_contact.category'); $saveOrder = $listOrder == 'a.ordering'; ?>
items); foreach ($this->items as $i => $item) : $ordering = $listOrder == 'a.ordering'; $canCreate = $user->authorise('core.create', 'com_contact.category.'.$item->catid); $canEdit = $user->authorise('core.edit', 'com_contact.category.'.$item->catid); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; $canEditOwn = $user->authorise('core.edit.own', 'com_contact.category.'.$item->catid) && $item->created_by == $userId; $canChange = $user->authorise('core.edit.state', 'com_contact.category.'.$item->catid) && $canCheckin; $item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_contact&task=edit&type=other&id='.$item->catid); ?>
items, 'filesave.png', 'contacts.saveorder'); ?>
id); ?> checked_out) : ?> editor, $item->checked_out_time, 'contacts.', $canCheckin); ?> escape($item->name); ?> escape($item->name); ?>

escape($item->alias));?>

linked_user)) : ?> linked_user;?> published, $i, 'contacts.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> featured, $i, $canChange); ?> category_title; ?> pagination->orderUpIcon($i, ($item->catid == @$this->items[$i-1]->catid), 'contacts.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?> pagination->orderDownIcon($i, $n, ($item->catid == @$this->items[$i+1]->catid), 'contacts.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?> pagination->orderUpIcon($i, ($item->catid == @$this->items[$i-1]->catid), 'contacts.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?> pagination->orderDownIcon($i, $n, ($item->catid == @$this->items[$i+1]->catid), 'contacts.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?> class="text-area-order" title="name; ?> order" /> ordering; ?> access_level; ?> language=='*'):?> language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> id; ?>
loadTemplate('batch'); ?> pagination->getListFooter(); ?>
index.html000066600000000037151371522610006550 0ustar00 .htaccess000066600000000177151371522610006356 0ustar00 Order allow,deny Deny from all views/categories/view.html.php000066600000005406151373364220012473 0ustar00get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } if ($items === false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } $params = &$state->params; $items = array($parent->id => $items); //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->maxLevelcat = $params->get('maxLevelcat', -1); $this->assignRef('params', $params); $this->assignRef('parent', $parent); $this->assignRef('items', $items); $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if($menu) { $this->params->def('page_heading', $this->params->def('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } views/categories/.htaccess000066600000000177151373364220011643 0ustar00 Order allow,deny Deny from all views/categories/index.html000066600000000037151373364220012035 0ustar00 views/categories/tmpl/default.php000066600000002435151373364220013155 0ustar00
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading')); ?>

params->get('show_base_description')) : ?> params->get('categories_description')) : ?>
params->get('categories_description'), '', 'com_contact.categories'); ?>
parent->description) : ?>
parent->description, '', 'com_contact.categories'); ?>
loadTemplate('items'); ?>
views/categories/tmpl/default.xml000066600000043325151373364220013171 0ustar00
views/categories/tmpl/default_items.php000066600000003240151373364220014351 0ustar00items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> views/categories/tmpl/.htaccess000066600000000177151373364220012617 0ustar00 Order allow,deny Deny from all views/categories/tmpl/index.html000066600000000037151373364220013011 0ustar00 views/.htaccess000066600000000177151373364220007516 0ustar00 Order allow,deny Deny from all views/index.html000066600000000037151373364220007710 0ustar00 views/category/view.feed.php000066600000004262151373364220012121 0ustar00get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $params = $app->getParams(); $feedEmail = $app->getCfg('feed_email', 'author'); $siteEmail = $app->getCfg('mailfrom'); $fromName = $app->getCfg('fromname'); JRequest::setVar('limit', $app->getCfg('feed_limit')); // Get some data from the models $category = $this->get('Category'); $rows = $this->get('Items'); $doc->link = JRoute::_(ContactHelperRoute::getCategoryRoute($category->id)); foreach ($rows as $row) { // strip html from feed item title $title = $this->escape($row->name); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the contact slug $row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; // url link to article $link = JRoute::_(ContactHelperRoute::getContactRoute($row->slug, $row->catid)); $description = $row->address; $author = $row->created_by_alias ? $row->created_by_alias : $row->author; @$date = ($row->created ? date('r', strtotime($row->created)) : ''); // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $date; $item->category = $category->title; $item->author = $author; // We don't have the author email so we have to use site in both cases. if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } elseif($feedEmail == 'author') { $item->authorEmail = $row->author_email; } // loads item info into rss array $doc->addItem($item); } } } views/category/.htaccess000066600000000177151373364220011333 0ustar00 Order allow,deny Deny from all views/category/tmpl/default_items.php000066600000012145151373364220014045 0ustar00escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> items)) : ?>

params->get('show_pagination_limit')) : ?>
  pagination->getLimitBox(); ?>
params->get('show_headings')) : ?> params->get('show_position_headings')) : ?> params->get('show_email_headings')) : ?> params->get('show_telephone_headings')) : ?> params->get('show_mobile_headings')) : ?> params->get('show_fax_headings')) : ?> params->get('show_suburb_headings')) : ?> params->get('show_state_headings')) : ?> params->get('show_country_headings')) : ?> items as $i => $item) : ?> items[$i]->published == 0) : ?> params->get('show_position_headings')) : ?> params->get('show_email_headings')) : ?> params->get('show_telephone_headings')) : ?> params->get('show_mobile_headings')) : ?> params->get('show_fax_headings')) : ?> params->get('show_suburb_headings')) : ?> params->get('show_state_headings')) : ?> params->get('show_country_headings')) : ?>
name; ?> con_position; ?> telephone; ?> mobile; ?> fax; ?> suburb; ?> state; ?> country; ?>
params->get('show_pagination')) : ?>
views/category/tmpl/default.xml000066600000040562151373364220012661 0ustar00
views/category/tmpl/default.php000066600000003035151373364220012642 0ustar00
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading')); ?>

params->get('show_category_title', 1)) : ?>

category->title, '', 'com_contact.category'); ?>

params->def('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> params->get('show_description') && $this->category->description) : ?> category->description, '', 'com_contact.category'); ?>
loadTemplate('items'); ?> children[$this->category->id])&& $this->maxLevel != 0) : ?>

loadTemplate('children'); ?>
views/category/tmpl/index.html000066600000000037151373364220012501 0ustar00 views/category/tmpl/default_children.php000066600000003331151373364220014511 0ustar00children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?> Order allow,deny Deny from all views/category/view.html.php000066600000015034151373364220012161 0ustar00getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if ($category == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } // Check whether category access level allows access. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); if (!in_array($category->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Prepare the data. // Compute the contact slug. for ($i = 0, $n = count($items); $i < $n; $i++) { $item = &$items[$i]; $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; $temp = new JRegistry(); $temp->loadString($item->params); $item->params = clone($params); $item->params->merge($temp); if ($item->params->get('show_email', 0) == 1) { $item->email_to = trim($item->email_to); if (!empty($item->email_to) && JMailHelper::isEmailAddress($item->email_to)) { $item->email_to = JHtml::_('email.cloak', $item->email_to); } else { $item->email_to = ''; } } } // Setup the category parameters. $cparams = $category->getParams(); $category->params = clone($params); $category->params->merge($cparams); $children = array($category->id => $children); $maxLevel = $params->get('maxLevel', -1); $this->assignRef('maxLevel', $maxLevel); $this->assignRef('state', $state); $this->assignRef('items', $items); $this->assignRef('category', $category); $this->assignRef('children', $children); $this->assignRef('params', $params); $this->assignRef('parent', $parent); $this->assignRef('pagination', $pagination); //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Check for layout override only if this is not the active menu item // If it is the active menu item, then the view and category id will match $active = $app->getMenu()->getActive(); if ((!$active) || ((strpos($active->link, 'view=category') === false) || (strpos($active->link, '&id=' . (string) $this->category->id) === false))) { if ($layout = $category->params->get('category_layout')) { $this->setLayout($layout); } } elseif (isset($active->query['layout'])) { // We need to set the layout in case this is an alternative menu item (with an alternative layout) $this->setLayout($active->query['layout']); } $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $id = (int) @$menu->query['id']; if ($menu && ($menu->query['option'] != 'com_contact' || $menu->query['view'] == 'contact' || $id != $this->category->id)) { $path = array(array('title' => $this->category->title, 'link' => '')); $category = $this->category->getParent(); while (($menu->query['option'] != 'com_contact' || $menu->query['view'] == 'contact' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($category->id)); $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $pathway->addItem($item['title'], $item['link']); } } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->category->metadesc) { $this->document->setDescription($this->category->metadesc); } elseif (!$this->category->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->category->metakey) { $this->document->setMetadata('keywords', $this->category->metakey); } elseif (!$this->category->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } if ($app->getCfg('MetaAuthor') == '1') { $this->document->setMetaData('author', $this->category->getMetadata()->get('author')); } $mdata = $this->category->getMetadata()->toArray(); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } // Add alternative feed link if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } } } views/category/metadata.xml000066600000000242151373364220012030 0ustar00 views/category/index.html000066600000000037151373364220011525 0ustar00 views/contact/metadata.xml000066600000000230151373364220011643 0ustar00 views/contact/tmpl/default_profile.php000066600000002101151373364220014171 0ustar00 item->profile->getFieldset('profile'); ?>
value) : echo '
'.$profile->label.'
'; $profile->text = htmlspecialchars($profile->value, ENT_COMPAT, 'UTF-8'); switch ($profile->id) : case "profile_website": $v_http = substr ($profile->profile_value, 0, 4); if ($v_http == "http") : echo '
'.$profile->text.'
'; else : echo '
'.$profile->text.'
'; endif; break; default: echo '
'.$profile->text.'
'; break; endswitch; endif; endforeach; ?>
views/contact/tmpl/index.html000066600000000037151373364220012317 0ustar00 views/contact/tmpl/default.xml000066600000023431151373364220012473 0ustar00
views/contact/tmpl/default.php000066600000012647151373364220012471 0ustar00
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading')); ?>

contact->name && $this->params->get('show_name')) : ?>

contact->name; ?>

params->get('show_contact_category') == 'show_no_link') : ?>

contact->category_title; ?>

params->get('show_contact_category') == 'show_with_link') : ?> contact->catid);?>

escape($this->contact->category_title); ?>

params->get('show_contact_list') && count($this->contacts) > 1) : ?>
contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?>
params->get('presentation_style')!='plain'){?> params->get('presentation_style').'.start', 'contact-slider'); ?> params->get('presentation_style').'.panel', JText::_('COM_CONTACT_DETAILS'), 'basic-details'); } ?> params->get('presentation_style')=='plain'):?> '. JText::_('COM_CONTACT_DETAILS').''; ?> contact->image && $this->params->get('show_image')) : ?>
contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?>
contact->con_position && $this->params->get('show_position')) : ?>

contact->con_position; ?>

loadTemplate('address'); ?> params->get('allow_vcard')) : ?>

params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?> params->get('presentation_style')!='plain'):?> params->get('presentation_style').'.panel', JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form'); ?> params->get('presentation_style')=='plain'):?> '. JText::_('COM_CONTACT_EMAIL_FORM').''; ?> loadTemplate('form'); ?> params->get('show_links')) : ?> loadTemplate('links'); ?> params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?> params->get('presentation_style')!='plain'):?> params->get('presentation_style').'.panel', JText::_('JGLOBAL_ARTICLES'), 'display-articles'); ?> params->get('presentation_style')=='plain'):?> '. JText::_('JGLOBAL_ARTICLES').''; ?> loadTemplate('articles'); ?> params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?> params->get('presentation_style')!='plain'):?> params->get('presentation_style').'.panel', JText::_('COM_CONTACT_PROFILE'), 'display-profile'); ?> params->get('presentation_style')=='plain'):?> '. JText::_('COM_CONTACT_PROFILE').''; ?> loadTemplate('profile'); ?> contact->misc && $this->params->get('show_misc')) : ?> params->get('presentation_style')!='plain'){?> params->get('presentation_style').'.panel', JText::_('COM_CONTACT_OTHER_INFORMATION'), 'display-misc');} ?> params->get('presentation_style')=='plain'):?> '. JText::_('COM_CONTACT_OTHER_INFORMATION').''; ?>
params->get('marker_misc'); ?>
contact->misc; ?>
params->get('presentation_style')!='plain'){?> params->get('presentation_style').'.end');} ?>
views/contact/tmpl/default_form.php000066600000005721151373364220013507 0ustar00error)) : ?>
error; ?>
form->getLabel('contact_name'); ?>
form->getInput('contact_name'); ?>
form->getLabel('contact_email'); ?>
form->getInput('contact_email'); ?>
form->getLabel('contact_subject'); ?>
form->getInput('contact_subject'); ?>
form->getLabel('contact_message'); ?>
form->getInput('contact_message'); ?>
params->get('show_email_copy')){ ?>
form->getLabel('contact_email_copy'); ?>
form->getInput('contact_email_copy'); ?>
form->getFieldsets() as $fieldset): ?> name != 'contact'):?> form->getFieldset($fieldset->name);?> hidden): ?> input;?>
label; ?> required && $field->type != "Spacer"): ?>
input;?>
views/contact/tmpl/default_address.php000066600000007536151373364220014177 0ustar00 params->get('address_check') > 0) && ($this->contact->address || $this->contact->suburb || $this->contact->state || $this->contact->country || $this->contact->postcode)) : ?>
params->get('address_check') > 0) : ?> params->get('marker_address'); ?>
contact->address && $this->params->get('show_street_address')) : ?> contact->address); ?> contact->suburb && $this->params->get('show_suburb')) : ?> contact->suburb; ?> contact->state && $this->params->get('show_state')) : ?> contact->state; ?> contact->postcode && $this->params->get('show_postcode')) : ?> contact->postcode; ?> contact->country && $this->params->get('show_country')) : ?> contact->country; ?> params->get('address_check') > 0) : ?>
params->get('show_email') || $this->params->get('show_telephone')||$this->params->get('show_fax')||$this->params->get('show_mobile')|| $this->params->get('show_webpage') ) : ?>
contact->email_to && $this->params->get('show_email')) : ?>

params->get('marker_email'); ?> contact->email_to; ?>

contact->telephone && $this->params->get('show_telephone')) : ?>

params->get('marker_telephone'); ?> contact->telephone); ?>

contact->fax && $this->params->get('show_fax')) : ?>

params->get('marker_fax'); ?> contact->fax); ?>

contact->mobile && $this->params->get('show_mobile')) :?>

params->get('marker_mobile'); ?> contact->mobile); ?>

contact->webpage && $this->params->get('show_webpage')) : ?>

contact->webpage; ?>

params->get('show_email') || $this->params->get('show_telephone')||$this->params->get('show_fax')||$this->params->get('show_mobile')|| $this->params->get('show_webpage') ) : ?>
views/contact/tmpl/.htaccess000066600000000177151373364220012125 0ustar00 Order allow,deny Deny from all views/contact/tmpl/default_links.php000066600000002160151373364220013656 0ustar00params->get('presentation_style')) : echo '

'.JText::_('COM_CONTACT_LINKS').'

'; else : echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_LINKS'), 'display-links'); endif; ?> views/contact/tmpl/default_articles.php000066600000001324151373364220014345 0ustar00 params->get('show_articles')) : ?>
    item->articles as $article) : ?>
  1. slug, $article->catslug)), htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?>
views/contact/view.html.php000066600000021361151373364220011777 0ustar00get('State'); $item = $this->get('Item'); $this->form = $this->get('Form'); // Get the parameters $params = JComponentHelper::getParams('com_contact'); if ($item) { // If we found an item, merge the item parameters $params->merge($item->params); // Get Category Model data $categoryModel = JModelLegacy::getInstance('Category', 'ContactModel', array('ignore_request' => true)); $categoryModel->setState('category.id', $item->catid); $categoryModel->setState('list.ordering', 'a.name'); $categoryModel->setState('list.direction', 'asc'); $categoryModel->setState('filter.published', 1); $contacts = $categoryModel->getItems(); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // check if access is not public $groups = $user->getAuthorisedViewLevels(); $return = ''; if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups))) { $uri = JFactory::getURI(); $return = (string)$uri; JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); return; } $options['category_id'] = $item->catid; $options['order by'] = 'a.default_con DESC, a.ordering ASC'; // Handle email cloaking if ($item->email_to && $params->get('show_email')) { $item->email_to = JHtml::_('email.cloak', $item->email_to); } if ($params->get('show_street_address') || $params->get('show_suburb') || $params->get('show_state') || $params->get('show_postcode') || $params->get('show_country')) { if (!empty ($item->address) || !empty ($item->suburb) || !empty ($item->state) || !empty ($item->country) || !empty ($item->postcode)) { $params->set('address_check', 1); } } else { $params->set('address_check', 0); } // Manage the display mode for contact detail groups switch ($params->get('contact_icons')) { case 1 : // text $params->set('marker_address', JText::_('COM_CONTACT_ADDRESS').": "); $params->set('marker_email', JText::_('JGLOBAL_EMAIL').": "); $params->set('marker_telephone', JText::_('COM_CONTACT_TELEPHONE').": "); $params->set('marker_fax', JText::_('COM_CONTACT_FAX').": "); $params->set('marker_mobile', JText::_('COM_CONTACT_MOBILE').": "); $params->set('marker_misc', JText::_('COM_CONTACT_OTHER_INFORMATION').": "); $params->set('marker_class', 'jicons-text'); break; case 2 : // none $params->set('marker_address', ''); $params->set('marker_email', ''); $params->set('marker_telephone', ''); $params->set('marker_mobile', ''); $params->set('marker_fax', ''); $params->set('marker_misc', ''); $params->set('marker_class', 'jicons-none'); break; default : // icons $image1 = JHtml::_('image', 'contacts/'.$params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS').": ", NULL, true); $image2 = JHtml::_('image', 'contacts/'.$params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL').": ", NULL, true); $image3 = JHtml::_('image', 'contacts/'.$params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE').": ", NULL, true); $image4 = JHtml::_('image', 'contacts/'.$params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX').": ", NULL, true); $image5 = JHtml::_('image', 'contacts/'.$params->get('icon_misc', 'con_info.png'), JText::_('COM_CONTACT_OTHER_INFORMATION').": ", NULL, true); $image6 = JHtml::_('image', 'contacts/'.$params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE').": ", NULL, true); $params->set('marker_address', $image1); $params->set('marker_email', $image2); $params->set('marker_telephone', $image3); $params->set('marker_fax', $image4); $params->set('marker_misc', $image5); $params->set('marker_mobile', $image6); $params->set('marker_class', 'jicons-icons'); break; } // Add links to contacts if ($params->get('show_contact_list') && count($contacts) > 1) { foreach($contacts as &$contact) { $contact->link = JRoute::_(ContactHelperRoute::getContactRoute($contact->slug, $contact->catid)); } $item->link = JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->assignRef('contact', $item); $this->assignRef('params', $params); $this->assignRef('return', $return); $this->assignRef('state', $state); $this->assignRef('item', $item); $this->assignRef('user', $user); $this->assignRef('contacts', $contacts); // Override the layout only if this is not the active menu item // If it is the active menu item, then the view and item id will match $active = $app->getMenu()->getActive(); if ((!$active) || ((strpos($active->link, 'view=contact') === false) || (strpos($active->link, '&id=' . (string) $this->item->id) === false))) { if ($layout = $params->get('contact_layout')) { $this->setLayout($layout); } } elseif (isset($active->query['layout'])) { // We need to set the layout in case this is an alternative menu item (with an alternative layout) $this->setLayout($active->query['layout']); } $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); $id = (int) @$menu->query['id']; // if the menu item does not concern this contact if ($menu && ($menu->query['option'] != 'com_contact' || $menu->query['view'] != 'contact' || $id != $this->item->id)) { // If this is not a single contact menu item, set the page title to the contact title if ($this->item->name) { $title = $this->item->name; } $path = array(array('title' => $this->contact->name, 'link' => '')); $category = JCategories::getInstance('Contact')->get($this->contact->catid); while ($category && ($menu->query['option'] != 'com_contact' || $menu->query['view'] == 'contact' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($this->contact->catid)); $category = $category->getParent(); } $path = array_reverse($path); foreach($path as $item) { $pathway->addItem($item['title'], $item['link']); } } if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } if (empty($title)) { $title = $this->item->name; } $this->document->setTitle($title); if ($this->item->metadesc) { $this->document->setDescription($this->item->metadesc); } elseif (!$this->item->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->item->metakey) { $this->document->setMetadata('keywords', $this->item->metakey); } elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } $mdata = $this->item->metadata->toArray(); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } } } views/contact/view.vcf.php000066600000005450151373364220011612 0ustar00get('State'); $item = $this->get('Item'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } $doc = JFactory::getDocument(); $doc->setMetaData('Content-Type', 'text/directory', true); // Initialise variables. $app = JFactory::getApplication(); $params = $app->getParams(); $user = JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); // Compute lastname, firstname and middlename $item->name = trim($item->name); // "Lastname, Firstname Midlename" format support // e.g. "de Gaulle, Charles" $namearray = explode(',', $item->name); if (count($namearray) > 1 ) { $lastname = $namearray[0]; $card_name = $lastname; $name_and_midname = trim($namearray[1]); $firstname = ''; if (!empty($name_and_midname)) { $namearray = explode(' ', $name_and_midname); $firstname = $namearray[0]; $middlename = (count($namearray) > 1) ? $namearray[1] : ''; $card_name = $firstname . ' ' . ($middlename ? $middlename . ' ' : '') . $card_name; } } // "Firstname Middlename Lastname" format support else { $namearray = explode(' ', $item->name); $middlename = (count($namearray) > 2) ? $namearray[1] : ''; $firstname = array_shift($namearray); $lastname = count($namearray) ? end($namearray) : ''; $card_name = $firstname . ($middlename ? ' ' . $middlename : '') . ($lastname ? ' ' . $lastname : ''); } $rev = date('c', strtotime($item->modified)); JResponse::setHeader('Content-disposition', 'attachment; filename="'.$card_name.'.vcf"', true); $vcard = array(); $vcard[].= 'BEGIN:VCARD'; $vcard[].= 'VERSION:3.0'; $vcard[] = 'N:'.$lastname.';'.$firstname.';'.$middlename; $vcard[] = 'FN:'. $item->name; $vcard[] = 'TITLE:'.$item->con_position; $vcard[] = 'TEL;TYPE=WORK,VOICE:'.$item->telephone; $vcard[] = 'TEL;TYPE=WORK,FAX:'.$item->fax; $vcard[] = 'TEL;TYPE=WORK,MOBILE:'.$item->mobile; $vcard[] = 'ADR;TYPE=WORK:;;'.$item->address.';'.$item->suburb.';'.$item->state.';'.$item->postcode.';'.$item->country; $vcard[] = 'LABEL;TYPE=WORK:'.$item->address."\n".$item->suburb."\n".$item->state."\n".$item->postcode."\n".$item->country; $vcard[] = 'EMAIL;TYPE=PREF,INTERNET:'.$item->email_to; $vcard[] = 'URL:'.$item->webpage; $vcard[] = 'REV:'.$rev.'Z'; $vcard[] = 'END:VCARD'; echo implode("\n", $vcard); return true; } } views/contact/.htaccess000066600000000177151373364220011151 0ustar00 Order allow,deny Deny from all views/contact/index.html000066600000000037151373364220011343 0ustar00 views/featured/tmpl/.htaccess000066600000000177151373364220012271 0ustar00 Order allow,deny Deny from all views/featured/tmpl/default.php000066600000002210151373364220012616 0ustar00
params->get('show_page_heading')!=0 ): ?>

escape($this->params->get('page_heading')); ?>

loadTemplate('items'); ?> params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) : ?>
views/featured/tmpl/default.xml000066600000030041151373364220012632 0ustar00
views/featured/tmpl/default_items.php000066600000011476151373364220014035 0ustar00escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); // Create a shortcut for params. $params = &$this->item->params; ?> items)) : ?>

params->get('show_pagination_limit')) : ?>
  pagination->getLimitBox(); ?>
params->get('show_headings')) : ?> params->get('show_position_headings')) : ?> params->get('show_email_headings')) : ?> params->get('show_telephone_headings')) : ?> params->get('show_mobile_headings')) : ?> params->get('show_fax_headings')) : ?> params->get('show_suburb_headings')) : ?> params->get('show_state_headings')) : ?> params->get('show_country_headings')) : ?> items as $i => $item) : ?> "> params->get('show_position_headings')) : ?> params->get('show_email_headings')) : ?> params->get('show_telephone_headings')) : ?> params->get('show_mobile_headings')) : ?> params->get('show_fax_headings')) : ?> params->get('show_suburb_headings')) : ?> params->get('show_state_headings')) : ?> params->get('show_country_headings')) : ?>
name; ?> con_position; ?> telephone; ?> mobile; ?> fax; ?> suburb; ?> state; ?> country; ?>
views/featured/tmpl/index.html000066600000000037151373364220012463 0ustar00 views/featured/metadata.xml000066600000000234151373364220012013 0ustar00 views/featured/.htaccess000066600000000177151373364220011315 0ustar00 Order allow,deny Deny from all views/featured/view.html.php000066600000007366151373364220012154 0ustar00getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Check whether category access level allows access. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); // Prepare the data. // Compute the contact slug. for ($i = 0, $n = count($items); $i < $n; $i++) { $item = &$items[$i]; $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; $temp = new JRegistry(); $temp->loadString($item->params); $item->params = clone($params); $item->params->merge($temp); if ($item->params->get('show_email', 0) == 1) { $item->email_to = trim($item->email_to); if (!empty($item->email_to) && JMailHelper::isEmailAddress($item->email_to)) { $item->email_to = JHtml::_('email.cloak', $item->email_to); } else { $item->email_to = ''; } } } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $maxLevel = $params->get('maxLevel', -1); $this->assignRef('maxLevel', $maxLevel); $this->assignRef('state', $state); $this->assignRef('items', $items); $this->assignRef('category', $category); $this->assignRef('children', $children); $this->assignRef('params', $params); $this->assignRef('parent', $parent); $this->assignRef('pagination', $pagination); $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $id = (int) @$menu->query['id']; $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } views/featured/index.html000066600000000037151373364220011507 0ustar00 models/index.html000066600000000037151373364220010036 0ustar00 models/contact.php000066600000026135151373364220010214 0ustar00setState('contact.id', $pk); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_contact')) && (!$user->authorise('core.edit', 'com_contact'))){ $this->setState('filter.published', 1); $this->setState('filter.archived', 2); } } /** * Method to get the contact form. * * The base form is loaded from XML and then an event is fired * * * @param array $data An optional array of data for the form to interrogate. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @return JForm A JForm object on success, false on failure * @since 1.6 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_contact.contact', 'contact', array('control' => 'jform', 'load_data' => true)); if (empty($form)) { return false; } $id = $this->getState('contact.id'); $params = $this->getState('params'); $contact = $this->_item[$id]; $params->merge($contact->params); if(!$params->get('show_email_copy', 0)){ $form->removeField('contact_email_copy'); } return $form; } protected function loadFormData() { $data = (array)JFactory::getApplication()->getUserState('com_contact.contact.data', array()); return $data; } /** * Gets a list of contacts * @param array * @return mixed Object or null */ public function &getItem($pk = null) { // Initialise variables. $pk = (!empty($pk)) ? $pk : (int) $this->getState('contact.id'); if ($this->_item === null) { $this->_item = array(); } if (!isset($this->_item[$pk])) { try { $db = $this->getDbo(); $query = $db->getQuery(true); //sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id.' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id.' END as catslug'; $query->select($this->getState('item.select', 'a.*') . ','.$case_when.','.$case_when1); $query->from('#__contact_details AS a'); // Join on category table. $query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access'); $query->join('LEFT', '#__categories AS c on c.id = a.catid'); // Join over the categories to get parent category titles $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias'); $query->join('LEFT', '#__categories as parent ON parent.id = c.parent_id'); $query->where('a.id = ' . (int) $pk); // Filter by start and end dates. $nullDate = $db->Quote($db->getNullDate()); $nowDate = $db->Quote(JFactory::getDate()->toSql()); // Filter by published state. $published = $this->getState('filter.published'); $archived = $this->getState('filter.archived'); if (is_numeric($published)) { $query->where('(a.published = ' . (int) $published . ' OR a.published =' . (int) $archived . ')'); $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')'); $query->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); } $db->setQuery($query); $data = $db->loadObject(); if ($error = $db->getErrorMsg()) { throw new JException($error); } if (empty($data)) { throw new JException(JText::_('COM_CONTACT_ERROR_CONTACT_NOT_FOUND'), 404); } // Check for published state if filter set. if (((is_numeric($published)) || (is_numeric($archived))) && (($data->published != $published) && ($data->published != $archived))) { JError::raiseError(404, JText::_('COM_CONTACT_ERROR_CONTACT_NOT_FOUND')); } // Convert parameter fields to objects. $registry = new JRegistry; $registry->loadString($data->params); $data->params = clone $this->getState('params'); $data->params->merge($registry); $registry = new JRegistry; $registry->loadString($data->metadata); $data->metadata = $registry; // Compute access permissions. if ($access = $this->getState('filter.access')) { // If the access filter has been set, we already know this user can view. $data->params->set('access-view', true); } else { // If no access filter is set, the layout takes some responsibility for display of limited information. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); if ($data->catid == 0 || $data->category_access === null) { $data->params->set('access-view', in_array($data->access, $groups)); } else { $data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups)); } } $this->_item[$pk] = $data; } catch (JException $e) { $this->setError($e); $this->_item[$pk] = false; } } if ($this->_item[$pk]) { if ($extendedData = $this->getContactQuery($pk)) { $this->_item[$pk]->articles = $extendedData->articles; $this->_item[$pk]->profile = $extendedData->profile; } } return $this->_item[$pk]; } protected function getContactQuery($pk = null) { // TODO: Cache on the fingerprint of the arguments $db = $this->getDbo(); $user = JFactory::getUser(); $pk = (!empty($pk)) ? $pk : (int) $this->getState('contact.id'); $query = $db->getQuery(true); if ($pk) { //sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id.' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('cc.alias'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('cc.id'); $case_when1 .= $query->concatenate(array($c_id, 'cc.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id.' END as catslug'; $query->select('a.*, cc.access as category_access, cc.title as category_name, ' .$case_when.','.$case_when1); $query->from('#__contact_details AS a'); $query->join('INNER', '#__categories AS cc on cc.id = a.catid'); $query->where('a.id = ' . (int) $pk); $published = $this->getState('filter.published'); $archived = $this->getState('filter.archived'); if (is_numeric($published)) { $query->where('a.published IN (1,2)'); $query->where('cc.published IN (1,2)'); } $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN ('.$groups.')'); try { $db->setQuery($query); $result = $db->loadObject(); if ($error = $db->getErrorMsg()) { throw new Exception($error); } if (empty($result)) { throw new JException(JText::_('COM_CONTACT_ERROR_CONTACT_NOT_FOUND'), 404); } // If we are showing a contact list, then the contact parameters take priority // So merge the contact parameters with the merged parameters if ($this->getState('params')->get('show_contact_list')) { $registry = new JRegistry; $registry->loadString($result->params); $this->getState('params')->merge($registry); } } catch (Exception $e) { $this->setError($e); return false; } if ($result) { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); //get the content by the linked user $query = $db->getQuery(true); $query->select('a.id'); $query->select('a.title'); $query->select('a.state'); $query->select('a.access'); $query->select('a.created'); // SQL Server changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id.' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id.' END as catslug'; $query->select($case_when1 . ',' . $case_when); $query->from('#__content as a'); $query->leftJoin('#__categories as c on a.catid=c.id'); $query->where('a.created_by = '.(int)$result->user_id); $query->where('a.access IN ('. $groups.')'); $query->order('a.state DESC, a.created DESC'); // filter per language if plugin published if (JLanguageMultilang::isEnabled()) { $query->where(('a.created_by = ' . (int) $result->user_id) . ' AND ' . ('a.language='.$db->quote(JFactory::getLanguage()->getTag()).' OR a.language='.$db->quote('*'))); } if (is_numeric($published)) { $query->where('a.state IN (1,2)'); } $db->setQuery($query, 0, 10); $articles = $db->loadObjectList(); $result->articles = $articles; //get the profile information for the linked user require_once JPATH_ADMINISTRATOR.'/components/com_users/models/user.php'; $userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); $data = $userModel->getItem((int)$result->user_id); JPluginHelper::importPlugin('user'); $form = new JForm('com_users.profile'); // Get the dispatcher. $dispatcher = JDispatcher::getInstance(); // Trigger the form preparation event. $dispatcher->trigger('onContentPrepareForm', array($form, $data)); // Trigger the data preparation event. $dispatcher->trigger('onContentPrepareData', array('com_users.profile', $data)); // Load the data into the form after the plugins have operated. $form->bind($data); $result->profile = $form; $this->contact = $result; return $result; } } } } models/.htaccess000066600000000177151373364220007644 0ustar00 Order allow,deny Deny from all models/categories.php000066600000005666151373364220010714 0ustar00setState('filter.extension', $this->_extension); // Get the parent id if defined. $parentId = JRequest::getInt('id'); $this->setState('filter.parentId', $parentId); $params = $app->getParams(); $this->setState('params', $params); $this->setState('filter.published', 1); $this->setState('filter.access', true); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.extension'); $id .= ':'.$this->getState('filter.published'); $id .= ':'.$this->getState('filter.access'); $id .= ':'.$this->getState('filter.parentId'); return parent::getStoreId($id); } /** * redefine the function an add some properties to make the styling more easy * * @return mixed An array of data items on success, false on failure. */ public function getItems() { if(!count($this->_items)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry(); if($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('show_empty_categories_cat', 0); $categories = JCategories::getInstance('Contact', $options); $this->_parent = $categories->get($this->getState('filter.parentId', 'root')); if(is_object($this->_parent)) { $this->_items = $this->_parent->getChildren(); } else { $this->_items = false; } } return $this->_items; } public function getParent() { if(!is_object($this->_parent)) { $this->getItems(); } return $this->_parent; } } models/rules/contactemailmessage.php000066600000001213151373364220013711 0ustar00get('banned_text'); foreach(explode(';', $banned) as $item){ if ($item != '' && JString::stristr($value, $item) !== false) return false; } return true; } } models/rules/contactemailsubject.php000066600000001216151373364220013727 0ustar00get('banned_subject'); foreach(explode(';', $banned) as $item){ if ($item != '' && JString::stristr($value, $item) !== false) return false; } return true; } } models/rules/contactemail.php000066600000001435151373364220012352 0ustar00get('banned_email'); foreach(explode(';', $banned) as $item){ if ($item != '' && JString::stristr($value, $item) !== false) return false; } return true; } } models/rules/.htaccess000066600000000177151373364220010776 0ustar00 Order allow,deny Deny from all models/rules/index.html000066600000000037151373364220011170 0ustar00 models/forms/index.html000066600000000037151373364220011164 0ustar00 models/forms/.htaccess000066600000000177151373364220010772 0ustar00 Order allow,deny Deny from all models/forms/contact.xml000066600000003120151373364220011340 0ustar00
models/forms/form.xml000066600000033772151373364220010670 0ustar00
models/category.php000066600000022446151373364220010377 0ustar00_params)) { $params = new JRegistry(); $params->loadString($item->params); $item->params = $params; } } return $items; } /** * Method to build an SQL query to load the list data. * * @return string An SQL query * @since 1.6 */ protected function getListQuery() { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields from the categories. //sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id.' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id.' END as catslug'; $query->select($this->getState('list.select', 'a.*') . ','.$case_when.','.$case_when1); // . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, ' // . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END AS catslug '); $query->from($db->quoteName('#__contact_details').' AS a'); $query->join('LEFT', '#__categories AS c ON c.id = a.catid'); $query->where('a.access IN ('.$groups.')'); // Filter by category. if ($categoryId = $this->getState('category.id')) { $query->where('a.catid = '.(int) $categoryId); $query->where('c.access IN ('.$groups.')'); } // Join over the users for the author and modified_by names. $query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author"); $query->select("ua.email AS author_email"); $query->join('LEFT', '#__users AS ua ON ua.id = a.created_by'); $query->join('LEFT', '#__users AS uam ON uam.id = a.modified_by'); // Filter by state $state = $this->getState('filter.published'); if (is_numeric($state)) { $query->where('a.published = '.(int) $state); } // Filter by start and end dates. $nullDate = $db->Quote($db->getNullDate()); $nowDate = $db->Quote(JFactory::getDate()->toSql()); if ($this->getState('filter.publish_date')){ $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')'); $query->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); } // Filter by language if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')'); } // Set sortname ordering if selected if ($this->getState('list.ordering') == 'sortname') { $query->order($db->escape('a.sortname1').' '.$db->escape($this->getState('list.direction', 'ASC'))); $query->order($db->escape('a.sortname2').' '.$db->escape($this->getState('list.direction', 'ASC'))); $query->order($db->escape('a.sortname3').' '.$db->escape($this->getState('list.direction', 'ASC'))); } else { $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); } return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { // Initialise variables. $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_contact'); $db = $this->getDbo(); // List state information $format = JRequest::getWord('format'); if ($format=='feed') { $limit = $app->getCfg('feed_limit'); } else { $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); } $this->setState('list.limit', $limit); $limitstart = JRequest::getUInt('limitstart', 0); $this->setState('list.start', $limitstart); // Get list ordering default from the parameters $menuParams = new JRegistry(); if ($menu = $app->getMenu()->getActive()) { $menuParams->loadString($menu->params); } $mergedParams = clone $params; $mergedParams->merge($menuParams); $orderCol = JRequest::getCmd('filter_order', $mergedParams->get('initial_sort', 'ordering')); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = JRequest::getCmd('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $id = JRequest::getVar('id', 0, '', 'int'); $this->setState('category.id', $id); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_contact')) && (!$user->authorise('core.edit', 'com_contact'))){ // limit to published for people who can't edit or edit.state. $this->setState('filter.published', 1); // Filter by start and end dates. $this->setState('filter.publish_date', true); } $this->setState('filter.language', $app->getLanguageFilter()); // Load the parameters. $this->setState('params', $params); } /** * Method to get category data for the current category * * @param int An optional ID * * @return object * @since 1.5 */ public function getCategory() { if(!is_object($this->_item)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry(); if($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_items', 1) || $params->get('show_empty_categories', 0); $categories = JCategories::getInstance('Contact', $options); $this->_item = $categories->get($this->getState('category.id', 'root')); if(is_object($this->_item)) { $this->_children = $this->_item->getChildren(); $this->_parent = false; if($this->_item->getParent()) { $this->_parent = $this->_item->getParent(); } $this->_rightsibling = $this->_item->getSibling(); $this->_leftsibling = $this->_item->getSibling(false); } else { $this->_children = false; $this->_parent = false; } } return $this->_item; } /** * Get the parent category. * * @param int An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ public function getParent() { if(!is_object($this->_item)) { $this->getCategory(); } return $this->_parent; } /** * Get the sibling (adjacent) categories. * * @return mixed An array of categories or false if an error occurs. */ function &getLeftSibling() { if(!is_object($this->_item)) { $this->getCategory(); } return $this->_leftsibling; } function &getRightSibling() { if(!is_object($this->_item)) { $this->getCategory(); } return $this->_rightsibling; } /** * Get the child categories. * * @param int An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ function &getChildren() { if(!is_object($this->_item)) { $this->getCategory(); } return $this->_children; } } models/featured.php000066600000014010151373364220010345 0ustar00_params)) { $params = new JRegistry(); $params->loadString($item->params); $item->params = $params; } } return $items; } /** * Method to build an SQL query to load the list data. * * @return string An SQL query * @since 1.6 */ protected function getListQuery() { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields from the categories. $query->select($this->getState('list.select', 'a.*')); $query->from($db->quoteName('#__contact_details').' AS a'); $query->where('a.access IN ('.$groups.')'); $query->where('a.featured=1'); $query->join('INNER', '#__categories AS c ON c.id = a.catid'); $query->where('c.access IN ('.$groups.')'); // Filter by category. if ($categoryId = $this->getState('category.id')) { $query->where('a.catid = '.(int) $categoryId); } //sqlsrv change... aliased c.published to cat_published // Join to check for category published state in parent categories up the tree $query->select('c.published as cat_published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published'); $subquery = 'SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent '; $subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt '; $subquery .= 'WHERE parent.extension = ' . $db->quote('com_contact'); // Find any up-path categories that are not published // If all categories are published, badcats.id will be null, and we just use the contact state $subquery .= ' AND parent.published != 1 GROUP BY cat.id '; // Select state to unpublished if up-path category is unpublished $publishedWhere = 'CASE WHEN badcats.id is null THEN a.published ELSE 0 END'; $query->join('LEFT OUTER', '(' . $subquery . ') AS badcats ON badcats.id = c.id'); // Filter by state $state = $this->getState('filter.published'); if (is_numeric($state)) { $query->where('a.published = '.(int) $state); // Filter by start and end dates. $nullDate = $db->Quote($db->getNullDate()); $date = JFactory::getDate(); $nowDate = $db->Quote($date->toSql()); $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')'); $query->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); $query->where($publishedWhere . ' = ' . (int) $state); } // Filter by language if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')'); } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { // Initialise variables. $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_contact'); // List state information $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); $this->setState('list.limit', $limit); $limitstart = JRequest::getUInt('limitstart', 0); $this->setState('list.start', $limitstart); $orderCol = JRequest::getCmd('filter_order', 'ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = JRequest::getCmd('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_contact')) && (!$user->authorise('core.edit', 'com_contact'))){ // limit to published for people who can't edit or edit.state. $this->setState('filter.published', 1); // Filter by start and end dates. $this->setState('filter.publish_date', true); } $this->setState('filter.language', $app->getLanguageFilter()); // Load the parameters. $this->setState('params', $params); } } metadata.xml000066600000000076151373364220007063 0ustar00 helpers/route.php000066600000005626151373364220010100 0ustar00 array((int) $id) ); //Create the link $link = 'index.php?option=com_contact&view=contact&id='. $id; if ($catid > 1) { $categories = JCategories::getInstance('Contact'); $category = $categories->get($catid); if ($category) { $needles['category'] = array_reverse($category->getPath()); $needles['categories'] = $needles['category']; $link .= '&catid='.$catid; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } return $link; } public static function getCategoryRoute($catid) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('Contact')->get($id); } if ($id < 1 || !($category instanceof JCategoryNode)) { $link = ''; } else { $needles = array(); //Create the link $link = 'index.php?option=com_contact&view=category&id='.$id; $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } } return $link; } protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); // Prepare the reverse lookup array. if (self::$lookup === null) { self::$lookup = array(); $component = JComponentHelper::getComponent('com_contact'); $items = $menus->getItems('component_id', $component->id); foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$view])) { self::$lookup[$view] = array(); } if (isset($item->query['id'])) { self::$lookup[$view][$item->query['id']] = $item->id; } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(self::$lookup[$view])) { foreach($ids as $id) { if (isset(self::$lookup[$view][(int)$id])) { return self::$lookup[$view][(int)$id]; } } } } } $active = $menus->getActive(); if ($active) { return $active->id; } return null; } } helpers/category.php000066600000001404151373364220010545 0ustar00 Order allow,deny Deny from all helpers/index.html000066600000000037151373364220010215 0ustar00 helpers/icon.php000066600000005320151373364220007661 0ustar00toString(array('scheme', 'host', 'port')); $link = $base.JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid) , false); $url = 'index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; if ($params->get('show_icons')) { $text = JHtml::_('image', 'system/emailButton.png', JText::_('JGLOBAL_EMAIL'), NULL, true); } else { $text = ' '.JText::_('JGLOBAL_EMAIL'); } $attribs['title'] = JText::_('JGLOBAL_EMAIL'); $attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; $output = JHtml::_('link', JRoute::_($url), $text, $attribs); return $output; } static function print_popup($article, $params, $attribs = array()) { $url = ContentHelperRoute::getContactRoute($contact->slug, $contact->catid); $url .= '&tmpl=component&print=1&layout=default&page='.@ $request->limitstart; $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; // checks template image directory for image, if non found default are loaded if ($params->get('show_icons')) { $text = JHtml::_('image', 'system/printButton.png', JText::_('JGLOBAL_PRINT'), NULL, true); } else { $text = JText::_('JGLOBAL_ICON_SEP') .' '. JText::_('JGLOBAL_PRINT') .' '. JText::_('JGLOBAL_ICON_SEP'); } $attribs['title'] = JText::_('JGLOBAL_PRINT'); $attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; $attribs['rel'] = 'nofollow'; return JHtml::_('link', JRoute::_($url), $text, $attribs); } static function print_screen($contact, $params, $attribs = array()) { // checks template image directory for image, if non found default are loaded if ($params->get('show_icons')) { $text = JHtml::_('image', 'system/printButton.png', JText::_('JGLOBAL_PRINT'), NULL, true); } else { $text = JText::_('JGLOBAL_ICON_SEP') .' '. JText::_('JGLOBAL_PRINT') .' '. JText::_('JGLOBAL_ICON_SEP'); } return ''.$text.''; } } contact.php000066600000000671151373364220006726 0ustar00execute(JRequest::getCmd('task')); $controller->redirect(); controllers/contact.php000066600000012700151373364220011270 0ustar00 true)) { return parent::getModel($name, $prefix, array('ignore_request' => false)); } public function submit() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $app = JFactory::getApplication(); $model = $this->getModel('contact'); $params = JComponentHelper::getParams('com_contact'); $stub = JRequest::getString('id'); $id = (int) $stub; // Get the data from POST $data = JRequest::getVar('jform', array(), 'post', 'array'); $contact = $model->getItem($id); $params->merge($contact->params); // Check for a valid session cookie if ($params->get('validate_session', 0)) { if (JFactory::getSession()->getState() != 'active') { JError::raiseWarning(403, JText::_('COM_CONTACT_SESSION_INVALID')); // Save the data in the session. $app->setUserState('com_contact.contact.data', $data); // Redirect back to the contact form. $this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false)); return false; } } // Contact plugins JPluginHelper::importPlugin('contact'); $dispatcher = JDispatcher::getInstance(); // Validate the posted data. $form = $model->getForm(); if (!$form) { JError::raiseError(500, $model->getError()); return false; } $validate = $model->validate($form, $data); if ($validate === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState('com_contact.contact.data', $data); // Redirect back to the contact form. $this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false)); return false; } // Validation succeeded, continue with custom handlers $results = $dispatcher->trigger('onValidateContact', array(&$contact, &$data)); foreach ($results as $result) { if ($result instanceof Exception) { return false; } } // Passed Validation: Process the contact plugins to integrate with other applications $results = $dispatcher->trigger('onSubmitContact', array(&$contact, &$data)); // Send the email $sent = false; if (!$params->get('custom_reply')) { $sent = $this->_sendEmail($data, $contact, $params->get('show_email_copy')); } // Set the success message if it was a success if (!($sent instanceof Exception)) { $msg = JText::_('COM_CONTACT_EMAIL_THANKS'); } else { $msg = ''; } // Flush the data from the session $app->setUserState('com_contact.contact.data', null); // Redirect if it is set in the parameters, otherwise redirect back to where we came from if ($contact->params->get('redirect')) { $this->setRedirect($contact->params->get('redirect'), $msg); } else { $this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false), $msg); } return true; } private function _sendEmail($data, $contact, $copy_email_activated) { $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_contact'); if ($contact->email_to == '' && $contact->user_id != 0) { $contact_user = JUser::getInstance($contact->user_id); $contact->email_to = $contact_user->get('email'); } $mailfrom = $app->getCfg('mailfrom'); $fromname = $app->getCfg('fromname'); $sitename = $app->getCfg('sitename'); $copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename); $name = $data['contact_name']; $email = $data['contact_email']; $subject = $data['contact_subject']; $body = $data['contact_message']; // Prepare email body $prefix = JText::sprintf('COM_CONTACT_ENQUIRY_TEXT', JURI::base()); $body = $prefix . "\n" . $name . ' <' . $email . '>' . "\r\n\r\n" . stripslashes($body); $mail = JFactory::getMailer(); $mail->addRecipient($contact->email_to); $mail->addReplyTo(array($email, $name)); $mail->setSender(array($mailfrom, $fromname)); $mail->setSubject($sitename . ': ' . $subject); $mail->setBody($body); $sent = $mail->Send(); // If we are supposed to copy the sender, do so. // Check whether email copy function activated if ($copy_email_activated == true && isset($data['contact_email_copy'])) { $copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename); $copytext .= "\r\n\r\n" . $body; $copysubject = JText::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject); $mail = JFactory::getMailer(); $mail->addRecipient($email); $mail->addReplyTo(array($email, $name)); $mail->setSender(array($mailfrom, $fromname)); $mail->setSubject($copysubject); $mail->setBody($copytext); $sent = $mail->Send(); } return $sent; } } controllers/.htaccess000066600000000177151373364220010727 0ustar00 Order allow,deny Deny from all controllers/index.html000066600000000037151373364220011121 0ustar00 controller.php000066600000002655151373364220007462 0ustar00'INT', 'id'=>'INT', 'cid'=>'ARRAY', 'year'=>'INT', 'month'=>'INT', 'limit'=>'UINT', 'limitstart'=>'UINT', 'showall'=>'INT', 'return'=>'BASE64', 'filter'=>'STRING', 'filter_order'=>'CMD', 'filter_order_Dir'=>'CMD', 'filter-search'=>'STRING', 'print'=>'BOOLEAN', 'lang'=>'CMD'); parent::display($cachable, $safeurlparams); return $this; } } router.php000066600000011142151373364220006606 0ustar00getMenu(); $params = JComponentHelper::getParams('com_contact'); $advanced = $params->get('sef_advanced_link', 0); if (empty($query['Itemid'])) { $menuItem = $menu->getActive(); } else { $menuItem = $menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mCatid = (empty($menuItem->query['catid'])) ? null : $menuItem->query['catid']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if (isset($query['view'])) { $view = $query['view']; if (empty($query['Itemid'])) { $segments[] = $query['view']; } unset($query['view']); }; // are we dealing with a contact that is attached to a menu item? if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == intval($query['id']))) { unset($query['view']); unset($query['catid']); unset($query['id']); return $segments; } if (isset($view) and ($view == 'category' or $view == 'contact')) { if ($mId != intval($query['id']) || $mView != $view) { if($view == 'contact' && isset($query['catid'])) { $catid = $query['catid']; } elseif(isset($query['id'])) { $catid = $query['id']; } $menuCatid = $mId; $categories = JCategories::getInstance('Contact'); $category = $categories->get($catid); if($category) { //TODO Throw error that the category either not exists or is unpublished $path = array_reverse($category->getPath()); $array = array(); foreach($path as $id) { if((int) $id == (int)$menuCatid) { break; } if($advanced) { list($tmp, $id) = explode(':', $id, 2); } $array[] = $id; } $segments = array_merge($segments, array_reverse($array)); } if($view == 'contact') { if($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } $segments[] = $id; } } unset($query['id']); unset($query['catid']); } if (isset($query['layout'])) { if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if ($query['layout'] == 'default') { unset($query['layout']); } } }; return $segments; } /** * Parse the segments of a URL. * * @param array The segments of the URL to parse. * * @return array The URL attributes to be used by the application. */ function ContactParseRoute($segments) { $vars = array(); //Get the active menu item. $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getActive(); $params = JComponentHelper::getParams('com_contact'); $advanced = $params->get('sef_advanced_link', 0); // Count route segments $count = count($segments); // Standard routing for newsfeeds. if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } // From the categories view, we can only jump to a category. $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; $contactCategory = JCategories::getInstance('Contact')->get($id); $categories = ($contactCategory) ? $contactCategory->getChildren() : array(); $vars['catid'] = $id; $vars['id'] = $id; $found = 0; foreach($segments as $segment) { $segment = $advanced ? str_replace(':', '-', $segment) : $segment; foreach($categories as $category) { if ($category->slug == $segment || $category->alias == $segment) { $vars['id'] = $category->id; $vars['catid'] = $category->id; $vars['view'] = 'category'; $categories = $category->getChildren(); $found = 1; break; } } if ($found == 0) { if($advanced) { $db = JFactory::getDBO(); $query = 'SELECT id FROM #__contact_details WHERE catid = '.$vars['catid'].' AND alias = '.$db->Quote($segment); $db->setQuery($query); $nid = $db->loadResult(); } else { $nid = $segment; } $vars['id'] = $nid; $vars['view'] = 'contact'; } $found = 0; } return $vars; }