Ejemplo n.º 1
0
</div>
<h2><?php 
echo _("Proponents");
?>
</h2>
<ul>
<?
	if ($proposal->id) {
		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>
<?
		}
	} else {
?>
	<li>
		<div class="form">
			<input type="text" name="proponent" value="<?
		if (!empty($_POST['proponent'])) echo h($_POST['proponent']); else echo h(Login::$member->username());
		?>" maxlength="<?php 
echo Proposal::proponent_length;
?>
Ejemplo n.º 2
0
<?
/**
 * member.php
 *
 * @author Magnus Rosenbaum <*****@*****.**>
 * @package Basisentscheid
 */


require "inc/common_http.php";

Login::access("member");

if (empty($_GET['id'])) error(_("Missing parameter"));

$member = new Member(intval($_GET['id']));

if (!$member) error(_("The requested member does not exist."));


html_head(sprintf(_("Member %s"), $member->username()));

?>
<p><?php 
echo content2html($member->profile);
?>
</p>
<?

html_foot();
Ejemplo n.º 3
0
/**
 * a fatal user error
 *
 * @param string  $text
 * @param boolean $content2html (optional) format content
 */
function error($text, $content2html=false) {
	if (PHP_SAPI=="cli") {
		// for tests
		echo "Error: ".$text."\n";
	} else {
		if (empty($GLOBALS['html_head_issued'])) {
			html_head(_("Error"));
		}
?>
<p class="error">&#9747; <?php 
echo $content2html ? content2html($text) : h($text);
?>
</p>
<?
		html_foot();
	}
	exit;
}
Ejemplo n.º 4
0
	/**
	 * 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);

	}
Ejemplo n.º 5
0
/**
 * display annotation by admins
 *
 * @param Proposal $proposal
 */
function display_annotation(Proposal $proposal) {
	if (Login::$admin) {
?>
<section id="annotation">
<?
		if (!empty($_GET['edit_annotation'])) {
?>
<h2><?=_("Annotation by admins")?></h2>
<?
			form(URI::same()."#annotation", "", "annotation", "annotation", true);
?>
<textarea name="annotation" cols="100" rows="3"><?=h($proposal->annotation)?></textarea>
<input type="hidden" name="action" value="save_annotation">
<input type="submit" value="<?=_("save")?>">
<?
			form_end();
		} else {
?>
<div class="add"><a href="<?=URI::append(['edit_annotation'=>1])?>#annotation" class="iconlink"><img src="img/edit.png" width="16" height="16" <?alt(_("edit"))?>></a></div>
<h2><?=_("Annotation by admins")?></h2>
<?=content2html($proposal->annotation)?>
<?
		}
?>
</section>
<?
	} elseif ($proposal->annotation) {
?>
<section id="annotation">
<h2><?=_("Annotation by admins")?></h2>
<?=content2html($proposal->annotation)?>
</section>
<?
	}
}
Ejemplo n.º 6
0
	/**
	 * content area of one comment
	 *
	 * @param Comment $comment
	 */
	private function display_comment_content(Comment $comment) {
?>
		<p><?php 
echo content2html($comment->content);
?>
</p>
<?

		// reply
		if (
			self::$proposal->allowed_add_comments($this->rubric) and
			self::$parent!=$comment->id and
			!$comment->removed
		) {
			if (Login::access_allowed("comment")) {
				$open = self::$open;
				$open[] = $comment->id;
				$open = array_unique($open);
?>
		<div class="reply"><a href="<?php 
echo URI::append(['open' => $open, 'parent' => $comment->id]);
?>
#form" class="iconlink"><img src="img/reply.png" width="16" height="16" <?alt(_("reply"))?>></a></div>
<?
			} else {
?>
		<div class="reply iconlink disabled"><img src="img/reply.png" width="16" height="16" <?alt(_("reply"))?>></div>
<?
			}
		}

		// rating and remove/restore
		if ($comment->rating) {
			?><span class="rating" title="<?php 
echo _("sum of ratings");
?>
">+<?php 
echo $comment->rating;
?>
</span> <?
		}
		if (Login::$admin) {
			form(URI::same(), 'class="button"');
?>
<input type="hidden" name="id" value="<?php 
echo $comment->id;
?>
">
<?
			if ($comment->removed) {
?>
<input type="hidden" name="action" value="restore_comment">
<input type="submit" value="<?php 
echo _("restore");
?>
">
<?
			} else {
?>
<input type="hidden" name="action" value="remove_comment">
<input type="submit" value="<?php 
echo _("remove");
?>
">
<?
			}
			form_end();
		} elseif (
			self::$proposal->allowed_add_comments($this->rubric) and
			// don't allow to rate ones own comments
			!$comment->is_author() and
			// don't allow to rate removed comments
			!$comment->removed
		) {
			if (Login::access_allowed("rate")) {
				$disabled = "";
				$uri = URI::same()."#comment".$comment->id;
			} else {
				$disabled = " disabled";
				$uri = "";
			}
			if ($comment->score) {
				form($uri, 'class="button rating reset"');
?>
<input type="hidden" name="comment" value="<?php 
echo $comment->id;
?>
">
<input type="hidden" name="action" value="reset_rating">
<input type="submit" value="0"<?php 
echo $disabled;
?>
>
<?
				form_end();
			}
			for ($score=1; $score <= Comment::rating_score_max; $score++) {
				form($uri, 'class="button rating'.($score <= $comment->score?' selected':'').'"');
?>
<input type="hidden" name="comment" value="<?php 
echo $comment->id;
?>
">
<input type="hidden" name="action" value="set_rating">
<input type="hidden" name="rating" value="<?php 
echo $score;
?>
">
<input type="submit" value="+<?php 
echo $score;
?>
"<?php 
echo $disabled;
?>
>
<?
				form_end();
			}
		}

	}
Ejemplo n.º 7
0
echo _("Title");
?>
</h2>
<p class="proposal proposal_title"><?php 
echo h($draft->title);
?>
</p>
<h2><?php 
echo _("Content");
?>
</h2>
<p class="proposal"><?php 
echo content2html($draft->content);
?>
</p>
<h2><?php 
echo _("Reason");
?>
</h2>
<p class="proposal"><?php 
echo content2html($draft->reason);
?>
</p>
</section>

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

<?

html_foot();