Now all modules are in core modules folder
This commit is contained in:
parent
5ba1cdfa0b
commit
05b6a91b0c
1907 changed files with 0 additions and 0 deletions
136
modules/faq/includes/faq-category-hide-answer.tpl.php
Normal file
136
modules/faq/includes/faq-category-hide-answer.tpl.php
Normal file
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show/hide categorized answers when
|
||||
* the question is clicked.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $display_header
|
||||
* Boolean value controlling whether a header should be displayed.
|
||||
* $header_title
|
||||
* The category title.
|
||||
* $category_depth
|
||||
* The term or category depth.
|
||||
* $description
|
||||
* The current page's description.
|
||||
* $term_image
|
||||
* The HTML for the category image. This is empty if the taxonomy image module
|
||||
* is not enabled or there is no image associated with the term.
|
||||
* $display_faq_count
|
||||
* Boolean value controlling whether or not the number of faqs in a category
|
||||
* should be displayed.
|
||||
* $question_count
|
||||
* The number of questions in category.
|
||||
* $nodes
|
||||
* An array of nodes to be displayed.
|
||||
* Each node stored in the $nodes array has the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Whether $node['body'] contains the full body or just the teaser text.
|
||||
* $container_class
|
||||
* The class attribute of the element containing the sub-categories, either
|
||||
* 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
|
||||
* a category's faqs.
|
||||
* $subcat_list
|
||||
* An array of sub-categories. Each sub-category stored in the $subcat_list
|
||||
* array has the following information:
|
||||
* $subcat['link'] is the link to the sub-category.
|
||||
* $subcat['description'] is the sub-category description.
|
||||
* $subcat['count'] is the number of questions in the sub-category.
|
||||
* $subcat['term_image'] is the sub-category (taxonomy) image.
|
||||
* $subcat_list_style
|
||||
* The style of the sub-category list, either ol or ul (ordered or unordered).
|
||||
* $subcat_body_list
|
||||
* The sub-categories faqs, recursively themed (by this template).
|
||||
*/
|
||||
|
||||
if ($category_depth > 0) {
|
||||
$hdr = 'h6';
|
||||
}
|
||||
else {
|
||||
$hdr = 'h5';
|
||||
}
|
||||
|
||||
?><div class="faq-category-group">
|
||||
<!-- category header with title, link, image, description, and count of
|
||||
questions inside -->
|
||||
<div class="faq-qa-header">
|
||||
<?php if ($display_header): ?>
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $header_title; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $question_count; ?>)
|
||||
<?php endif; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
|
||||
<?php else: ?>
|
||||
<?php print $term_image; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($description)): ?>
|
||||
<div class="faq-qa-description"><?php print $description ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($term_image)): ?>
|
||||
<div class="clear-block"></div>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-qa-header -->
|
||||
|
||||
<?php if (!empty($subcat_list)): ?>
|
||||
<!-- list subcategories, with title, link, description, count -->
|
||||
<div class="item-list">
|
||||
<<?php print $subcat_list_style; ?> class="faq-category-list">
|
||||
<?php foreach ($subcat_list as $i => $subcat): ?>
|
||||
<li>
|
||||
<?php print $subcat['link']; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $subcat['count']; ?>)
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($subcat['description'])): ?>
|
||||
<div class="faq-qa-description"><?php print $subcat['description']; ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="clear-block"></div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $subcat_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php print $container_class; ?>">
|
||||
|
||||
<!-- include subcategories -->
|
||||
<?php if (count($subcat_body_list)): ?>
|
||||
<?php foreach ($subcat_body_list as $i => $subcat_html): ?>
|
||||
<div class="faq-category-indent"><?php print $subcat_html; ?></div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- list questions (in title link) and answers (in body) -->
|
||||
<div class="faq-dl-hide-answer">
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $i => $node): ?>
|
||||
<div class="faq-question-answer">
|
||||
<div class="faq-question faq-dt-hide-answer">
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question faq-dt-hide-answer -->
|
||||
|
||||
<div class="faq-answer faq-dd-hide-answer">
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer faq-dd-hide-answer -->
|
||||
</div> <!-- Close div: faq-question-answer -->
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-dl-hide-answer -->
|
||||
|
||||
</div> <!-- Close div: faq-qa / faq-qa-hide -->
|
||||
|
||||
</div> <!-- Close div: faq-category-group -->
|
126
modules/faq/includes/faq-category-new-page.tpl.php
Normal file
126
modules/faq/includes/faq-category-new-page.tpl.php
Normal file
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show the categorized answer in a
|
||||
* new page.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $display_header
|
||||
* Boolean value controlling whether a header should be displayed.
|
||||
* $header_title
|
||||
* The category title.
|
||||
* $category_depth
|
||||
* The term or category depth.
|
||||
* $description
|
||||
* The current page's description.
|
||||
* $term_image
|
||||
* The HTML for the category image. This is empty if the taxonomy image module
|
||||
* is not enabled or there is no image associated with the term.
|
||||
* $display_faq_count
|
||||
* Boolean value controlling whether or not the number of faqs in a category
|
||||
* should be displayed.
|
||||
* $question_count
|
||||
* The number of questions in category.
|
||||
* $question_list
|
||||
* An array of questions.
|
||||
* $question_list_style, either ol or ul
|
||||
* The style of the question list, either ol or ul (ordered or unordered).
|
||||
* $container_class
|
||||
* The class attribute of the element containing the sub-categories, either
|
||||
* 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
|
||||
* a category's faqs.
|
||||
* $subcat_list
|
||||
* An array of sub-categories. Each sub-category stored in the $subcat_list
|
||||
* array has the following information:
|
||||
* $subcat['link'] is the link to the sub-category.
|
||||
* $subcat['description'] is the sub-category description.
|
||||
* $subcat['count'] is the number of questions in the sub-category.
|
||||
* $subcat['term_image'] is the sub-category (taxonomy) image.
|
||||
* $subcat_list_style
|
||||
* The style of the sub-category list, either ol or ul (ordered or unordered).
|
||||
* $subcat_body_list
|
||||
* The sub-categories faqs, recursively themed (by this template).
|
||||
*/
|
||||
|
||||
if ($category_depth > 0) {
|
||||
$hdr = 'h6';
|
||||
}
|
||||
else {
|
||||
$hdr = 'h5';
|
||||
}
|
||||
|
||||
?><div class="faq-category-group">
|
||||
<!-- category header with title, link, image, description, and count of
|
||||
questions inside -->
|
||||
<div class="faq-qa-header">
|
||||
<?php if ($display_header): ?>
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $header_title; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $question_count; ?>)
|
||||
<?php endif; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
|
||||
<?php else: ?>
|
||||
<?php print $term_image; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($description)): ?>
|
||||
<div class="faq-qa-description"><?php print $description ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($term_image)): ?>
|
||||
<div class="clear-block"></div>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-qa-header -->
|
||||
|
||||
<!-- list subcategories, with title, link, description, count -->
|
||||
<?php if (!empty($subcat_list)): ?>
|
||||
<div class="item-list">
|
||||
<<?php print $subcat_list_style; ?> class="faq-category-list">
|
||||
<?php foreach ($subcat_list as $i => $subcat): ?>
|
||||
<li>
|
||||
<?php print $subcat['link']; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $subcat['count']; ?>)
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($subcat['description'])): ?>
|
||||
<div class="faq-qa-description"><?php print $subcat['description']; ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="clear-block"></div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $subcat_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php print $container_class; ?>">
|
||||
|
||||
<!-- include subcategories -->
|
||||
<?php if (count($subcat_body_list)): ?>
|
||||
<?php foreach ($subcat_body_list as $i => $subcat_html): ?>
|
||||
<div class="faq-category-indent"><?php print $subcat_html; ?></div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- list questions (in title link) and answers (in body) -->
|
||||
<?php if (!empty($question_list)): ?>
|
||||
<div class="item-list">
|
||||
<<?php print $question_list_style; ?> class="faq-category-list">
|
||||
<?php foreach ($question_list as $i => $question_link): ?>
|
||||
<li>
|
||||
<?php print $question_link; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $question_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div> <!-- Close div: faq-qa / faq-qa-hide -->
|
||||
|
||||
</div> <!-- Close div: faq-category-group -->
|
145
modules/faq/includes/faq-category-questions-inline.tpl.php
Normal file
145
modules/faq/includes/faq-category-questions-inline.tpl.php
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show categorized questions inline.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $display_header
|
||||
* Boolean value controlling whether a header should be displayed.
|
||||
* $header_title
|
||||
* The category title.
|
||||
* $category_depth
|
||||
* The term or category depth.
|
||||
* $description
|
||||
* The current page's description.
|
||||
* $term_image
|
||||
* The HTML for the category image. This is empty if the taxonomy image module
|
||||
* is not enabled or there is no image associated with the term.
|
||||
* $display_faq_count
|
||||
* Boolean value controlling whether or not the number of faqs in a category
|
||||
* should be displayed.
|
||||
* $question_count
|
||||
* The number of questions in category.
|
||||
* $nodes
|
||||
* An array of nodes to be displayed.
|
||||
* Each node stored in the $nodes array has the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Whether $node['body'] contains the full body or just the teaser text.
|
||||
* $container_class
|
||||
* The class attribute of the element containing the sub-categories, either
|
||||
* 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
|
||||
* a category's faqs.
|
||||
* $question_label
|
||||
* The label to prepend to the question text.
|
||||
* $answer_label
|
||||
* The label to prepend to the answer text.
|
||||
* $subcat_list
|
||||
* An array of sub-categories. Each sub-category stored in the $subcat_list
|
||||
* array has the following information:
|
||||
* $subcat['link'] is the link to the sub-category.
|
||||
* $subcat['description'] is the sub-category description.
|
||||
* $subcat['count'] is the number of questions in the sub-category.
|
||||
* $subcat['term_image'] is the sub-category (taxonomy) image.
|
||||
* $subcat_list_style
|
||||
* The style of the sub-category list, either ol or ul (ordered or unordered).
|
||||
* $subcat_body_list
|
||||
* The sub-categories faqs, recursively themed (by this template).
|
||||
*/
|
||||
|
||||
if ($category_depth > 0) {
|
||||
$hdr = 'h6';
|
||||
}
|
||||
else {
|
||||
$hdr = 'h5';
|
||||
}
|
||||
|
||||
?>
|
||||
<a name="top"></a>
|
||||
<div class="faq-category-group">
|
||||
<!-- category header with title, link, image, description, and count of
|
||||
questions inside -->
|
||||
<div class="faq-qa-header">
|
||||
<?php if ($display_header): ?>
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $header_title; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $question_count; ?>)
|
||||
<?php endif; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
|
||||
<?php else: ?>
|
||||
<?php print $term_image; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($description)): ?>
|
||||
<div class="faq-qa-description"><?php print $description ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($term_image)): ?>
|
||||
<div class="clear-block"></div>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-qa-header -->
|
||||
|
||||
<!-- list subcategories, with title, link, description, count -->
|
||||
<?php if (!empty($subcat_list)): ?>
|
||||
<div class="item-list">
|
||||
<<?php print $subcat_list_style; ?> class="faq-category-list">
|
||||
<?php foreach ($subcat_list as $i => $subcat): ?>
|
||||
<li>
|
||||
<?php print $subcat['link']; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $subcat['count']; ?>)
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($subcat['description'])): ?>
|
||||
<div class="faq-qa-description"><?php print $subcat['description']; ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="clear-block"></div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $subcat_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php print $container_class; ?>">
|
||||
|
||||
<!-- include subcategories -->
|
||||
<?php if (count($subcat_body_list)): ?>
|
||||
<?php foreach ($subcat_body_list as $i => $subcat_html): ?>
|
||||
<div class="faq-category-indent"><?php print $subcat_html; ?></div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- list questions (in title link) and answers (in body) -->
|
||||
<div>
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $i => $node): ?>
|
||||
<div class="faq-question">
|
||||
<?php if (!empty($question_label)): ?>
|
||||
<strong class="faq-question-label"><?php print $question_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question -->
|
||||
|
||||
<div class="faq-answer">
|
||||
<?php if (!empty($answer_label)): ?>
|
||||
<strong class="faq-answer-label"><?php print $answer_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer -->
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div -->
|
||||
|
||||
</div> <!-- Close div: faq-qa / faq-qa-hide -->
|
||||
|
||||
</div> <!-- Close div: faq-category-group -->
|
135
modules/faq/includes/faq-category-questions-top-answers.tpl.php
Normal file
135
modules/faq/includes/faq-category-questions-top-answers.tpl.php
Normal file
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the answers section of the FAQ page if set to show
|
||||
* categorized questions at the top of the page.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $display_answers
|
||||
* Whether or not there should be any output.
|
||||
* $display_header
|
||||
* Boolean value controlling whether a header should be displayed.
|
||||
* $header_title
|
||||
* The category title.
|
||||
* $category_name
|
||||
* The name of the category.
|
||||
* $answer_category_name
|
||||
* Whether the category name should be displayed with the answers.
|
||||
* $group_questions_top
|
||||
* Whether the questions and answers should be grouped together.
|
||||
* $category_depth
|
||||
* The term or category depth.
|
||||
* $description
|
||||
* The current page's description.
|
||||
* $term_image
|
||||
* The HTML for the category image. This is empty if the taxonomy image module
|
||||
* is not enabled or there is no image associated with the term.
|
||||
* $display_faq_count
|
||||
* Boolean value controlling whether or not the number of faqs in a category
|
||||
* should be displayed.
|
||||
* $question_count
|
||||
* The number of questions in category.
|
||||
* $nodes
|
||||
* An array of nodes to be displayed.
|
||||
* Each node stored in the $nodes array has the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Whether $node['body'] contains the full body or just the teaser text.
|
||||
* $question_label
|
||||
* The question label, intended to be pre-pended to the question text.
|
||||
* $answer_label
|
||||
* The answer label, intended to be pre-pended to the answer text.
|
||||
* $container_class
|
||||
* The class attribute of the element containing the sub-categories, either
|
||||
* 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
|
||||
* a category's faqs.
|
||||
* $subcat_body_list
|
||||
* The sub-categories faqs, recursively themed (by this template).
|
||||
*/
|
||||
|
||||
|
||||
if ($category_depth > 0) {
|
||||
$hdr = 'h6';
|
||||
}
|
||||
else {
|
||||
$hdr = 'h5';
|
||||
}
|
||||
|
||||
$depth = 0;
|
||||
|
||||
?><?php if ($display_answers): ?>
|
||||
<?php if ($answer_category_name): ?>
|
||||
<?php while ($depth < $category_depth): ?>
|
||||
<div class="faq-category-indent">
|
||||
<?php $depth++; endwhile; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="faq-category-menu">
|
||||
|
||||
<?php if ($display_header): ?>
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $category_name; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
<div class="clear-block"></div>
|
||||
<div class="faq-category-group">
|
||||
<div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$answer_category_name || $display_header): ?>
|
||||
|
||||
<!-- Include subcategories. -->
|
||||
<?php if (count($subcat_body_list)): ?>
|
||||
<?php foreach ($subcat_body_list as $i => $subcat_html): ?>
|
||||
<?php print $subcat_html; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$display_header): ?>
|
||||
<div class="faq-category-group">
|
||||
<div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- List questions (in title link) and answers (in body). -->
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $i => $node): ?>
|
||||
|
||||
<div class="faq-question">
|
||||
<?php if (!empty($question_label)): ?>
|
||||
<strong class="faq-question-label"><?php print $question_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question -->
|
||||
|
||||
<div class="faq-answer">
|
||||
<?php if (!empty($answer_label)): ?>
|
||||
<strong class="faq-answer-label"><?php print $answer_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer -->
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div> <!-- Close div -->
|
||||
</div> <!-- Close div: faq-category-group -->
|
||||
</div>
|
||||
|
||||
<?php if ($answer_category_name): ?>
|
||||
<?php while ($depth > 0): ?>
|
||||
</div> <!-- Close div: faq-category-indent -->
|
||||
<?php $depth--; endwhile; ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
endif; // if display_answers
|
180
modules/faq/includes/faq-category-questions-top.tpl.php
Normal file
180
modules/faq/includes/faq-category-questions-top.tpl.php
Normal file
|
@ -0,0 +1,180 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the questions section of the FAQ page if set to show
|
||||
* categorized questions at the top of the page.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $display_header
|
||||
* Boolean value controlling whether a header should be displayed.
|
||||
* $header_title
|
||||
* The category title.
|
||||
* $category_name
|
||||
* The name of the category.
|
||||
* $answer_category_name
|
||||
* Whether the category name should be displayed with the answers.
|
||||
* $group_questions_top
|
||||
* Whether the questions and answers should be grouped together.
|
||||
* $category_depth
|
||||
* The term or category depth.
|
||||
* $description
|
||||
* The current page's description.
|
||||
* $term_image
|
||||
* The HTML for the category image. This is empty if the taxonomy image module
|
||||
* is not enabled or there is no image associated with the term.
|
||||
* $display_faq_count
|
||||
* Boolean value controlling whether or not the number of faqs in a category
|
||||
* should be displayed.
|
||||
* $question_count
|
||||
* The number of questions in category.
|
||||
* $nodes
|
||||
* An array of nodes to be displayed.
|
||||
* Each node stored in the $nodes array has the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Whether $node['body'] contains the full body or just the teaser text.
|
||||
* $container_class
|
||||
* The class attribute of the element containing the sub-categories, either
|
||||
* 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
|
||||
* a category's faqs.
|
||||
* $question_list
|
||||
* An array of question links.
|
||||
* $question_list_style
|
||||
* The style of the question list, ul for unordered, ol for ordered.
|
||||
* $subcat_list
|
||||
* An array of sub-categories. Each sub-category stored in the $subcat_list
|
||||
* array has the following information:
|
||||
* $subcat['link'] is the link to the sub-category.
|
||||
* $subcat['description'] is the sub-category description.
|
||||
* $subcat['count'] is the number of questions in the sub-category.
|
||||
* $subcat['term_image'] is the sub-category (taxonomy) image.
|
||||
* $subcat_list_style
|
||||
* The style of the sub-category list, either ol or ul (ordered or unordered).
|
||||
* $subcat_body_list
|
||||
* The sub-categories faqs, recursively themed (by this template).
|
||||
*/
|
||||
|
||||
if ($category_depth > 0) {
|
||||
$hdr = 'h6';
|
||||
}
|
||||
else {
|
||||
$hdr = 'h5';
|
||||
}
|
||||
|
||||
?>
|
||||
<a name="top"></a>
|
||||
<div class="faq-category-menu">
|
||||
|
||||
<!-- category header with title, link, image, description, and count of questions inside -->
|
||||
<div class="faq-qa-header">
|
||||
<?php if ($display_header): ?>
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $header_title; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $question_count; ?>)
|
||||
<?php endif; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
<?php else: ?>
|
||||
<?php print $term_image; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($description)): ?>
|
||||
<div class="faq-qa-description"><?php print $description ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($term_image)): ?>
|
||||
<div class="clear-block"></div>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-qa-header -->
|
||||
|
||||
|
||||
<?php if (!empty($subcat_list)): ?>
|
||||
<!-- list subcategories, with title, link, description, count -->
|
||||
<div class="item-list">
|
||||
<<?php print $subcat_list_style; ?> class="faq-category-list">
|
||||
<?php foreach ($subcat_list as $i => $subcat): ?>
|
||||
<li>
|
||||
<?php print $subcat['link']; ?>
|
||||
<?php if ($display_faq_count): ?>
|
||||
(<?php print $subcat['count']; ?>)
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($subcat['description'])): ?>
|
||||
<div class="faq-qa-description"><?php print $subcat['description']; ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="clear-block"></div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $subcat_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php print $container_class; ?>">
|
||||
|
||||
<?php // include subcategories ?>
|
||||
<?php if (count($subcat_body_list)): ?>
|
||||
<?php foreach ($subcat_body_list as $i => $subcat_html): ?>
|
||||
<div class="faq-category-indent"><?php print $subcat_html; ?></div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php // list question links ?>
|
||||
<?php if (!empty($question_list)): ?>
|
||||
<div class="item-list">
|
||||
<<?php print $question_list_style; ?> class="faq-ul-questions-top">
|
||||
<?php foreach ($question_list as $i => $question_link): ?>
|
||||
<li>
|
||||
<?php print $question_link; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</<?php print $question_list_style; ?>>
|
||||
</div> <!-- Close div: item-list -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$group_questions_top && $category_display != 'hide_qa'): ?>
|
||||
</div> <!-- Close div: faq-qa / faq-qa-hide -->
|
||||
</div> <!-- Close div: faq-category-menu -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($answer_category_name): ?>
|
||||
<!-- Display header before answers in some layouts. -->
|
||||
<<?php print $hdr; ?> class="faq-header">
|
||||
<?php print $term_image; ?>
|
||||
<?php print $category_name; ?>
|
||||
</<?php print $hdr; ?>>
|
||||
<div class="clear-block"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php // List questions (in title link) and answers (in body). ?>
|
||||
<div class="faq-category-group">
|
||||
<div>
|
||||
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $i => $node): ?>
|
||||
|
||||
<div class="faq-question"><?php // Strong question label here? ?>
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question -->
|
||||
|
||||
<div class="faq-answer">
|
||||
<strong><?php print $answer_label; ?></strong>
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer -->
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div> <!-- Close div -->
|
||||
</div> <!-- Close div: faq-category-group -->
|
||||
|
||||
<?php if ($group_questions_top || $category_display == 'hide_qa'): ?>
|
||||
</div> <!-- Close div: faq-qa / faq-qa-hide -->
|
||||
</div> <!-- Close div: faq-category-menu -->
|
||||
<?php
|
||||
endif;
|
39
modules/faq/includes/faq-hide-answer.tpl.php
Normal file
39
modules/faq/includes/faq-hide-answer.tpl.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show/hide the answers when the
|
||||
* question is clicked.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $nodes
|
||||
* The array of nodes to be displayed.
|
||||
* Each $node array contains the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Is true if $node['body'] is a teaser.
|
||||
*/
|
||||
?><div>
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $node): ?>
|
||||
<?php // Cycle through each of the nodes. We now have the variable $node to work with. ?>
|
||||
<div class="faq-question-answer">
|
||||
<div class="faq-question faq-dt-hide-answer">
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question faq-dt-hide-answer -->
|
||||
|
||||
<div class="faq-answer faq-dd-hide-answer">
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer faq-dd-hide-answer -->
|
||||
</div> <!-- Close div: faq-question-answer -->
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div -->
|
20
modules/faq/includes/faq-new-page.tpl.php
Normal file
20
modules/faq/includes/faq-new-page.tpl.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show the answer in a new page.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $list_style
|
||||
* The style of the list, either ol or ul (ordered list or unordered list).
|
||||
* $list_items
|
||||
* An array of nodes to be displayed in the list.
|
||||
* $list
|
||||
* Pre-formatted list.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
print $list;
|
49
modules/faq/includes/faq-questions-inline.tpl.php
Normal file
49
modules/faq/includes/faq-questions-inline.tpl.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show the questions inline.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $nodes
|
||||
* The array of nodes to be displayed.
|
||||
* Each node stored in the $nodes array has the following information:
|
||||
* $node['question'] is the question text.
|
||||
* $node['body'] is the answer text.
|
||||
* $node['links'] represents the node links, e.g. "Read more".
|
||||
* $question_label
|
||||
* The question label, intended to be pre-pended to the question text.
|
||||
* $answer_label
|
||||
* The answer label, intended to be pre-pended to the answer text.
|
||||
* $use_teaser
|
||||
* Tells whether $node['body'] contains the full body or just the teaser
|
||||
*/
|
||||
?>
|
||||
<a name="top"></a>
|
||||
<div>
|
||||
<?php if (count($nodes)): ?>
|
||||
<?php foreach ($nodes as $node): ?>
|
||||
<?php // Cycle through the $nodes array so that we now have a $node variable to work with. ?>
|
||||
<br />
|
||||
<div class="faq-question">
|
||||
<?php if (!empty($question_label)): ?>
|
||||
<strong class="faq-question-label"><?php print $question_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['question']; ?>
|
||||
</div> <!-- Close div: faq-question -->
|
||||
|
||||
<div class="faq-answer">
|
||||
<?php if (!empty($answer_label)): ?>
|
||||
<strong class="faq-answer-label"><?php print $answer_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $node['body']; ?>
|
||||
<?php if (isset($node['links'])): ?>
|
||||
<?php print $node['links']; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div: faq-answer -->
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div> <!-- Close div -->
|
56
modules/faq/includes/faq-questions-top.tpl.php
Normal file
56
modules/faq/includes/faq-questions-top.tpl.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for the FAQ page if set to show the questions in a list at the
|
||||
* top.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Available variables:
|
||||
*
|
||||
* $questions_list
|
||||
* Pre-formatted list of questions.
|
||||
* $questions
|
||||
* An array of questions to use for producing the question list at the top.
|
||||
* $answers
|
||||
* An array of answers to use for producing the main body of text.
|
||||
* $answers[$key]['question'] is the question text.
|
||||
* $answers[$key]['body'] is the answer text.
|
||||
* $answers[$key]['links'] represents the node links, e.g. "Read more".
|
||||
* $use_teaser
|
||||
* Is true if $answer['body'] is a teaser.
|
||||
* $list_style
|
||||
* Represents the style of list, ul for unordered, ol for ordered.
|
||||
* $question_label
|
||||
* The question label, intended to be pre-pended to the question text.
|
||||
* $answer_label
|
||||
* The answer label, intended to be pre-pended to the answer text.
|
||||
* $limit
|
||||
* Represents the number of items.
|
||||
*/
|
||||
?>
|
||||
<a name="top"></a>
|
||||
<?php print $questions_list ?>
|
||||
<br />
|
||||
<?php $key = 0; ?>
|
||||
<?php while ($key < $limit): ?>
|
||||
<?php // Cycle through all the answers and "more" links. $key will represent the applicable position in the arrays. ?>
|
||||
<div class="faq-question">
|
||||
<?php if (!empty($question_label)): ?>
|
||||
<strong class="faq-question-label"><?php print $question_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $answers[$key]['question']; ?>
|
||||
</div> <!-- Close div: faq-question -->
|
||||
|
||||
<div class="faq-answer">
|
||||
<?php if (!empty($answer_label)): ?>
|
||||
<strong class="faq-answer-label"><?php print $answer_label; ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php print $answers[$key]['body']; ?>
|
||||
<?php print $answers[$key]['links']; ?>
|
||||
</div> <!-- Close div: faq-answer -->
|
||||
<?php // Increment $key to move on to the next position. ?>
|
||||
<?php $key++; ?>
|
||||
<?php
|
||||
endwhile;
|
148
modules/faq/includes/faq.hide_answer.inc
Normal file
148
modules/faq/includes/faq.hide_answer.inc
Normal file
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FAQ page callbacks for the "hide answer" layouts.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create FAQ page if set to show/hide answer when question is clicked.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_hide_answer(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$this_page = $_GET['q'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
|
||||
$nodes = array();
|
||||
$count = 0;
|
||||
foreach ($data as $node) {
|
||||
$anchor = 'n' . $node->nid;
|
||||
faq_view_question($nodes[$count], $node, $this_page, $anchor);
|
||||
faq_view_answer($nodes[$count], $node, array(), $teaser, $links);
|
||||
$count++;
|
||||
}
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$variables['nodes'] = $nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create categorized FAQ page if set to show answer when question is clicked.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_category_hide_answer(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$category_display = $variables['category_display'];
|
||||
$term = $variables['term'];
|
||||
$parent_term = $variables['parent_term'];
|
||||
$class = $variables['class'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
$display_faq_count = variable_get('faq_count', FALSE);
|
||||
$hide_child_terms = variable_get('faq_hide_child_terms', FALSE);
|
||||
$show_term_page_children = variable_get('faq_show_term_page_children', FALSE);
|
||||
$default_sorting = variable_get('faq_default_sorting', 'DESC');
|
||||
|
||||
// Initialise some variables.
|
||||
$default_weight = 0;
|
||||
if ($default_sorting != 'DESC') {
|
||||
$default_weight = 1000000;
|
||||
}
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq') {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
}
|
||||
}
|
||||
// Force some settings in case we're processing a special faq question list
|
||||
// created by a custom call to faq_page().
|
||||
elseif (!empty($parent_term)) {
|
||||
$get_child_terms = $parent_term->tid;
|
||||
$show_term_page_children = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Get number of questions, and account for hidden sub-categories.
|
||||
$count = 0;
|
||||
if ($display_faq_count && $hide_child_terms) {
|
||||
$count = taxonomy_term_count_nodes($term->tid, 'faq');
|
||||
}
|
||||
$variables['display_faq_count'] = $display_faq_count;
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
// Configure header.
|
||||
$variables['category_depth'] = $term->depth;
|
||||
$variables['category_name'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
if ($category_display == 'hide_qa') {
|
||||
$variables['header_title'] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), "faq/$term->tid");
|
||||
}
|
||||
else {
|
||||
$variables['header_title'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
}
|
||||
|
||||
// Configure category description.
|
||||
$variables['description'] = check_markup(faq_tt("taxonomy:term:$term->tid:description", $term->description));
|
||||
|
||||
// Get list of sub-categories if necessary.
|
||||
$child_categories = array();
|
||||
if (($show_term_page_children || $hide_child_terms) && $category_display == 'new_page') {
|
||||
$child_categories = faq_view_child_category_headers($term);
|
||||
}
|
||||
$variables['subcat_list'] = $child_categories;
|
||||
$variables['subcat_list_style'] = variable_get('faq_category_listing', 'ul');
|
||||
|
||||
// Configure class (faq-qa or faq-qa-hide).
|
||||
if ($get_child_terms == $term->tid) {
|
||||
$variables['container_class'] = 'faq-qa';
|
||||
}
|
||||
else {
|
||||
$variables['container_class'] = $class;
|
||||
}
|
||||
|
||||
// Configure sub-category bodies (theme recursively).
|
||||
$variables['subcat_body_list'] = array();
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != 'faq') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
$variables['subcat_body_list'] = faq_get_child_categories_faqs($term, 'faq_category_hide_answer', $default_weight, $default_sorting, $category_display, $variables['class'], $parent_term);
|
||||
}
|
||||
|
||||
if (!count($data)) {
|
||||
$variables['question_count'] = $count;
|
||||
$variables['nodes'] = array();
|
||||
return;
|
||||
}
|
||||
|
||||
$nodes = array();
|
||||
foreach ($data as $node) {
|
||||
if (!$hide_child_terms) {
|
||||
$count++;
|
||||
}
|
||||
$node_var = array();
|
||||
$anchor = 't' . $term->tid . 'n' . $node->nid;
|
||||
faq_view_question($node_var, $node, $this_page, $anchor);
|
||||
faq_view_answer($node_var, $node, array(), $teaser, $links);
|
||||
$nodes[] = $node_var;
|
||||
}
|
||||
$variables['nodes'] = $nodes;
|
||||
$variables['question_count'] = $count;
|
||||
}
|
||||
|
134
modules/faq/includes/faq.new_page.inc
Normal file
134
modules/faq/includes/faq.new_page.inc
Normal file
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FAQ page callbacks for the "new page" layouts.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create FAQ page if set to show the answer in a new page.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_new_page(&$variables) {
|
||||
$items = array();
|
||||
$data = $variables['data'];
|
||||
|
||||
foreach ($data as $node) {
|
||||
$items[] = l($node->title, "node/$node->nid");
|
||||
}
|
||||
|
||||
$list_style = variable_get('faq_question_listing', 'ul');
|
||||
$variables['list_style'] = $list_style;
|
||||
$variables['list_items'] = $items;
|
||||
|
||||
$variables['list'] = theme('item_list', $items, NULL, $list_style, array("class" => "faq-question-listing"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create categorized FAQ page if set to show answer in a new page.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
|
||||
function template_preprocess_faq_category_new_page(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$category_display = $variables['category_display'];
|
||||
$term = $variables['term'];
|
||||
$parent_term = $variables['parent_term'];
|
||||
$class = $variables['class'];
|
||||
$this_page = $_GET['q'];
|
||||
|
||||
// Fetch configuration.
|
||||
$display_faq_count = variable_get('faq_count', FALSE);
|
||||
$hide_child_terms = variable_get('faq_hide_child_terms', FALSE);
|
||||
$show_term_page_children = variable_get('faq_show_term_page_children', FALSE);
|
||||
|
||||
// Initialise some variables.
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq') {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
}
|
||||
}
|
||||
// Force some settings in case we're processing a special faq question list
|
||||
// created by a custom call to faq_page().
|
||||
elseif (!empty($parent_term)) {
|
||||
$get_child_terms = $parent_term->tid;
|
||||
$show_term_page_children = TRUE;
|
||||
}
|
||||
|
||||
$default_sorting = variable_get('faq_default_sorting', 'DESC');
|
||||
$default_weight = 0;
|
||||
if ($default_sorting != 'DESC') {
|
||||
$default_weight = 1000000;
|
||||
}
|
||||
|
||||
// Get number of questions, and account for hidden sub-categories.
|
||||
$count = 0;
|
||||
if ($display_faq_count && $hide_child_terms) {
|
||||
$count = taxonomy_term_count_nodes($term->tid, 'faq');
|
||||
}
|
||||
$variables['display_faq_count'] = $display_faq_count;
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
// Configure header.
|
||||
$variables['category_depth'] = $term->depth;
|
||||
if ($category_display == 'hide_qa') {
|
||||
$variables['header_title'] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), "faq/$term->tid");
|
||||
}
|
||||
else {
|
||||
$variables['header_title'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
}
|
||||
|
||||
// Configure category description.
|
||||
$variables['description'] = check_markup(faq_tt("taxonomy:term:$term->tid:description", $term->description));
|
||||
|
||||
// Get list of sub-categories if necessary.
|
||||
$child_categories = array();
|
||||
if (($show_term_page_children || $hide_child_terms) && $category_display == 'new_page') {
|
||||
$child_categories = faq_view_child_category_headers($term);
|
||||
}
|
||||
$variables['subcat_list'] = $child_categories;
|
||||
$variables['subcat_list_style'] = variable_get('faq_category_listing', 'ul');
|
||||
|
||||
// Configure class (faq-qa or faq-qa-hide).
|
||||
if ($get_child_terms == $term->tid) {
|
||||
$variables['container_class'] = 'faq-qa';
|
||||
}
|
||||
else {
|
||||
$variables['container_class'] = $class;
|
||||
}
|
||||
|
||||
// Configure sub-category bodies (theme recursively).
|
||||
$variables['subcat_body_list'] = array();
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != 'faq') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
$variables['subcat_body_list'] = faq_get_child_categories_faqs($term, 'faq_category_new_page', $default_weight, $default_sorting, $category_display, $variables['class'], $parent_term);
|
||||
}
|
||||
|
||||
if (!count($data)) {
|
||||
$variables['question_count'] = $count;
|
||||
return;
|
||||
}
|
||||
|
||||
$nodes = array();
|
||||
foreach ($data as $node) {
|
||||
if (!$hide_child_terms) {
|
||||
$count++;
|
||||
}
|
||||
$nodes[] = l($node->title, "node/$node->nid");
|
||||
}
|
||||
$variables['question_list'] = $nodes;
|
||||
$variables['question_list_style'] = variable_get('faq_question_listing', 'ul');
|
||||
$variables['question_count'] = $count;
|
||||
}
|
||||
|
168
modules/faq/includes/faq.questions_inline.inc
Normal file
168
modules/faq/includes/faq.questions_inline.inc
Normal file
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FAQ page callbacks for the "questions inline" layouts.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create the FAQ page if set to show the questions inline.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_questions_inline(&$variables) {
|
||||
$data = $variables['data'];
|
||||
|
||||
// Fetch configuration.
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
|
||||
// Configure "back to top" link.
|
||||
$this_page = $_GET['q'];
|
||||
$back_to_top = faq_init_back_to_top($this_page);
|
||||
|
||||
// Configure labels.
|
||||
$variables['question_label'] = '';
|
||||
$variables['answer_label'] = '';
|
||||
if (variable_get('faq_qa_mark', FALSE)) {
|
||||
$variables['question_label'] = check_plain(variable_get('faq_question_label', "Q:"));
|
||||
$variables['answer_label'] = check_plain(variable_get('faq_answer_label', "A:"));
|
||||
}
|
||||
|
||||
$nodes = array();
|
||||
$count = 0;
|
||||
foreach ($data as $node) {
|
||||
$anchor = 'n' . $node->nid;
|
||||
faq_view_question($nodes[$count], $node, NULL, $anchor);
|
||||
faq_view_answer($nodes[$count], $node, $back_to_top, $teaser, $links);
|
||||
$count++;
|
||||
}
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$variables['nodes'] = $nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create categorized FAQ page if set to show/hide the questions inline.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_category_questions_inline(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$category_display = $variables['category_display'];
|
||||
$term = $variables['term'];
|
||||
$parent_term = $variables['parent_term'];
|
||||
$class = $variables['class'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
$display_faq_count = variable_get('faq_count', FALSE);
|
||||
$hide_child_terms = variable_get('faq_hide_child_terms', FALSE);
|
||||
$show_term_page_children = variable_get('faq_show_term_page_children', FALSE);
|
||||
$default_sorting = variable_get('faq_default_sorting', 'DESC');
|
||||
|
||||
// Initialise some variables.
|
||||
$default_weight = 0;
|
||||
if ($default_sorting != 'DESC') {
|
||||
$default_weight = 1000000;
|
||||
}
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq') {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
}
|
||||
}
|
||||
// Force some settings in case we're processing a special faq question list
|
||||
// created by a custom call to faq_page().
|
||||
elseif (!empty($parent_term)) {
|
||||
$get_child_terms = $parent_term->tid;
|
||||
$show_term_page_children = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Configure "back to top" link.
|
||||
$back_to_top = faq_init_back_to_top($this_page);
|
||||
|
||||
// Configure labels.
|
||||
$variables['question_label'] = '';
|
||||
$variables['answer_label'] = '';
|
||||
if (variable_get('faq_qa_mark', FALSE)) {
|
||||
$variables['question_label'] = check_plain(variable_get('faq_question_label', "Q:"));
|
||||
$variables['answer_label'] = check_plain(variable_get('faq_answer_label', "A:"));
|
||||
}
|
||||
|
||||
// Get number of questions, and account for hidden sub-categories.
|
||||
$count = 0;
|
||||
if ($display_faq_count && $hide_child_terms) {
|
||||
$count = taxonomy_term_count_nodes($term->tid, 'faq');
|
||||
}
|
||||
$variables['display_faq_count'] = $display_faq_count;
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
// Configure header.
|
||||
$variables['category_depth'] = $term->depth;
|
||||
if ($category_display == 'hide_qa') {
|
||||
$variables['header_title'] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), "faq/$term->tid");
|
||||
}
|
||||
else {
|
||||
$variables['header_title'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
}
|
||||
|
||||
// Configure category description.
|
||||
$variables['description'] = check_markup(faq_tt("taxonomy:term:$term->tid:description", $term->description));
|
||||
|
||||
// Get list of sub-categories if necessary.
|
||||
$child_categories = array();
|
||||
if (($show_term_page_children || $hide_child_terms) && $category_display == 'new_page') {
|
||||
$child_categories = faq_view_child_category_headers($term);
|
||||
}
|
||||
$variables['subcat_list'] = $child_categories;
|
||||
$variables['subcat_list_style'] = variable_get('faq_category_listing', 'ul');
|
||||
|
||||
// Configure class (faq-qa or faq-qa-hide).
|
||||
if ($get_child_terms == $term->tid) {
|
||||
$variables['container_class'] = 'faq-qa';
|
||||
}
|
||||
else {
|
||||
$variables['container_class'] = $class;
|
||||
}
|
||||
|
||||
// Configure sub-category bodies (theme recursively).
|
||||
$variables['subcat_body_list'] = array();
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != 'faq') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
$variables['subcat_body_list'] = faq_get_child_categories_faqs($term, 'faq_category_questions_inline', $default_weight, $default_sorting, $category_display, $variables['class'], $parent_term);
|
||||
}
|
||||
|
||||
if (!count($data)) {
|
||||
$variables['question_count'] = $count;
|
||||
return;
|
||||
}
|
||||
|
||||
$nodes = array();
|
||||
foreach ($data as $node) {
|
||||
if (!$hide_child_terms) {
|
||||
$count++;
|
||||
}
|
||||
$node_var = array();
|
||||
$anchor = 't' . $term->tid . 'n' . $node->nid;
|
||||
faq_view_question($node_var, $node, NULL, $anchor);
|
||||
faq_view_answer($node_var, $node, $back_to_top, $teaser, $links);
|
||||
$nodes[] = $node_var;
|
||||
}
|
||||
$variables['nodes'] = $nodes;
|
||||
$variables['question_count'] = $count;
|
||||
$variables['use_teaser'] = $teaser;
|
||||
}
|
||||
|
282
modules/faq/includes/faq.questions_top.inc
Normal file
282
modules/faq/includes/faq.questions_top.inc
Normal file
|
@ -0,0 +1,282 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FAQ page callbacks for the "questions top" layouts.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create the structure of the page, when the questions are to be shown on top.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
* @return
|
||||
* A variable holding the HTML formatted page.
|
||||
*/
|
||||
function template_preprocess_faq_questions_top(&$variables) {
|
||||
$data = $variables['data'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
|
||||
// Configure labels.
|
||||
$variables['question_label'] = '';
|
||||
$variables['answer_label'] = '';
|
||||
if (variable_get('faq_qa_mark', FALSE)) {
|
||||
$variables['question_label'] = check_plain(variable_get('faq_question_label', "Q:"));
|
||||
$variables['answer_label'] = check_plain(variable_get('faq_answer_label', "A:"));
|
||||
}
|
||||
|
||||
// Configure "back to top" link.
|
||||
$this_page = $_GET['q'];
|
||||
$back_to_top = faq_init_back_to_top($this_page);
|
||||
|
||||
// Loop through results.
|
||||
$questions = array();
|
||||
$answers = array();
|
||||
$key = 0;
|
||||
foreach ($data as $node) {
|
||||
$anchor = 'n' . $node->nid;
|
||||
$questions[$key] = l($node->title, $this_page, array('fragment' => $anchor));
|
||||
faq_view_question($answers[$key], $node, NULL, $anchor);
|
||||
faq_view_answer($answers[$key], $node, $back_to_top, $teaser, $links);
|
||||
$key++;
|
||||
}
|
||||
$variables['limit'] = $key;
|
||||
|
||||
$list_style = variable_get('faq_question_listing', 'ul');
|
||||
$variables['list_style'] = $list_style;
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$variables['questions'] = $questions;
|
||||
$variables['answers'] = $answers;
|
||||
$variables['questions_list'] = theme('item_list', $questions, NULL, $list_style, array("class" => "faq-ul-questions-top"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create categorized questions for FAQ page if set to show questions on top.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_category_questions_top(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$category_display = $variables['category_display'];
|
||||
$term = $variables['term'];
|
||||
$parent_term = $variables['parent_term'];
|
||||
$class = $variables['class'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
$display_faq_count = variable_get('faq_count', FALSE);
|
||||
$hide_child_terms = variable_get('faq_hide_child_terms', FALSE);
|
||||
$show_term_page_children = variable_get('faq_show_term_page_children', FALSE);
|
||||
$group_questions_top = variable_get('faq_group_questions_top', FALSE);
|
||||
$default_sorting = variable_get('faq_default_sorting', 'DESC');
|
||||
|
||||
// Initialise some variables.
|
||||
$default_weight = 0;
|
||||
if ($default_sorting != 'DESC') {
|
||||
$default_weight = 1000000;
|
||||
}
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq') {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
}
|
||||
}
|
||||
// Force some settings in case we're processing a special faq question list
|
||||
// created by a custom call to faq_page().
|
||||
elseif (!empty($parent_term)) {
|
||||
$get_child_terms = $parent_term->tid;
|
||||
$show_term_page_children = TRUE;
|
||||
}
|
||||
|
||||
// Configure "back to top" link.
|
||||
$back_to_top = faq_init_back_to_top($this_page);
|
||||
|
||||
// Get number of questions, and account for hidden sub-categories.
|
||||
$count = 0;
|
||||
if ($display_faq_count && $hide_child_terms) {
|
||||
$count = taxonomy_term_count_nodes($term->tid, 'faq');
|
||||
}
|
||||
$variables['display_faq_count'] = $display_faq_count;
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
// Configure header.
|
||||
$variables['category_depth'] = $term->depth;
|
||||
$variables['category_name'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
if ($category_display == 'hide_qa') {
|
||||
$variables['header_title'] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), "faq/$term->tid");
|
||||
}
|
||||
else {
|
||||
$variables['header_title'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
}
|
||||
|
||||
// Configure category description.
|
||||
$variables['description'] = check_markup(faq_tt("taxonomy:term:$term->tid:description", $term->description));
|
||||
|
||||
// Get list of sub-categories if necessary.
|
||||
$child_categories = array();
|
||||
if (($show_term_page_children || $hide_child_terms) && $category_display == 'new_page') {
|
||||
$child_categories = faq_view_child_category_headers($term);
|
||||
}
|
||||
$variables['subcat_list'] = $child_categories;
|
||||
$variables['subcat_list_style'] = variable_get('faq_category_listing', 'ul');
|
||||
|
||||
// Configure class (faq-qa or faq-qa-hide).
|
||||
if ($get_child_terms == $term->tid) {
|
||||
$variables['container_class'] = 'faq-qa';
|
||||
}
|
||||
else {
|
||||
$variables['container_class'] = $class;
|
||||
}
|
||||
|
||||
// Configure sub-category bodies (theme recursively).
|
||||
$variables['subcat_body_list'] = array();
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != 'faq') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
$variables['subcat_body_list'] = faq_get_child_categories_faqs($term, 'faq_category_questions_top', $default_weight, $default_sorting, $category_display, $variables['class'], $parent_term);
|
||||
}
|
||||
|
||||
if (!count($data)) {
|
||||
$variables['question_count'] = $count;
|
||||
return;
|
||||
}
|
||||
|
||||
$questions = array();
|
||||
$nodes = array();
|
||||
foreach ($data as $node) {
|
||||
if (!$hide_child_terms) {
|
||||
$count++;
|
||||
}
|
||||
$anchor = 't' . $term->tid . 'n' . $node->nid;
|
||||
$node_var = array();
|
||||
faq_view_question($node_var, $node, NULL, $anchor);
|
||||
if ($group_questions_top || $category_display == 'hide_qa') {
|
||||
faq_view_answer($node_var, $node, $back_to_top, $teaser, $links);
|
||||
}
|
||||
$nodes[] = $node_var;
|
||||
$questions[] = l($node->title, $this_page, array('fragment' => $anchor));
|
||||
}
|
||||
$variables['question_count'] = $count;
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$variables['question_list'] = $questions;
|
||||
$variables['question_list_style'] = variable_get('faq_question_listing', 'ul');
|
||||
|
||||
$variables['group_questions_top'] = $group_questions_top;
|
||||
if ($group_questions_top || $category_display == "hide_qa") {
|
||||
$variables['nodes'] = $nodes;
|
||||
$variables['answer_category_name'] = variable_get('faq_answer_category_name', FALSE);
|
||||
}
|
||||
else {
|
||||
$variables['nodes'] = array();
|
||||
$variables['answer_category_name'] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create categorized answers for FAQ page if set to show the questions on top.
|
||||
*
|
||||
* @param &$variables
|
||||
* Array reference of arguments given to the theme() function.
|
||||
*/
|
||||
function template_preprocess_faq_category_questions_top_answers(&$variables) {
|
||||
$data = $variables['data'];
|
||||
$category_display = $variables['category_display'];
|
||||
$term = $variables['term'];
|
||||
$parent_term = $variables['parent_term'];
|
||||
$class = $variables['class'];
|
||||
|
||||
// Fetch configuration.
|
||||
$teaser = variable_get('faq_use_teaser', FALSE);
|
||||
$links = variable_get('faq_show_node_links', FALSE);
|
||||
$disable_node_links = variable_get('faq_disable_node_links', FALSE);
|
||||
$hide_child_terms = variable_get('faq_hide_child_terms', FALSE);
|
||||
$show_term_page_children = variable_get('faq_show_term_page_children', FALSE);
|
||||
$group_questions_top = variable_get('faq_group_questions_top', FALSE);
|
||||
$default_sorting = variable_get('faq_default_sorting', 'DESC');
|
||||
|
||||
// Configure labels.
|
||||
$variables['question_label'] = '';
|
||||
$variables['answer_label'] = '';
|
||||
if (variable_get('faq_qa_mark', FALSE)) {
|
||||
$variables['question_label'] = check_plain(variable_get('faq_question_label', "Q:"));
|
||||
$variables['answer_label'] = check_plain(variable_get('faq_answer_label', "A:"));
|
||||
}
|
||||
|
||||
// Initialise some variables.
|
||||
$default_weight = 0;
|
||||
if ($default_sorting != 'DESC') {
|
||||
$default_weight = 1000000;
|
||||
}
|
||||
|
||||
$variables['group_questions_top'] = $group_questions_top;
|
||||
if ($group_questions_top || $category_display == "hide_qa") {
|
||||
$variables['display_answers'] = FALSE;
|
||||
$variables['category_depth'] = 0;
|
||||
return;
|
||||
}
|
||||
$variables['display_answers'] = TRUE;
|
||||
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq') {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
}
|
||||
}
|
||||
// Force some settings in case we're processing a special faq question list
|
||||
// created by a custom call to faq_page().
|
||||
elseif (!empty($parent_term)) {
|
||||
$get_child_terms = $parent_term->tid;
|
||||
$show_term_page_children = TRUE;
|
||||
}
|
||||
|
||||
// Configure "back to top" link.
|
||||
$back_to_top = faq_init_back_to_top($this_page);
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
// Configure sub-category bodies (theme recursively).
|
||||
$variables['subcat_body_list'] = array();
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != 'faq') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
$variables['subcat_body_list'] = faq_get_child_categories_faqs($term, 'faq_category_questions_top_answers', $default_weight, $default_sorting, $category_display, $variables['class'], $parent_term);
|
||||
}
|
||||
|
||||
|
||||
$nodes = array();
|
||||
foreach ($data as $node) {
|
||||
$node_var = array();
|
||||
$anchor = 't' . $term->tid . 'n' . $node->nid;
|
||||
faq_view_question($node_var, $node, NULL, $anchor);
|
||||
faq_view_answer($node_var, $node, $back_to_top, $teaser, $links);
|
||||
$nodes[] = $node_var;
|
||||
}
|
||||
$variables['use_teaser'] = $teaser;
|
||||
$variables['nodes'] = $nodes;
|
||||
$variables['category_name'] = check_plain(faq_tt("taxonomy:term:$term->tid:name", $term->name));
|
||||
$variables['category_depth'] = $term->depth;
|
||||
$variables['display_header'] = FALSE;
|
||||
$variables['answer_category_name'] = variable_get('faq_answer_category_name', FALSE);
|
||||
if ($variables['answer_category_name'] && taxonomy_term_count_nodes($term->tid, 'faq')) {
|
||||
$variables['display_header'] = TRUE;
|
||||
}
|
||||
}
|
||||
|
Reference in a new issue