By 老猫 | 4月 20, 2012 - 5:30 下午 - Posted in 网站建设
public function PostController_Render_Before($Sender, $Args) {
$Form = $Sender->Form; //new Gdn_Form();
$QuestionButton = !C('Plugins.QnA.UseBigButtons') || GetValue('Type', $_GET) == 'Question';
if (!$Form->IsPostBack()) {
//if (!property_exists($Sender, 'Discussion')) {
if (!property_exists($Sender, 'Question')) {
//$Form->SetValue('Type', 'Question');
$Form->SetValue('Type', 'Discussion');
} elseif (!$Form->GetValue('Type')) {
$Form->SetValue('Type', 'Question');
//$Form->SetValue('Type', 'Discussion');
}
}
if ($Form->GetValue('Type') == 'Question' && $QuestionButton) {
$Sender->SetData('Title', T('Ask a Question'));
}
}

This entry was posted on 星期五, 4月 20th, 2012 at 5:30 下午 and is filed under 网站建设. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.