本文整理汇总了PHP中Period::ngroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Period::ngroup方法的具体用法?PHP Period::ngroup怎么用?PHP Period::ngroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Period
的用法示例。
在下文中一共展示了Period::ngroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _
"><label for="name"><?php
echo _("Name or location of the ballot");
?>
</label><span class="input"><input type="text" name="name" id="name" value="<?php
echo h($ballot->name);
?>
"></span></div>
<div class="input <?php
echo stripes();
?>
"><label for="ngroup"><?php
echo _("Group of location");
?>
</label><span class="input">
<?
input_select("ngroup", Ngroup::options($period->ngroup()->parent), $ballot->ngroup, 'id="ngroup"');
?>
</span></div>
<div class="input <?php
echo stripes();
?>
"><label for="opening_hour"><?php
echo _("Opening hours");
?>
</label><span class="input">
<select name="opening_hour" id="opening_hour">
<?
if ($ballot->opening) {
list($hour, $minute, $second) = explode(":", $ballot->opening);
} else {
$hour = 0;
示例2: 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";
//.........这里部分代码省略.........