Exemplo n.º 1
0
 * 
 * Description: Build the form to download an existing export file or
 * generate a new one
 */
global $mosConfig_absolute_path, $jLang;
require_once 'components/com_jtips/modules/Export/list.tmpl.php';
$tpl = new ListMode();
//Make available objects options
$objects = array('' => $jLang['_ADMIN_CONF_NONE'], 'jBadWord' => $jLang['_ADMIN_EXP_BADWORDS'], 'jComment' => $jLang['_ADMIN_EXP_COMMENTS'], 'jGame' => $jLang['_ADMIN_EXP_GAMES'], 'jHistory' => $jLang['_ADMIN_EXP_HISTORY'], 'jRound' => $jLang['_ADMIN_EXP_ROUNDS'], 'jTeam' => $jLang['_ADMIN_EXP_TEAMS'], 'jSeason' => $jLang['_ADMIN_EXP_SEASONS'], 'jTipsUser' => $jLang['_ADMIN_EXP_USERS'], 'jTip' => $jLang['_ADMIN_EXP_TIPS']);
$objectsOptions = array();
foreach ($objects as $key => $val) {
    $objectsOptions[] = jTipsHTML::makeOption($key, $val);
}
$tpl->selectLists['objects'] = jTipsHTML::selectList($objectsOptions, 'table', "id='table' class='inputbox'", 'value', 'text');
$actionOptions = array(jTipsHTML::makeOption('download', $jLang['_ADMIN_DASH_DOWNLOAD']), jTipsHTML::makeOption('delete', $jLang['_ADMIN_CONF_COMMENTSACTION_DELETE']));
$disableExportButton = 'disabled';
$history = getExportHistory();
$historyOptions = array();
foreach ($history as $item) {
    if (is_int(strpos($item, '.csv'))) {
        $disableExportButton = '';
        break;
    }
}
foreach ($history as $key => $item) {
    $historyOptions[] = jTipsHTML::makeOption($key, $item);
}
$tpl->disableExportButton = $disableExportButton;
$tpl->selectLists['history'] = jTipsHTML::selectList($historyOptions, 'export_history', "{$disableExportButton} id='export_history' class='inputbox'", 'value', 'text');
$tpl->selectLists['actions'] = jTipsHTML::selectList($actionOptions, 'expAction', "{$disableExportButton} id='expAction', class='inputbox'", 'value', 'text');
$tpl->display();
Exemplo n.º 2
0
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright © 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 08/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Allow file upload and import of data
 */
global $mosConfig_absolute_path, $mainframe;
require_once 'components/com_jtips/modules/Import/list.tmpl.php';
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Import/Import.js'></script>");
$tpl = new ListMode();
$file = $mosConfig_absolute_path . '/administrator/components/com_jtips/import.csv';
$tpl->importExists = jTipsFileExists($file);
$objects = array('' => $jLang['_ADMIN_CONF_NONE'], 'jBadWord' => $jLang['_ADMIN_EXP_BADWORDS'], 'jGame' => $jLang['_ADMIN_EXP_GAMES'], 'jRound' => $jLang['_ADMIN_EXP_ROUNDS'], 'jTeam' => $jLang['_ADMIN_EXP_TEAMS'], 'jSeason' => $jLang['_ADMIN_EXP_SEASONS']);
$objectsOptions = array();
foreach ($objects as $key => $val) {
    $objectsOptions[] = jTipsHTML::makeOption($key, $val);
}
$tpl->selectLists['objects'] = jTipsHTML::selectList($objectsOptions, 'importObject', "id='importObject' class='inputbox' onchange='getOptions(this);'", 'value', 'text');
$tpl->noneOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
$tpl->headers = fetchImportRow();
$tpl->row1Data = fetchImportRow(1);
$tpl->row2Data = fetchImportRow(2);
$tpl->opts = '';
$tpl->display();
Exemplo n.º 3
0
    function display()
    {
        global $jLang, $database, $mosConfig_live_site, $Itemid;
        $left_id_field = $this->left . '_id';
        $right_id_field = $this->right . '_id';
        $left_score = $this->left . '_score';
        $right_score = $this->right . '_score';
        ?>
		<style type='text/css'>
		#loader2.ajax-loading {
			background:url(<?php 
        echo $mosConfig_live_site;
        ?>
/components/com_jtips/images/loading.gif) no-repeat center;
			padding: 20px 0;
		}
		</style>
		<div id="loader2"></div>
		<div id="games_table">
		<form action="index2.php?Itemid=<?php 
        echo $Itemid;
        ?>
" method="post" name="adminForm" id="jTipsRoundProcessForm">
		<input type="hidden" name="option" value="com_jtips" />
		<input type="hidden" name="view" value="Administration" />
		<input type="hidden" name="action" value="SaveRoundResults" />
		<input type="hidden" name="<?php 
        echo jTipsSpoofValue();
        ?>
" value="1" />
		<table class="admintable" cellspacing="0" width="100%">
		<thead>
		<tr class="sectiontableheader">
		<th><?php 
        echo $jLang['_COM_GAME_' . strtoupper($this->left)];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_GAME_' . strtoupper($this->right)];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_TIPS_' . strtoupper($this->left) . 'SCORE'];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_TIPS_' . strtoupper($this->right) . 'SCORE'];
        ?>
</th>
		<th><?php 
        echo $jLang['_ADMIN_GAME_BONUS'];
        ?>
</th>
		</tr>
		</thead>
		<tbody>
		<?php 
        $rowIndex = 0;
        foreach ($this->jGames as $jGame) {
            $leftTeam = new jTeam($database);
            $rightTeam = new jTeam($database);
            $leftTeam->load($jGame->{$left_id_field});
            $rightTeam->load($jGame->{$right_id_field});
            ?>
			<tr class="sectiontableentry<?php 
            echo $rowIndex++ % 2 + 1;
            ?>
">
			<td align="left">
				<input type="hidden" name="cid[]" value="<?php 
            echo $jGame->id;
            ?>
" />
				<?php 
            echo $leftTeam->getDisplayLogoName();
            ?>
			</td>
			<td align="left"><?php 
            echo $rightTeam->getDisplayLogoName();
            ?>
</td>
			<td><input type="text" size="5" class="inputbox" autocomplete="off" style="text-align:center;" name="<?php 
            echo $left_score;
            ?>
[]" value="<?php 
            echo $jGame->{$left_score};
            ?>
" /></td>
			<td><input type="text" size="5" class="inputbox" autocomplete="off" style="text-align:center;" name="<?php 
            echo $right_score;
            ?>
[]" value="<?php 
            echo $jGame->{$right_score};
            ?>
" /></td>
			<td align="left">
				<?php 
            $bonusDD = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption($leftTeam->id, $leftTeam->getName()), jTipsHTML::makeOption($rightTeam->id, $rightTeam->getName()));
            if ($this->jSeason->pick_bonus == 2) {
                $bonusDD[] = jTipsHTML::makeOption(-2, $jLang['_ADMIN_SEASON_EPTB_BOT']);
            }
            echo jTipsHTML::selectList($bonusDD, 'bonus_id[]', "class='inputbox' style='width:95%;'", 'value', 'text', $jGame->bonus_id);
            ?>
			</td>
			</tr>
			<?php 
        }
        ?>
		</tbody>
		</table>
		<div class="contentheading" style="text-align:center;">
		<?php 
        if (isJoomla15()) {
            ?>
			<input type="submit" value="<?php 
            echo $jLang['_COM_ADMIN_RESULTS_SAVE_PROCESS'];
            ?>
" name="submit_process" class="button" />
			<input type="button" value="<?php 
            echo $jLang['_COM_CANCEL'];
            ?>
" name="cancel" onClick="window.parent.document.getElementById('sbox-window').close();" class="button" />
			<?php 
        } else {
            ?>
			<input type="submit" value="<?php 
            echo $jLang['_COM_ADMIN_RESULTS_SAVE_PROCESS'];
            ?>
" name="submit_process" class="button" />
			<input type="button" value="<?php 
            echo $jLang['_COM_CANCEL'];
            ?>
" name="cancel" onClick="$('mb_close_link').onclick();" class="button" />
			<?php 
        }
        ?>
		</div>
		</form>
		</div>
		<?php 
    }
Exemplo n.º 4
0
//Do we have an existing Season?
$id = array_shift($ids);
if (is_numeric($id)) {
    $jTeam->load($id);
}
//set the page title
$title = $jLang['_ADMIN_TEAM_TITLE'] . ": " . ($jTeam->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW']);
//set the custom javascripts
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Teams/Teams.js'></script>");
//what seasons are there
$jSeason = new jSeason($database);
$jSeasons = forceArray($jSeason->loadByParams(array()));
$jSeasonOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
jTipsSortArrayObjects($jSeasons, 'name', 'ASC');
foreach ($jSeasons as $season) {
    $jSeasonOptions[] = jTipsHTML::makeOption($season->id, $season->name);
}
//build the field definitions
$formData = array('basic' => array('legend' => '_ADMIN_BASIC_INFORMATION', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jTeam->id))), 'season' => array('label' => '_ADMIN_TEAM_SEASON', 'field' => array('type' => 'select', 'attributes' => array('name' => 'season_id', 'id' => 'season_id', 'class' => 'inputbox'), 'options' => $jSeasonOptions, 'selected' => $jTeam->season_id)), 'name' => array('label' => '_ADMIN_TEAM_NAME', 'field' => array('type' => 'text', 'attributes' => array('name' => 'name', 'id' => 'name', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->name))), 'location' => array('label' => '_ADMIN_TEAM_LOCATION', 'field' => array('type' => 'text', 'attributes' => array('name' => 'location', 'id' => 'location', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->location))), 'website' => array('label' => '_ADMIN_TEAM_URL', 'field' => array('type' => 'text', 'attributes' => array('name' => 'url', 'id' => 'url', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->url))), 'about' => array('label' => '_ADMIN_TEAM_ABOUT', 'field' => array('type' => 'editor', 'attributes' => array('name' => 'about', 'id' => 'about', 'class' => 'inputbox', 'value' => jTipsStripslashes($jTeam->about)))))));
$formData['image'] = array('legend' => '_ADMIN_TEAM_LOGO', 'fields' => array('logo' => array('label' => '_ADMIN_TEAM_LOGO', 'field' => array('type' => 'file', 'attributes' => array('size' => '50', 'type' => 'file', 'class' => 'inputbox', 'name' => 'logo', 'id' => 'logo')))));
if ($jTeam->logo) {
    $formData['image']['fields']['current_logo'] = array('label' => '_ADMIN_TEAM_CURRENT_LOGO', 'field' => array('type' => 'img', 'attributes' => array('alt' => 'Logo', 'id' => 'current_logo', 'src' => $mosConfig_live_site . '/' . getJtipsImage($jTeam->logo, 100))));
    $formData['image']['fields']['remove_logo'] = array('label' => '_ADMIN_TEAM_REMOVE_LOGO', 'field' => array('type' => 'checkbox', 'attributes' => array('class' => 'inputbox', 'name' => 'remove_logo', 'value' => '1', 'type' => 'checkbox', 'onClick' => 'if (this.checked){$("logo").disabled=true;}else{$("logo").disabled=false}')), 'description' => '_ADMIN_TEAM_REMOVE_LOGO_DEF');
}
// BUG 287 - can no longer edit team points
/*$formData['points'] = array(
	'legend' => '_ADMIN_TEAM_POINTS_ADJUST',
	'fields' => array(
		'wins' => array(
			'label' => '_ADMIN_TEAM_ADJUST_WINS',
			'field' => array(
Exemplo n.º 5
0
 * Description: 
 */
global $mainframe;
require_once 'components/com_jtips/modules/Customisations/edit.tmpl.php';
$ids = jTipsGetParam($_REQUEST, 'cid', array());
if (empty($ids)) {
    //mosRedirect('index2.php?option=com_jtips&module=Customisations', $jLang['_ADMIN_CSTM_NO_FILE_SPECIFIED']);
}
$id = array_shift($ids);
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/lib/edit_area/edit_area_full.js'></script>");
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Customisations/Edit.js'></script>");
$tpl = new EditMode();
if ($id or $id === '0') {
    $path = $mosConfig_absolute_path . '/components/com_jtips/custom/';
    $files = array();
    $fileList = findAllFiles($path, $files);
    $file = $fileList[$id];
    $tpl->path = $file;
    if (isJoomla15()) {
        jimport('joomla.filesystem.file');
        $tpl->content = JFile::read($file);
    } else {
        $tpl->content = file_get_contents($file);
    }
} else {
    $tpl->path = $tpl->content = '';
    $viewOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption('Administration', 'Administration'), jTipsHTML::makeOption('CompetitionLadder', 'Competition Ladder'), jTipsHTML::makeOption('Dashboard', 'Dashboard'), jTipsHTML::makeOption('Menu', 'Menu'), jTipsHTML::makeOption('TeamLadder', 'Team Ladder'), jTipsHTML::makeOption('Tips', 'Tips Panel'), jTipsHTML::makeOption('UserPreferences', 'User Preferences'));
    $tpl->viewList = jTipsHTML::selectList($viewOptions, 'view', "class='inputbox'", 'value', 'text');
    //$tpl->displayFileSetup();
}
$tpl->display();
Exemplo n.º 6
0
 * Website: www.jtips.com.au
 * Created: 09/09/2008
 * 
 * Description: 
 * 
 * 
 */
global $jLang, $database, $jTips;
//This breaks the shortcuts on the dashboard
//jTipsSpoofCheck();
require_once 'components/com_jtips/classes/jseason.class.php';
$ids = jTipsGetParam($_REQUEST, 'cid', array());
//Do we have an existing Season?
$id = array_shift($ids);
$jSeason = new jSeason($database);
if (is_numeric($id)) {
    $jSeason->load($id);
} else {
    $jSeason->start_time = $jSeason->end_time = gmdate('Y-m-d H:i:s');
}
$title = $jLang['_ADMIN_SEASON_MANAGER'] . ": " . ($jSeason->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW']);
$formData = array('core' => array('legend' => '_ADMIN_SEASON_CORE_FIELDS_FS', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jSeason->id))), 'name' => array('label' => '_ADMIN_SEASON_NAME', 'field' => array('type' => 'text', 'attributes' => array('size' => '50', 'type' => 'text', 'class' => 'inputbox', 'name' => 'name', 'id' => 'name', 'value' => $jSeason->name))), 'url' => array('label' => '_ADMIN_SEASON_LINKURL', 'field' => array('type' => 'text', 'attributes' => array('type' => 'text', 'size' => '50', 'class' => 'inputbox', 'name' => 'url', 'id' => 'url', 'value' => $jSeason->url))), 'tip_display' => array('label' => '_ADMIN_SEASON_TIPSDISPLAY', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'tip_display', 'id' => 'tip_display'), 'options' => array(jTipsHTML::makeOption(0, $jLang['_ADMIN_SEASON_NAMEONLY']), jTipsHTML::makeOption(1, $jLang['_ADMIN_SEASON_LOGOONLY']), jTipsHTML::makeOption(2, $jLang['_ADMIN_SEASON_NAMELOGO'])), 'selected' => $jSeason->tip_display)), 'tips_layout' => array('label' => '_ADMIN_CONF_TIPS_PANEL_LAYOUT', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'tips_layout', 'id' => 'tips_layout'), 'options' => array(jTipsHTML::makeOption('home', $jLang['_ADMIN_CONF_HOME']), jTipsHTML::makeOption('away', $jLang['_ADMIN_CONF_AWAY'])), 'selected' => $jSeason->tips_layout), 'description' => '_ADMIN_CONF_TIPS_PANEL_LAYOUT_DEF'), 'start_time' => array('label' => '_ADMIN_SEASON_START_DATE', 'field' => array('type' => 'date', 'attributes' => array('name' => 'start_time', 'id' => 'start_time', 'value' => TimeDate::toDisplayDate($jSeason->start_time), 'class' => 'inputbox', 'type' => 'text')), 'description' => '_ADMIN_SEASON_START_DATE_DEF'), 'end_time' => array('label' => '_ADMIN_SEASON_END_DATE', 'field' => array('type' => 'date', 'attributes' => array('name' => 'end_time', 'id' => 'end_time', 'value' => TimeDate::toDisplayDate($jSeason->end_time), 'class' => 'inputbox', 'type' => 'text')), 'description' => '_ADMIN_SEASON_END_DATE_DEF'), 'rounds' => array('label' => '_ADMIN_SEASON_ROUNDS', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'rounds', 'id' => 'rounds', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->rounds))), 'disable_tips' => array('label' => '_ADMIN_SEASON_DISABLE_TIPS', 'description' => '_ADMIN_SEASON_DISABLE_TIPS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'disable_tips', 'id' => 'disable_tips'), 'selected' => $jSeason->disable_tips)), 'scorer_id' => array('label' => '_ADMIN_SEASON_SCORER', 'description' => '_ADMIN_SEASON_SCORER_DEF', 'field' => array('type' => 'select', 'attributes' => array('id' => 'scorer_id', 'name' => 'scorer_id', 'class' => 'inputbox'), 'selected' => $jSeason->scorer_id, 'options' => jTipsGetAvailableScorers())), 'description' => array('label' => '_ADMIN_SEASON_DESCR', 'field' => array('type' => 'editor', 'attributes' => array('name' => 'description', 'id' => 'description', 'rows' => 10, 'cols' => 50, 'value' => jTipsStripslashes($jSeason->description)))))));
$formData['image'] = array('legend' => '_ADMIN_SEASON_LOGO_PATH', 'fields' => array('imageupload' => array('label' => '_ADMIN_SEASON_LOGO_PATH', 'field' => array('type' => 'file', 'attributes' => array('size' => '50', 'type' => 'file', 'class' => 'inputbox', 'name' => 'image', 'id' => 'image', 'value' => $jSeason->image)))));
if ($jSeason->image) {
    $formData['image']['fields']['current_image'] = array('label' => '_ADMIN_TEAM_CURRENT_LOGO', 'field' => array('type' => 'img', 'attributes' => array('alt' => 'Logo', 'id' => 'current_logo', 'src' => $mosConfig_live_site . '/' . $jSeason->image)));
    $formData['image']['fields']['remove_image'] = array('label' => '_ADMIN_TEAM_REMOVE_LOGO', 'field' => array('type' => 'checkbox', 'attributes' => array('class' => 'inputbox', 'name' => 'remove_image', 'value' => '1', 'type' => 'checkbox', 'onClick' => 'if (this.checked){$("image").disabled=true;}else{$("image").disabled=false}')), 'description' => '_ADMIN_TEAM_REMOVE_LOGO_DEF');
}
$formData['team_points'] = array('legend' => '_ADMIN_SEASON_TEAM_POINTS_FS', 'fields' => array('team_win' => array('label' => '_ADMIN_SEASON_TWP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_win', 'id' => 'team_win', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_win)), 'description' => '_ADMIN_SEASON_TWP_DEF'), 'team_draw' => array('label' => '_ADMIN_SEASON_TDP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_draw', 'id' => 'team_draw', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_draw)), 'description' => '_ADMIN_SEASON_TDP_DEF'), 'team_lose' => array('label' => '_ADMIN_SEASON_TLP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_lose', 'id' => 'team_lose', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_lose)), 'description' => '_ADMIN_SEASON_TLP_DEF'), 'team_bye' => array('label' => '_ADMIN_SEASON_TBP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_bye', 'id' => 'team_bye', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_bye)), 'description' => '_ADMIN_SEASON_TBP_DEF'), 'team_bonus' => array('label' => '_ADMIN_SEASON_BONUS_TEAM', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_bonus', 'id' => 'team_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_bonus))), 'team_starts' => array('label' => '_ADMIN_SEASON_ETS', 'description' => '_ADMIN_SEASON_ETS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'team_starts', 'id' => 'team_starts'), 'selected' => $jSeason->team_starts))));
$formData['points_configuration'] = array('legend' => '_ADMIN_SEASON_TIPS_CONFIG_FS', 'fields' => array('pick_score' => array('label' => '_ADMIN_SEASON_EPTS', 'description' => '_ADMIN_SEASON_EPTS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_score', 'id' => 'pick_score'), 'selected' => $jSeason->pick_score)), 'pick_margin' => array('label' => '_ADMIN_SEASON_EPTM', 'description' => '_ADMIN_SEASON_EPTM_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_margin', 'id' => 'pick_margin'), 'selected' => $jSeason->pick_margin)), 'pick_draw' => array('label' => '_ADMIN_SEASON_EPTD', 'description' => '_ADMIN_SEASON_EPTD_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_draw', 'id' => 'pick_draw'), 'selected' => $jSeason->pick_draw)), 'pick_bonus' => array('label' => '_ADMIN_SEASON_EPTB', 'description' => '_ADMIN_SEASON_EPTB_DEF', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_bonus', 'id' => 'pick_bonus'), 'selected' => $jSeason->pick_bonus, 'options' => array(jTipsHTML::makeOption(0, $jLang['_ADMIN_SEASON_EPTB_DIS']), jTipsHTML::makeOption(1, $jLang['_ADMIN_SEASON_EPTB_SIN']), jTipsHTML::makeOption(2, $jLang['_ADMIN_SEASON_EPTB_BOT'])))), 'game_times' => array('label' => '_ADMIN_SEASON_GAME_TIMES', 'description' => '_ADMIN_SEASON_GAME_TIMES_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'game_times', 'id' => 'game_times'), 'selected' => $jSeason->game_times)), 'tough_score' => array('label' => '_ADMIN_SEASON_TOUGH_SCORE', 'description' => '_ADMIN_SEASON_TOUGH_SCORE_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'tough_score', 'id' => 'tough_score'), 'selected' => $jSeason->tough_score))));
$formData['user_points'] = array('legend' => '_ADMIN_SEASON_USER_POINTS_FS', 'fields' => array('user_correct' => array('label' => '_ADMIN_SEASON_UCORR', 'description' => '_ADMIN_SEASON_UCORR_DEF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_correct', 'id' => 'user_correct', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_correct))), 'user_draw' => array('label' => '_ADMIN_SEASON_UDRAW', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_draw', 'id' => 'user_draw', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_draw))), 'user_none' => array('label' => '_ADMIN_SEASON_UNONE', 'description' => '_ADMIN_SEASON_UNONE_DEF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_none', 'id' => 'user_none', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_none))), 'precision_score' => array('label' => '_ADMIN_SEASON_PRECISION', 'description' => '_ADMIN_SEASON_PRECISION_DEF', 'field' => array('type' => 'bool', 'attributes' => array('name' => 'precision_score', 'id' => 'precision_score'), 'selected' => $jSeason->precision_score)), 'user_bonus' => array('label' => '_ADMIN_SEASON_UPERF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_bonus', 'id' => 'user_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_bonus))), 'user_pick_score' => array('label' => '_ADMIN_SEASON_USCOR', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_score', 'id' => 'user_pick_score', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_score))), 'user_pick_margin' => array('label' => '_ADMIN_SEASON_UMARG', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_margin', 'id' => 'user_pick_margin', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_margin))), 'user_pick_bonus' => array('label' => '_ADMIN_SEASON_UBONU', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_bonus', 'id' => 'user_pick_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_bonus))), 'default_points' => array('label' => '_ADMIN_SEASON_DEFAULT_POINTS', 'description' => '_ADMIN_SEASON_DEFAULT_POINTS_DEF', 'field' => array('type' => 'select', 'attributes' => array('name' => 'default_points', 'id' => 'default_points', 'class' => 'inputbox'), 'options' => array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption('low', $jLang['_ADMIN_SEASON_DEFAULT_POINTS_LOW']), jTipsHTML::makeOption('avg', $jLang['_ADMIN_SEASON_DEFAULT_POINTS_AVG'])), 'selected' => $jSeason->default_points))));
jTipsAdminDisplay::EditView($title, $formData, 'season');
Exemplo n.º 7
0
function makeSelectList($options, $name, $attributes = "", $selected = false)
{
    $theOptions = $selectedOption = array();
    foreach ($options as $key => $val) {
        $thisOption = jTipsHTML::makeOption($key, $val);
        if ($key == $selected) {
            $selectedOption[] = $thisOption;
        }
        $thisOptions[] = $thisOption;
    }
    if (empty($thisOptions)) {
        $thisOptions[] = jTipsHTML::makeOption('', '--None--');
        $attributes .= " disabled='disabled'";
    }
    return jTipsHTML::selectList($thisOptions, $name, $attributes, 'value', 'text', $selectedOption);
}
Exemplo n.º 8
0
<?php

defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 02/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: 
 */
jTipsSpoofCheck();
global $database, $jTips, $jLang;
require_once 'components/com_jtips/classes/jbadword.class.php';
$focus = new jBadWord($database);
$ids = jTipsGetParam($_REQUEST, 'cid', array());
//Do we have an existing Season?
$id = array_shift($ids);
if (is_numeric($id)) {
    $focus->load($id);
}
$title = $jLang['_ADMIN_BW_HEADER'] . ": " . ($focus->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW']);
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/BadWords/Edit.js'></script>");
$formData = array('basic' => array('legend' => '_ADMIN_EDIT_MAIN_INFORMATION', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $focus->id))), 'badword' => array('label' => '_ADMIN_BW_BAD_WORD', 'field' => array('type' => 'text', 'attributes' => array('size' => 50, 'name' => 'badword', 'id' => 'badword', 'class' => 'inputbox', 'value' => jTipsStripslashes(htmlentities($focus->badword, ENT_QUOTES)), 'type' => 'text'))), 'match_case' => array('label' => '_ADMIN_BW_CASE_SENSITIVE', 'field' => array('type' => 'bool', 'attributes' => array('name' => 'match_case', 'id' => 'match_case', 'class' => 'inputbox'), 'selected' => $focus->match_case)), 'action' => array('label' => '_ADMIN_BW_ACTION', 'field' => array('type' => 'select', 'attributes' => array('name' => 'action', 'id' => 'action', 'class' => 'inputbox', 'onChange' => 'toggleReplace();'), 'options' => array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption('replace', $jLang['_ADMIN_CONF_COMMENTSACTION_REPLACE']), jTipsHTML::makeOption('delete', $jLang['_ADMIN_CONF_COMMENTSACTION_DELETE'])), 'selected' => $focus->action)), 'replace' => array('label' => '_ADMIN_BW_REPLACEMENT', 'field' => array('type' => 'text', 'attributes' => array('size' => 50, 'name' => 'replace', 'id' => 'replace', 'class' => 'inputbox', 'type' => 'text', 'disabled' => 'disabled', 'value' => jTipsStripslashes(htmlentities($focus->replace, ENT_QUOTES))))), 'reset_hits' => array('label' => '_ADMIN_BW_RESET_HITS', 'field' => array('type' => 'bool', 'attributes' => array('name' => 'reset_hits', 'id' => 'reset_hits', 'class' => 'inputbox'), 'selected' => 0)))));
jTipsAdminDisplay::EditView($title, $formData, 'badwords');
Exemplo n.º 9
0
//Do we have an existing Season?
$id = array_shift($ids);
if (is_numeric($id)) {
    $jComment->load($id);
}
if (!$jComment->exists()) {
    mosRedirect('index2.php?option=com_jtips&task=list&module=Comments', $jLang['_ADMIN_COMMENT_LOAD_ERROR']);
}
$jTipsUser = new jTipsUser($database);
$jTipsUser->load($jComment->user_id);
$title = $jLang['_ADMIN_DASH_COMMENT_MANAGER'] . ": " . $jLang['_ADMIN_OTHER_EDIT'];
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Comments/Comments.js'></script>");
//what seasons are there
$jSeason = new jSeason($database);
$jSeasons = forceArray($jSeason->loadByParams(array()));
$jSeasonOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
jTipsSortArrayObjects($jSeasons, 'name', 'ASC');
foreach ($jSeasons as $season) {
    $jSeasonOptions[] = jTipsHTML::makeOption($season->id, $season->name);
}
//which season is this in?
$jRound = new jRound($database);
$jRound->load($jComment->round_id);
$jRounds = forceArray($jRound->loadByParams(array('season_id' => $jRound->season_id)));
$jRoundOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
jTipsSortArrayObjects($jSeasons, 'name', 'ASC');
foreach ($jRounds as $round) {
    $jRoundOptions[] = jTipsHTML::makeOption($round->id, $round->round);
}
$formData = array('basic' => array('legend' => '_ADMIN_COMM_EDIT_COMMENT', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jComment->id))), 'orig_round_id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'orig_round_id', 'id' => 'orig_round_id', 'value' => $jComment->round_id))), 'user_id' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'user_id', 'id' => 'user_id', 'value' => $jComment->user_id))), 'user' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => $jTipsUser->getUserField('name') . " (" . $jTipsUser->getUserField('username') . ")"))), 'season_id' => array('label' => '_ADMIN_ROUND_SEASON', 'field' => array('type' => 'select', 'attributes' => array('name' => 'season_id', 'id' => 'season_id', 'class' => 'inputbox', 'onChange' => 'getTheRounds(this);'), 'options' => $jSeasonOptions, 'selected' => $jRound->season_id)), 'round_id' => array('label' => '_ADMIN_ROUND_ROUND', 'field' => array('type' => 'select', 'attributes' => array('name' => 'round_id', 'id' => 'round_id', 'class' => 'inputbox'), 'options' => $jRoundOptions, 'selected' => $jComment->round_id)), 'comment' => array('label' => '_ADMIN_COMM_EDIT_COMMENT', 'field' => array('type' => 'text', 'attributes' => array('size' => 50, 'name' => 'comment', 'id' => 'comment', 'class' => 'inputbox', 'type' => 'text', 'value' => jTipsStripslashes(htmlentities($jComment->comment, ENT_QUOTES))))), 'updatedlabel' => array('label' => '_COM_TIPS_LASTUP', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => TimeDate::toDisplayDateTime($jComment->updated))), 'description' => '_ADMIN_COMMENTS_UDPATED_DESCRIPTION'))));
jTipsAdminDisplay::EditView($title, $formData, 'comments');