本文整理汇总了PHP中Match::SetShortUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::SetShortUrl方法的具体用法?PHP Match::SetShortUrl怎么用?PHP Match::SetShortUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Match
的用法示例。
在下文中一共展示了Match::SetShortUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnPreRender
function OnPreRender()
{
# list subscriptions to pages (which may not yet be topics)
$this->SetCssClass('subscriptions');
if (is_array($this->a_subs) and count($this->a_subs)) {
# build table
$o_table = new XhtmlElement('table');
# build header row
$o_row = new XhtmlElement('tr');
$o_row->AddControl(new XhtmlElement('th', 'What you subscribed to'));
$o_row->AddControl(new XhtmlElement('th', 'Date subscribed'));
$o_row->AddControl(new XhtmlElement('th', 'Unsubscribe'));
$o_thead = new XhtmlElement('thead', $o_row);
$o_table->AddControl($o_thead);
# build table body
$o_tbody = new XhtmlElement('tbody');
foreach ($this->a_subs as $o_sub) {
$o_item = null;
# build table row for each subscription
if ($o_sub->GetType() == ContentType::STOOLBALL_MATCH) {
$o_item = new Match($this->o_settings);
$o_item->SetShortUrl($o_sub->GetSubscribedItemUrl());
}
if (is_object($o_item)) {
$o_row = new XhtmlElement('tr');
$o_link = new XhtmlElement('a', Html::Encode($o_sub->GetTitle()));
$o_link->AddAttribute('href', $o_item->GetNavigateUrl());
$o_td_item = new XhtmlElement('td', $o_link);
if ($o_sub->GetContentDate()) {
$o_qualifier = new XhtmlElement('span', ' on ' . Html::Encode($o_sub->GetContentDate()));
$o_qualifier->SetCssClass('subscriptionQualifier');
$o_td_item->AddControl($o_qualifier);
}
$o_row->AddControl($o_td_item);
# admin cells
$o_row->AddControl($this->GetSubscribeDateCell($o_sub));
$o_row->AddControl($this->GetActionCell($o_sub));
$o_tbody->AddControl($o_row);
unset($o_item);
}
}
$o_table->AddControl($o_tbody);
$this->AddControl($o_table);
} else {
$o_p = new XhtmlElement('p', 'You have not subscribed to any email alerts.');
$o_p->SetCssClass('subscriptionNone');
$this->AddControl($o_p);
}
}
示例2: BuildPostedDataObject
/**
* Builds a match object containing the result information posted by the control
*
*/
public function BuildPostedDataObject()
{
$match = new Match($this->GetSettings());
$match->SetMatchType(MatchType::TOURNAMENT);
# Get match id
$s_key = $this->GetNamingPrefix() . 'item';
if (isset($_POST[$s_key])) {
$s_id = $_POST[$s_key];
if (strlen($s_id)) {
$match->SetId($s_id);
}
}
# Get the title
$s_key = $this->GetNamingPrefix() . 'Title';
if (isset($_POST[$s_key])) {
$match->SetTitle(strip_tags($_POST[$s_key]));
}
# Get the qualification type
$s_key = $this->GetNamingPrefix() . 'Qualify';
if (isset($_POST[$s_key])) {
$match->SetQualificationType($_POST[$s_key]);
}
# Get the player type
$s_key = $this->GetNamingPrefix() . 'PlayerType';
if (isset($_POST[$s_key])) {
$match->SetPlayerType($_POST[$s_key]);
}
$s_key = $this->GetNamingPrefix() . "Players";
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$match->SetMaximumPlayersPerTeam($_POST[$s_key]);
}
# Get the number of overs
$s_key = $this->GetNamingPrefix() . "Overs";
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$match->SetOvers($_POST[$s_key]);
}
# Get the short URL
$s_key = $this->GetNamingPrefix() . 'ShortUrl';
if (isset($_POST[$s_key])) {
$match->SetShortUrl($_POST[$s_key]);
}
# Get the start date
$s_key = $this->GetNamingPrefix() . 'Start';
$match->SetStartTime(DateControl::GetPostedTimestampUtc($s_key));
$match->SetIsStartTimeKnown(DateControl::GetIsTimePosted($s_key));
# Get the initial team
$team = new Team($this->GetSettings());
$s_key = $this->GetNamingPrefix() . 'ContextTeam';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$team->SetId($_POST[$s_key]);
$match->AddAwayTeam($team);
}
# Get the ground
$s_key = $this->GetNamingPrefix() . 'Ground';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$o_ground = new Ground($this->GetSettings());
$o_ground->SetId($_POST[$s_key]);
$match->SetGround($o_ground);
}
# Get the notes
$s_key = $this->GetNamingPrefix() . 'Notes';
if (isset($_POST[$s_key])) {
$match->SetNotes($_POST[$s_key]);
}
$this->SetDataObject($match);
}
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:70,代码来源:tournament-edit-control.class.php
示例3: BuildMatchSummary
/**
* Helper to build basic info about a match from raw data
*
* @param Match $match
* @param DataRow $row
*/
private function BuildMatchSummary(Match $match, $row)
{
$match->SetId($row->match_id);
if (isset($row->start_time)) {
$match->SetStartTime($row->start_time);
}
if (isset($row->start_time_known)) {
$match->SetIsStartTimeKnown($row->start_time_known);
}
if (isset($row->match_type)) {
$match->SetMatchType($row->match_type);
}
if (isset($row->player_type_id)) {
$match->SetPlayerType($row->player_type_id);
}
if (isset($row->qualification)) {
$match->SetQualificationType($row->qualification);
}
if (isset($row->players_per_team)) {
$match->SetMaximumPlayersPerTeam($row->players_per_team);
}
if (isset($row->max_tournament_teams)) {
$match->SetMaximumTeamsInTournament($row->max_tournament_teams);
}
if (isset($row->tournament_spaces)) {
$match->SetSpacesLeftInTournament($row->tournament_spaces);
}
if (isset($row->overs_per_innings)) {
$match->SetOvers($row->overs_per_innings);
}
if (isset($row->match_title)) {
$match->SetTitle($row->match_title);
}
if (isset($row->custom_title)) {
$match->SetUseCustomTitle($row->custom_title);
}
if (isset($row->home_bat_first) and !is_null($row->home_bat_first)) {
$match->Result()->SetHomeBattedFirst($row->home_bat_first);
}
if (isset($row->won_toss) and !is_null($row->won_toss)) {
$match->Result()->SetTossWonBy($row->won_toss);
}
if (isset($row->home_runs)) {
$match->Result()->SetHomeRuns($row->home_runs);
}
if (isset($row->home_wickets)) {
$match->Result()->SetHomeWickets($row->home_wickets);
}
if (isset($row->away_runs)) {
$match->Result()->SetAwayRuns($row->away_runs);
}
if (isset($row->away_wickets)) {
$match->Result()->SetAwayWickets($row->away_wickets);
}
if (isset($row->home_points)) {
$match->Result()->SetHomePoints($row->home_points);
}
if (isset($row->away_points)) {
$match->Result()->SetAwayPoints($row->away_points);
}
if (isset($row->player_of_match_id)) {
$player = new Player($this->GetSettings());
$player->SetId($row->player_of_match_id);
$player->SetName($row->player_of_match);
$player->SetShortUrl($row->player_of_match_url);
$player->Team()->SetId($row->player_of_match_team_id);
$match->Result()->SetPlayerOfTheMatch($player);
}
if (isset($row->player_of_match_home_id)) {
$player = new Player($this->GetSettings());
$player->SetId($row->player_of_match_home_id);
$player->SetName($row->player_of_match_home);
$player->SetShortUrl($row->player_of_match_home_url);
$player->Team()->SetId($row->player_of_match_home_team_id);
$match->Result()->SetPlayerOfTheMatchHome($player);
}
if (isset($row->player_of_match_away_id)) {
$player = new Player($this->GetSettings());
$player->SetId($row->player_of_match_away_id);
$player->SetName($row->player_of_match_away);
$player->SetShortUrl($row->player_of_match_away_url);
$player->Team()->SetId($row->player_of_match_away_team_id);
$match->Result()->SetPlayerOfTheMatchAway($player);
}
if (isset($row->match_notes)) {
$match->SetNotes($row->match_notes);
}
if (isset($row->short_url)) {
$match->SetShortUrl($row->short_url);
}
if (isset($row->update_search) and $row->update_search == 1) {
$match->SetSearchUpdateRequired();
}
if (isset($row->added_by) and is_numeric($row->added_by)) {
//.........这里部分代码省略.........
示例4: BuildPostedDataObject
/**
* Builds a match object containing the result information posted by the control
*
*/
public function BuildPostedDataObject()
{
$o_match = new Match($this->GetSettings());
# Get match id
$s_key = $this->GetNamingPrefix() . 'item';
if (isset($_POST[$s_key])) {
$s_id = $_POST[$s_key];
if (strlen($s_id)) {
$o_match->SetId($s_id);
}
}
# Get the short URL
$s_key = $this->GetNamingPrefix() . 'ShortUrl';
if (isset($_POST[$s_key])) {
$o_match->SetShortUrl($_POST[$s_key]);
}
# Get the start date
$s_key = $this->GetNamingPrefix() . 'Start';
$o_match->SetStartTime(DateControl::GetPostedTimestampUtc($s_key));
$o_match->SetIsStartTimeKnown(DateControl::GetIsTimePosted($s_key));
# Get the home team
# Test for (int)$_POST[$s_key] deliberately excludes "Not known" value, which is 0
$o_home = new Team($this->GetSettings());
$s_key = $this->GetNamingPrefix() . 'Home';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key]) and (int) $_POST[$s_key]) {
$o_home->SetId($_POST[$s_key]);
$o_match->SetHomeTeam($o_home);
}
# Get the away team
# Test for (int)$_POST[$s_key] deliberately excludes "Not known" value, which is 0
$o_away = new Team($this->GetSettings());
$s_key = $this->GetNamingPrefix() . 'Away';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key]) and (int) $_POST[$s_key]) {
$o_away->SetId($_POST[$s_key]);
$o_match->SetAwayTeam($o_away);
}
# Get the ground
$s_key = $this->GetNamingPrefix() . 'Ground';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$o_ground = new Ground($this->GetSettings());
$o_ground->SetId($_POST[$s_key]);
$o_match->SetGround($o_ground);
}
# Get the notes
$s_key = $this->GetNamingPrefix() . 'Notes';
if (isset($_POST[$s_key])) {
$o_match->SetNotes($_POST[$s_key]);
}
# Get the match type
$s_key = $this->GetNamingPrefix() . 'MatchType';
if (isset($_POST[$s_key]) and is_numeric($_POST[$s_key])) {
$o_match->SetMatchType($_POST[$s_key]);
}
# Get the tournament
if ($o_match->GetMatchType() == MatchType::TOURNAMENT_MATCH) {
$s_key = $this->GetNamingPrefix() . 'Tournament';
if (isset($_POST[$s_key]) and is_numeric($_POST[$s_key])) {
$tournament = new Match($this->GetSettings());
$tournament->SetMatchType(MatchType::TOURNAMENT);
$tournament->SetId($_POST[$s_key]);
$o_match->SetTournament($tournament);
}
}
# Get the season
$s_key = $this->GetNamingPrefix() . 'Season';
if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
$o_season = new Season($this->GetSettings());
$o_season->SetId($_POST[$s_key]);
$o_match->Seasons()->Add($o_season);
}
$this->SetDataObject($o_match);
}
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:76,代码来源:match-fixture-edit-control.class.php