function TblTeams($name, $op, $id, $cup_id) { Table::Table($name, $op, $id); $this->cfg->team->name = "team"; $this->cfg->team->public_name = _Druzyna; $this->cfg->team->type = 'text'; $this->cfg->team->maxlength = 32; $this->cfg->team->not_empty = 1; $this->cfg->team->edit = 1; $this->cfg->cpt_pn->name = "cpt_pn"; $this->cfg->cpt_pn->public_name = _Kapitan; $this->cfg->cpt_pn->db_list2 = '' . _DB_PREFIX . '_players'; $this->cfg->cpt_pn->db_list_pk = "player_number"; $this->cfg->cpt_pn->db_list_sel1 = "lname"; $this->cfg->cpt_pn->db_list_sel2 = "fname"; // $this->cfg->cpt_pn->db_list_cond = " team_id = 0 "; $this->cfg->cpt_pn->db_list_cond = " cup_id = " . $cup_id; $this->cfg->cpt_pn->not_empty = 0; // $this->cfg->cpt_pn->no_add = 1; $this->cfg->cup_id->name = "cup_id"; $this->cfg->cup_id->public_name = _CUPNAME; $this->cfg->cup_id->db_list = '' . _DB_PREFIX . '_cups'; $this->cfg->cup_id->db_list_pk = "id"; $this->cfg->cup_id->db_list_sel = "cup"; $this->cfg->cup_id->db_list_cond = " close = 0"; $this->cfg->cup_id->not_empty = 1; }
function TrackDayCountsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('posted_when', 'tracks')); $this->set_field_option('posted_when', 'datetime'); $this->process_options($params); }
/** * Constructor for a HTML table. * @param array List of attribute/value pairs for html styles. **/ function ZebraTable($styles = "", $switcherClass = "", $headerClass = "", $hovercolor = "", $nohovercolor = "") { Table::Table($styles); $this->classcnt = 0; //Counter $this->JSenabled = $GLOBALS["auth"]->auth["jscript"]; $this->hoverenabled = FALSE; if (is_array($switcherClass)) { $this->switcherClass = $switcherClass; } else { $this->switcherClass = array("table_row_odd", "table_row_even"); } if ($headerClass) { $this->header_class = $headerClass; } else { $this->header_class = "table_header"; } if (is_array($hovercolor)) { $this->hovercolor = $hovercolor; } else { $this->hovercolor = array("#B7C2E2", "#CED8F2"); } if (is_array($nohovercolor)) { $this->nohovercolor = $nohovercolor; } else { $this->nohovercolor = array("#E2E2E2", "#F2F2F2"); } }
function ErrorsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('jobs', 'message', 'type', 'start')); $this->set_field_option('start', 'datetime-key'); $this->set_field_option('jobs', 'num'); $this->process_options($params); }
function ResourcesTable($m, $params, $unused) { parent::Table($m); $this->set_fields(array('id', 'name', 'interval', 'latest_run')); $this->set_field_option('latest_run', 'datetime-key'); $this->set_field_option('interval', 'time'); $this->set_default_ordering('latest_run', 'DESC'); $this->process_options($params); }
function TrackCountsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('blog', 'feed', 'tracks')); $this->set_field_option('blog', 'sql-name', 's.site_url'); $this->set_field_option('feed', 'sql-name', 'f.url'); $this->set_field_option('feed', 'search'); $this->set_default_ordering('s.site_url', 'ASC'); $this->process_options($params); }
function ContentTable($styles = "") { Table::Table($styles); if (!@$styles["width"]) { $this->table_width = "99%"; } if (!@$styles["align"]) { $this->table_align = "center"; } }
function FeedTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'url', 'title', 'task', 'periodicity', 'kind', 'tags', 'mod_date', 'items', 'errors', '2_weeks')); $this->set_field_option('id', 'sql-name', 'f.id'); $this->set_field_option('url', 'sql-name', 'f.url'); $this->set_field_option('items', 'num'); $this->set_field_option('errors', 'num'); $this->set_field_option('title', 'truncate', 30); $this->process_options($params); }
function TasksTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'type', 'program', 'args', 'state', 'hostname', 'periodicity', 'latest_run', 'jobs', 'resource')); $this->set_field_option('latest_run', 'datetime'); $this->set_field_option('id', 'sql-name', 't.id'); $this->set_field_option('type', 'sql-name', 't.type'); $this->set_field_option('resource', 'sql-name', 'resource_id'); $this->set_default_ordering('latest_run', 'DESC'); $this->process_options($params); }
function ContainerTable($styles = "") { Table::Table($styles); if (!@$styles["width"]) { $this->table_width = "100%"; } if (!@$styles["class"]) { $this->table_class = "blank"; } $this->row_class = "blank"; $this->cell_class = "blank"; }
function FeedItemCommentCountsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'url', 'title', 'comments', 'kind', 'tags', 'mod_date')); $this->set_field_option('id', 'sql-name', 'f.id'); $this->set_field_option('url', 'sql-name', 'f.url'); $this->set_field_option('comments', 'num'); $this->set_field_option('kind', 'sql-name', 'm.kind'); $this->set_field_option('tags', 'sql-name', 'm.tags'); //$this->set_field_option('c.pub_date', 'datetime-key'); $this->process_options($params); $this->max_limit = 200; }
function JobsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'task', 'type', 'program', 'args', 'state', 'hostname', 'attempts', 'message', 'output', 'scheduled', 'start', 'resource', 'actions')); $this->set_field_option('start', 'datetime'); $this->set_field_option('scheduled', 'datetime'); $this->set_field_option('message', 'expand', 20); $this->set_field_option('output', 'expand', 20); $this->set_field_option('attempts', 'num'); $this->set_field_option('resource', 'sql-name', 'resource_id'); $this->set_field_option('actions', 'flushright'); $this->set_default_ordering('scheduled', 'ASC'); $this->process_options($params); }
function FeedItemCommentsTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'item', 'feed', 'tags', 'pub_date', 'mod_date', 'content', 'author', 'jobs', 'link')); $this->set_field_option('item', 'sql-name', 'feed_item_id'); $this->set_field_option('feed', 'sql-name', 'i.feed_id'); //$this->set_field_option('item', 'sql-name', 'c.feed_item_id'); $this->set_field_option('pub_date', 'datetime-key'); $this->set_field_option('title', 'expand', 50); $this->set_field_option('content', 'expand', 90); $this->set_default_ordering('pub_date', 'DESC'); $this->process_options($params); $this->max_limit = 200; $this->interval = '*'; }
function FeedItemTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'feed', 'tags', 'pub_date', 'fetch_date', 'title', 'summary', 'content', 'jobs', 'comments', 'link')); $this->set_field_option('id', 'sql-name', 'i.id'); $this->set_field_option('feed', 'sql-name', 'i.feed_id'); $this->set_field_option('pub_date', 'datetime-key'); $this->set_field_option('title', 'expand', 100); $this->set_field_option('summary', 'expand', 200); $this->set_field_option('content', 'expand', 500); $this->set_field_option('content', 'dynamic', TRUE); $this->limit = 10; $this->process_options($params); $this->max_limit = 200; }
function EnclosuresTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'feed', 'feed_item', 'link', 'title', 'description', 'mime', 'pub_date', 'mod_date')); $this->set_field_option('pub_date', 'sql-name', 'e.pub_date'); $this->set_field_option('pub_date', 'datetime-key'); $this->set_field_option('feed', 'sql-name', 'i.feed'); $this->set_field_option('feed_item', 'sql-name', 'e.feed_item_id'); //$this->set_field_option('periodicity', 'time'); //$this->set_field_option('id', 'sql-name', 'e.id'); //$this->set_field_option('type', 'sql-name', 't.type'); $this->set_field_option('title', 'truncate', 30); $this->set_field_option('description', 'truncate', 30); $this->set_default_ordering('id', 'DESC'); $this->process_options($params); }
function TblCups($name, $op, $id) { Table::Table($name, $op, $id); $this->cfg->cup->name = "cup"; $this->cfg->cup->public_name = _CUPNAME; $this->cfg->cup->type = 'text'; $this->cfg->cup->size = 32; $this->cfg->cup->maxlength = 64; $this->cfg->cup->not_empty = 1; $this->cfg->cup->edit = 1; $this->cfg->chief_pn->name = "chief_pn"; $this->cfg->chief_pn->no_add = 1; $this->cfg->close->name = "close"; $this->cfg->close->public_name = _PucharZamkniety; $this->cfg->close->radio = 'pucharClose_select'; $this->cfg->close->edit = 1; }
function TblGames($name, $op, $id) { Table::Table($name, $op, $id); $this->cfg->cup_id->name = "cup_id"; $this->cfg->cup_id->public_name = _CUPNAME; $this->cfg->cup_id->db_list = _DB_PREFIX . '_cups'; $this->cfg->cup_id->db_list_pk = "id"; $this->cfg->cup_id->db_list_sel = "cup"; $this->cfg->cup_id->db_list_cond = "close!=1"; $this->cfg->cup_id->not_empty = 1; $this->cfg->chief_pn->name = "chief_pn"; $this->cfg->chief_pn->no_add = 1; $this->cfg->game->name = "game"; $this->cfg->game->public_name = _GAMENAME; $this->cfg->game->type = 'text'; $this->cfg->game->maxlength = 64; $this->cfg->game->not_empty = 1; $this->cfg->town->name = "town"; $this->cfg->town->public_name = _GAMETOWN; $this->cfg->town->type = 'text'; $this->cfg->town->maxlength = 32; $this->cfg->town->not_empty = 1; $this->cfg->place->name = "place"; $this->cfg->place->public_name = _GAMEPLACE; $this->cfg->place->type = 'text'; $this->cfg->place->maxlength = 32; $this->cfg->place->not_empty = 1; $this->cfg->dt->name = "dt"; $this->cfg->dt->public_name = _GAMEDATE; $this->cfg->dt->type = 'text'; $this->cfg->dt->maxlength = 10; $this->cfg->dt->is_date = 1; $this->cfg->dt->not_empty = 1; $this->cfg->game_mode->name = "game_mode"; $this->cfg->game_mode->public_name = _Rodzajgry; $this->cfg->game_mode->radio = 'mode_select'; $this->cfg->game_mode->not_empty = 1; $this->cfg->ratio->name = "ratio"; $this->cfg->ratio->no_add = 1; $this->cfg->game_status->name = "game_status"; $this->cfg->game_status->no_add = 1; }
function TracksTable($m, $params, $unused) { parent::Table($m, $params); $this->set_fields(array('id', 'item', 'feed', 'anchor', 'artist', 'title', 'manual_tags', 'tags', 'method', 'sent', 'permalink', 'location', 'blog')); $this->set_field_option('item', 'sql-name', 'feed_item_id'); $this->set_field_option('feed', 'sql-name', 'i.feed_id'); $this->set_field_option('title', 'sql-name', 's.title'); $this->set_field_option('blog', 'sql-name', 's.site_url'); $this->set_field_option('posted', 'datetime'); $this->set_field_option('sent', 'datetime-key'); $this->set_field_option('tags', 'sql-name', 's.tags'); $this->set_field_option('artist', 'search'); $this->set_field_option('title', 'search'); $this->set_field_option('blog', 'search'); $this->set_default_ordering('sent', 'DESC'); $this->process_options($params); $this->max_limit = 200; //$this->stat['tags']['sum'] = 0; $this->method_counts = array('id3' => 0, 'filename' => 0, 'anchor' => 0); }
function TblResults($name, $op, $id) { Table::Table($name, $op, $id); $this->cfg->game_id->name = "game_id"; $this->cfg->game_id->public_name = _GAME; $this->cfg->game_id->db_list = '' . _DB_PREFIX . '_games'; $this->cfg->game_id->db_list_pk = "id"; $this->cfg->game_id->db_list_sel = "game"; $this->cfg->game_id->not_empty = 1; $this->cfg->player_id->name = "pn"; $this->cfg->player_id->public_name = _Numer_zawodnika; $this->cfg->position->name = "position"; $this->cfg->position->public_name = _Miejsce; $this->cfg->position->type = 'text'; $this->cfg->position->maxlength = 32; $this->cfg->position->not_empty = 1; $this->cfg->score->name = "score"; $this->cfg->score->public_name = _Punkty; $this->cfg->score->type = 'text'; $this->cfg->score->maxlength = 10; $this->cfg->score->not_empty = 1; }
/** * constructor * @param string $name * @param string $alias * @param string $index_hints_list * @return void */ function MysqlTableWithHint($name, $alias = NULL, $index_hints_list) { parent::Table($name, $alias); $this->index_hints_list = $index_hints_list; }
/** * Constructor * * @todo we might not want to count total rows when not needed... * @todo fplanque: I am seriously considering putting $count_sql into 2nd or 3rd position. Any prefs? * @todo dh> We might just use "SELECT SQL_CALC_FOUND_ROWS ..." and "FOUND_ROWS()"..! - available since MySQL 4 - would save one query just for counting! * * @param string SQL query * @param string prefix to differentiate page/order params when multiple Results appear one same page * @param string default ordering of columns (special syntax) if not specified in the URL params * example: -A-- will sort in ascending order on 2nd column * example: ---D will sort in descending order on 4th column * @param integer number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page) * @param string SQL to get the total count of results * @param boolean * @param NULL|string SQL query used to count the total # of rows (if NULL, we'll try to COUNT(*) by ourselves) */ function Results($sql, $param_prefix = '', $default_order = '', $limit = NULL, $count_sql = NULL, $init_page = true) { global $UserSettings; parent::Table(); $this->sql = $sql; $this->limit = is_null($limit) ? $UserSettings->get('results_per_page') : $limit; $this->param_prefix = $param_prefix; // Count total rows: // TODO: check if this can be done later instead $this->count_total_rows($count_sql); if ($init_page) { // attribution of a page number $this->page_param = 'results_' . $param_prefix . 'page'; $page = param($this->page_param, 'integer', 1, true); $this->page = min($page, $this->total_pages); } // attribution of an order type $this->order_param = 'results_' . $param_prefix . 'order'; $this->order = param($this->order_param, 'string', $default_order, true); }
/** * Constructor * * @todo we might not want to count total rows when not needed... * @todo fplanque: I am seriously considering putting $count_sql into 2nd or 3rd position. Any prefs? * @todo dh> We might just use "SELECT SQL_CALC_FOUND_ROWS ..." and "FOUND_ROWS()"..! - available since MySQL 4 - would save one query just for counting! * * @param string SQL query * @param string prefix to differentiate page/order params when multiple Results appear one same page * @param string default ordering of columns (special syntax) if not specified in the URL params * example: -A-- will sort in ascending order on 2nd column * example: ---D will sort in descending order on 4th column * @param integer Default number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page) * @param string|integer SQL query used to count the total # of rows * - if integer, we'll use that as the count * - if NULL, we'll try to COUNT(*) by ourselves * @param boolean TRUE to initialize page params * @param integer|NULL Total rows count that allows to use an order of any column, NULL - don't restrict */ function Results($sql, $param_prefix = '', $default_order = '', $default_limit = NULL, $count_sql = NULL, $init_page = true, $force_order_by_count = NULL) { parent::Table(NULL, $param_prefix); $this->sql = $sql; $this->count_sql = $count_sql; $this->init_limit_param($default_limit); if ($init_page) { // attribution of a page number $this->page_param = 'results_' . $this->param_prefix . 'page'; $this->page = param($this->page_param, 'integer', 1, true); } $this->default_order = $default_order; $this->force_order_by_count = $force_order_by_count; }
/** * Constructor * * @todo we might not want to count total rows when not needed... * @todo fplanque: I am seriously considering putting $count_sql into 2nd or 3rd position. Any prefs? * @todo dh> We might just use "SELECT SQL_CALC_FOUND_ROWS ..." and "FOUND_ROWS()"..! - available since MySQL 4 - would save one query just for counting! * * @param string SQL query * @param string prefix to differentiate page/order params when multiple Results appear one same page * @param string default ordering of columns (special syntax) if not specified in the URL params * example: -A-- will sort in ascending order on 2nd column * example: ---D will sort in descending order on 4th column * @param integer Default number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page) * @param string SQL to get the total count of results * @param boolean * @param string|integer SQL query used to count the total # of rows * - if integer, we'll use that as the count * - if NULL, we'll try to COUNT(*) by ourselves */ function Results($sql, $param_prefix = '', $default_order = '', $default_limit = NULL, $count_sql = NULL, $init_page = true) { parent::Table(NULL, $param_prefix); $this->sql = $sql; $this->init_limit_param($default_limit); // Count total rows: // TODO: check if this can be done later instead $this->count_total_rows($count_sql); if ($init_page) { // attribution of a page number $this->page_param = 'results_' . $this->param_prefix . 'page'; $page = param($this->page_param, 'integer', 1, true); $this->page = min($page, $this->total_pages); } $this->init_order_param($default_order); }
/** * constructor * @param string $name * @param string $alias * @param string $join_type * @param array $conditions * @return void */ function JoinTable($name, $alias, $join_type, $conditions) { parent::Table($name, $alias); $this->join_type = $join_type; $this->conditions = $conditions; }
function TblPlayers($name, $op, $id, $pcat = 1) { Table::Table($name, $op, $id); $this->cfg->player_number->name = "player_number"; $this->cfg->player_number->public_name = _Numergracza; $this->cfg->player_number->type = 'text'; $this->cfg->player_number->maxlength = 4; $this->cfg->player_number->not_empty = 1; $this->cfg->player_number->numeric = 1; $this->cfg->lname->name = "lname"; $this->cfg->lname->public_name = _Nazwisko; $this->cfg->lname->type = 'text'; $this->cfg->lname->edit = 1; $this->cfg->lname->maxlength = 16; $this->cfg->lname->not_empty = 1; $this->cfg->fname->name = "fname"; $this->cfg->fname->public_name = _Imie; $this->cfg->fname->type = 'text'; $this->cfg->fname->maxlength = 16; $this->cfg->fname->not_empty = 1; $this->cfg->nick->name = "nick"; $this->cfg->nick->public_name = _Nick; $this->cfg->nick->type = 'text'; $this->cfg->nick->maxlength = 16; $this->cfg->city->name = "city"; $this->cfg->city->public_name = _Miejscowosc; $this->cfg->city->type = 'text'; $this->cfg->city->maxlength = 32; $this->cfg->city->no_list = 1; $this->cfg->sex->name = "sex"; $this->cfg->sex->public_name = _Plec; $this->cfg->sex->radio = 'sex_select'; $this->cfg->sex->not_empty = 1; $this->cfg->sex->no_list = 1; $this->cfg->cat->name = "cat"; $this->cfg->cat->public_name = _Grupa; if ($pcat == 4) { $this->cfg->cat->list_me = 'groups_select'; } if ($pcat == 3) { $this->cfg->cat->list_me = 'groups_select_short'; } $this->cfg->cat->not_empty = 1; $this->cfg->cat->no_list = 1; $this->cfg->cat->level = 4; $this->cfg->team_id->name = "team_id"; $this->cfg->team_id->public_name = _Druzyna; $this->cfg->team_id->db_list = _DB_PREFIX . '_teams'; $this->cfg->team_id->db_list_pk = "id"; $this->cfg->team_id->db_list_sel = "team"; $this->cfg->team_id->db_list_cond = 'cup_id = ' . $_COOKIE['CUP_ID']; $this->cfg->team_id->no_list = 1; $this->cfg->pass->name = "pass"; $this->cfg->pass->public_name = _Haslo; $this->cfg->pass->type = 'password'; $this->cfg->pass->maxlength = 16; $this->cfg->pass->no_list = 1; $this->cfg->cat->level = 4; $this->cfg->cup_id->name = "cup_id"; $this->cfg->cup_id->public_name = _CUPNAME; $this->cfg->cup_id->db_list = _DB_PREFIX . '_cups'; $this->cfg->cup_id->db_list_pk = "id"; $this->cfg->cup_id->db_list_sel = "cup"; $this->cfg->cup_id->db_list_cond = " close = 0"; $this->cfg->cup_id->not_empty = 1; }