/** * Method to get the field input markup. * * @return string The field input markup. * */ protected function getInput() { $attributes = $this->buildAttributes(); /*if ($this->value && file_exists(JPATH_ROOT.'/media/com_osmembership/upload/'.$this->value))*/ if ($this->value) { if ($this->name == "osm_avatar") { $str = '<div class="avatar" onclick="jQuery(\'#' . $this->name . '\').trigger(\'click\');" title="Click to Change" style="max-height:100px;overflow:hidden;"><img style="max-width:100px;" src="' . JURI::base() . 'media/com_osmembership/upload/' . OSMembershipHelper::getOriginalFilename($this->value) . '"/></div>'; $str .= '<div><input style="display:none" onchange="jQuery(\'#osm_form\').submit()" type="file" name="' . $this->name . '" id="' . $this->name . '" value=""' . $attributes . $this->extraAttributes . ' /></div>'; return $str; } else { return '<input type="file" name="' . $this->name . '" id="' . $this->name . '" value=""' . $attributes . $this->extraAttributes . ' />. ' . JText::_('OSM_CURRENT_FILE') . ' <strong>' . OSMembershipHelper::getOriginalFilename($this->value) . '</strong> <a href="index.php?option=com_osmembership&task=download_file&file_name=' . $this->value . '">' . JText::_('OSM_DOWNLOAD') . '</a>'; } } else { return '<input type="file" name="' . $this->name . '" id="' . $this->name . '" value=""' . $attributes . $this->extraAttributes . ' />'; } }
?> </div> </div> <div class="col-lg-1"> <div class="arrow_pointer"></div> </div> <div class="col-lg-4"> <div class="inner-addon right-addon"> <h1 class="change-avatar"><span class="light">Change Avatar</span></h1> <?php if (isset($fields['osm_avatar'])) { //echo $fields['osm_avatar']->input; $str = '<div class="avatar" title="Click to Change" style="max-height:100px;overflow:hidden;" class="btn btn-primary btn-lg" data-toggle="modal"><img style="max-width:100px;" src="' . JURI::base() . 'media/com_osmembership/upload/' . OSMembershipHelper::getOriginalFilename($fields['osm_avatar']->value) . '"/></div>'; echo $str; ?> <?php } else { ?> <div class="avatar" data-toggle="modal" style="max-height:100px;overflow:hidden;"> <img src="./templates/propertease/images/profile.png" style="max-width:100px;"> </div> <?php } ?> </div> </div>