本文整理汇总了PHP中JoomleagueHelper::formatName方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::formatName方法的具体用法?PHP JoomleagueHelper::formatName怎么用?PHP JoomleagueHelper::formatName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomleagueHelper
的用法示例。
在下文中一共展示了JoomleagueHelper::formatName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// Get a refrence of the page instance in joomla
$document = JFactory::getDocument();
$model = $this->getModel();
$config = $model->getTemplateConfig($this->getName());
$person = $model->getPerson();
$this->assignRef('project', $model->getProject());
$this->assignRef('overallconfig', $model->getOverallConfig());
$this->assignRef('config', $config);
$this->assignRef('person', $person);
$ref =& $model->getReferee();
if ($ref) {
$titleStr = JText::sprintf('COM_JOOMLEAGUE_REFEREE_ABOUT_AS_A_REFEREE', JoomleagueHelper::formatName(null, $ref->firstname, $ref->nickname, $ref->lastname, $this->config["name_format"]));
} else {
$titleStr = JText::_('Unknown referee within project');
}
$this->assignRef('referee', $ref);
$this->assignRef('history', $model->getHistory('ASC'));
$this->assign('title', $titleStr);
if ($config['show_gameshistory']) {
$this->assignRef('games', $model->getGames());
$this->assignRef('teams', $model->getTeamsIndexedByPtid());
}
if ($person) {
$extended = $this->getExtended($person->extended, 'referee');
$this->assignRef('extended', $extended);
}
$document->setTitle($titleStr);
$this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
parent::display($tpl);
}
示例2: getStaffLink
public static function getStaffLink($item, $params)
{
$flag = "";
if ($params->get('show_flag')) {
$flag = Countries::getCountryFlag($item->country) . " ";
}
$text = "<i>" . JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format")) . "</i>";
if ($params->get('show_staff_link')) {
$link = JoomleagueHelperRoute::getStaffRoute($params->get('p'), $params->get('team'), $item->slug);
echo $flag . JHtml::link($link, $text);
} else {
echo '<i>' . JText::sprintf('%1$s', $flag . $text) . '</i>';
}
}
示例3: searchReferee
public function searchReferee()
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$model = JLGModel::getInstance('Quickadd', 'JoomleagueModel');
$query = JRequest::getVar("query", "", "", "string");
$projectid = $mainframe->getUserState($option . "project");
$results = $model->getNotAssignedReferees($query, $projectid);
$response = array("totalCount" => count($results), "rows" => array());
foreach ($results as $row) {
$name = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, 0) . " (" . $row->id . ")";
$response["rows"][] = array("id" => $row->id, "name" => $name);
}
echo json_encode($response);
exit;
}
示例4: display
public function display($tpl = null)
{
// Get a refrence of the page instance in joomla
$document = JFactory::getDocument();
$model = $this->getModel();
$config = $model->getTemplateConfig($this->getName());
$person = $model->getPerson();
$project = $model->getProject();
$current_round = $project->current_round;
$personid = $model->personid;
$this->project = $model->getProject();
$this->overallconfig = $model->getOverallConfig();
$this->config = $config;
$this->person = $person;
$staff = $model->getTeamStaffByRound($current_round, $personid);
$this->teamStaff = $staff;
$this->history = $model->getStaffHistory('ASC');
$this->stats = $model->getStats($current_round, $personid);
$this->staffstats = $model->getStaffStats($current_round, $personid);
$this->historystats = $model->getHistoryStaffStats($current_round, $personid);
$this->showediticon = $model->getAllowed($config['edit_own_player']);
$extended = $this->getExtended($person->extended, 'staff');
$this->extended = $extended;
if (isset($person)) {
$name = JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]);
}
// Set page title
$titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_STAFF_PAGE_TITLE'));
$titleInfo->personName = $name;
if (!empty($this->project)) {
$titleInfo->projectName = $this->project->name;
$titleInfo->leagueName = $this->project->league_name;
$titleInfo->seasonName = $this->project->season_name;
}
$division = $model->getDivision(JRequest::getInt('division', 0));
if (!empty($division) && $division->id != 0) {
$titleInfo->divisionName = $division->name;
}
$this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
$document->setTitle($this->pagetitle);
parent::display($tpl);
}
示例5: defined
<?php
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.mootools');
$modalheight = JComponentHelper::getParams('com_joomleague')->get('modal_popup_height', 600);
$modalwidth = JComponentHelper::getParams('com_joomleague')->get('modal_popup_width', 900);
?>
<table class="contentpaneopen">
<tr>
<td class="contentheading">
<?php
echo JText::sprintf('COM_JOOMLEAGUE_PLAYER_INFORMATION', JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]));
if ($this->showediticon) {
/*
$link = JoomleagueHelperRoute::getPlayerRoute( $this->project->id, $this->teamPlayer->team_id, $this->person->id, 'person.edit' );
$desc = JHTML::image(
"media/com_joomleague/jl_images/edit.png",
JText::_( 'COM_JOOMLEAGUE_PERSON_EDIT' ),
array( "title" => JText::_( "COM_JOOMLEAGUE_PERSON_EDIT" ) )
);
echo " ";
echo JHTML::_('link', $link, $desc );
*/
?>
<a rel="{handler: 'iframe',size: {x: <?php
echo $modalwidth;
?>
,y: <?php
echo $modalheight;
?>
示例6: defined
/**
* Joomleague
*
* @copyright Copyright (C) 2006-2015 joomleague.at. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link http://www.joomleague.at
*/
defined('_JEXEC') or die;
?>
<fieldset class="adminform">
<legend>
<?php
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_DETAILS_TITLE', JoomleagueHelper::formatName(null, $this->project_teamstaff->firstname, $this->project_teamstaff->nickname, $this->project_teamstaff->lastname, 0), $this->teamws->name, $this->projectws->name);
?>
</legend>
<table class="admintable table">
<tr>
<td width="20%" valign="top" align="right" class="key">
<label for="position">
<?php
echo JText::_('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_POS');
?>
</label>
</td>
<td colspan="7">
<?php
echo $this->lists['projectpositions'];
?>
示例7: _displayEditlist
function _displayEditlist($tpl)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$project_id = $mainframe->getUserState($option . 'project');
$uri = JFactory::getURI();
$filter_state = $mainframe->getUserStateFromRequest($option . 'p_filter_state', 'filter_state', '', 'word');
$filter_order = $mainframe->getUserStateFromRequest($option . 'p_filter_order', 'filter_order', 'p.lastname', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'p_filter_order_Dir', 'filter_order_Dir', '', 'word');
$search = $mainframe->getUserStateFromRequest($option . 'p_search', 'search', '', 'string');
$search_mode = $mainframe->getUserStateFromRequest($option . 'p_search_mode', 'search_mode', '', 'string');
$model = $this->getModel();
$projectplayer =& $this->get('Data');
$total =& $this->get('Total');
$pagination =& $this->get('Pagination');
// state filter
$lists['state'] = JHTML::_('grid.state', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
$lists['search_mode'] = $search_mode;
$projectws =& $this->get('Data', 'projectws');
//build the html select list for project assigned players
$ress = array();
$res1 = array();
$notusedplayers = array();
if ($ress =& $model->getProjectPlayers()) {
foreach ($ress1 as $res1) {
$used = 0;
foreach ($ress as $res) {
if ($res1->value == $res->value) {
$used = 1;
}
}
if ($used == 0) {
$notusedplayers[] = JHTML::_('select.option', $res1->value, JoomleagueHelper::formatName(null, $res1->firstname, $res1->nickname, $res1->lastname, 0) . ' (' . $res1->notes . ')');
}
}
} else {
foreach ($ress1 as $res1) {
$notusedplayers[] = JHTML::_('select.option', $res1->value, JoomleagueHelper::formatName(null, $res1->firstname, $res1->nickname, $res1->lastname, 0) . ' (' . $res1->notes . ')');
}
}
//build the html select list for players
if (count($notusedplayers) > 0) {
$lists['players'] = JHTML::_('select.genericlist', $notusedplayers, 'playerslist[]', ' style="width:150px" class="inputbox" multiple="true" size="30"', 'value', 'text');
} else {
$lists['players'] = '<select name="playerslist[]" id="playerslist" style="width:150px" class="inputbox" multiple="true" size="10"></select>';
}
unset($res);
unset($res1);
unset($notusedplayers);
$this->assignRef('user', JFactory::getUser());
$this->assignRef('lists', $lists);
$this->assignRef('projectplayer', $projectplayer);
$this->assignRef('projectws', $projectws);
$this->assignRef('pagination', $pagination);
$this->assignRef('request_url', $uri->toString());
parent::display($tpl);
}
示例8: elseif
</td>
<td class="center">
<?php
echo $row->person_id;
?>
</td>
<td class="center">
<?php
if ($row->picture == '') {
$imageTitle = JText::_('COM_JOOMLEAGUE_ADMIN_TSTAFFS_NO_IMAGE');
echo JHtml::_('image', 'administrator/components/com_joomleague/assets/images/delete.png', $imageTitle, 'title= "' . $imageTitle . '"');
} elseif ($row->picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
$imageTitle = JText::_('COM_JOOMLEAGUE_ADMIN_TSTAFFS_DEFAULT_IMAGE');
echo JHtml::_('image', 'administrator/components/com_joomleague/assets/images/information.png', $imageTitle, 'title= "' . $imageTitle . '"');
} elseif ($row->picture == !'') {
$playerName = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, 0);
echo JoomleagueHelper::getPictureThumb($row->picture, $playerName, 0, 21, 4);
}
?>
</td>
<td class="nowrap" class="center">
<?php
if ($row->project_position_id != 0) {
$selectedvalue = $row->project_position_id;
$append = '';
} else {
$selectedvalue = 0;
$append = '';
}
if ($append != '') {
?>
示例9: foreach
if ($this->matchreferees) {
?>
<tr>
<td colspan="3" >
<span class="label"><?php
echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_REFEREE');
?>
</span>
<?php
$first = true;
foreach ($this->matchreferees as $referee) {
$referee_link = JoomleagueHelperRoute::getRefereeRoute($this->project->id, $referee->id);
if (!$first) {
echo ', ';
}
$link = JHTML::link($referee_link, JoomleagueHelper::formatName(null, $referee->firstname, $referee->nickname, $referee->lastname, $this->config["name_format"]));
if ($this->config["show_referee_position"] == 1) {
$link .= ' (' . $referee->position_name . ')';
}
?>
<span><?php
echo $link;
?>
</span>
<?php
$first = false;
}
?>
</td>
</tr>
<tr>
示例10: printName
public static function printName($item, $team, $params, $project)
{
$name = JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format"));
if ($params->get('show_player_link')) {
return JHtml::link(JoomleagueHelperRoute::getPlayerRoute($project->slug, $team->team_slug, $item->person_id), $name);
} else {
echo $name;
}
}
示例11: isset
}
}
?>
<tr class="<?php
echo $class;
?>
"<?php
echo $favStyle;
?>
>
<td class="rank"><?php
echo $rank;
?>
</td>
<?php
$playerName = JoomleagueHelper::formatName(null, $row->fname, $row->nname, $row->lname, $this->config['name_format']);
?>
<?php
if ($this->config['show_picture_thumb'] == 1) {
?>
<td class="td_c playerpic">
<?php
$picture = isset($row->teamplayerpic) ? $row->teamplayerpic : null;
if (empty($picture) || $picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
$picture = $row->picture;
}
if (!file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder("player");
}
echo JoomleagueHelper::getPictureThumb($picture, $playerName, $this->config['player_picture_width'], $this->config['player_picture_height']);
?>
示例12: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.7
*/
protected function addToolbar()
{
// Set toolbar items for the page
$edit = JRequest::getVar('edit', true);
$option = JRequest::getCmd('option');
$params = JComponentHelper::getParams($option);
$default_name_format = $params->get("name_format");
$name = JoomleagueHelper::formatName(null, $this->project_teamstaff->firstname, $this->project_teamstaff->nickname, $this->project_teamstaff->lastname, $default_name_format);
$text = !$edit ? JText::_('COM_JOOMLEAGUE_GLOBAL_NEW') : JText::_('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_TITLE') . ': ' . $name;
JToolBarHelper::title($text);
JLToolBarHelper::save('teamstaff.save');
if (!$edit) {
JLToolBarHelper::cancel('teamstaff.cancel');
} else {
// for existing items the button is renamed `close` and the apply button is showed
JLToolBarHelper::apply('teamstaff.apply');
JLToolBarHelper::cancel('teamstaff.cancel', 'COM_JOOMLEAGUE_GLOBAL_CLOSE');
}
JToolBarHelper::back();
JToolBarHelper::help('screen.joomleague', true);
}
示例13:
</thead>
<?php
$k = 0;
for ($i = 0, $n = count($this->stafflist); $i < $n; $i++) {
$row =& $this->stafflist[$i];
?>
<tr class="<?php
echo $k == 0 ? $this->config['style_class1'] : $this->config['style_class2'];
?>
">
<?php
if ($this->config['show_player_numbers']) {
?>
<td width="30" class="td_c"> </td><?php
}
$playerName = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, $this->config["name_format_staff"]);
if ($this->config['show_staff_icon']) {
$picture = $row->picture;
if (empty($picture) || $picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
$picture = $row->ppic;
}
if (!file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder("player");
}
?>
<td width="40" class="td_c" nowrap="nowrap">
<?php
if (!$this->config['show_highslide']) {
/*
echo JoomleagueHelper::getPictureThumb($picture, $playerName,
$this->config['staff_picture_width'],
示例14: defined
<?php
defined('_JEXEC') or die('Restricted access');
?>
<fieldset class="adminform">
<legend>
<?php
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_TEAMPLAYER_PIC_TITLE', JoomleagueHelper::formatName(null, $this->project_player->firstname, $this->project_player->nickname, $this->project_player->lastname, 0), '<i>' . $this->teamws->name . '</i>', '<i>' . $this->projectws->name . '</i>');
?>
</legend>
<table class="admintable">
<?php
foreach ($this->form->getFieldset($this->cfg_which_media_tool) as $field) {
?>
<tr>
<td class="key"><?php
echo $field->label;
?>
</td>
<td><?php
echo $field->input;
?>
</td>
</tr>
<?php
}
?>
</table>
</fieldset>
示例15: _displayEditlineup
function _displayEditlineup($tpl)
{
$option = JRequest::getCmd('option');
$app = JFactory::getApplication();
$project_id = $app->getUserState($option . 'project');
$document = JFactory::getDocument();
$tid = JRequest::getVar('team', '0');
$params = JComponentHelper::getParams($option);
$default_name_format = $params->get("name_format");
$default_name_dropdown_list_order = $params->get("cfg_be_name_dropdown_list_order", "lastname");
// add the js script
$version = urlencode(JoomleagueHelper::getVersion());
$document->addScript(JUri::base() . 'components/com_joomleague/assets/js/startinglineup.js?v=' . $version);
$model = $this->getModel();
$teams = $model->getMatchTeams();
if (is_null($teams)) {
JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_TEAM_MATCH') . '<br /><br />');
return false;
}
$teamname = $tid == $teams->projectteam1_id ? $teams->team1 : $teams->team2;
$this->_handlePreFillRoster($teams, $model, $params, $tid, $teamname);
// get starters
$starters = $model->getRoster($tid);
$starters_id = array_keys($starters);
// get players not already assigned to starter
$not_assigned = $model->getTeamPlayers($tid, $starters_id, $default_name_dropdown_list_order);
if (!$not_assigned && !$starters_id) {
JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_PLAYERS_MATCH') . '<br /><br />');
return false;
}
$projectpositions = $model->getProjectPositions();
if (!$projectpositions) {
JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_POS') . '<br /><br />');
return false;
}
// build select list for not assigned players
$not_assigned_options = array();
foreach ((array) $not_assigned as $p) {
if ($p->jerseynumber > 0) {
$jerseynumber = '[' . $p->jerseynumber . '] ';
} else {
$jerseynumber = '';
}
switch ($default_name_dropdown_list_order) {
case 'lastname':
case 'firstname':
$not_assigned_options[] = JHtml::_('select.option', $p->value, $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
break;
case 'position':
$not_assigned_options[] = JHtml::_('select.option', $p->value, '(' . JText::_($p->positionname) . ') - ' . $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
break;
}
}
$lists['team_players'] = JHtml::_('select.genericlist', $not_assigned_options, 'roster[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="18"', 'value', 'text');
// build position select
$selectpositions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_IN_POSITION'));
$selectpositions = array_merge($selectpositions, $model->getProjectPositionsOptions(0, 1));
$lists['projectpositions'] = JHtml::_('select.genericlist', $selectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', NULL, false, true);
// build player select for substitutions
// starters + came in (because of multiple substitutions possibility in amateur soccer clubs for example)
$substitutions = $model->getSubstitutions($tid);
$starters = array_merge($starters, $substitutions[$tid]);
// not assigned players + went out (because of multiple substitutions possibility in amateur soccer clubs for example)
$not_assigned = array_merge($not_assigned, $substitutions[$tid]);
// filter out duplicates $starters
$new_starters = array();
$exclude = array("");
for ($i = 0; $i <= count($starters) - 1; $i++) {
if (!in_array(trim($starters[$i]->value), $exclude)) {
$new_starters[] = $starters[$i];
$exclude[] = trim($starters[$i]->value);
}
}
// filter out duplicates $not_assigned
$new_not_assigned = array();
$exclude = array("");
for ($i = 0; $i <= count($not_assigned) - 1; $i++) {
if (array_key_exists('came_in', $not_assigned[$i]) && $not_assigned[$i]->came_in == 1) {
if (!in_array(trim($not_assigned[$i]->in_for), $exclude)) {
$new_not_assigned[] = $not_assigned[$i];
$exclude[] = trim($not_assigned[$i]->in_for);
}
} elseif (!array_key_exists('came_in', $not_assigned[$i])) {
if (!in_array(trim($not_assigned[$i]->value), $exclude)) {
$new_not_assigned[] = $not_assigned[$i];
$exclude[] = trim($not_assigned[$i]->value);
}
}
}
$playersoptions_subs_out = array();
$playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
$i = 0;
foreach ((array) $new_starters as $player) {
switch ($default_name_dropdown_list_order) {
case 'lastname':
case 'firstname':
if (array_key_exists('came_in', $player)) {
$i++;
if ($i == 1) {
$playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_IN'));
//.........这里部分代码省略.........