Пример #1
0
<?php

defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Author: Jeremy Roberts
 * Package: jTicket
 * Website: www.jtips.com.au
 * Created: 09/09/2008
 *
 * Description:
 *
 *
 */
global $jLang;
jTipsSpoofCheck();
$title = $jLang['_ADMIN_LANGUAGE_EDITING'];
$langKeys = jTipsGetParam($_REQUEST, 'cid', array());
$key = array_shift($langKeys);
$formData = array();
if (isset($jLang[$key])) {
    $formData = array('fieldset' => array('legend' => '_ADMIN_LANG_EDIT_VALUE', 'fields' => array('label' => array('label' => '_ADMIN_LANGUAGE_SYSKEY', 'field' => array('type' => 'label', 'attributes' => array('value' => $key, 'type' => 'label'))), 'data' => array('label' => '_ADMIN_LANGUAGE_EDIT', 'field' => array('type' => 'text', 'attributes' => array('size' => '50', 'type' => 'text', 'class' => 'inputbox', 'name' => 'languageVar', 'value' => htmlentities($jLang[$key], ENT_QUOTES, 'UTF-8')))), 'key' => array('type' => 'hidden', 'field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'languageKey', 'value' => $key))))));
}
jTipsAdminDisplay::EditView($title, $formData, 'langmanager');
Пример #2
0
				'type' => 'text',
				'attributes' => array(
					'name' => 'points_against',
					'id' => 'points_against',
					'class' => 'inputbox',
					'size' => '10',
					'type' => 'text',
					'style' => 'text-align:center',
					'value' => $jTeam->points_against
				)
			)
		),
		'points' => array(
			'label' => '_ADMIN_TEAM_ADJUST',
			'field' => array(
				'type' => 'text',
				'attributes' => array(
					'name' => 'points',
					'id' => 'points',
					'class' => 'inputbox',
					'size' => '10',
					'type' => 'text',
					'style' => 'text-align:center',
					'value' => $jTeam->points
				)
			)
		)
	)
);*/
jTipsAdminDisplay::EditView($title, $formData, 'team');
Пример #3
0
 * @since 2.0.14
 * @version 2.1
 * @package jTips
 * 
 * Description: list jTips files and directories that cannot be written to
 */
global $database, $jTips, $mosConfig_absolute_path;
$header = array($jLang['_ADMIN_UPGRADER_TYPE'], $jLang['_ADMIN_UPGRADER_LOCATION'], $jLang['_ADMIN_UPGRADER_PERMISSIONS'], $jLang['_ADMIN_UPGRADER_OCTAL'], $jLang['_ADMIN_UPGRADER_OWNER']);
$formData = array('title' => $jLang['_ADMIN_UPGRADER_TITLE'], 'editTask' => '', 'module' => 'Upgrade', 'icon' => 'install');
$files = filesWritable(true);
$data = array();
$index = 0;
if (is_array($files) and !empty($files)) {
    foreach ($files as $f) {
        $file = $mosConfig_absolute_path . '/' . $f;
        $owner = posix_getpwuid(fileowner($file));
        if (is_dir($file)) {
            $img = 'sections.png';
            $title = $jLang['_ADMIN_UPGRADER_DIR_TITLE'];
            $tip = $jLang['_ADMIN_UPGRADER_DIR_INFO'];
        } else {
            $img = 'document.png';
            $title = $jLang['_ADMIN_UPGRADER_FILE_TITLE'];
            $tip = $jLang['_ADMIN_UPGRADER_FILE_INFO'];
        }
        $data[$index] = array(jTipsToolTip($tip, $title, '', $img), $f, getFilePermissions($file), substr(sprintf('%o', fileperms($file)), -3), $owner['name']);
        $index++;
    }
}
jTipsAdminDisplay::ListView($formData, $header, $data, null, '', null, $jLang['_ADMIN_UPGRADER_LIST_INFO']);
Пример #4
0
$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);
Пример #5
0
$tpl->css = jTipsStripslashes($css);

$tpl->display();
*/
global $jLang;
$formData = array('title' => $jLang['_ADMIN_CSS_TITLE'], 'editTask' => 'edit', 'module' => 'Styles', 'icon' => 'css');
$header = array('', 'Filename', 'Date Modified', $jLang['_ADMIN_UPGRADER_PERMISSIONS']);
global $mosConfig_absolute_path;
if (isJoomla15()) {
    $dir = $mosConfig_absolute_path . DS . 'components' . DS . 'com_jtips' . DS . 'css' . DS;
    jimport('joomla.filesystem.folder');
    $files = JFolder::files($dir);
} else {
    $dir = $mosConfig_absolute_path . '/components/com_jtips/css/';
    $files = findAllFiles($dir);
}
// get the key of the index.html file
$flipped = array_flip($files);
unset($files[$flipped['index.html']]);
sort($files);
$data = array();
$index = 0;
if (is_array($files) and !empty($files)) {
    foreach ($files as $f) {
        $file = $mosConfig_absolute_path . $f;
        $data[$index] = array(makeListLink($f, $index), date('Y-m-d H:i:s', filemtime($dir . $f)), getFilePermissions($dir . $f));
        $index++;
    }
}
jTipsAdminDisplay::ListView($formData, $header, $data, null);
Пример #6
0
            if ($status === 1) {
                $status = $jLang['_ADMIN_ROUND_STATUS_C'];
                //black - Complete
                $colour = "#000000";
            } else {
                if ($status === -1) {
                    $status = $jLang['_ADMIN_ROUND_STATUS_P'];
                    //red  - Pending Results
                    $colour = "#DF0009";
                }
            }
        }
    }
    $data[$round->id] = array(makeListLink($jLang['_ADMIN_ROUND_ROUND'] . " " . $round->round, $i++), $round->getSeasonName(), TimeDate::toDisplayDateTime($round->start_time), TimeDate::toDisplayDateTime($round->end_time), "<div style='text-align:center;color:{$colour};font-weight:bold;'>" . $status . "</div>");
}
$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);
}
//$statusOptions = array(
//	jTipsHTML::makeOption('', $jLang['_ADMIN_ROUND_STATUS_SELECT']),
//	jTipsHTML::makeOption('false', $jLang['_ADMIN_ROUND_STATUS_NS']),
//	jTipsHTML::makeOption('0', $jLang['_ADMIN_ROUND_STATUS_IP']),
//	jTipsHTML::makeOption('1', $jLang['_ADMIN_ROUND_STATUS_C']),
//	jTipsHTML::makeOption('-1', $jLang['_ADMIN_ROUND_STATUS_P'])
//);
$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', '')));
jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, null, true);
Пример #7
0
 * 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');
Пример #8
0
require_once 'components/com_jtips/classes/jbadword.class.php';
$formData = array('title' => $jLang['_ADMIN_BW_HEADER'], 'editTask' => 'edit', 'module' => 'BadWords', 'icon' => 'badwords');
$currentDir = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc');
if ($currentDir == 'asc') {
    $dir = 'desc';
} else {
    $dir = 'asc';
}
//The header row
$header = array('', "<a href='javascript:tableOrdering(\"badword\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_BAD_WORD'] . "</a>", "<a href='javascript:tableOrdering(\"match_case\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_CASE_SENSITIVE'] . "</a>", "<a href='javascript:tableOrdering(\"action\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_ACTION'] . "</a>", "<a href='javascript:tableOrdering(\"replace\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_REPLACEMENT'] . "</a>", "<a href='javascript:tableOrdering(\"hits\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_HITS'] . "</a>", "<a href='javascript:tableOrdering(\"updated\", \"{$dir}\", \"list\");'>" . $jLang['_ADMIN_BW_UPDATED'] . "</a>");
$jBadWord = new jBadWord($database);
$limitstart = jTipsGetParam($_REQUEST, 'limitstart', 0);
$limit = jTipsGetParam($_REQUEST, 'limit', 25);
$direction = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc');
if (empty($direction)) {
    $direction = 'asc';
}
$orderby = jTipsGetParam($_REQUEST, 'filter_order', 'badword');
if (empty($orderby)) {
    $orderby = 'badword';
}
$params = array('order' => array('type' => 'order', 'direction' => $direction, 'by' => $orderby));
$jBadWords = forceArray($jBadWord->loadByParams($params, $limit, $limitstart));
$pageNav = new mosPageNav($jBadWord->getCount(), $limitstart, $limit);
$data = array();
$i = 0;
foreach ($jBadWords as $badword) {
    $data[$badword->id] = array(makeListLink($badword->badword, $i++), "<div style='text-align:center;'><img src='images/" . ($badword->match_case ? 'tick' : 'publish_x') . ".png' border='0' alt='{$badword->match_case}' /></div>", ucwords($badword->action), $badword->replace, $badword->hits, TimeDate::toDisplayDateTime($badword->updated));
}
jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'edit');
Пример #9
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');
Пример #10
0
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 02/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: build a paginated list of customisation files
 */
global $jLang, $database, $mosConfig_absolute_path, $mainframe;
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Customisations/List.js'></script>");
$formData = array('title' => $jLang['_ADMIN_DASH_CUSTOMISATION_LIST'], 'editTask' => 'edit', 'module' => 'Customisations', 'icon' => 'customisations');
$currentDir = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc');
if ($currentDir == 'asc') {
    $dir = 'desc';
} else {
    $dir = 'asc';
}
//The header row
$header = array('', 'File Path', 'Permissions', 'Owner');
$path = $mosConfig_absolute_path . '/components/com_jtips/custom/';
$data = $files = array();
if (file_exists($path)) {
    $fileList = findAllFiles($path, $files);
    $index = 0;
    foreach ($fileList as $file) {
        $owner = posix_getpwuid(fileowner($file));
        $data[] = array(makeListLink(str_replace($path, '', $file), $index++), getFilePermissions($file), $owner['name']);
    }
}
jTipsAdminDisplay::ListView($formData, $header, $data, null, '', null, $jLang['_ADMIN_CUSTOMISATIONS_INFO']);
Пример #11
0
//has the season select been used?
if ($season_id = jTipsGetParam($_REQUEST, 'season_id', false)) {
    $params['season_id'] = array('type' => 'join', 'join_table' => '#__jtips_rounds', 'lhs_table' => '#__jtips_comments', 'lhs_key' => 'round_id', 'rhs_table' => '#__jtips_rounds', 'rhs_key' => 'id', 'supplement' => 'AND #__jtips_rounds.season_id = ' . $jComment->_db->Quote($season_id));
}
$jComments = forceArray($jComment->loadByParams($params, $limit, $limitstart));
$pageNav = new mosPageNav($jComment->getCount($params), $limitstart, $limit);
$data = array();
$i = 0;
foreach ($jComments as $comment) {
    //get the comment poster details
    $jTipsUser = new jTipsUser($database);
    $jTipsUser->load($comment->user_id);
    //Which round is it for
    $jRound = new jRound($database);
    $jRound->load($comment->round_id);
    if (strlen($comment->comment) > 100) {
        $suffix = '...';
    } else {
        $suffix = '';
    }
    $data[$comment->id] = array(makeListLink(substr(jTipsStripslashes($comment->comment), 0, 100) . $suffix, $i++), $jTipsUser->getUserField('name'), $jTipsUser->getUserField('username'), $comment->getSeasonName(), $jRound->round, TimeDate::toDisplayDateTime($comment->updated));
}
$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', '')));
jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, $jLang['_ADMIN_COMMENTS_INFO']);
Пример #12
0
if ($find = jTipsGetParam($_REQUEST, 'lang_val', false) and !jTipsGetParam($_REQUEST, 'clear', false)) {
    $theLanguage = array();
    foreach ($jLang as $key => $val) {
        if (preg_match('/' . $find . '/i', $val)) {
            $theLanguage[$key] = $val;
        }
    }
} else {
    $_REQUEST['lang_val'] = '';
    $theLanguage = $jLang;
}
ksort($theLanguage);
$data = array();
$limitstart = jTipsGetParam($_REQUEST, 'limitstart', 0);
$limit = jTipsGetParam($_REQUEST, 'limit', 25);
if ($limit == 0) {
    $limit = count($jLang);
}
$langKeys = array_keys($theLanguage);
$langDefs = array_values($theLanguage);
$index = 0;
for ($i = $limitstart; $i < $limitstart + $limit and $i < count($theLanguage); $i++) {
    $data[$langKeys[$i]] = array(makeListLink($langKeys[$i], $index), htmlentities($langDefs[$i], ENT_QUOTES, 'UTF-8'));
    $index++;
}
$filters = array('Search' => "<input type='text' name='lang_val' class='text_area' value='" . jTipsGetParam($_REQUEST, 'lang_val') . "' />");
$filters[] = "&nbsp;<input type='submit' name='search' value='Find' class='button' />";
$filters[] = "&nbsp;<input type='submit' name='clear' value='Reset' class='button' />";
$pageNav = new mosPageNav(count($theLanguage), $limitstart, $limit);
jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, '', $filters, $jLang['_ADMIN_LANGUAGE_LIST_INFO']);
Пример #13
0
$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');