本文整理汇总了PHP中Link::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::getUrl方法的具体用法?PHP Link::getUrl怎么用?PHP Link::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::getUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setProject
public function setProject(Project $project)
{
$this->project = $project;
$url = parent::getUrl();
$url->setQueryVar('page', 'project');
$url->setQueryVar('id', $project->getID());
$this->setContent($project->getName());
}
示例2: updateUrl
private function updateUrl()
{
if (count($this->releaseList) > 0) {
$list = "";
$first = null;
foreach ($this->releaseList as $id) {
if ($first == null) {
$first = $id;
}
$list .= "," . $id;
}
$list = substr($list, 1);
$url = parent::getUrl();
$url->setQueryVar('page', 'project');
$url->setQueryVar('id', $this->projectId);
$url->setQueryVar('show', $list);
$url->set(URL_FRAGMENT, $first);
}
}
示例3: newLinkUrl
function newLinkUrl($url)
{
$link = new Link($url);
return $link->getUrl();
}
示例4: time
lcm_setcookie('lcm_lang', $new_lang, time() + 365 * 24 * 3600);
// Save language preference only if we are installed and if author connected
if ($valid_author && include_config_exists('inc_connect')) {
include_lcm('inc_admin');
lcm_query("UPDATE lcm_author \n\t\t\t\t\t\tSET lang = '" . $new_lang . "' \n\t\t\t\t\t\tWHERE id_author = " . $GLOBALS['author_session']['id_author']);
$author_session['lang'] = $new_lang;
lcm_add_session($author_session, $_COOKIE['lcm_session']);
} else {
lcm_log("Not valid_author ({$valid_author}) or not yet installed");
}
$cible->delvar('lang');
$cible->addvar('lang', $new_lang);
} else {
lcm_log("lcm_set_language() is not happy, wrong lang code?");
}
}
}
// Redirection
// Under Apache, cookies with a redirection work
// Else, we do a HTTP refresh
if (ereg("^Apache", $_SERVER['SERVER_SOFTWARE'])) {
@header("Location: " . $cible->getUrlForHeader());
exit;
} else {
@header("Refresh: 0; url=" . $cible->getUrl());
echo "<html><head>";
echo "<meta http-equiv='Refresh' content='0; url=" . $cible->getUrl() . "'>";
echo "</head>\n";
echo "<body><a href='" . $cible->getUrl() . "'>" . "Redirecting.." . "</a></body></html>";
exit;
}
示例5: Link
echo "</select>\n";
echo "<button name=\"submit\" type=\"submit\" value=\"add_client\" class=\"simple_form_btn\">" . 'Add' . "</button>\n";
// TRAD
echo "</td></tr>\n";
echo "</table>\n";
// Delete appointment
if (_session('id_app', 0)) {
// $checked = ($this->getDataString('hidden') == 'Y' ? ' checked="checked" ' : '');
$checked = $_SESSION['form_data']['hidden'] == 'Y' ? ' checked="checked" ' : '';
echo '<p class="normal_text">';
echo '<input type="checkbox"' . $checked . ' name="hidden" id="box_delete" />';
echo '<label for="box_delete">' . _T('app_info_delete') . '</label>';
echo "</p>\n";
}
// Submit buttons
echo '<button name="submit" type="submit" value="adddet" class="simple_form_btn">' . _T('button_validate') . "</button>\n";
echo '<input type="hidden" name="id_app" value="' . _session('id_app', 0) . '" />' . "\n";
echo '<input type="hidden" name="id_case" value="' . _session('id_case', 0) . '" />' . "\n";
echo '<input type="hidden" name="id_followup" value="' . _session('id_followup', 0) . '" />' . "\n";
// because of XHTML validation...
if (_session('ref_edit_app')) {
$ref_link = new Link(_session('ref_edit_app'));
echo '<input type="hidden" name="ref_edit_app" value="' . $ref_link->getUrl() . '" />' . "\n";
}
echo "</form>\n";
lcm_page_end();
// Clear the errors, in case user jumps to other 'edit' page
$_SESSION['errors'] = array();
$_SESSION['app_data'] = array();
// DEPRECATED since 0.7.0
$_SESSION['form_data'] = array();
示例6: Link
//
// Time spent on case by authors
//
case 'times':
// List authors on the case
$show_more_times = _request('more_times') ? true : false;
$q = "SELECT\n\t\t\t\t\t\ta.id_author, name_first, name_middle, name_last,\n\t\t\t\t\t\tsum(IF(UNIX_TIMESTAMP(fu.date_end) > 0,\n\t\t\t\t\t\t\tUNIX_TIMESTAMP(fu.date_end)-UNIX_TIMESTAMP(fu.date_start), 0)) as time,\n\t\t\t\t\t\tsum(sumbilled) as sumbilled\n\t\t\t\t\tFROM lcm_author as a, lcm_followup as fu\n\t\t\t\t\tWHERE fu.id_author = a.id_author\n\t\t\t\t\t AND fu.id_case = {$case}\n\t\t\t\t\t AND fu.hidden = 'N'\n\t\t\t\t\tGROUP BY fu.id_author";
$result = lcm_query($q);
// Show table headers
echo '<fieldset class="info_box">';
show_page_subtitle(_T('case_subtitle_times'), 'reports_intro');
$link_details = new Link();
$link_details->addVar('more_times', intval(!$show_more_times));
echo "<table border='0' class='tbl_usr_dtl' width='99%'>\n";
echo "<tr>\n";
echo "<th class='heading'>" . _Th('case_input_author') . ' ' . '<a title="' . _T('fu_button_stats_' . ($show_more_times ? 'less' : 'more')) . '" href="' . $link_details->getUrl() . '">' . '<img src="images/spip/' . ($show_more_times ? 'moins' : 'plus') . '.gif" alt="" border="0" />' . '</a>' . "</th>\n";
echo "<th class='heading' width='120' nowrap='nowrap' align='right'>" . _Th('time_input_length') . ' (' . _T('time_info_short_hour') . ")</th>\n";
$total_time = 0;
$total_sum_billed = 0.0;
$meta_sum_billed = read_meta('fu_sum_billed');
if ($meta_sum_billed == 'yes') {
$currency = read_meta('currency');
echo "<th class='heading' width='120' nowrap='nowrap' align='right'>" . _Th('fu_input_sum_billed') . ' (' . $currency . ")</th>\n";
}
echo "</tr>\n";
// Show table contents & calculate total
while ($row = lcm_fetch_array($result)) {
$total_time += $row['time'];
$total_sum_billed += $row['sumbilled'];
echo "<tr><td>";
echo get_person_name($row);
示例7: Link
} else {
$tmp_link->addVar('show_nokw', "1");
echo '<p><a href="' . $tmp_link->getUrl() . '" class="run_lnk">' . _T('rep_button_nokw_show') . "</a></p>\n";
}
}
echo '<p><a href="rep_det.php?rep=' . $report->getId() . '" class="run_lnk">' . _T('rep_button_goback') . "</a></p>\n";
//
// Make a link to export the report
//
echo '<p>';
$link_csv = new Link();
$link_csv->delVar('export');
$link_csv->addVar('export', 'csv');
echo '<a href="' . $link_csv->getUrl() . '" class="exp_lnk">' . _T('rep_button_exportcsv') . '</a> ';
$link_ods = new Link();
$link_ods->delVar('export');
$link_ods->addVar('export', 'ods');
echo '<a href="' . $link_ods->getUrl() . '" class="exp_lnk">' . _T('rep_button_exportcsv') . ' (ODS)' . '</a>';
// TRAD
echo "</p>\n";
//
// Print debug information, if requested
//
if (isset($_REQUEST['debug'])) {
$dbg = $report->getJournal();
foreach ($dbg as $line) {
echo $line;
}
}
lcm_page_end();
}
示例8: Title
$page = PageContent::getInstance();
$page->addComponent(new Title("Zéro fansub", 1));
if (TEST_MODE_ACTIVATED) {
$options = new SimpleBlockComponent();
$options->setClass('testFeatures');
$options->addComponent("Options : ");
$link = new Link(Url::getCurrentUrl(), "show prepared");
if ($link->getUrl()->hasQueryVar('showPrepared')) {
$link->getUrl()->removeQueryVar('showPrepared');
$link->setClass('reverse');
} else {
$link->getUrl()->setQueryVar('showPrepared');
}
$options->addComponent($link);
$link = new Link(Url::getCurrentUrl(), "show old");
if ($link->getUrl()->hasQueryVar('showOld')) {
$link->getUrl()->removeQueryVar('showOld');
$link->setClass('reverse');
} else {
$link->getUrl()->setQueryVar('showOld');
}
$options->addComponent($link);
$page->addComponent($options);
}
$page->addComponent($views);
$remaining = 10;
if (Url::getCurrentUrl()->hasQueryVar('showOld')) {
// TODO display this option or implement pages
$remaining = -1;
}
foreach ($newsList as $news) {
示例9: elseif
<form action="#" method="post">
<input type="hidden" name="id_link" value="<?php
echo $_GET['id_link'];
?>
" />
<p>
<label for="codigo">Código</label>
<input type="text" disabled="disabled" value="<?php
echo $link->getCode();
?>
"/>
</p>
<p>
<label for="enlace">Enlace: </label>
<input id="enlace" type="text" name="enlace" value="<?php
echo $link->getUrl();
?>
" />
</p>
<p>
<label for="descripcion">Descripción</label>
<textarea id="descripcion" name="descripcion"><?php
echo $link->getDescription();
?>
</textarea>
</p>
<input type="hidden" name="accion" value="doedit" />
<input type="submit" value="Guardar">
</form>
<?php
} elseif ($_GET['accion'] == 'delete') {
示例10: _T
$headers[2]['title'] = _Th('authoredit_input_status');
$headers[2]['order'] = 'order_status';
show_list_start($headers);
for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) {
echo "<tr>\n";
echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">';
echo '<input type="checkbox" name="authors[]" value="' . $row['id_author'] . '" />';
echo "</td>\n";
echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . get_person_name($row) . "</td>\n";
echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . _T('authoredit_input_status_' . $row['status']) . "</td>\n";
echo "</tr>\n";
}
show_list_end($list_pos, $number_of_rows);
?>
<input type="hidden" name="case" value="<?php
echo $case;
?>
" />
<input type="hidden" name="ref_sel_auth" value="<?php
echo $dest_link->getUrl();
?>
" />
<button name="submit" type="submit" value="submit" class="simple_form_btn"><?php
echo _T('button_validate');
?>
</button>
</form>
<?php
lcm_page_end();
示例11: show_login
function show_login($cible, $prive = 'prive', $message_login = '')
{
$error = '';
$login = _request('var_login');
$logout = _request('var_logout');
// If the cookie fails, inc_auth tried to redirect to lcm_cookie who
// then tried to put a cookie. If it is not there, it is "cookie failed"
// who is there, and it's probably a bookmark on privet=yes and not
// a cookie failure.
$cookie_failed = "";
if (_request('var_cookie_failed')) {
$cookie_failed = $_COOKIE['lcm_session'] != 'cookie_test_failed';
}
global $author_session;
global $lcm_session;
global $clean_link;
if (!$cible) {
// cible = destination
$cible = new Link(_request('var_url', 'index.php'));
}
$cible->delVar('var_erreur');
$cible->delVar('var_url');
$cible->delVar('var_cookie_failed');
$clean_link->delVar('var_erreur');
$clean_link->delVar('var_login');
$clean_link->delVar('var_cookie_failed');
$url = $cible->getUrl();
// This populates the $author_session variable
include_lcm('inc_session');
verifier_visiteur();
if ($author_session and !$logout and ($author_session['status'] == 'admin' or $author_session['status'] == 'normal')) {
if ($url != $GLOBALS['clean_link']->getUrl()) {
lcm_header("Location: " . $cible->getUrlForHeader());
}
// [ML] This is making problems for no reason, we use login only
// for one mecanism (entering the system).
// echo "<a href='$url'>"._T('login_this_way')."</a>\n";
echo "<a class='content_link' href='index.php'>" . _T('login_this_way') . "</a>\n";
return;
}
if (_request('var_erreur') == 'pass') {
$error = _T('login_password_incorrect');
}
// The login is memorized in the cookie for a possible future admin login
if (!$login && isset($_COOKIE['lcm_admin'])) {
if (preg_match("/^@(.*)\$/", $_COOKIE['lcm_admin'], $regs)) {
$login = $regs[1];
}
} else {
if ($login == '-1') {
$login = '';
}
}
// other sources for authentication
$flag_autres_sources = isset($GLOBALS['ldap_present']) ? $GLOBALS['ldap_present'] : '';
// What informations to pass?
if ($login) {
$status_login = 0;
// unknown status
$login = clean_input($login);
$query = "SELECT id_author, status, password, prefs, alea_actuel, alea_futur \n\t\t\t\t\tFROM lcm_author \n\t\t\t\t\tWHERE username='{$login}'";
$result = lcm_query($query);
if ($row = lcm_fetch_array($result)) {
if ($row['status'] == 'trash' or $row['password'] == '') {
$status_login = -1;
// deny
} else {
$status_login = 1;
// known login
// Which infos to pass for the javascript ?
$id_author = $row['id_author'];
$alea_actuel = $row['alea_actuel'];
// for MD5
$alea_futur = $row['alea_futur'];
// Button for lenght of connection
if ($row['prefs']) {
$prefs = unserialize($row['prefs']);
$rester_checked = $prefs['cnx'] == 'perma' ? ' checked=\'checked\'' : '';
}
}
}
// Unknown login (except LDAP) or refused
if ($status_login == -1 or $status_login == 0 and !$flag_autres_sources) {
$error = _T('login_identifier_unknown', array('login' => htmlspecialchars(clean_output($login))));
$login = '';
// [ML] Not sure why this was here, but headers are already sent
// therefore it causes an error message (which is not shown, but
// might make a mess, knowing how PHP runs differently everywhere..)
// @lcm_setcookie('lcm_admin', '', time() - 3600);
}
}
// Javascript for the focus
if ($login) {
$js_focus = 'document.form_login.session_password.focus();';
} else {
$js_focus = 'document.form_login.var_login.focus();';
}
// [ML] we should probably add a help link here, since tech, but let's see
// how many users complain first, since this should affect only tech users
if ($cookie_failed == "yes") {
//.........这里部分代码省略.........
示例12: createLink
/**
* @before _verified
*/
public function createLink()
{
$this->JSONView();
$view = $this->getActionView();
$adid = RM::post("adid");
if (!$adid) {
return $view->set('message', "Invalid Request");
}
$ad = \Ad::first(["_id = ?" => $adid, "live = ?" => true], ['_id', 'title']);
if (!$ad) {
return $view->set('message', "Invalid Request");
}
$user = User::first(["id = ?" => RM::post("aff_id")]) ?? $this->user;
$tdomains = Shared\Services\User::trackingLinks($user, $this->org);
if (RM::post("domain")) {
$domain = RM::post("domain");
} else {
$domain = $this->array_random($tdomains);
}
$link = Link::first(["ad_id = ?" => $ad->_id, "user_id = ?" => $user->_id], ['domain', '_id']);
if (!$link) {
$link = new Link(['user_id' => $user->_id, 'ad_id' => $ad->_id, 'domain' => $domain, 'live' => true]);
$link->save();
}
$view->set('message', $ad->title)->set('link', $link->getUrl($domain));
}
示例13: Title
<?php
$page = PageContent::getInstance();
$page->setClass("havert");
$page->addComponent(new Title("Avertissement", 1));
$page->addComponent(new Image("images/news/avert.jpg"));
$page->addComponent(new Title("Vous êtes sur le point d'entrer en mode Hentaï", 2));
$page->addComponent(new SimpleParagraphComponent("Comme son nom l'indique, vous vous apprêtez à regarder plein de machins dégoûtants interdits aux enfants. Mais bon, si vous êtes majeur, vacciné et consentant, on vous y autorise."));
$okLink = new Link();
$okLink->setContent("Montrer les machins dégoutants");
$url = $okLink->getUrl();
$url->removeQueryVar(DISPLAY_H_AVERT);
$url->setQueryVar(MODE_H, true);
$page->addComponent($okLink);
$cancelLink = new Link(Url::indexUrl(), "Garder mon écran propre");
if (isset($_SERVER["HTTP_REFERER"])) {
// TODO if the referer is a page needing the H mode, do not use it
$cancelLink->setUrl(new Url($_SERVER["HTTP_REFERER"]));
}
$page->addComponent($cancelLink);
示例14: __construct
public function __construct($link)
{
parent::__construct('save');
$language = OW::getLanguage()->getInstance();
$this->link = $link;
$urlField = new TextField('url');
$urlField->setHasInvitation(true)->setInvitation('http://www.example.com');
$this->addElement($urlField->setRequired(true)->addValidator(new UrlValidator())->setLabel($language->text('links', 'save_form_url_field_label'))->setValue($this->link->getUrl()));
$titleField = new TextField('title');
$this->addElement($titleField->setRequired(true)->setLabel($language->text('links', 'save_form_title_field_label'))->setValue($this->link->getTitle()));
$descriptionTextArea = new WysiwygTextarea('description');
$descriptionTextArea->setLabel($language->text('links', 'save_form_desc_field_label'));
$descriptionTextArea->setValue($this->link->getDescription());
$descriptionTextArea->setRequired(true);
$this->addElement($descriptionTextArea);
$tagService = BOL_TagService::getInstance();
$tags = array();
if (intval($this->link->getId()) > 0) {
$arr = $tagService->findEntityTags($this->link->getId(), 'link');
foreach (!empty($arr) ? $arr : array() as $dto) {
$tags[] = $dto->getLabel();
}
}
$tagsField = new TagsInputField('tags');
$tagsField->setLabel($language->text('links', 'save_form_tags_field_label'));
$tagsField->setValue($tags);
$tagsField->setDelimiterChars(array('.'));
$this->addElement($tagsField);
// $tagsField = new TagsField('tags', $tags);
// $this->addElement($tagsField->setLabel($language->text('links', 'save_form_tags_field_label')));
$submit = new Submit('submit');
$this->addElement($submit);
}
示例15: show_list_end
function show_list_end($current_pos = 0, $number_of_rows = 0, $allow_show_all = false, $prefix = '')
{
global $prefs;
$prefix_var = $prefix ? $prefix . '_' : '';
echo "</table>\n";
//
// Navigation for previous/next screens
//
$list_pages = ceil($number_of_rows / $prefs['page_rows']);
if (!$list_pages) {
echo "<!-- list_pages == 0 -->\n";
return;
}
$link = new Link();
$pos = $link->getVar($prefix_var . 'list_pos');
$link->delVar($prefix_var . 'list_pos');
// If we are showing "All" items, do not show navigation
if ($pos == 'all') {
return '';
}
echo "<table border='0' align='center' width='99%' class='page_numbers'>\n";
echo '<tr><td align="left" width="15%">';
// Previous page
if ($current_pos > 0) {
if ($current_pos > $prefs['page_rows']) {
$link->addVar($prefix_var . 'list_pos', $current_pos - $prefs['page_rows']);
}
echo '<a href="' . $link->getUrl($prefix) . '" class="content_link">' . "< " . _T('listnav_link_previous') . '</a> ';
}
echo "</td>\n";
echo '<td align="center" width="70%">';
// Page numbers with direct links
if ($list_pages > 1) {
echo _T('listnav_link_gotopage') . ' ';
for ($i = 0; $i < $list_pages; $i++) {
if ($i == floor($current_pos / $prefs['page_rows'])) {
echo '[' . ($i + 1) . '] ';
} else {
$current_pos_val = $i * $prefs['page_rows'];
$link = new Link();
$link->delVar($prefix_var . 'list_pos');
if ($current_pos_val > 0) {
$link->addVar($prefix_var . 'list_pos', $current_pos_val);
}
echo '<a href="' . $link->getUrl($prefix) . '" class="content_link">' . ($i + 1) . '</a> ';
}
}
if ($allow_show_all) {
$link->delVar($prefix_var . 'list_pos');
$link->addVar($prefix_var . 'list_pos', 'all');
echo '<a href="' . $link->getUrl($prefix) . '" class="content_link">' . _T('listnav_link_show_all') . '</a>';
}
}
echo "</td>\n";
echo "<td align='right' width='15%'>";
// Next page
$next_pos = $current_pos + $prefs['page_rows'];
if ($next_pos < $number_of_rows) {
$current_pos_val = $next_pos;
$link = new Link();
$link->addVar($prefix_var . 'list_pos', $current_pos_val);
echo '<a href="' . $link->getUrl($prefix) . '" class="content_link">' . _T('listnav_link_next') . " >" . '</a>';
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
}