Ejemplo n.º 1
0
    function SitepollCommentEditForm()
    {
        parent::MailForm();
        $this->parseSettings('inc/app/sitepoll/forms/comment/edit/settings.php');
        page_title(intl_get('Editing Comment'));
        loader_import('sitepoll.Comment');
        $c = new SitepollComment();
        global $cgi;
        $comment = $c->get($cgi->id);
        $this->widgets['subject']->setValue($comment->subject);
        $this->widgets['user_id']->setValue($comment->user_id);
        $this->widgets['body']->setValue($comment->body);
        $this->widgets['poll']->setValue($comment->poll);
        page_add_script('
			function sitepoll_cancel (f) {
				window.location.href = "' . site_prefix() . '/index/sitepoll-results-action/poll.' . $cgi->poll . '";
				return false;
			}
		');
        $this->widgets['submit_button']->buttons[1]->extra = 'onclick="return sitepoll_cancel (this.form)"';
    }
Ejemplo n.º 2
0
<?php

if (!session_admin() || !isset($parameters['id'])) {
    header('Location: ' . site_prefix() . '/index/sitepoll-app');
    exit;
}
loader_import('sitepoll.Comment');
$c = new SitepollComment();
$comment = $c->get($parameters['id']);
if (!$comment) {
    header('Location: ' . site_prefix() . '/index/sitepoll-app');
    exit;
}
$c->remove($parameters['id']);
page_title(intl_get('Comment Deleted'));
echo template_simple('comment_deleted.spt', $comment);