本文整理汇总了PHP中qa_html_theme_base::q_view_clear方法的典型用法代码示例。如果您正苦于以下问题:PHP qa_html_theme_base::q_view_clear方法的具体用法?PHP qa_html_theme_base::q_view_clear怎么用?PHP qa_html_theme_base::q_view_clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qa_html_theme_base
的用法示例。
在下文中一共展示了qa_html_theme_base::q_view_clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: q_view_clear
function q_view_clear()
{
// call default method output
qa_html_theme_base::q_view_clear();
// return if not admin!
if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
return;
}
// check if question is duplicate
$closed = @$this->content['q_view']['raw']['closedbyid'] !== null;
if ($closed) {
// check if duplicate
$duplicate = qa_db_read_one_value(qa_db_query_sub('SELECT postid FROM `^posts`
WHERE `postid` = #
AND `type` = "Q"
;', $this->content['q_view']['raw']['closedbyid']), true);
if ($duplicate) {
$this->output('<div id="mergeDup" style="margin:10px 0 0 120px;padding:5px 10px;background:#FCC;border:1px solid #AAA;"><h3>Merge Duplicate:</h3>');
// form output
$this->output('
<FORM METHOD="POST">
<TABLE>
<TR>
<TD CLASS="qa-form-tall-label">
From:
<INPUT NAME="merge_from" id="merge_from" TYPE="text" VALUE="' . $this->content['q_view']['raw']['postid'] . '" CLASS="qa-form-tall-number">
To:
<INPUT NAME="merge_to" id="merge_to" TYPE="text" VALUE="' . $this->content['q_view']['raw']['closedbyid'] . '" CLASS="qa-form-tall-number">
</TD>
</TR>
<TR>
<TD CLASS="qa-form-tall-label">
Text to show when redirecting from merged question:
</TD>
</TR>
<TR>
<TD CLASS="qa-form-tall-label">
<INPUT NAME="merge_question_merged" id="merge_question_merged" TYPE="text" VALUE="' . qa_opt('merge_question_merged') . '" CLASS="qa-form-tall-text">
</TD>
</TR>
<TR>
<TD style="text-align:right;">
<INPUT NAME="merge_question_process" VALUE="Merge" TITLE="" TYPE="submit" CLASS="qa-form-tall-button qa-form-tall-button-0">
</TD>
</TR>
</TABLE>
</FORM> ');
$this->output('</div>');
}
}
}
示例2: page_title_error
function page_title_error()
{
if ($this->template == 'question' or $this->template == 'ask') {
$this->output('<h1>');
$this->title();
$this->output('</h1>');
if (isset($this->content['error'])) {
$this->error(@$this->content['error']);
}
} elseif ($this->template == 'tag' or $this->template == 'questions') {
// fill array with breadcrumb fields and show them
$bc = array();
// breadcrumb
$bc[0]['title'] = qa_opt('site_title');
$bc[0]['content'] = '<i class="fa fa-home"></i>';
$bc[0]['url'] = qa_opt('site_url');
if ($this->template == 'tag') {
$bc[1]['title'] = 'Tags';
$bc[1]['content'] = 'Tags';
$bc[1]['url'] = qa_path_html('tags');
$req = explode('/', $this->request);
$tag = $req[count($req) - 1];
$bc[2]['title'] = $tag;
$bc[2]['content'] = 'Tag "' . $tag . '"';
$bc[2]['url'] = qa_path_html($this->request, null, null, null, null);
} elseif ($this->template == 'questions') {
$req = explode('/', $this->request);
$cat = $req[count($req) - 1];
if (count($req) > 1) {
$category_name = $this->content["q_list"]["qs"][0]["raw"]["categoryname"];
$bc[1]['title'] = 'Categories';
$bc[1]['content'] = 'Categories';
$bc[1]['url'] = qa_path_html('categories');
$bc[2]['title'] = $category_name;
$bc[2]['content'] = $category_name;
$bc[2]['url'] = qa_path_html($this->request, null, null, null, null);
} else {
unset($bc);
}
}
if (isset($bc)) {
$this->output('<div class="header-buttons btn-group btn-breadcrumb pull-left">');
foreach ($bc as $item) {
$this->output(' <a href="' . $item['url'] . '" title="' . $item['title'] . '" class="btn btn-default">' . $item['content'] . '</a>');
}
$this->output('</div>');
}
} else {
qa_html_theme_base::page_title_error();
}
if ($this->template == 'admin' or $this->template == 'users' or $this->template == 'user' or qa_opt('it_nav_type') == 'standard') {
$this->show_nav('sub', 'nav navbar-nav sub-navbar pull-right');
}
qa_html_theme_base::q_view_clear();
}