Ejemplo n.º 1
0
	/**
	 * Load user form.
	 *
	 * @return void
	 */
	protected function before()
	{
		parent::before();

		$userParams = JComponentHelper::getParams('com_users');

		// Check if user is allowed to change his name.
		$this->changeUsername = $userParams->get('change_login_name', 1);

		// Check to see if Frontend User Params have been enabled.
		if ($userParams->get('frontend_userparams', 0))
		{
			JFactory::getLanguage()->load('com_users', JPATH_ADMINISTRATOR);

			JForm::addFormPath(JPATH_ROOT . '/components/com_users/models/forms');
			JForm::addFieldPath(JPATH_ROOT . '/components/com_users/models/fields');

			JPluginHelper::importPlugin('user');

			$registry = new JRegistry($this->user->params);
			$form = JForm::getInstance('com_users.profile', 'frontend');
			$data = new StdClass;
			$data->params = $registry->toArray();
			$dispatcher = JDispatcher::getInstance();
			$dispatcher->trigger('onContentPrepareForm', array($form, $data));

			$form->bind($data);
			$this->frontendForm = $form->getFieldset('params');
		}

		$this->headerText = JText::_('COM_KUNENA_PROFILE_EDIT_USER_TITLE');
	}
Ejemplo n.º 2
0
 /**
  * Prepare Kunena user settings.
  *
  * @return void
  */
 protected function before()
 {
     parent::before();
     $item = new StdClass();
     $item->name = 'messageordering';
     $item->label = JText::_('COM_KUNENA_USER_ORDER');
     $options = array();
     $options[] = JHtml::_('select.option', 0, JText::_('COM_KUNENA_USER_ORDER_KUNENA_GLOBAL'));
     $options[] = JHtml::_('select.option', 2, JText::_('COM_KUNENA_USER_ORDER_ASC'));
     $options[] = JHtml::_('select.option', 1, JText::_('COM_KUNENA_USER_ORDER_DESC'));
     $item->field = JHtml::_('select.genericlist', $options, 'messageordering', 'class="kinputbox form-control" size="1"', 'value', 'text', $this->escape($this->profile->ordering), 'kmessageordering');
     $this->settings[] = $item;
     $item = new StdClass();
     $item->name = 'hidemail';
     $item->label = JText::_('COM_KUNENA_USER_HIDEEMAIL');
     $options = array();
     $options[] = JHtml::_('select.option', 0, JText::_('COM_KUNENA_NO'));
     $options[] = JHtml::_('select.option', 1, JText::_('COM_KUNENA_YES'));
     $item->field = JHtml::_('select.genericlist', $options, 'hidemail', 'class="kinputbox form-control" size="1"', 'value', 'text', $this->escape($this->profile->hideEmail), 'khidemail');
     $this->settings[] = $item;
     $item = new StdClass();
     $item->name = 'showonline';
     $item->label = JText::_('COM_KUNENA_USER_SHOWONLINE');
     $options = array();
     $options[] = JHtml::_('select.option', 0, JText::_('COM_KUNENA_NO'));
     $options[] = JHtml::_('select.option', 1, JText::_('COM_KUNENA_YES'));
     $item->field = JHtml::_('select.genericlist', $options, 'showonline', 'class="kinputbox form-control" size="1"', 'value', 'text', $this->escape($this->profile->showOnline), 'kshowonline');
     $this->settings[] = $item;
     $item = new StdClass();
     $item->name = 'cansubscribe';
     $item->label = JText::_('COM_KUNENA_USER_CANSUBSCRIBE');
     $options = array();
     $options[] = JHtml::_('select.option', -1, JText::_('COM_KUNENA_USER_ORDER_KUNENA_GLOBAL'));
     $options[] = JHtml::_('select.option', 0, JText::_('COM_KUNENA_NO'));
     $options[] = JHtml::_('select.option', 1, JText::_('COM_KUNENA_YES'));
     $item->field = JHtml::_('select.genericlist', $options, 'cansubscribe', 'class="kinputbox form-control" size="1"', 'value', 'text', $this->escape($this->profile->canSubscribe), 'kcansubscribe');
     $this->settings[] = $item;
     $item = new StdClass();
     $item->name = 'userlisttime';
     $item->label = JText::_('COM_KUNENA_USER_USERLISTTIME');
     $options = array();
     $options[] = JHtml::_('select.option', -2, JText::_('COM_KUNENA_USER_ORDER_KUNENA_GLOBAL'));
     $options[] = JHtml::_('select.option', -1, JText::_('COM_KUNENA_SHOW_ALL'));
     $options[] = JHtml::_('select.option', 0, JText::_('COM_KUNENA_SHOW_LASTVISIT'));
     $options[] = JHtml::_('select.option', 4, JText::_('COM_KUNENA_SHOW_4_HOURS'));
     $options[] = JHtml::_('select.option', 8, JText::_('COM_KUNENA_SHOW_8_HOURS'));
     $options[] = JHtml::_('select.option', 12, JText::_('COM_KUNENA_SHOW_12_HOURS'));
     $options[] = JHtml::_('select.option', 24, JText::_('COM_KUNENA_SHOW_24_HOURS'));
     $options[] = JHtml::_('select.option', 48, JText::_('COM_KUNENA_SHOW_48_HOURS'));
     $options[] = JHtml::_('select.option', 168, JText::_('COM_KUNENA_SHOW_WEEK'));
     $options[] = JHtml::_('select.option', 720, JText::_('COM_KUNENA_SHOW_MONTH'));
     $options[] = JHtml::_('select.option', 8760, JText::_('COM_KUNENA_SHOW_YEAR'));
     $item->field = JHtml::_('select.genericlist', $options, 'userlisttime', 'class="kinputbox form-control" size="1"', 'value', 'text', $this->escape($this->profile->userListtime), 'kuserlisttime');
     $this->settings[] = $item;
     $this->headerText = JText::_('COM_KUNENA_PROFILE_EDIT_SETTINGS_TITLE');
 }
Ejemplo n.º 3
0
 /**
  * Prepare avatar form.
  *
  * @return void
  *
  * @throws KunenaExceptionAuthorise
  */
 protected function before()
 {
     parent::before();
     $avatar = KunenaFactory::getAvatarIntegration();
     if (!$avatar instanceof KunenaAvatarKunena) {
         throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_AUTH_ERROR_USER_EDIT_AVATARS'), 404);
     }
     $path = JPATH_ROOT . '/media/kunena/avatars/gallery';
     $this->gallery = $this->input->getString('gallery', '');
     $this->galleries = $this->getGalleries($path);
     $this->galleryOptions = $this->getGalleryOptions($path);
     $this->galleryImages = isset($this->galleries[$this->gallery]) ? $this->galleries[$this->gallery] : reset($this->galleries);
     $this->galleryUri = JUri::root(true) . '/media/kunena/avatars/gallery';
     $this->headerText = JText::_('COM_KUNENA_PROFILE_EDIT_AVATAR_TITLE');
 }
Ejemplo n.º 4
0
 /**
  * Prepare profile form items.
  *
  * @return void
  */
 protected function before()
 {
     parent::before();
     $bd = $this->profile->birthdate ? explode("-", $this->profile->birthdate) : array();
     if (count($bd) == 3) {
         $this->birthdate["year"] = $bd[0];
         $this->birthdate["month"] = $bd[1];
         $this->birthdate["day"] = $bd[2];
     }
     $this->genders[] = JHtml::_('select.option', '0', JText::_('COM_KUNENA_MYPROFILE_GENDER_UNKNOWN'));
     $this->genders[] = JHtml::_('select.option', '1', JText::_('COM_KUNENA_MYPROFILE_GENDER_MALE'));
     $this->genders[] = JHtml::_('select.option', '2', JText::_('COM_KUNENA_MYPROFILE_GENDER_FEMALE'));
     $this->social = array('twitter', 'facebook', 'myspace', 'skype', 'linkedin', 'delicious', 'friendfeed', 'digg', 'yim', 'aim', 'gtalk', 'icq', 'msn', 'blogspot', 'flickr', 'bebo');
     $this->headerText = JText::_('COM_KUNENA_PROFILE_EDIT_PROFILE_TITLE');
 }