| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/administrator/components/com_community/views/profiles/ |
Upload File : |
<?php
/**
* @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
* @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @author iJoomla.com <webmaster@ijoomla.com>
* @url https://www.jomsocial.com/license-agreement
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Version;
// Disallow direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.application.component.view' );
/**
* Configuration view for JomSocial
*/
class CommunityViewProfiles extends HtmlView
{
/**
* The default method that will display the output of this view which is called by
* Joomla
*
* @param string template Template file name
**/
public function display( $tpl = null )
{
$profile = $this->getModel( 'Profiles' );
$fields = $profile->getFields(true);
$pagination = $profile->getPagination();
$this->set( 'fields' , $fields );
$this->set( 'pagination' , $pagination );
parent::display( $tpl );
}
/**
* Method to get the Field type in text
*
* @param string Type of field
*
* @return string Text representation of the field type.
**/
public function getFieldText( $type )
{
$model = $this->getModel( 'Profiles' );
$types = $model->getProfileTypes();
$value = isset( $types[ $type ] ) ? $types[ $type ] : '';
return $value;
}
/**
* Method to get the publish status HTML
*
* @param object Field object
* @param string Type of the field
* @param string The ajax task that it should call
* @return string HTML source
**/
public function getPublish( &$row , $type , $ajaxTask )
{
$version = new Version();
$currentV = $version->getHelpVersion();
$alts = array( 0 => Text::_('COM_COMMUNITY_UNPUBLISH'),
1 => Text::_('COM_COMMUNITY_PUBLISHED'),
2 => Text::_('COM_COMMUNITY_ADMINONLY'));
$key = $row->$type?$row->$type:0;
$alt = $alts[$key];
$state = $row->$type ? 'publish' : 'unpublish';
$class = 'jgrid';
$span = '<span class="state '.$state.'"><span class="text">'.$alt.'</span></span></a>';
if($currentV >= '0.30')
{
$class = $row->type == 1 ? 'disabled jgrid': '';
$span = '<i class="icon-'.$state.'""></i>';
}
$href = '<a class="'.$class.'" href="javascript:void(0);" onclick="azcommunity.togglePublish(\'' . $ajaxTask . '\',\'' . $row->id . '\',\'' . $type . '\');">';
$href .= $span;
return $href;
}
/**
* Method to get the publish status HTML
*
* @param object Field object
* @param string Type of the field
* @param string The ajax task that it should call
* @return string HTML source
**/
public function showPublish( &$row , $type)
{
$imgY = 'tick.png';
$imgX = 'publish_x.png';
$image = $row->$type ? $imgY : $imgX;
$state = $row->$type ? 'publish' : 'unpublish';
$alt = $row->$type ? Text::_('COM_COMMUNITY_PUBLISHED') : Text::_('COM_COMMUNITY_UNPUBLISH');
$href = '<a class="jgrid"><span class="state '.$state.'"><span class="text">'.$alt.'</span></a>';
return $href;
}
/**
* Private method to set the toolbar for this view
*
* @access private
*
* @return null
**/
public function setToolBar()
{
// Set the titlebar text
ToolbarHelper::title( Text::_('COM_COMMUNITY_CUSTOM_PROFILES'), 'profiles' );
// Add the necessary buttons
ToolBarHelper::publishList('publish', Text::_('COM_COMMUNITY_PUBLISH'));
ToolBarHelper::unpublishList('unpublish', Text::_('COM_COMMUNITY_UNPUBLISH'));
ToolBarHelper::divider();
ToolBarHelper::trash('removefield', Text::_('COM_COMMUNITY_DELETE'));
ToolBarHelper::addNew('newgroup', Text::_('COM_COMMUNITY_PROFILES_NEW_GROUP'));
ToolBarHelper::addNew('newfield', Text::_('COM_COMMUNITY_NEW_FIELD'));
}
}