added comment editor!

This commit is contained in:
real_nowhereman 2009-02-27 10:37:40 +00:00
parent b9fedf7841
commit 184168d7a2
7 changed files with 41 additions and 8 deletions

View File

@ -111,7 +111,7 @@
function exec() {
foreach($this->args as $mandatory_argument) {
if (!isset($_GET[$mandatory_argument])) {
if (!isset($_REQUEST[$mandatory_argument])) {
return PANEL_REDIRECT_DEFAULT;
}
}
@ -159,7 +159,7 @@
*
*/
function onsubmit() {
function onsubmit($data = null) {
$returnvalue = 1;
$valid_evts = array_intersect(array_keys($_POST), $this->events);
@ -167,7 +167,7 @@
if ($the_event=array_pop($valid_evts)) {
$event = "on{$the_event}";
if (method_exists($this, $event))
$returnvalue = call_user_func(array(&$this, $event));
$returnvalue = call_user_func(array(&$this, $event), $data);
}
return $returnvalue;
@ -213,6 +213,7 @@
$dummyarr = array();
$errors = array();
$content = array();
$lang_loaded = false;
$l = null;
@ -256,13 +257,15 @@
$errors[$field] = $l['error'][$field];
if ($halt)
break;
} else {
$content[$field] = $string;
}
}
if(!$errors) {
$result = parent::onsubmit();
$result = parent::onsubmit($content);
} else {
$this->smarty->assign('error', $errors);
$result = $this->onerror();

View File

@ -102,7 +102,7 @@
if ($retval == PANEL_REDIRECT_CURRENT) {
foreach ($fp_admin_action->args as $mandatory_argument) {
$with_arguments .= '&' . $mandatory_argument .
'=' . $_GET[$mandatory_argument];
'=' . $_REQUEST[$mandatory_argument];
}
}

View File

@ -40,10 +40,16 @@ function admin_entry_comment_delete() { return confirm({/literal}'{$plang.act_de
<td>{if $url}<a href="{$url}">{$name}</a>{else}{$name}{/if}</td>
<td><a href="mailto:{$email}">{$email}</a></td>
<td>{$ip_address}</td>
<td><a class="link-delete" onclick="return admin_entry_comment_delete();"
<td>
<a class="link-general"
href="{"`$panel_url`&entry=`$entryid`"|action_link:commedit|cmd_link:comment:$id}">
{$plang.act_edit}
</a>
<a class="link-delete" onclick="return admin_entry_comment_delete();"
href="{"`$action_url`&entry=`$entryid`"|cmd_link:delete:$id}">
{$plang.act_del}
</a></td>
</a>
</td>
</tr>
{/comment}
</tbody></table>

View File

@ -21,6 +21,7 @@
'list' => true,
'write' => true,
'commentlist' => false,
'commedit' => false,
'delete' => false,
'cats' => true,
'stats' => false

View File

@ -108,7 +108,8 @@
$comment_dir = bdb_idtofile($id,BDB_COMMENT);
$comment['DATE'] = date_time();
if (!isset($comment['DATE']))
$comment['DATE'] = date_time();
$id = bdb_idfromtime(BDB_COMMENT, $comment['DATE']);
$f = $comment_dir . $id . EXT;
$str = utils_kimplode($comment);

View File

@ -94,6 +94,7 @@
'email' => 'Email',
'ip' => 'IP',
'actions' => 'Actions',
'act_edit' => 'Edit',
'act_del' => 'Delete',
'act_del_confirm' => 'Do you really want to delete this comment?',
'nocomments' => 'This entry have not been commented, yet.',
@ -108,6 +109,26 @@
the comment',
);
$lang['admin']['entry']['commedit'] =
array(
'head' => "Edit comment for entry",
'content' => 'Content',
'date' => 'Date',
'author' => 'Author',
'www' => 'Web Site',
'email' => 'Email',
'ip' => 'IP',
'submit' => 'Save'
);
$lang['admin']['entry']['commedit']['msgs'] =
array(
1 => 'Comment has been edited',
-1 => 'An error occurred while trying to edit the comment',
);
/* delete action */

View File

@ -237,6 +237,7 @@ input.maxsize, select.maxsize { width: 100% }
}
.admin-entry-commentlist td ,
.admin-widgets-blockparser td ,
.admin-plugin-default td {
padding: 1em .6em;