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


PHP URI::strip方法代码示例

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


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

示例1: init

	/**
	 * set the current Ngroup from $_GET['ngroup']
	 */
	public static function init() {
		if (!empty($_GET['ngroup'])) {
			$_SESSION['ngroup'] = intval($_GET['ngroup']);
			switch (BN) {
				// pages which use the ngroup parameter
			case "proposals.php":
			case "periods.php":
			case "areas.php":
			case "admin_areas.php":
				break;
				// jump to different page if the same page doesn't show the equivalent content in other groups
			case "proposal_edit.php":
				if (!isset($_GET['id']) and !isset($_GET['issue'])) break; // new (not alternative) proposal needs ngroup
			case "proposal.php":
			case "draft.php":
				redirect("proposals.php?ngroup=".$_SESSION['ngroup']);
			default:
				// remove ngroup parameter from URLs of ngroup-independent pages
				redirect(URI::strip(['ngroup'], true));
			}
		} elseif (!isset($_SESSION['ngroup'])) {
			$_SESSION['ngroup'] = 0;
		}
	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:27,代码来源:Ngroup.php

示例2: display_form

	/**
	 * display form with filters and search field
	 */
	public function display_form() {
?>
<form action="<?php 
echo BN;
?>
" method="GET" class="filter">
<?
		// pass on all other parameters
		URI::hidden(['filter'=>null, 'search'=>null, 'page'=>null]);

		// filter
		if ($this->filters) {
			$this->display_select_filter();
		}

		// search
		if ( $this->enable_search ) {
?>
<input type="text" name="search" value="<?php 
echo $this->search;
?>
" size="20">
<input type="submit" value="<?php 
echo _("search and filter");
?>
">
<?
		} else {
?>
<input type="submit" value="<?php 
echo _("filter");
?>
">
<?
		}
?>
<a href="<?php 
echo URI::strip(['filter', 'search']);
?>
"><?php 
echo _("reset");
?>
</a>
</form>
<?
	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:49,代码来源:Filter.php

示例3: printf

	<div class="mid_dummy">
		<a href="<?=URI::build($params + ['filter'=>"closed"])?>" title="<?
printf(_("%d issues are finished, %d issues are cancelled"), $counts['finished'], $counts['cancelled']);
?>" class="top<?
if ($filter=="closed") { ?> active<? }
?>"><?=_("closed")?> (<?=($counts['finished']+$counts['cancelled'])?>)</a>
	</div>
</div>
<form id="search" action="<?=BN?>" method="GET">
<?
input_hidden('ngroup', $ngroup->id);
if ($filter) input_hidden("filter", $filter);
?>
<?=_("Search")?>: <input type="search" name="search" value="<?=h($search)?>">
<input type="submit" value="<?=_("search")?>">
<a href="<?=URI::strip(['search'])?>"><?=_("reset")?></a>
</form>
</div>

<table class="proposals">
<?

$pager = new Pager(10);

$sql = "SELECT issue.*
	FROM issue
	JOIN area ON area.id = issue.area AND area.ngroup = ".intval($ngroup->id);
$join_proposal = false;
$where = array();
$order_by = " ORDER BY issue.id DESC";
$show_results = false;
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:31,代码来源:proposals.php

示例4: display_edit_period

	/**
	 * admins select a voting period
	 *
	 * @return boolean true if the period may be changed
	 */
	private function display_edit_period() {

		$options =& $this->available_periods();
		if (!$options) return false;

		if (@$_GET['edit_period']==$this->id) {
			form(URI::strip(['edit_period'])."#issue".$this->id);
			input_select("period", $options, $this->period);
			?><br><?
			input_hidden("issue", $this->id);
			input_hidden("action", "select_period");
?>
<input type="submit" value="<?=_("apply")?>">
<?
			form_end();
		} else {
			if ($this->period) {
				?><a href="periods.php?ngroup=<?=$this->area()->ngroup?>&amp;hl=<?=$this->period?>"><?=$this->period?></a><?
			}
			?><a href="<?=URI::append(['edit_period'=>$this->id])?>#issue<?=$this->id?>" class="iconlink"><img src="img/edit.png" width="16" height="16" alt="<?=_("edit")?>" title="<?=_("select voting period")?>"></a><?
		}

		return true;
	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:29,代码来源:Issue.php

示例5: display_edit

	/**
	 * display the page with the form to edit or add a record
	 */
	protected function display_edit() {

		if ($this->id) {
			// edit existing record
			if (!$this->object) {
				$this->object = new $this->classname($this->id);
				if (!$this->object->id) {
					warning(_("The record you want to edit does not exist."));
					$this->redirect_to_list();
				}
			}
?>
<h2><?php 
echo $this->msg_strtr($this->msg_edit_record, $this->object);
?>
</h2>
<?
			$form_action = URI::append(['id'=>$this->object->id]);
		} else {
			// add new record
			if (!$this->object) {
				$this->object = new $this->classname;
			}
?>
<h2><?php 
echo $this->msg_add_record;
?>
</h2>
<?
			$form_action = "";
		}

		$this->display_edit_form_top($form_action);

?>
<fieldset>
<?

		$this->display_edit_content();

		if (method_exists($this, "after_edit_content")) {
			$this->after_edit_content();
		}

?>
<div class="buttons th"><span class="cancel"><a href="<?php 
echo URI::strip(['id']);
?>
"><?php 
echo _("cancel");
?>
</a></span><span class="input"><input type="submit" value="<?php 
echo _("save");
?>
"></span></div>
</fieldset>
<input type="hidden" name="action" value="editsubmit">
<?
		form_end();

	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:64,代码来源:DbTableAdmin.php

示例6: display

	/**
	 * display pager
	 *
	 * @param integer $pagelinksdist (optional)
	 */
	public function display($pagelinksdist=3) {

?>
<div class="pager">
<?

		$showpagebegin = max(1, $this->page - $pagelinksdist);
		$showpageend = min($this->pagescount, $this->page + $pagelinksdist);

		$linkpart = URI::linkpart(URI::strip(['page', 'itemsperpage']));

		if ( $this->linescount > 10 ) { // display the items-per-page switch only if it would change anything
?>
<div class="itemsperpage"><?php 
echo $this->msg_itemsperpage;
?>
: &nbsp;&nbsp;
<?
			foreach ( array(10, 20, 50, 100) as $i ) {
				?><a href="<?php 
echo $linkpart;
?>
itemsperpage=<?php 
echo $i;
?>
"<?
				if ( $this->itemsperpage == $i ) { ?> class="active"<? }
				?>><?php 
echo $i;
?>
</a>
<?
			}
			?></div>
<?
		}

		$linkpart2 = $linkpart."itemsperpage=".$this->itemsperpage."&amp;";

		if ( $this->pagescount > 1 ) { // display the page only if there is more than 1 page
?>
<div class="pages"><?php 
echo _("Pages");
?>
: &nbsp;&nbsp;
<?
			if ( $this->page > $pagelinksdist + 1) {
				?><a href="<?php 
echo $linkpart2;
?>
page=1">1</a><?
				echo $this->separator;
				if ( $this->page > $pagelinksdist + 2 ) echo $this->ellipsis.$this->separator;
			}
			for ($i=$showpagebegin;$i<=$showpageend;$i++) {
				?><a href="<?php 
echo $linkpart2;
?>
page=<?php 
echo $i;
?>
"<?
				if ( $this->page==$i ) { ?> class="active"<? }
				?>><?php 
echo $i;
?>
</a><?
				if ( $i < $showpageend ) echo $this->separator;
			}
			if ( $this->page < $this->pagescount - $pagelinksdist ) {
				if ( $this->page < $this->pagescount - ($pagelinksdist+1) ) echo $this->separator.$this->ellipsis;
				echo $this->separator;
				?><a href="<?php 
echo $linkpart2;
?>
page=<?php 
echo $this->pagescount;
?>
"><?php 
echo $this->pagescount;
?>
</a><?
			}
			?></div>
<?
		}

?>
<div class="clearfix"></div>
</div>
<?

	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:98,代码来源:Pager.php


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