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


PHP Html::Encode方法代码示例

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


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

示例1: OnPageLoad

 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     $user = AuthenticationManager::GetUser();
     $list = '';
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_CATEGORIES)) {
         $list .= '<li><a href="/yesnosorry/categorylist.php">Categories</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS)) {
         $list .= '<li><a href="/play/clubs">Clubs and schools</a></li>';
         $list .= '<li><a href="/yesnosorry/contact-audit.php">Contact details audit</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_GROUNDS)) {
         $list .= '<li><a href="/yesnosorry/groundlist.php">Grounds</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_USERS_AND_PERMISSIONS)) {
         $list .= '<li><a href="/yesnosorry/personlist.php">Users</a></li>' . '<li><a href="/yesnosorry/roles.php">Roles</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_URLS)) {
         $list .= '<li><a href="regenerate-short-urls.php">Regenerate short URL cache</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_SEARCH)) {
         $list .= '<li><a href="/search/reindex.php">Reindex search</a></li>';
     }
     if ($user->Permissions()->HasPermission(PermissionType::MANAGE_STATISTICS)) {
         $list .= '<li><form action="/play/statistics/recalculate-player-statistics.php" method="post"><div><input type="submit" value="Recalculate player statistics" /></div></form></li>';
     }
     if ($list) {
         echo '<ul>' . $list . '</ul>';
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:31,代码来源:index.php

示例2: OnPageLoad

    function OnPageLoad()
    {
        if (is_object($this->data_object)) {
            echo new XhtmlElement('h1', Html::Encode('Delete role: ' . $this->data_object->getRoleName()));
        } else {
            echo new XhtmlElement('h1', 'Delete role');
            $this->deleted = true;
        }
        if ($this->deleted) {
            ?>
			<p>The role has been deleted.</p>
			<p><a href="roles.php">View all roles</a></p>
			<?php 
        } else {
            ?>
				<p>Deleting a role cannot be undone.</p>
				<p>Are you sure you want to delete this role?</p>
				<form method="post" class="deleteButtons">
				<div>
				<input type="submit" value="Delete role" name="delete" />
				<input type="submit" value="Cancel" name="cancel" />
				</div>
				</form>
				<?php 
            $this->AddSeparator();
            require_once 'stoolball/user-edit-panel.class.php';
            $panel = new UserEditPanel($this->GetSettings(), 'this role');
            $panel->AddLink('edit this role', "role.php?item=" . $this->data_object->getRoleId());
            echo $panel;
        }
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:31,代码来源:roledelete.php

示例3: OnPageLoad

    function OnPageLoad()
    {
        ?>
<h1>Manage roles</h1>
<table>
    <thead><tr><th>Role</th><th>Action</th></tr></thead>
    <tbody>
	<?php 
        foreach ($this->roles as $role) {
            ?>
		<tr>
		    <td><a href="role.php?item=<?php 
            echo Html::Encode($role->getRoleId());
            ?>
"><?php 
            echo Html::Encode($role->getRoleName());
            ?>
</a></td>
		    <td><a href="roledelete.php?item=<?php 
            echo Html::Encode($role->getRoleId());
            ?>
">Delete</a></td>
		</tr>
		<?php 
        }
        ?>
	</tbody>
</table>
<?php 
        $this->AddSeparator();
        require_once 'stoolball/user-edit-panel.class.php';
        $panel = new UserEditPanel($this->GetSettings(), '');
        $panel->AddLink('add a role', 'role.php');
        echo $panel;
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:35,代码来源:roles.php

示例4: OnPageLoad

 function OnPageLoad()
 {
     if ($this->page_not_found) {
         require_once $_SERVER['DOCUMENT_ROOT'] . "/wp-content/themes/stoolball/section-404.php";
         return;
     }
     echo "<h1>" . Html::Encode($this->GetPageTitle()) . "</h1>";
     require_once 'xhtml/navigation/tabs.class.php';
     $tabs = array('Summary' => $this->tournament->GetNavigateUrl(), 'Tournament statistics' => '');
     echo new Tabs($tabs);
     ?>
     <div class="box tab-box">
         <div class="dataFilter"></div>
         <div class="box-content">
     <?php 
     # See what stats we've got available
     require_once "_summary-data-found.php";
     if (!$has_player_stats) {
         echo "<p>There aren't any statistics for the " . htmlentities($this->tournament->GetTitle(), ENT_QUOTES, "UTF-8", false) . ' 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 - why you should add yours</a>.</p>';
     } else {
         require_once "_summary-controls.php";
     }
     ?>
     </div>
     </div>
     <?php 
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:28,代码来源:summary-tournament.php

示例5: OnPreRender

 function OnPreRender()
 {
     /* @var $o_settings SiteSettings */
     /* @var $o_user User */
     $o_settings = $this->o_settings;
     $o_user =& $this->o_user;
     if ($o_user->IsSignedIn()) {
         # Show username
         $this->AddControl(new XhtmlElement('p', 'Welcome ' . $o_user->GetName(), "large"));
         $token = isset($_SESSION['csrf_token']) ? $_SESSION['csrf_token'] : base64_encode(mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB)));
         $_SESSION['csrf_token'] = $token;
         $html = '<form method="post" class="sign-out" action="/you/sign-out"><div>
         <input type="hidden" name="action" value="signout" />
         <input type="hidden" name="securitytoken" value="' . Html::Encode($token) . '" />
         <input type="submit" value="Sign out" /></div></form>';
         $this->AddControl($html);
         # Build edit profile link
         $o_profile = new XhtmlAnchor('Edit profile', $o_settings->GetUrl('AccountEdit'));
         $o_profile->AddAttribute('accesskey', '0');
         $o_profile->SetCssClass('editProfile');
         $this->AddControl($o_profile);
     } else {
         # Build sign in link
         $o_sign_in = new XhtmlAnchor('Sign in', $o_settings->GetFolder('Account'));
         $o_sign_in->AddAttribute('accesskey', '0');
         $o_sign_in->SetCssClass('signIn');
         $this->AddControl($o_sign_in);
         # Build register link
         $register = new XhtmlAnchor('Register', $o_settings->GetUrl('AccountCreate'));
         $this->AddControl($register);
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:32,代码来源:authentication-control.class.php

示例6: OnPageLoad

 function OnPageLoad()
 {
     echo '<h1>' . Html::Encode($this->GetPageTitle()) . '</h1>';
     $new_user = is_object($this->new_user) ? $this->new_user : new User();
     $this->form->SetDataObject($new_user);
     echo $this->form;
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:7,代码来源:signup.php

示例7: OnPreRender

 public function OnPreRender()
 {
     $by = $this->player->GetPlayerRole() == \Player::PLAYER ? ", " : " conceded by ";
     $this->AddControl('<h1><span property="schema:name">' . \Html::Encode($this->player->GetName()) . '</span>' . \Html::Encode($by . ' ' . $this->player->Team()->GetName() . $this->filter_description) . "</h1>");
     # When has this player played?
     $match_or_matches = $this->player->GetTotalMatches() == 1 ? " match" : " matches";
     $years = $this->player->GetPlayingYears();
     $filtered = "";
     if ($this->filter_description) {
         # If first played date is missing, the player came from PlayerManager because there were no statistics found
         if (!$this->filter_matched_nothing) {
             $filtered = " matching this filter";
         } else {
             $filtered = ", but none match this filter";
             $years = '';
         }
     }
     $team_name = '<span rel="schema:memberOf"><span about="' . \Html::Encode($this->player->Team()->GetLinkedDataUri()) . '" typeof="schema:SportsTeam"><a property="schema:name" rel="schema:url" href="' . \Html::Encode($this->player->Team()->GetNavigateUrl()) . "\">" . \Html::Encode($this->player->Team()->GetName()) . "</a></span></span>";
     if ($this->player->GetPlayerRole() == \Player::PLAYER) {
         if ($this->player->GetTotalMatches() == 0) {
             $played_total = " hasn't played any " . $match_or_matches;
         } else {
             $played_total = ' played <a href="/play/statistics/player-performances' . $this->filter_querystring . '">' . $this->player->GetTotalMatches() . $match_or_matches . '</a>';
         }
         $this->AddControl("<p>" . \Html::Encode($this->player->GetName()) . $played_total . " for {$team_name}{$filtered}{$years}.</p>");
         # Player of match
         if ($this->player->GetTotalPlayerOfTheMatchNominations() > 0) {
             $match_or_matches = $this->player->GetTotalPlayerOfTheMatchNominations() == 1 ? " match." : " matches.";
             $this->AddControl('<p>Nominated <a href="/play/statistics/player-of-match' . $this->filter_querystring . '">player of the match</a> in ' . $this->player->GetTotalPlayerOfTheMatchNominations() . $match_or_matches . "</p>");
         }
     } else {
         $this->AddControl("<p>{$team_name} recorded " . \Html::Encode($this->player->TotalRuns() . " " . strtolower($this->player->GetName()) . " in " . $this->player->GetTotalMatches() . $match_or_matches . "{$filtered}{$years}.") . "</p>");
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:34,代码来源:player-summary-control.class.php

示例8: OnPageLoad

    function OnPageLoad()
    {
        if ($this->b_success) {
            ?>
<h1>Confirmation successful</h1>
<p>Thank you for confirming your email address. Your profile has been updated.</p>
<p>When you next sign in to <?php 
            echo Html::Encode($this->GetSettings()->GetSiteName());
            ?>
 you'll
need to use your new email address, <strong><?php 
            echo Html::Encode(AuthenticationManager::GetUser()->GetEmail());
            ?>
</strong>, along with your existing password.</p>
<p><a href="<?php 
            echo Html::Encode($this->GetSettings()->GetUrl('AccountEdit'));
            ?>
">Back to your profile</a></p>
			<?php 
        } else {
            ?>
<h1>Confirmation failed</h1>
<p>Sorry, your request to change your registered email address could not be confirmed.</p>
<p>Please check that you used the exact address in the email you received, or try to <a href="<?php 
            echo Html::Encode($this->GetSettings()->GetUrl('AccountEssential'));
            ?>
">change your email address</a> again.</p>
			<?php 
        }
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:30,代码来源:e.php

示例9: OnPreRender

 function OnPreRender()
 {
     # get email address to populate form
     $s_email = '';
     if (isset($_GET['address']) and $_GET['address']) {
         $s_email = $_GET['address'];
     } else {
         if (isset($_POST['email']) and $_POST['email']) {
             $s_email = $_POST['email'];
         }
     }
     # get password to populate form
     $s_pass = (isset($_POST['password']) and $_POST['password']) ? $_POST['password'] : '';
     # remember whether to remember
     $s_remember = $this->authentication_manager->HasCookies() ? ' checked="checked"' : '';
     # work out which page to redirect to once signed in
     if (isset($_GET['page']) and $_GET['page']) {
         $s_page_to_return_to = $_GET['page'];
     } else {
         if (isset($_POST['page']) and $_POST['page']) {
             $s_page_to_return_to = $_POST['page'];
         } else {
             if (isset($_SERVER['HTTP_REFERER']) and $_SERVER['HTTP_REFERER'] and strstr($_SERVER['HTTP_REFERER'], $this->settings->GetUrl('AccountCreate')) === false and strstr($_SERVER['HTTP_REFERER'], $this->settings->GetFolder('Account')) === false) {
                 $s_page_to_return_to = $_SERVER['HTTP_REFERER'];
             } else {
                 $s_page_to_return_to = $this->settings->GetClientRoot();
             }
         }
     }
     # home page is last resort
     # build up form xhtml
     $this->AddControl('<div class="formPart"><label for="email2" class="formLabel">Your email address</label> <div class="formControl"><input type="email" size="30" maxlength="100" autocorrect="off" autocapitalize="off" id="email2" name="email" value="' . Html::Encode($s_email) . '" /></div></div>' . "\n" . '<div class="formPart"><label for="password2" class="formLabel">Your password</label> <div class="formControl"><input type="password" size="30" autocorrect="off" autocapitalize="off" id="password2" name="password" value="' . Html::Encode($s_pass) . '" /></div></div>' . "\n" . '<div class="formPart"><div class="formControl"><label for="remember_me"><input type="checkbox" name="remember_me" id="remember_me"' . Html::Encode($s_remember) . ' /> Keep me signed in <small>(uses a cookie)</small></label></div></div>' . "\n" . '<input type="hidden" name="page" value="' . Html::Encode($s_page_to_return_to) . '" />' . "\n" . '<div><input type="submit" class="submit" value="Sign in" /></div>' . "\n" . '<p id="authGetPassword"><a href="/you/request-password-reset">Reset password</a></p>' . "\n" . '<script>' . "\n" . '<!--' . "\n" . "document.getElementById('email2').focus();\n" . '//-->' . "\n" . '</script>' . "\n");
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:33,代码来源:signin-form.class.php

示例10: OnPreRender

 function OnPreRender()
 {
     /* @var $o_season Season */
     /* @var $o_team Team */
     $this->SetCaption($this->o_competition->GetName());
     $o_headings = new XhtmlRow(array('Name of team', 'Ground address', 'Contact details'));
     $o_headings->SetIsHeader(true);
     $this->AddRow($o_headings);
     foreach ($this->o_competition->GetLatestSeason()->GetTeams() as $o_team) {
         if ($o_team instanceof Team) {
             $o_row = new XhtmlRow();
             $o_row->AddCell(new XhtmlAnchor(Html::Encode($o_team->GetName()), $o_team->GetEditTeamUrl()));
             $o_row->AddCell(new PostalAddressControl($o_team->GetGround()->GetAddress()));
             $private = $o_team->GetPrivateContact();
             $public = $o_team->GetContact();
             $private_header = '<h2 style="margin:0; font-size:1.1em; color: #900;">Private</h2>';
             if ($private and $public) {
                 $contact = $public . $private_header . $private;
             } else {
                 $contact = $private ? $private_header . $private : $public;
             }
             $o_row->AddCell(nl2br(XhtmlMarkup::ApplySimpleTags(XhtmlMarkup::ApplyLinks($contact, true))));
             $this->AddRow($o_row);
         }
     }
     parent::OnPreRender();
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:27,代码来源:competition-text-table.class.php

示例11: OnPageLoad

    function OnPageLoad()
    {
        echo new XhtmlElement('h1', Html::Encode('Delete category: ' . $this->data_object->GetName()));
        if ($this->deleted) {
            ?>
			<p>The category has been deleted.</p>
			<p><a href="/yesnosorry/categorylist.php">View all categories</a></p>
			<?php 
        } else {
            if ($this->has_permission) {
                ?>
				<p>Deleting a category cannot be undone.</p>
				<ul>
					<li>Its competitions will not be listed in a category</li>
				</ul> 
					
				<p>Are you sure you want to delete this category?</p>
				<form action="<?php 
                echo Html::Encode($this->data_object->GetDeleteCategoryUrl());
                ?>
" method="post" class="deleteButtons">
				<div>
				<input type="submit" value="Delete category" name="delete" />
				<input type="submit" value="Cancel" name="cancel" />
				</div>
				</form>
				<?php 
            } else {
                ?>
				<p>Sorry, you're not allowed to delete this category.</p>
				<p><a href="/yesnosorry/categorylist.php">Go back to the list of categories</a></p>
				<?php 
            }
        }
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:35,代码来源:categorydelete.php

示例12: OnLoadPageData

    public function OnLoadPageData()
    {
        require_once 'stoolball/competition-manager.class.php';
        $manager = new CompetitionManager($this->GetSettings(), $this->GetDataConnection());
        $manager->ReadById(null, array($this->season_id));
        $competition = $manager->GetFirst();
        unset($manager);
        if (!$competition instanceof Competition) {
            return;
        }
        require_once 'stoolball/ground-manager.class.php';
        $manager = new GroundManager($this->GetSettings(), $this->GetDataConnection());
        $manager->FilterBySeason(array($competition->GetWorkingSeason()->GetId()));
        $manager->ReadAll();
        $grounds = $manager->GetItems();
        unset($manager);
        ?>
$(function() {
// Make the placeholder big enough for a map
var mapControl = document.getElementById("map");
mapControl.style.width = '100%';
mapControl.style.height = '500px'; // Create the map var
var bounds = new google.maps.LatLngBounds();
var myOptions = { mapTypeId : google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(mapControl, myOptions);
var markers = [];
var info;
		<?php 
        foreach ($grounds as $ground) {
            /* @var $ground Ground */
            if (!$ground->GetAddress()->GetLatitude() or !$ground->GetAddress()->GetLongitude()) {
                continue;
            }
            $content = "'<div class=\"map-info\">' +\n\t'<h2>" . str_replace("'", "\\'", Html::Encode($ground->GetNameAndTown())) . "</h2>' +\n\t'<p>Home to: ";
            $teams = $ground->Teams()->GetItems();
            $length = count($teams);
            for ($i = 0; $i < $length; $i++) {
                if ($i > 0 and $i == $length - 1) {
                    $content .= " and ";
                } else {
                    if ($i > 0) {
                        $content .= ", ";
                    }
                }
                $content .= '<a href="' . Html::Encode($teams[$i]->GetNavigateUrl()) . '">' . str_replace("'", "\\'", Html::Encode($teams[$i]->GetNameAndType())) . '</a>';
            }
            $content .= "</p></div>'";
            # And marker and click event to trigger info window. Wrap info window in function to isolate marker, otherwise the last marker
            # is always used for the position of the info window.
            echo "var marker = new google.maps.Marker({\n\t\t\tposition : new google.maps.LatLng(" . $ground->GetAddress()->GetLatitude() . "," . $ground->GetAddress()->GetLongitude() . "),\n\t\t\tshadow: Stoolball.Maps.WicketShadow(),\n\t\t\ticon: Stoolball.Maps.WicketIcon(),\n\t\t\ttitle : '" . str_replace("'", "\\'", $ground->GetNameAndTown()) . "'\n\t\t  });\n\t\t  markers.push(marker);\n\t\t  bounds.extend(marker.position);\n\n\t\t  (function(marker){\n\t\t\t  google.maps.event.addListener(marker, 'click', function()\n\t\t\t  {\n\t\t\t  \tvar content = {$content};\n\t\t\t  \tif (!info) info = new google.maps.InfoWindow();\n\t\t\t  \tinfo.setContent(content);\n\t\t\t  \tinfo.open(map, marker);\n\t\t\t  });\n\t\t  })(marker);\n\t\t  ";
        }
        ?>
map.fitBounds(bounds);
var style = [{ url: '/images/features/map-markers.gif', height: 67, width: 31, textColor: '#ffffff', textSize: 10 }];
var clusterer = new MarkerClusterer(map, markers, { 'gridSize': 30, styles: style});
});
		<?php 
        exit;
    }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:59,代码来源:map.js.php

示例13: OnPageLoad

 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     echo '<p>You can subscribe to emails for ' . Html::Encode($this->GetSettings()->GetSiteName()) . '\'s match comments. ' . 'Once you have subscribed, as soon as anyone else adds their comments,  you\'ll get an email.</p>';
     # display tables of subscriptions
     echo new SubscriptionGrid($this->GetSettings(), $this->a_subs);
     echo '<form method="get" action="' . Html::Encode($this->GetSettings()->GetUrl('AccountEdit')) . '"><div>' . '<input type="submit" class="submit" value="Done" title="Return to your edit profile options page" />' . '</div></form>';
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:8,代码来源:emails.php

示例14: OnPageLoad

 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     # display the club
     $o_club = is_object($this->o_club) ? $this->o_club : new Club($this->GetSettings());
     $this->o_edit->SetDataObject($o_club);
     echo $this->o_edit;
     parent::OnPageLoad();
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:9,代码来源:clubedit.php

示例15: OnPageLoad

 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     # display the competition
     $o_competition = is_object($this->o_competition) ? $this->o_competition : new Competition($this->GetSettings());
     $this->o_edit->SetDataObject($o_competition);
     echo $this->o_edit;
     parent::OnPageLoad();
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:9,代码来源:competitionedit.php


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