//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(
* * 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();
* Description: */ jTipsSpoofCheck(); global $jTips, $database; require_once 'components/com_jtips/classes/jseason.class.php'; require_once 'components/com_jtips/classes/juser.class.php'; require_once 'components/com_jtips/modules/Users/edit.tmpl.php'; $tpl = new EditMode(); $tpl->formData = array('title' => $jLang['_ADMIN_USERS_TITLE'] . ": " . $jLang['_ADMIN_OTHER_NEW']); $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', '')), $jLang['_ADMIN_SEARCH'] => "<input type='text' name='user_search' value='" . jTipsGetParam($_REQUEST, 'user_search', '') . "' class='inputbox' /> <button type='submit' class='button'>" . $jLang['_ADMIN_GO'] . "</button> <button type='submit' class='button' onclick='this.form.user_search.value=\"\";'>" . $jLang['_ADMIN_RESET'] . "</button>"); $tpl->selectLists = $filters; $currentDir = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc'); if ($currentDir == 'asc') { $dir = 'desc'; } else { $dir = 'asc'; } $tpl->nextDir = $dir; if ($user_search = jTipsGetParam($_REQUEST, 'user_search', false)) { $where = "AND (username LIKE '%" . $database->getEscaped($user_search) . "%' OR name LIKE '%" . $database->getEscaped($user_search) . "%')"; } else { $where = ''; } $offset = jTipsGetParam($_REQUEST, 'limitstart', 0); $query = "SELECT COUNT(*) FROM #__users WHERE block = '0' {$where}";
* Package: jTicket * Website: www.jtips.com.au * Created: 10/09/2008 * * Description: Saves the edited language key definition * to the jLang array and writes the array to * the language file. * * Allows complete language customisation */ global $mainframe, $jLang, $mosConfig_lang, $mosConfig_absolute_path; //Make sure this is not a hack job jTipsSpoofCheck(); //set the edited field $key = jTipsGetParam($_REQUEST, 'languageKey', ''); $val = jTipsHTML::cleanText(jTipsGetParam($_REQUEST, 'languageVar', '')); $jLang[$key] = trim($val); ksort($jLang); if (writeArrayToFile('jLang', $jLang, 'components/com_jtips/i18n/' . $mosConfig_lang . '.php')) { //BUG 265 - delete the existing js language file if it exists // BUG 320 - Fixed typo in path to js language file $jsLangFile = $mosConfig_absolute_path . '/components/com_jtips/js/language.js'; if (jTipsFileExists($jsLangFile)) { if (isJoomla15()) { jimport('joomla.filesystem.file'); JFile::delete($jsLangFile); } else { unlink($jsLangFile); } } $message = $jLang['_ADMIN_LANGUAGE_UPDATED'];
$tpl->date_end_date = TimeDate::toDisplayDate($focus->end_time, true); } $date_end_time_hour = TimeDate::format($focus->end_time, '%I', true); $date_end_time_minute = TimeDate::format($focus->end_time, '%M', true); $date_end_time_meridiem = strtolower(TimeDate::format($focus->end_time, '%p', true)); // BUG 326 - Optionally allo 24-hour format if (intval($jTips['Is24Hour']) == 1) { $hour_end = 23; if ($date_end_time_meridiem == 'pm') { $date_end_time_hour += 12; } } else { $hour_end = 12; } $tpl->date_end_time_hour = jTipsHTML::integerSelectList(1, $hour_end, 1, 'date_end_time_hour', "class='inputbox'", $date_end_time_hour); $tpl->date_end_time_minute = jTipsHTML::integerSelectList('00', $end, $step, 'date_end_time_minute', "class='inputbox'", $date_end_time_minute); if (intval($jTips['Is24Hour']) == 1) { $tpl->date_end_time_meridiem = ''; } else { $tpl->date_end_time_meridiem = jTipsHTML::selectList($meridiemOptions, 'date_end_time_meridiem', "class='inputbox'", 'value', 'text', $date_end_time_meridiem); } $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $tpl->selectLists['season_id'] = jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='getTheRounds(this);'", 'value', 'text', $focus->season_id); $roundOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE'])); $tpl->selectLists['roundnum'] = jTipsHTML::selectList($roundOptions, 'roundnum', "disabled id='roundnum', class='inputbox'", 'value', 'text', $focus->round); $tpl->display();
$limit = jTipsGetParam($_REQUEST, 'limit', 25); $direction = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc'); if (empty($direction)) { $direction = 'asc'; } $orderby = jTipsGetParam($_REQUEST, 'filter_order', 'name'); if (empty($orderby)) { $orderby = 'name'; } $params = array('order' => array('type' => 'order', 'direction' => $direction, 'by' => $orderby), 'join_users' => array('type' => 'join', 'join_table' => '#__users', 'lhs_table' => '#__jtips_users', 'lhs_key' => 'user_id', 'rhs_table' => '#__users', 'rhs_key' => 'id')); if ($season_id = jTipsGetParam($_REQUEST, 'season_id', false)) { $params['season_id'] = $season_id; } $jTipsUsers = forceArray($jTipsUser->loadByParams($params, $limit, $limitstart)); $pageNav = new mosPageNav($jTipsUser->getCount(), $limitstart, $limit); $data = array(); $i = 0; foreach ($jTipsUsers as $jTipsUserItem) { $scores = $jTipsUserItem->getSummaryScores(); $data[$jTipsUserItem->id] = array("<label for='cb{$i}'>" . $jTipsUserItem->getUserField('name') . "</label>", $jTipsUserItem->getUserField('username'), $jTipsUserItem->getSeasonName(), $jTipsUserItem->doubleup, number_format($scores[$jTipsUserItem->season_id]['average'], 2), $scores[$jTipsUserItem->season_id]['total_points'], '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'paid\');"><img src="images/' . ($jTipsUserItem->paid ? "tick" : "publish_x") . '.png" id="paid_' . $jTipsUserItem->id . '" border="0" /></div>', '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'status\');"><img src="images/' . ($jTipsUserItem->status == 1 ? "tick" : "publish_x") . '.png" border="0" id="status_' . $jTipsUserItem->id . '" /></a></div>'); $i++; } $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='this.form.submit();'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', ''))); //BUG 217 - 5th arg was teamEdit, changed to list - this is the TASK form field value jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, $jLang['_ADMIN_USERS_INFO'], true);
* 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();
function display() { ob_get_contents(); global $database, $mainframe, $jTips, $jLang, $jTipsCurrentUser, $Itemid, $mosConfig_live_site; $send_email = $jTipsCurrentUser->getPreference('email_reminder'); if (empty($send_email)) { $send_email = '0'; } $tips_notifications = $jTipsCurrentUser->getPreference('tips_notifications'); if (empty($tips_notifications)) { $tips_notifications = '0'; } $postURL = jTipsRoute("index.php?option=com_jtips&Itemid=" . $Itemid); $width = $jTips['ShowTipsWidth'] - 40; ?> <style type="text/css"> @import url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/css/jtips-default.css); @import url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/css/jtips-popup.css); </style> <div style="padding-top:10px;padding-left:10px;padding-right:10px;padding-bottom:10px;width:<?php echo $width; ?> px;text-align:center;"> <form action="<?php echo $postURL; ?> " name="adminForm" method="post" id="adminForm"> <input type="hidden" name="option" value="<?php echo jTipsGetParam($_REQUEST, 'option', 'com_jtips'); ?> " /> <input type="hidden" name="view" value="UserPreferences" /> <input type="hidden" name="action" value="save" /> <input type="hidden" name="task" value="save" /> <input type="hidden" name="return" value="<?php echo jTipsGetParam($_REQUEST, 'return', ''); ?> " /> <input type="hidden" name="season" value="<?php echo getSeasonID(); ?> " /> <input type="hidden" name="user" value="<?php echo $jTipsCurrentUser->id; ?> " /> <input type="hidden" name="id" value="<?php echo $jTipsCurrentUser->user_id; ?> " /> <h1 class="contentheading"><?php echo $jLang['_COM_USER_PREFERENCES']; ?> </h1> <table width="100%" border="0" cellspacing="5" cellpadding="0" style="margin-top:25px;"> <tbody> <tr> <th align="right"><?php echo $jLang['_COM_TIME_ZONE']; ?> </th> <td><?php echo makeSelectList($this->timezones, 'timezone', "class='inputbox'", $this->timezone); ?> </td> </tr> <?php if (isset($jTips['EnableEmailReminders']) and $jTips['EnableEmailReminders'] == 1) { ?> <tr> <th align="right"><?php echo $jLang['_COM_SEND_REMINDER_EMAIL']; ?> </th> <td><?php echo jTipsHTML::yesnoRadioList('email_reminder', '', $send_email); ?> </td> </tr> <?php } ?> <?php if (isset($jTips['TipsNotifyEnable']) and $jTips['TipsNotifyEnable'] == 1) { ?> <tr> <th align="right"><?php echo $jLang['_ADMIN_CONF_NOTIFY_TIPS']; ?> </th> <td><?php echo jTipsHTML::yesnoRadioList('tips_notifications', '', $tips_notifications); ?> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td style="text-align:center;" colspan="2"><input type="submit" name="submit_preferences" value=" <?php echo $jLang['_COM_SAVE']; ?> " class="button" onClick="window.top.setTimeout('window.parent.document.getElementById(\'sbox-window\').close()', 700);" /></td> </tr> </tfoot> </table> </form> </div> <?php }
* 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');
function display() { global $jTips, $jLang; if (isJoomla15()) { JToolBarHelper::title($this->formData['title'], 'user'); } else { ?> <table class='adminheading'> <tr> <th><?php echo $this->formData['title']; ?> </th> </tr> </table> <?php } ?> <script type='text/javascript'> function submitbutton(pressbutton) { if (pressbutton != 'list') { //are any users selected? if(document.adminForm.boxchecked.value==0) { alert('<?php echo $jLang['_ADMIN_USER_NEW_NO_SELECTION']; ?> '); return; } //is a season selected? if ($('season_id').value == '') { alert("<?php echo $jLang['_ADMIN_SEASON_SELECT_ALERT']; ?> "); return; } } submitform(pressbutton); } </script> <form action='index2.php' name='adminForm' id='adminForm' method='post'> <input type="hidden" name="task" value="edit" /> <input type="hidden" name="option" value="com_jtips" /> <input type="hidden" name="module" value="Users" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo jTipsGetParam($_REQUEST, 'filter_order'); ?> " /> <input type="hidden" name="filter_order_Dir" value="<?php echo jTipsGetParam($_REQUEST, 'filter_order_Dir'); ?> " /> <input type="hidden" name="<?php echo jTipsSpoofValue(); ?> " value="1" /> <table class="adminform"> <?php foreach ($this->selectLists as $label => $list) { ?> <tr> <td width="20%"><?php echo $label; ?> : </td> <td><?php echo $list; ?> </td> <td> </td> </tr> <?php } ?> </table> <table class="adminlist"> <thead> <tr> <th align='center' width='1'>#</th> <th align="center" width='20'><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count($this->users); ?> );" /></th> <th><a href="javascript:tableOrdering('name', '<?php echo $this->nextDir; ?> ', 'edit');"><?php echo $jLang['_ADMIN_USERS_FULLNAME']; ?> </a></th> <th><a href="javascript:tableOrdering('username', '<?php echo $this->nextDir; ?> ', 'edit');"><?php echo $jLang['_ADMIN_USERS_USERNAME']; ?> </a></th> <th><a href="javascript:tableOrdering('email', '<?php echo $this->nextDir; ?> ', 'edit');"><?php echo $jLang['_ADMIN_USERS_EMAIL']; ?> </a></th> </tr> </thead> <tbody> <?php $i = 0; foreach ($this->users as $user) { ?> <tr class="row<?php echo $i % 2; ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td align="center"><?php echo jTipsHTML::idBox($i, $user->id); ?> </td> <td><label for="cb<?php echo $i; ?> "><?php echo $user->name; ?> </label></td> <td><?php echo $user->username; ?> </td> <td><a href="mailto:<?php echo $user->email; ?> "><?php echo $user->email; ?> </a></td> </tr> <?php $i++; } ?> </tbody> <?php if (isJoomla15()) { ?> <tfoot> <tr> <td colspan="50"><?php echo $this->pageNav->getListFooter(); ?> </td> </tr> </tfoot> <?php } ?> </table> <?php if (!isJoomla15()) { echo $this->pageNav->getListFooter(); } ?> </form> <?php }
function parseEditField($def) { global $jTips; if (isset($def['attributes']) and !empty($def['attributes'])) { $attribs = array(); foreach ($def['attributes'] as $name => $value) { // BUG 393 - values with quotes cause invalid HTML $attribs[] = "{$name}=\"" . str_replace('"', "'", jTipsStripslashes($value)) . "\""; } $attributes = implode(" ", $attribs); } else { $attributes = ''; } switch ($def['type']) { case 'label': $html = "<span class='help'>" . $def['attributes']['value'] . "</span>"; break; case 'select': $html = jTipsHTML::selectList($def['options'], $def['attributes']['name'], $attributes, 'value', 'text', $def['selected']); break; case 'date': //BUG 263 - Date fields in J1.0 must be in YYYY-MM-DD format if (!isJoomla15()) { $def['attributes']['value'] = TimeDate::format($def['attributes']['value'], '%Y-%m-%d'); $attributes = preg_replace("/value='[^']*'/i", "value='" . $def['attributes']['value'] . "'", $attributes); } $html = "<input {$attributes} /> <img src='components/com_jtips/images/calendar.png' onclick='return showCalendar(\"{$def['attributes']['name']}\", \"{$jTips['DateFormat']}\");' border='0' alt='...' align='absmiddle' />"; break; case 'bool': $html = jTipsHTML::yesnoRadioList($def['attributes']['name'], $attributes, $def['selected']); break; case 'img': $html = "<img {$attributes} />"; break; case 'textarea': $html = "<textarea {$attributes}>" . jTipsStripslashes($def['text']) . "</textarea>"; break; case 'editor': jTipsInitEditor(); jTipsEditorArea($def['attributes']['name'], jTipsStripslashes($def['attributes']['value']), $def['attributes']['name'], '100%', '300px', 100, 25); jTipsHTML::keepAlive(); return ''; break; default: if (jTipsGetParam($def['attributes'], 'value')) { $def['attributes']['value'] = jTipsStripslashes($def['attributes']['value']); } $html = "<input {$attributes} />"; break; } return $html; }
<?php 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 - 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');
function display() { global $jLang; ?> <form action='index2.php' method='post' name='adminForm' enctype='multipart/form-data'> <input type='hidden' name='task' value='' /> <input type='hidden' name='option' value='<?php echo jTipsGetParam($_REQUEST, 'option', 'com_jtips'); ?> ' /> <input type='hidden' name='hidemainmenu' value='0' /> <input type="hidden" name="module" value="Import" /> <input type="hidden" name="<?php echo jTipsSpoofValue(); ?> " value="1" /> <?php if (isJoomla15()) { JToolBarHelper::title($jLang['_ADMIN_IMP_HEADER'], 'import'); } else { ?> <table class='adminheading'> <tr> <th><?php echo $jLang['_ADMIN_IMP_HEADER']; ?> </th> </tr> </table> <?php } ?> <?php if ($this->importExists) { ?> <fieldset> <legend><?php echo $jLang['_ADMIN_IMPORT_SETUP_LEGEND']; ?> </legend> <input type="hidden" name="hasFile" id="hasFile" value="1" /> <input type="hidden" name="importFile" value="1" id="importFile" /> <table class='admintable' width="100%"> <tr> <td class="key"><label for="importObject"><?php echo $jLang['_ADMIN_IMP_SELECT_TYPE']; ?> </label></td> <td><?php echo $this->selectLists['objects']; ?> <span id='loading' style='display:none;'><?php echo getAjaxLoading(); ?> </span></td> </tr> <tr id="match_row" style="display:none;"> <td class="key" valign="top"><?php echo $jLang['_ADMIN_IMP_MATCH_SELECT']; ?> :</td> <td><select name="match_on[]" id="match_on" multiple="multiple" class="inputbox"></select></td> </tr> </table> </fieldset> <fieldset> <legend><?php echo $jLang['_ADMIN_IMP_FIELD_MAPPING_LEGEND']; ?> </legend> <table class='adminlist' width="100%"> <thead> <tr> <th width='25%'><?php echo $jLang['_ADMIN_IMP_COL_HEADER']; ?> </th> <th width='25%'><?php echo $jLang['_ADMIN_IMP_FIELD_MAP']; ?> </th> <th width='25%'>Row 1 Data</th> <th width='25%'>Row 2 Data</th> </tr> </thead> <tbody> <?php for ($i = 0; $i < count($this->headers); $i++) { $col = cleanString($this->headers[$i]); $row1 = isset($this->row1Data[$i]) ? $this->row1Data[$i] : ''; $row2 = isset($this->row2Data[$i]) ? $this->row2Data[$i] : ''; ?> <tr class="row<?php echo $i % 2; ?> "> <td class="key" width='25%'><?php echo $col; ?> </td> <td><?php echo jTipsHTML::selectList($this->noneOptions, "importFields[{$col}]", 'disabled id="' . $col . '" class="importFields"', 'value', 'text'); ?> </td> <td style='text-align:left;'><?php echo jTipsHTML::cleanText($row1); ?> </td> <td style='text-align:left;'><?php echo jTipsHTML::cleanText($row2); ?> </td> </tr> <?php } ?> </tbody> </table> </fieldset> <?php } else { ?> <fieldset> <legend><?php echo $jLang['_ADMIN_IMPORT_UPLOAD_LEGEND']; ?> </legend> <input type="hidden" name="hasFile" id="hasFile" value="0" /> <table class='admintable' width="100%"> <tr> <td class="key" width='25%'><label for="importFile"><?php echo $jLang['_ADMIN_IMP_UPLOAD']; ?> </label></td> <td><input type='file' name='importFile' id="importFile" size='40' /></td> </tr> </table> </fieldset> <?php } ?> </form> <?php }
function ListView($formData, $header, $data, $pageNav, $returnTask = '', $filters = null, $info = null, $showProgressBar = false) { global $mainframe, $jTips, $jLang; if ($showProgressBar) { $slidercode = "<script type='text/javascript'>window.addEvent('domready', function() {slider = new Fx.Slide('progressbar', {duration: 500});slider.hide();});</script>"; ?> <div class="progress" id="progressbar"> <span><img src="components/com_jtips/images/saving.gif" border="0" alt="<?php echo $jLang['_ADMIN_AJAX_PROCESSING']; ?> " /><br /> <?php echo $jLang['_ADMIN_AJAX_PROCESSING']; ?> </span> </div> <?php //BUG 258 - The javascript in J1.0 must be echoed after the DOM element if (isJoomla15()) { $mainframe->addCustomHeadTag($slidercode); } else { print $slidercode; } } ?> <form action='index2.php' method='post' name='adminForm' id="adminForm" enctype="multipart/form-data"> <input type="hidden" name="filter_order" value="<?php echo jTipsGetParam($_REQUEST, 'filter_order'); ?> " /> <input type="hidden" name="filter_order_Dir" value="<?php echo jTipsGetParam($_REQUEST, 'filter_order_Dir'); ?> " /> <input type='hidden' name='option' value='<?php echo jTipsGetParam($_REQUEST, 'option', 'com_jtips'); ?> '> <input type='hidden' name='task' value='<?php echo jTipsGetParam($_REQUEST, 'task', $returnTask); ?> '> <input type='hidden' name='module' value='<?php echo jTipsGetParam($_REQUEST, 'module', ''); ?> '> <input type='hidden' name='hidemainmenu' id="hidemainmenu" value=""> <input type='hidden' name='boxchecked' value='0'> <input type="hidden" name="<?php echo jTipsSpoofValue(); ?> " value="1" /> <?php if (isJoomla15()) { if (!isset($formData['icon']) or empty($formData['icon'])) { $formData['icon'] = 'generic'; } JToolBarHelper::title($formData['title'], $formData['icon']); } else { ?> <table class='adminheading' width="100%"> <tbody> <tr> <th valign="top" align="left" class="edit" nowrap><?php echo $formData['title']; ?> </th> </tr> </tbody> </table> <?php } if (is_array($filters) or !is_null($info)) { ?> <table width="100%" class="adminform"> <tbody><tr><td width="100%"> <?php echo $info; if (is_array($filters) and !empty($filters)) { ?> </td><td nowrap> <?php foreach ($filters as $label => $formField) { echo $formField; } } ?> </td></tr></tbody> <?php } if (!is_null($info) and false) { ?> <tfoot> <tr> <td colspan="<?php echo count($filters) + 1; ?> "><?php echo $info; ?> </td> </tr> </tfoot> <?php } ?> </table> <table class='adminlist'> <thead> <tr> <?php $hasIntCol = false; foreach ($header as $label) { if ($label == '' and !$hasIntCol) { ?> <th align='center' width='1'>#</th><?php $hasIntCol = true; } if ($label == '' and $hasIntCol) { ?> <th align='center' width='5'><input type="checkbox" name="toggle" onClick="checkAll(<?php echo count($data); ?> );" /></th><?php } else { ?> <th><?php echo $label; ?> </th> <?php } } ?> </tr> </thead> <tbody> <?php $i = 0; foreach ($data as $id => $row) { ?> <tr class="row<?php echo $i % 2; ?> "> <?php if ($header[0] == '') { ?> <td width='1'><?php echo $i + 1; ?> </td> <td width="5"><?php echo jTipsHTML::idBox($i, $id); ?> </td> <?php } foreach ($row as $cell) { if (is_numeric($cell)) { $align = "center"; } else { $align = "left"; } ?> <td align="<?php echo $align; ?> "><?php echo jTipsStripslashes($cell); ?> </td> <?php } //BUG 264 - When no checkbox is shown, the row number is never increased, so the style never changes $i++; ?> </tr> <?php } ?> </tbody> <?php if (isJoomla15() and !is_null($pageNav)) { // BUG 400 - colspan changed to be calculated rather than fixed at 50, caused display errors in IE ?> <tfoot> <tr> <td colspan="<?php echo count($header) + 1; ?> "><?php echo $pageNav->getListFooter(); ?> </td> </tr> </tfoot> <?php } ?> </table><?php if (!isJoomla15() and !is_null($pageNav)) { echo $pageNav->getListFooter(); } ?> </form> <?php }
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 }
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();
//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');