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


PHP Issue::area方法代码示例

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


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

示例1: display_proposal_info

	/**
	 * display the right column with area and proponents
	 *
	 * @param Issue   $issue
	 * @param array   $proponents
	 * @param boolean $is_proponent
	 */
	public function display_proposal_info(Issue $issue, array $proponents, $is_proponent) {
?>
<h2><?php 
echo _("Area");
?>
</h2>
<p class="proposal"><?php 
echo h($issue->area()->name);
?>
</p>
<h2><?php 
echo _("Proponents");
?>
</h2>
<ul>
<?
		foreach ( $proponents as $proponent ) {
?>
	<li><?
			if ($proponent->proponent_confirmed) {
				echo content2html($proponent->proponent_name);
			} else {
				?><span class="unconfirmed"><?php 
echo content2html($proponent->proponent_name);
?>
</span><?
			}
			?></li>
<?
		}
?>
</ul>
<?

		// show drafts only to the proponents
		if (!$is_proponent) return;

		$this->display_drafts($proponents);

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

示例2: display_proposal_info

/**
 * display the right column with area and proponents
 *
 * @param Proposal $proposal
 * @param Issue   $issue
 * @param array   $proponents
 * @param boolean $is_proponent
 */
function display_proposal_info(Proposal $proposal, Issue $issue, array $proponents, $is_proponent) {
?>
<h2><?=_("Area")?></h2>
<p class="proposal"><?=h($issue->area()->name)?></p>
<?

	$is_any_proponent = false;
	if (Login::$member) {
		foreach ( $proponents as $proponent ) {
			if ($proponent->id==Login::$member->id) {
				$is_any_proponent = true;
				break;
			}
		}
	}

	$allowed_edit_proponent = false;
	if ($proposal->allowed_change_proponents()) {
		if (Login::$member and Login::$member->entitled($_SESSION['ngroup'])) {
			$allowed_edit_proponent = true;
			if (!$is_any_proponent) {
?>
<div class="add"><a href="<?=URI::append(['become_proponent'=>1])?>" class="icontextlink"><img src="img/plus.png" width="16" height="16" alt="<?=_("plus")?>"><?=_("become proponent")?></a></div>
<?
			}
		} else {
?>
<div class="add icontextlink disabled" title="<?=_("You are not logged in, not in this group, not eligible or not verified.")?>"><img src="img/plus.png" width="16" height="16" alt="<?=_("plus")?>"><?=_("become proponent")?></div>
<?
		}
	}

?>
<h2><?=_("Proponents")?></h2>
<div class="proponents">
<ul>
<?
	$confirmed_proponents = 0;
	foreach ( $proponents as $proponent ) {
		/** @var Member $proponent */
		if ($proponent->proponent_confirmed) $confirmed_proponents++;
		// show unconfirmed proponents only to confirmed proponents and himself
		if (!$is_proponent and !$proponent->proponent_confirmed and (!Login::$member or $proponent->id!=Login::$member->id)) continue;
?>
	<li><?
		if (Login::$member and $proponent->id==Login::$member->id and $allowed_edit_proponent) {
			if (isset($_GET['edit_proponent'])) {
				form(URI::same(), "", "", "proponent", true);
?>
<input type="text" name="proponent" value="<?=h($proponent->proponent_name)?>" maxlength="<?=Proposal::proponent_length?>" required><br>
<input type="hidden" name="action" value="apply_proponent">
<input type="submit" value="<?=_("apply changes")?>">
<?
				form_end();
			} else {
				if ($proponent->proponent_confirmed) {
					echo content2html($proponent->proponent_name);
				} else {
?>
<span class="unconfirmed"><?=content2html($proponent->proponent_name)?></span>
(<?=$proponent->identity()?>)
<?
				}
				?> <a href="<?=URI::append(['edit_proponent'=>1])?>" class="iconlink"><img src="img/edit.png" width="16" height="16" alt="<?=_("edit")?>" title="<?=_("edit your proponent name and contact details")?>"></a><a href="<?=URI::append(['remove_proponent'=>1])?>" class="iconlink"><img src="img/delete.png" width="21" height="16" alt="<?=_("delete")?>" title="<?=_("remove yourself from the list of proponents")?>"></a><?
			}
		} elseif ($proponent->proponent_confirmed) {
			echo content2html($proponent->proponent_name);
		} elseif ($is_proponent and $allowed_edit_proponent) {
			form(URI::same());
?>
<span class="unconfirmed"><?=content2html($proponent->proponent_name)?></span>
(<?=$proponent->identity()?>)
<input type="hidden" name="member" value="<?=$proponent->id?>">
<input type="hidden" name="action" value="confirm_proponent">
<input type="submit" value="<?=_("confirm")?>">
<?
			form_end();
		} else {
			?><span class="unconfirmed"><?=content2html($proponent->proponent_name)?></span><?
		}
		?></li>
<?
	}
	if (Login::$member and $allowed_edit_proponent and isset($_GET['become_proponent']) and !$is_any_proponent) {
?>
	<li><?
		form(URI::same(), "", "", "proponent", true);
?>
<input type="text" name="proponent" value="<?=h(Login::$member->username())?>" maxlength="<?=Proposal::proponent_length?>" required><br>
<div class="explain"><?=_("Enter your name and contact details as you would like to see them in the proposal. To prevent fraud, also your username will be shown to the other proponents.")?></div>
<input type="hidden" name="action" value="become_proponent">
<input type="submit" value="<?=_("apply to become proponent")?>">
//.........这里部分代码省略.........
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:101,代码来源:proposal.php

示例3: Issue

/**
 * vote result
 *
 * @author Magnus Rosenbaum <dev@cmr.cx>
 * @package Basisentscheid
 */


require "inc/common_http.php";

$issue = new Issue(@$_GET['issue']);
if (!$issue->id) {
	error(_("The requested issue does not exist."));
}

$_SESSION['ngroup'] = $issue->area()->ngroup;

if ($issue->state != 'finished') {
	error(_("This issue is not finished."));
}

html_head(_("Vote result"), true);

?>
<table class="proposals">
<?
Issue::display_proposals_th(true);
list($proposals, $submitted) = $issue->proposals_list(true);
$issue->display_proposals($proposals, $submitted, count($proposals), true);
?>
</table>
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:31,代码来源:vote_result.php

示例4: content

	/**
	 * compose subject and body
	 *
	 * @return array
	 */
	private function content() {

		// ngroup
		if ($this->period) {
			$ngroup = $this->period->ngroup();
		} elseif ($this->issue) {
			$ngroup = $this->issue->area()->ngroup();
		} elseif ($this->proposal) {
			$ngroup = $this->proposal->issue()->area()->ngroup();
		} else {
			trigger_error("ngroup could not be determined", E_USER_WARNING);
			$ngroup = null;
		}
		$body = _("Group").": ".$ngroup->name."\n\n";

		$separator = "-----8<--------------------------------------------------------------------\n"; // 75 characters

		switch ($this->type) {
		case "comment":

			$subject = sprintf(_("New comment in proposal %d - %s"), $this->proposal->id, $this->comment->title);

			$uri = BASE_URL."proposal.php?id=".$this->proposal->id;
			if ($this->comment->rubric == "discussion") $uri .= "&discussion=1";

			$body .= _("Proposal")." ".$this->proposal->id.": ".$this->proposal->title."\n\n";
			if (Login::$member) {
				$body .= sprintf(_("Member '%s' posted this comment:"), Login::$member->username());
			} else {
				$body .= _("Someone not logged in posted this comment:");
			}
			$body .= "\n"
				.$uri."&comment=".$this->comment->id."\n"
				.$separator
				.$this->comment->title."\n\n"
				.$this->comment->content."\n"
				.$separator
				._("Reply:")."\n"
				.$uri."&reply=".$this->comment->id;

			break;
		case "reply":

			$subject = sprintf(_("New reply to your comment in proposal %d - %s"), $this->proposal->id, $this->comment->title);

			$uri = BASE_URL."proposal.php?id=".$this->proposal->id;
			if ($this->comment->rubric == "discussion") $uri .= "&discussion=1";

			$body .= _("Proposal")." ".$this->proposal->id.": ".$this->proposal->title."\n\n";
			if (Login::$member) {
				$body .= sprintf(_("Member '%s' replied to your comment:"), Login::$member->username());
			} else {
				$body .= _("Someone not logged in replied to your comment:");
			}
			$body .= "\n"
				.$uri."&comment=".$this->comment->id."\n"
				.$separator
				.$this->comment->title."\n\n"
				.$this->comment->content."\n"
				.$separator
				._("Reply:")."\n"
				.$uri."&reply=".$this->comment->id;

			break;
		case "new_proposal":

			$subject = sprintf(_("New proposal %d in area %s - %s"), $this->proposal->id, $this->proposal->issue()->area()->name, $this->proposal->title);

			$body .= sprintf(_("Proponent '%s' added a new proposal:"), $this->proponent)."\n"
				.BASE_URL."proposal.php?id=".$this->proposal->id."\n\n"
				."===== "._("Title")." =====\n"
				.$this->proposal->title."\n\n"
				."===== "._("Content")." =====\n"
				.$this->proposal->content."\n\n"
				."===== "._("Reason")." =====\n"
				.$this->proposal->reason."\n";

			break;
		case "new_draft":

			$subject = sprintf(_("New draft for proposal %d - %s"), $this->proposal->id, $this->proposal->title);

			if ($this->proponent !== false) {
				$body .= sprintf(_("Proponent '%s' added a new draft:"), $this->proponent);
			} else {
				$body .= _("An admin added a new draft:");
			}
			$body .= "\n"
				.BASE_URL."proposal.php?id=".$this->proposal->id."\n\n"
				."===== "._("Title")." =====\n"
				.$this->proposal->title."\n\n"
				."===== "._("Content")." =====\n"
				.$this->proposal->content."\n\n"
				."===== "._("Reason")." =====\n"
				.$this->proposal->reason."\n";
//.........这里部分代码省略.........
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:101,代码来源:Notification.php


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