本文整理汇总了PHP中CLMText::sgpl方法的典型用法代码示例。如果您正苦于以下问题:PHP CLMText::sgpl方法的具体用法?PHP CLMText::sgpl怎么用?PHP CLMText::sgpl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLMText
的用法示例。
在下文中一共展示了CLMText::sgpl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AdminLink
?>
</td>
<td align="center">
<?php
echo JHTML::_('date', $row->datum, JText::_('DATE_FORMAT_CLM'));
?>
</td>
<td align="center">
<?php
$adminLink = new AdminLink();
$adminLink->view = "turroundmatches";
$adminLink->more = array('turnierid' => $this->param['id'], 'roundid' => $row->id);
$adminLink->makeURL();
echo '<a href="' . $adminLink->url . '">' . CLMText::sgpl($row->countMatches, JText::_('MATCH'), JText::_('MATCHES')) . '</a>';
?>
</td>
<td align="center">
<?php
echo $row->countAssigned . " " . JText::_('MATCHES_ASSIGNED');
echo '<br />' . $row->countResults . " " . JText::_('MATCHES_PLAYED');
?>
</td>
<td align="center">
<?php
echo $published;
?>
</td>
示例2: _removeDo
function _removeDo()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// Turnierdaten holen
$turnier = JTable::getInstance('turniere', 'TableCLM');
$turnier->load($this->id);
// Daten zu dieser ID laden
// Turnier existent?
if (!$turnier->id) {
JError::raiseWarning(500, CLMText::errorText('TOURNAMENT', 'NOTEXISTING'));
return false;
}
$clmAccess = clm_core::$access;
if ($turnier->tl != clm_core::$access->getJid() and $clmAccess->access('BE_tournament_edit_detail') !== true or $clmAccess->access('BE_tournament_edit_detail') === false) {
//if (clm_core::$access->getType() != 'admin' AND clm_core::$access->getType() != 'tl') {
JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS'));
return false;
}
// Wenn Ergebnisse gemeldet keine nachträgliche Löschung erlauben
$tournament = new CLMTournament($this->id);
$tournament->checkTournamentStarted();
if ($tournament->started) {
JError::raiseWarning(500, JText::_('DELETION_NOT_POSSIBLE') . ": " . JText::_('RESULTS_ENTERED'));
return false;
}
// ausgewählte Einträge
$cid = JRequest::getVar('cid', array(), '', 'array');
JArrayHelper::toInteger($cid);
if (count($cid) < 1) {
JError::raiseWarning(500, JText::_('NO_ITEM_SELECTED', true));
return false;
}
// alle Checks erledigt
$cids = implode(',', $cid);
$query = 'DELETE FROM #__clm_turniere_tlnr' . ' WHERE turnier = ' . $turnier->id . ' AND id IN ( ' . $cids . ' )';
$this->_db->setQuery($query);
if (!$this->_db->query()) {
JError::raiseWarning(500, JText::_('DB_ERROR', true));
return false;
}
$text = CLMText::sgpl(count($cid), JText::_('PLAYER'), JText::_('PLAYERS')) . " " . JText::_('DELETED');
// Log schreiben
$clmLog = new CLMLog();
$clmLog->aktion = $text;
$clmLog->params = array('sid' => $turnier->sid, 'tid' => $turnier->id, 'cids' => count($cid));
$clmLog->write();
// Message
$app = JFactory::getApplication();
$app->enqueueMessage($text);
return true;
}
示例3: publish
function publish()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// termine? evtl global inconstruct anlegen
$user = JFactory::getUser();
$cid = JRequest::getVar('cid', array(), '', 'array');
JArrayHelper::toInteger($cid);
$task = JRequest::getCmd('task');
$publish = $task == 'publish';
// zu vergebender Wert 0/1
// Inhalte übergeben?
if (empty($cid)) {
JError::raiseWarning(500, 'NO_ITEM_SELECTED');
} else {
// ja, Inhalte vorhanden
// erst jetzt alle Einträge durchgehen
foreach ($cid as $key => $value) {
// load the row from the db table
$row = JTable::getInstance('termine', 'TableCLM');
$row->load($value);
// Daten zu dieser ID laden
// Änderung nötig?
if ($row->published != $publish) {
// Log
$clmLog = new CLMLog();
$clmLog->aktion = JText::_('TERMINE') . " " . $row->name . ": " . $task;
$clmLog->params = array();
$clmLog->write();
// Log geschrieben - Änderungen später
} else {
unset($cid[$key]);
}
}
// alle Einträge geprüft
// immer noch Einträge vorhanden?
if (!empty($cid)) {
$row = JTable::getInstance('termine', 'TableCLM');
$row->publish($cid, $publish);
// Meldung erstellen
$app = JFactory::getApplication();
if ($publish) {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('TERMINE_TASK'), JText::_('TERMINE_TASKS')) . " " . JText::_('CLM_PUBLISHED'));
} else {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('TERMINE_TASK'), JText::_('TERMINE_TASKS')) . " " . JText::_('CLM_UNPUBLISHED'));
}
} else {
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('NO_CHANGES'));
}
}
$this->adminLink->makeURL();
$this->setRedirect($this->adminLink->url);
}
示例4: publish
function publish()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// Instanz der Tabelle
$row = JTable::getInstance('turniere', 'TableCLM');
$row->load($this->id);
// Daten zu dieser ID laden
$clmAccess = clm_core::$access;
if ($row->tl != clm_core::$access->getJid() and $clmAccess->access('BE_tournament_edit_detail') !== true or $clmAccess->access('BE_tournament_edit_detail') === false) {
//if (clm_core::$access->getType() != 'admin' AND clm_core::$access->getType() != 'tl') {
JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS'));
return false;
}
// TODO? evtl global inconstruct anlegen
$user = JFactory::getUser();
$cid = JRequest::getVar('cid', array(), '', 'array');
JArrayHelper::toInteger($cid);
$task = JRequest::getCmd('task');
$publish = $task == 'publish';
// zu vergebender Wert 0/1
// Inhalte übergeben?
if (empty($cid)) {
JError::raiseWarning(500, 'NO_ITEM_SELECTED');
} else {
// ja, Inhalte vorhanden
$cids = implode(',', $cid);
$query = 'UPDATE #__clm_turniere_rnd_termine' . ' SET published = ' . (int) $publish . ' WHERE id IN ( ' . $cids . ' )' . ' AND ( checked_out = 0 OR ( checked_out = ' . (int) $user->get('id') . ' ) )';
$this->_db->setQuery($query);
if (!$this->_db->query()) {
JError::raiseWarning(500, JText::_('DB_ERROR', true));
}
$app = JFactory::getApplication();
if ($publish) {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('ROUND'), JText::_('ROUNDS')) . " " . JText::_('CLM_PUBLISHED'));
} else {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('ROUND'), JText::_('ROUNDS')) . " " . JText::_('CLM_UNPUBLISHED'));
}
// Log
$clmLog = new CLMLog();
$clmLog->aktion = JText::_('ROUND') . " " . $row->name . ": " . $task;
$clmLog->params = array('tid' => $this->id);
// TurnierID wird als LigaID gespeichert
$clmLog->write();
}
$this->adminLink->makeURL();
$this->setRedirect($this->adminLink->url);
}
示例5: floor
}
echo '</tr>';
// Ende der Zeile
}
// Abschlußzeile
echo '<tr class="ende">';
// total
echo '<td colspan="3"> ';
echo JText::_('TEAM_TOTAL');
echo '</td>';
// TWZ-Schnitt
echo '<td class="tp_col_4">';
if ($this->player->countTWZplayers > 0) {
echo 'Ø ' . floor($this->player->sumTWZ / $this->player->countTWZplayers);
if ($this->player->countTWZplayersNone > 0) {
echo '<br />(' . CLMText::sgpl($this->player->countTWZplayers, JText::_('TOURNAMENT_PLAYER'), JText::_('TOURNAMENT_PLAYERS'), $complete_string = TRUE) . ')';
}
} else {
echo '-';
}
echo '</td>';
// Pkt
echo '<td class="tp_col_5">';
echo $this->player->sum_punkte . " / " . $this->player->countMatchesPlayed;
echo '<br />' . CLMText::getPosString($this->player->rankingPos, 2);
echo '</td>';
echo '</tr>';
?>
</table>
<!--Bereich für pgn-Viewer-->
示例6: _resetDo
function _resetDo()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// Instanz der Tabelle
$row = JTable::getInstance('turniere', 'TableCLM');
$row->load($this->turnierid);
$clmAccess = clm_core::$access;
if ($row->tl != clm_core::$access->getJid() and $clmAccess->access('BE_tournament_edit_round') !== true or $clmAccess->access('BE_tournament_edit_round') === false) {
JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS'));
return false;
}
$user = JFactory::getUser();
// Reale RundenNummer, DG aus RundenID ermitteln, tl_ok
$query = 'SELECT nr, dg, tl_ok' . ' FROM #__clm_turniere_rnd_termine' . ' WHERE id = ' . $this->roundid;
$this->_db->setQuery($query);
list($runde, $dg, $tl_ok) = $this->_db->loadRow();
// wenn Runde schon bestätigt, zurücksetzen nicht erlauben
if ($tl_ok == 1) {
JError::raiseWarning(500, CLMText::errorText('ROUND', 'ALREADYAPPROVED'));
return false;
}
// sind überhaupt Ergebnisse eingetragen?
$query = "SELECT COUNT(*) FROM #__clm_turniere_rnd_spl" . " WHERE turnier = " . $this->turnierid . " AND runde = " . $runde . " AND dg = " . $dg . " AND ergebnis IS NOT NULL";
$this->_db->setQuery($query);
$resultCount = $this->_db->loadResult();
if ($resultCount == 0) {
JError::raiseWarning(500, CLMText::errorText('RESULTS', 'NOTEXISTING'));
return false;
}
// Runde anpassen
$query = "UPDATE #__clm_turniere_rnd_termine" . " SET gemeldet = NULL, zeit ='000e0-00-00 00:00:00', editor = " . $user->id . ", edit_zeit = NOW()" . " WHERE id = " . $this->roundid;
$this->_db->setQuery($query);
$this->_db->query();
// Ergebnisse löschen
$query = "UPDATE #__clm_turniere_rnd_spl" . " SET ergebnis = NULL, tiebrS = 0, tiebrG = 0, gemeldet = NULL " . " WHERE turnier = " . $this->turnierid . " AND runde = " . $runde . " AND dg = " . $dg;
$this->_db->setQuery($query);
$this->_db->query();
// Teilnehmer zurücksetzen bei KO-Turnier
if ($row->typ == '3' or $row->typ == '5') {
$query = "UPDATE #__clm_turniere_tlnr" . " SET koRound = " . ($runde - 1) . ", koStatus = '1' " . " WHERE turnier = " . $this->turnierid . " AND koRound >= " . $runde;
$this->_db->setQuery($query);
$this->_db->query();
}
JError::raiseNotice(500, CLMText::sgpl($resultCount / 2, JText::_('RESULT'), JText::_('RESULTS')) . " " . JText::_('RESET'));
// Rangliste neu berechnen!
$tournament = new CLMTournament($this->turnierid, true);
$tournament->calculateRanking();
$tournament->setRankingPositions();
// Log schreiben
$clmLog = new CLMLog();
$clmLog->aktion = JText::_('RESULTS') . " " . JText::_('RESET');
//$clmLog->params = array('tid' => $this->turnierid, 'rnd' => $this->roundid); // TurnierID wird als LigaID gespeichert
$clmLog->params = array('tid' => $this->turnierid, 'rnd' => $runde);
// TurnierID wird als LigaID gespeichert
$clmLog->write();
return true;
}
示例7: _resetDo
function _resetDo()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
if (CLM_usertype != 'admin' and CLM_usertype != 'tl') {
JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS'));
return FALSE;
}
$user =& JFactory::getUser();
// Reale RundenNummer, DG aus RundenID ermitteln, tl_ok
$query = 'SELECT nr, dg, tl_ok' . ' FROM #__clm_turniere_rnd_termine' . ' WHERE id = ' . $this->roundid;
$this->_db->setQuery($query);
list($runde, $dg, $tl_ok) = $this->_db->loadRow();
// wenn Runde schon bestätigt, zurücksetzen nicht erlauben
if ($tl_ok == 1) {
JError::raiseWarning(500, CLMText::errorText('ROUND', 'ALREADYAPPROVED'));
return FALSE;
}
// sind überhaupt Ergebnisse eingetragen?
$query = "SELECT COUNT(*) FROM #__clm_turniere_rnd_spl" . " WHERE turnier = " . $this->turnierid . " AND runde = " . $runde . " AND dg = " . $dg . " AND ergebnis IS NOT NULL";
$this->_db->setQuery($query);
$resultCount = $this->_db->loadResult();
if ($resultCount == 0) {
JError::raiseWarning(500, CLMText::errorText('RESULTS', 'NOTEXISTING'));
return FALSE;
}
// Runde anpassen
$query = "UPDATE #__clm_turniere_rnd_termine" . " SET gemeldet = NULL, zeit ='000e0-00-00 00:00:00', editor = " . $user->id . ", edit_zeit = NOW()" . " WHERE id = " . $this->roundid;
$this->_db->setQuery($query);
$this->_db->query();
// Ergebnisse löschen
$query = "UPDATE #__clm_turniere_rnd_spl" . " SET ergebnis = NULL" . " WHERE turnier = " . $this->turnierid . " AND runde = " . $runde . " AND dg = " . $dg;
$this->_db->setQuery($query);
$this->_db->query();
JError::raiseNotice(500, CLMText::sgpl($resultCount / 2, JText::_('RESULT'), JText::_('RESULTS')) . " " . JText::_('RESET'));
// Rangliste neu berechnen!
$tournament = new CLMTournament($this->turnierid, TRUE);
$tournament->calculateRanking();
$tournament->setRankingPositions();
// Log schreiben
$clmLog = new CLMLog();
$clmLog->aktion = JText::_('RESULTS') . " " . JText::_('RESET');
$clmLog->params = array('tid' => $this->turnierid, 'rnd' => $this->roundid);
// TurnierID wird als LigaID gespeichert
$clmLog->write();
return TRUE;
}
示例8: publish
function publish()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// TODO? evtl global inconstruct anlegen
$user =& JFactory::getUser();
$cid = JRequest::getVar('cid', array(), '', 'array');
JArrayHelper::toInteger($cid);
$task = JRequest::getCmd('task');
$publish = $task == 'publish';
// zu vergebender Wert 0/1
// Inhalte übergeben?
if (empty($cid)) {
JError::raiseWarning(500, 'NO_ITEM_SELECTED');
} else {
// ja, Inhalte vorhanden
// erst jetzt alle Einträge durchgehen
foreach ($cid as $key => $value) {
// load the row from the db table
$row =& JTable::getInstance('turniere', 'TableCLM');
$row->load($value);
// Daten zu dieser ID laden
// Prüfen ob User Berechtigung für dieses Turnier hat
if (CLM_usertype != 'admin' and CLM_usertype != 'tl') {
JError::raiseWarning(500, $row->name . ": " . JText::_('TOURNAMENT_NO_ACCESS'));
// daher diesen Eintrag aus dem cid-Array löschen
unset($cid[$key]);
} else {
// Berechtigung vorhanden
// Änderung nötig?
if ($row->published != $publish) {
// Log
$clmLog = new CLMLog();
$clmLog->aktion = JText::_('TOURNAMENT') . " " . $row->name . ": " . $task;
$clmLog->params = array('sid' => $row->sid, 'tid' => $value);
// TurnierID wird als LigaID gespeichert
$clmLog->write();
// Log geschrieben - Änderungen später
} else {
unset($cid[$key]);
}
}
}
// alle Einträge geprüft
// immer noch Einträge vorhanden?
if (!empty($cid)) {
$row =& JTable::getInstance('turniere', 'TableCLM');
$row->publish($cid, $publish);
// Meldung erstellen
$app =& JFactory::getApplication();
if ($publish) {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('TOURNAMENT'), JText::_('TOURNAMENTS')) . " " . JText::_('CLM_PUBLISHED'));
} else {
$app->enqueueMessage(CLMText::sgpl(count($cid), JText::_('TOURNAMENT'), JText::_('TOURNAMENTS')) . " " . JText::_('CLM_UNPUBLISHED'));
}
} else {
$app =& JFactory::getApplication();
$app->enqueueMessage(JText::_('NO_CHANGES'));
}
}
$this->adminLink->makeURL();
$this->setRedirect($this->adminLink->url);
}