Current File : /home/pacjaorg/public_html/km/components/com_djclassifieds/views/profileedit/view.html.php |
<?php
/**
* @package DJ-Classifieds
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*/
defined ('_JEXEC') or die('Restricted access');
class DJClassifiedsViewProfileedit extends JViewLegacy
{
private static $_viewname = 'profileedit';
public function __construct($config = array())
{
parent::__construct($config);
$par = JFactory::getApplication()->getParams('com_djclassifieds');
$this->_addPath('template', JPATH_ROOT.'/components/com_djclassifieds/themes/'.$par->get('theme','default').'/views/'.self::$_viewname);
}
function display($tpl = NULL)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$par = $app->getParams('com_djclassifieds');
DJClassifiedsTheme::loadLanguage('com_users', null);
if(!$user->id){
DJClassifiedsSEO::redirectLogIn();
}
$model = $this->getModel();
$profile = $model->getProfileRow($user->id);
$custom_fields = $model->getCustomFields($profile); // backward view compatibility
$custom_values_c = $model->getCustomValuesCount(); // backward view compatibility
$profile_image = $model->getProfileImage();
$users_form = $model->getUsersForm();
DJClassifiedsTheme::includeDJImageAssets();
DJClassifiedsTheme::includeMapsScript($par);
DJClassifiedsTheme::includeCalendarScripts();
JHTML::_('bootstrap.tooltip');
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.modal'); // show_in_modal fields
$regions = $model->getRegions($par->get('reg_ordering', 'ordering,name'));
$reg_path = $model->getTreePathArray($profile->region_id, $regions, true); // backward compatibility
$this->reg_path_arr = $model->getTreePathArray($profile->region_id, $regions);
$plugin_sections = $app->triggerEvent('onProfileEditFormSections', array($profile, &$custom_fields, &$custom_values_c, &$profile_image, &$par));
DJClassifiedsSEO::setMeta();
DJClassifiedsSEO::setSiteNameInPageTitle();
$this->page_heading = DJClassifiedsSEO::getPageHeading($par);
if(!empty($profile->latitude) && !empty($profile->longitude)){
$this->lat = $profile->latitude;
$this->lon = $profile->longitude;
}else if($app->input->cookie->get('djcf_latlon')){
$lat_lon = explode('_', $app->input->cookie->get('djcf_latlon'));
$this->lat = $lat_lon[0];
$this->lon = $lat_lon[1];
}else{
$loc_coord = DJClassifiedsGeocode::getLocation($par->get('map_lat_lng_address','England, London'));
$this->lat = !empty($loc_coord) ? $loc_coord['lat'] : '';
$this->lon = !empty($loc_coord) ? $loc_coord['lng'] : '';
}
$this->form = $model->getForm();
$this->profile = $profile;
$this->custom_fields = $custom_fields; // backward view compatibility
$this->custom_values_c = $custom_values_c; // backward view compatibility
$this->avatar = $profile_image;
$this->plugin_sections = $plugin_sections;
$this->regions = $regions;
$this->reg_path = $reg_path;
$this->users_form = $users_form;
$this->par = $par;
parent::display();
}
}