当前位置: 首页>>代码示例>>PHP>>正文


PHP Team::GetLinkedDataUri方法代码示例

本文整理汇总了PHP中Team::GetLinkedDataUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::GetLinkedDataUri方法的具体用法?PHP Team::GetLinkedDataUri怎么用?PHP Team::GetLinkedDataUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Team的用法示例。


在下文中一共展示了Team::GetLinkedDataUri方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: OnLoadPageData

 function OnLoadPageData()
 {
     # get id of team
     $i_id = $this->team_manager->GetItemId($this->team);
     # no need to read team data if creating a new team
     # unlike some pages though, re-read after a save because not all info is posted back
     if ($i_id) {
         # get team
         $this->team_manager->ReadById(array($i_id));
         $this->team = $this->team_manager->GetFirst();
         # Check user has permission to edit this team
         if (!$this->team instanceof Team or !AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS, $this->team->GetLinkedDataUri())) {
             $this->GetAuthenticationManager()->GetPermission();
         }
     } else {
         # Check user has permission to create teams
         if (!AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS)) {
             $this->GetAuthenticationManager()->GetPermission();
         }
     }
     # get all clubs
     $this->club_manager->ReadAll();
     $this->edit->SetClubs($this->club_manager->GetItems());
     # get all grounds
     $this->ground_manager->ReadAll();
     $this->edit->SetGrounds($this->ground_manager->GetItems());
     # tidy up
     unset($this->team_manager);
     unset($this->club_manager);
     unset($this->ground_manager);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:31,代码来源:teamedit.php

示例2: __construct

 /**
  * Creates a TeamEditPanel
  *
  * @param SiteSettings $settings
  * @param Team $team
  * @param Season[] $seasons
  * @param Match[] $matches
  */
 public function __construct(SiteSettings $settings, Team $team, $seasons, $matches)
 {
     parent::__construct($settings, " this team");
     $is_one_time_team = $team->GetTeamType() == Team::ONCE;
     if (!$is_one_time_team) {
         $this->AddLink('tell us about your team', $settings->GetUrl('TeamAdd'));
     }
     if (AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS, $team->GetLinkedDataUri())) {
         $this->AddLink('edit this team', $team->GetEditTeamUrl());
     }
     if (AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS)) {
         $this->AddLink('delete this team', $team->GetDeleteTeamUrl());
     }
     if (!$is_one_time_team) {
         $b_in_league = false;
         $b_in_cup = false;
         if (is_array($seasons)) {
             foreach ($seasons as $season) {
                 /* @var $season Season */
                 if (!$b_in_cup and $season->MatchTypes()->Contains(MatchType::CUP)) {
                     $b_in_cup = true;
                 }
                 if (!$b_in_league and $season->MatchTypes()->Contains(MatchType::LEAGUE)) {
                     $b_in_league = true;
                 }
                 if ($b_in_cup and $b_in_league) {
                     break;
                 }
             }
         }
         $this->AddLink('add practice', $team->GetAddMatchNavigateUrl(MatchType::PRACTICE));
         $this->AddLink('add friendly match', $team->GetAddMatchNavigateUrl(MatchType::FRIENDLY));
         $this->AddLink('add tournament', $team->GetAddMatchNavigateUrl(MatchType::TOURNAMENT));
         if ($b_in_league) {
             $this->AddLink('add league match', $team->GetAddMatchNavigateUrl(MatchType::LEAGUE));
         }
         if ($b_in_cup) {
             $this->AddLink('add cup match', $team->GetAddMatchNavigateUrl(MatchType::CUP));
         }
         if (is_array($matches) and count($matches)) {
             # Make sure there's at least one match which is not a tournament or a practice
             foreach ($matches as $o_match) {
                 /* @var $o_match Match */
                 if ($o_match->GetMatchType() == MatchType::PRACTICE or $o_match->GetMatchType() == MatchType::TOURNAMENT or $o_match->GetMatchType() == MatchType::TOURNAMENT_MATCH) {
                     continue;
                 } else {
                     $this->AddLink('update results', $team->GetResultsNavigateUrl());
                     break;
                 }
             }
             $this->AddLink('add matches to your calendar', $team->GetCalendarNavigateUrl());
         }
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:62,代码来源:team-edit-panel.class.php

示例3: Delete

 /**
  * @access public
  * @return void
  * @param int[] $a_ids
  * @desc Delete from the db the Teams matching the supplied ids
  */
 public function Delete($a_ids)
 {
     # check parameter
     $this->ValidateNumericArray($a_ids);
     if (!count($a_ids)) {
         throw new Exception('No teams to delete');
     }
     $s_ids = join(', ', $a_ids);
     # Get more information on the teams
     $teams = array();
     $s_sql = "SELECT team_id, short_url, owner_role_id FROM nsa_team WHERE team_id IN ({$s_ids})";
     $result = $this->GetDataConnection()->query($s_sql);
     while ($row = $result->fetch()) {
         $team = new Team($this->GetSettings());
         $team->SetId($row->team_id);
         $team->SetShortUrl($row->short_url);
         $team->SetOwnerRoleId($row->owner_role_id);
         $teams[] = $team;
     }
     $result->closeCursor();
     # Check that current user is an admin or a team owner
     require_once "authentication/authentication-manager.class.php";
     $user = AuthenticationManager::GetUser();
     foreach ($teams as $team) {
         /* @var $team Team */
         if (!$user->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS, $team->GetLinkedDataUri())) {
             throw new Exception("Unauthorised");
         }
     }
     # delete owner role
     $authentication_manager = new AuthenticationManager($this->GetSettings(), $this->GetDataConnection(), null);
     foreach ($teams as $team) {
         /* @var $team Team */
         if ($team->GetOwnerRoleId()) {
             $authentication_manager->DeleteRole($team->GetOwnerRoleId());
         }
     }
     unset($authentication_manager);
     # delete from short URL cache
     require_once 'http/short-url-manager.class.php';
     $o_url_manager = new ShortUrlManager($this->GetSettings(), $this->GetDataConnection());
     foreach ($teams as $team) {
         /* @var $team Team */
         $o_url_manager->Delete($team->GetShortUrl());
     }
     unset($o_url_manager);
     # Delete relationships to matches
     $s_match_link = $this->GetSettings()->GetTable('MatchTeam');
     $s_sql = 'DELETE FROM ' . $s_match_link . ' WHERE team_id IN (' . $s_ids . ') ';
     $this->GetDataConnection()->query($s_sql);
     # Delete relationships to competitions
     $s_season_link = $this->GetSettings()->GetTable('TeamSeason');
     $s_sql = 'DELETE FROM ' . $s_season_link . ' WHERE team_id IN (' . $s_ids . ') ';
     $this->GetDataConnection()->query($s_sql);
     # Delete players
     require_once "player-manager.class.php";
     $player_manager = new PlayerManager($this->GetSettings(), $this->GetDataConnection());
     $player_manager->ReadPlayersInTeam($a_ids);
     $players = $player_manager->GetItems();
     if (count($players)) {
         $player_ids = array();
         foreach ($players as $player) {
             $player_ids[] = $player->GetId();
         }
         $player_manager->Delete($player_ids);
     }
     unset($player_manager);
     # delete team(s)
     $s_sql = 'DELETE FROM nsa_team WHERE team_id IN (' . $s_ids . ') ';
     $this->GetDataConnection()->query($s_sql);
     return $this->GetDataConnection()->GetAffectedRows();
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:78,代码来源:team-manager.class.php

示例4: OnPageLoad

    function OnPageLoad()
    {
        /* @var $team Team */
        $team = $this->team;
        # display the team
        echo '<div class="team" typeof="schema:SportsTeam" about="' . htmlentities($this->team->GetLinkedDataUri(), ENT_QUOTES, "UTF-8", false) . '">';
        echo new TeamNameControl($this->team, 'h1');
        require_once 'xhtml/navigation/tabs.class.php';
        $tabs = array('Summary' => '');
        if ($this->has_player_stats) {
            $tabs['Players'] = $this->team->GetPlayersNavigateUrl();
        }
        $tabs['Statistics'] = $this->team->GetStatsNavigateUrl();
        echo new Tabs($tabs);
        ?>
        <div class="box tab-box">
            <div class="dataFilter"></div>
            <div class="box-content">
        <?php 
        if (!$this->is_one_time_team) {
            # add club name
            if ($team->GetClub()->GetId()) {
                $o_club_para = new XhtmlElement('p');
                $o_club_para->AddControl('Part of ');
                $o_club_link = new XhtmlElement('a', htmlentities($team->GetClub()->GetName(), ENT_QUOTES, "UTF-8", false));
                $o_club_link->AddAttribute('href', $team->GetClub()->GetNavigateUrl());
                $o_club_para->AddControl($o_club_link);
                $o_club_para->AddControl('.');
                echo $o_club_para;
            }
        }
        # Add intro
        if ($team->GetIntro()) {
            $s_intro = htmlentities($team->GetIntro(), ENT_QUOTES, "UTF-8", false);
            $s_intro = XhtmlMarkup::ApplyParagraphs($s_intro);
            $s_intro = XhtmlMarkup::ApplyLists($s_intro);
            $s_intro = XhtmlMarkup::ApplySimpleXhtmlTags($s_intro, false);
            $s_intro = XhtmlMarkup::ApplyLinks($s_intro);
            if (strpos($s_intro, '<p>') > -1) {
                echo '<div property="schema:description">' . $s_intro . '</div>';
            } else {
                echo '<p property="schema:description">' . $s_intro . '</p>';
            }
        }
        ######################
        ### When and where ###
        ######################
        echo new XhtmlElement('h2', 'When and where');
        if (!$this->is_one_time_team) {
            # Add not playing, if relevant
            if (!$team->GetIsActive()) {
                echo new XhtmlElement('p', new XhtmlElement('strong', 'This team doesn\'t play any more.'));
            }
        }
        # add ground
        $ground = $team->GetGround();
        if ($ground->GetId() and $ground->GetName()) {
            echo '<p rel="schema:location">This team plays at <a typeof="schema:Place" about="' . htmlentities($ground->GetLinkedDataUri(), ENT_QUOTES, "UTF-8", false) . '" property="schema:name" rel="schema:url" href="' . htmlentities($ground->GetNavigateUrl(), ENT_QUOTES, "UTF-8", false) . '">' . htmlentities($ground->GetNameAndTown(), ENT_QUOTES, "UTF-8", false) . '</a>.</p>';
        }
        if (!$this->is_one_time_team) {
            # Add playing times
            if ($team->GetPlayingTimes()) {
                $s_times = htmlentities($team->GetPlayingTimes(), ENT_QUOTES, "UTF-8", false);
                $s_times = XhtmlMarkup::ApplyParagraphs($s_times);
                $s_times = XhtmlMarkup::ApplyLists($s_times);
                $s_times = XhtmlMarkup::ApplySimpleXhtmlTags($s_times, false);
                $s_times = XhtmlMarkup::ApplyLinks($s_times);
                echo $s_times;
            }
        }
        # Match list
        if (count($this->a_matches)) {
            if ($this->is_one_time_team) {
                $came = "came";
                if (count($this->a_matches) == 1 and $this->a_matches[0]->GetStartTime() > gmdate("U")) {
                    $came = "will come";
                }
                echo "<p>This team {$came} together once to play in a tournament.</p>";
            } else {
                echo new XhtmlElement('h2', 'Matches this season');
            }
            echo new MatchListControl($this->a_matches);
        }
        if (!$this->is_one_time_team) {
            #################
            ###  Seasons  ###
            #################
            $seasons = array();
            foreach ($team->Seasons() as $team_in_season) {
                $seasons[] = $team_in_season->GetSeason();
            }
            if (count($seasons)) {
                $season_list = new SeasonListControl($seasons);
                $season_list->SetShowCompetition(true);
                echo $season_list;
            }
        }
        #################
        ###   Cost    ###
        #################
//.........这里部分代码省略.........
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:101,代码来源:team.php

示例5: CheckForPermission

 private function CheckForPermission(Team $team)
 {
     if (is_null($this->has_permission)) {
         $this->has_permission = AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS, $team->GetLinkedDataUri());
         if (!$this->has_permission) {
             $this->GetAuthenticationManager()->GetPermission();
         }
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:9,代码来源:playeredit.php

示例6: CreateTeamLink

 private function CreateTeamLink(Team $team)
 {
     $span = new XhtmlElement('span');
     $span->AddAttribute("typeof", "schema:SportsTeam");
     $span->AddAttribute("about", $team->GetLinkedDataUri());
     $link = new XhtmlElement('a', Html::Encode($team->GetName()));
     $link->AddAttribute("property", "schema:name");
     $link->AddAttribute('href', $team->GetNavigateUrl());
     $link->AddAttribute("rel", "schema:url");
     $span->AddControl($link);
     return $span;
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:12,代码来源:match-control.class.php

示例7: OnPageLoad

    public function OnPageLoad()
    {
        echo '<article typeof="schema:SportsTeam" about="' . htmlentities($this->team->GetLinkedDataUri(), ENT_QUOTES, "UTF-8", false) . '">';
        echo '<h1>Players for <span property="schema:name">' . htmlentities($this->team->GetName(), ENT_QUOTES, "UTF-8", false) . "</span></h1>";
        require_once 'xhtml/navigation/tabs.class.php';
        $tabs = array('Summary' => $this->team->GetNavigateUrl());
        $tabs['Players'] = '';
        $tabs['Statistics'] = $this->team->GetStatsNavigateUrl();
        echo new Tabs($tabs);
        ?>
        <div class="box tab-box">
            <div class="dataFilter"></div>
            <div class="box-content">
        <?php 
        if (count($this->players) > 4) {
            $threshold = (int) gmdate("Y") - 1;
            $list_open = false;
            echo '<div class="player-list">';
            foreach ($this->players as $player) {
                /* @var $player Player */
                if ($player->GetPlayerRole() == Player::PLAYER and (gmdate("Y", $player->GetLastPlayedDate()) >= $threshold or $player->GetLastPlayedDate() == 0)) {
                    if (!$list_open) {
                        echo '<h2>Current and recent players</h2><ol rel="schema:members">';
                        $list_open = true;
                    }
                    echo '<li typeof="schema:Person" about="' . htmlentities($player->GetLinkedDataUri(), ENT_QUOTES, "UTF-8", false) . '"><a property="schema:name" rel="schema:url" href="' . htmlentities($player->GetPlayerUrl(), ENT_QUOTES, "UTF-8", false) . '">' . htmlentities($player->GetName(), ENT_QUOTES, "UTF-8", false) . "</a></li>";
                }
            }
            if ($list_open) {
                echo "</ol>";
            }
            $list_open = false;
            foreach ($this->players as $player) {
                /* @var $player Player */
                if ($player->GetPlayerRole() == Player::PLAYER and gmdate("Y", $player->GetLastPlayedDate()) < $threshold and $player->GetLastPlayedDate() != 0) {
                    if (!$list_open) {
                        echo '<h2>Former players</h2><ol rel="schema:members">';
                        $list_open = true;
                    }
                    echo '<li typeof="schema:Person" about="' . htmlentities($player->GetLinkedDataUri(), ENT_QUOTES, "UTF-8", false) . '"><a property="schema:name" rel="schema:url" href="' . htmlentities($player->GetPlayerUrl(), ENT_QUOTES, "UTF-8", false) . '">' . htmlentities($player->GetName(), ENT_QUOTES, "UTF-8", false) . "</a></li>";
                }
            }
            if ($list_open) {
                echo "</ol>";
            }
            $list_open = false;
            foreach ($this->players as $player) {
                /* @var $player Player */
                if ($player->GetPlayerRole() != Player::PLAYER) {
                    if (!$list_open) {
                        echo "<h2>Extras</h2><ul>";
                        $list_open = true;
                    }
                    echo '<li><a href="' . htmlentities($player->GetPlayerUrl(), ENT_QUOTES, "UTF-8", false) . '">' . htmlentities($player->GetName(), ENT_QUOTES, "UTF-8", false) . "</a></li>";
                }
            }
            if ($list_open) {
                echo "</ul>";
            }
            echo "</div>";
        } else {
            ?>
<p>There aren't any player statistics for this team yet.</p>
<p>To find out how to add them, see <a href="/play/manage/website/matches-and-results-why-you-should-add-yours/">Matches and results &#8211; why you should add yours</a>.</p>
			<?php 
        }
        ?>
        </div>
        </div>
        </article>
        <?php 
        $this->AddSeparator();
        if (AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS, $this->team->GetLinkedDataUri())) {
            # Create a panel with actions
            $panel = new UserEditPanel($this->GetSettings());
            $panel->AddCssClass("with-tabs");
            #$panel->AddLink("add a player", $this->team->GetPlayerAddNavigateUrl());
            echo $panel;
            $this->BuySomething();
        } else {
            echo '<div class="with-tabs">';
            $this->BuySomething();
            echo '</div>';
        }
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:85,代码来源:players.php


注:本文中的Team::GetLinkedDataUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。