updated webform & faq
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
*.patch
|
||||
*.diff
|
||||
.idea/
|
||||
.idea/*
|
@@ -36,13 +36,15 @@ function faq_general_settings_form($form) {
|
||||
'#default_value' => variable_get('faq_title', 'Frequently Asked Questions'),
|
||||
);
|
||||
|
||||
$form['body_filter']['faq_description'] = array(
|
||||
'#type' => 'textarea',
|
||||
$faq_description_default = array('value' => '', 'format' => filter_fallback_format());
|
||||
$faq_description = variable_get('faq_description', $faq_description_default);
|
||||
$form['faq_description'] = array(
|
||||
'#type' => 'text_format',
|
||||
'#title' => t('FAQ Description'),
|
||||
'#default_value' => variable_get('faq_description', ''),
|
||||
'#default_value' => $faq_description['value'],
|
||||
'#description' => t('Your FAQ description. This will be placed at the top of the page, above the questions and can serve as an introductory text.'),
|
||||
'#rows' => 5,
|
||||
'#format' => variable_get('faq_description_format', NULL),
|
||||
'#format' => $faq_description['format'],
|
||||
);
|
||||
|
||||
$form['faq_custom_breadcrumbs'] = array(
|
||||
@@ -61,7 +63,7 @@ function faq_general_settings_form($form) {
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('FAQ Path'),
|
||||
'#description' => t('This option sets the path to the faq page. DO NOT append with a \'/\''),
|
||||
'#default_value' => variable_get('faq_path', 'faq-page'),
|
||||
'#default_value' => _faq_path(),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
|
@@ -22,9 +22,8 @@ files[] = includes/faq.questions_top.inc
|
||||
files[] = views/faq.views.inc
|
||||
configure = admin/config/content/faq
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-09-08
|
||||
version = "7.x-1.1"
|
||||
; Information added by Drupal.org packaging script on 2019-11-25
|
||||
version = "7.x-1.2"
|
||||
core = "7.x"
|
||||
project = "faq"
|
||||
datestamp = "1441726722"
|
||||
|
||||
datestamp = "1574706185"
|
||||
|
@@ -112,7 +112,7 @@ function faq_uninstall() {
|
||||
// General settings.
|
||||
variable_del('faq_title');
|
||||
variable_del('faq_description');
|
||||
variable_del('faq_description_format');
|
||||
variable_del('faq_path');
|
||||
// Questions page.
|
||||
variable_del('faq_display');
|
||||
variable_del('faq_question_listing');
|
||||
@@ -127,6 +127,7 @@ function faq_uninstall() {
|
||||
variable_del('faq_back_to_top');
|
||||
variable_del('faq_disable_node_links');
|
||||
variable_del('faq_default_sorting');
|
||||
variable_del('faq_question_long_form');
|
||||
// Categories page.
|
||||
variable_del('faq_use_categories');
|
||||
variable_del('faq_category_display');
|
||||
@@ -406,6 +407,22 @@ function faq_update_7002(&$sandbox) {
|
||||
return t('Custom field added, @count questions converted into fields.', array('@count' => $sandbox['max'] + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert faq page description to array.
|
||||
*/
|
||||
function faq_update_7003(&$sandbox) {
|
||||
$description = variable_get('faq_description', '');
|
||||
$format = variable_get('faq_description_format', filter_fallback_format());
|
||||
$faq_description = array(
|
||||
'value' => $description,
|
||||
'format' => $format,
|
||||
);
|
||||
variable_set('faq_description', $faq_description);
|
||||
variable_del('faq_description_format');
|
||||
|
||||
return t('Converted faq page description to array.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Code examples modified.
|
||||
*
|
||||
|
@@ -74,7 +74,7 @@ function faq_node_access($node, $op, $account = NULL) {
|
||||
*/
|
||||
function faq_menu() {
|
||||
$items = array();
|
||||
$faq_path = variable_get('faq_path', 'faq-page');
|
||||
$faq_path = _faq_path();
|
||||
|
||||
$items[$faq_path] = array(
|
||||
'title' => 'Frequently Asked Questions',
|
||||
@@ -239,13 +239,13 @@ function faq_form_faq_general_settings_form_alter(&$form, &$form_state) {
|
||||
*/
|
||||
function faq_insert($node) {
|
||||
$items = field_get_items('node', $node, 'field_detailed_question');
|
||||
$detailed_question = reset($items);
|
||||
$detailed_question = !empty($items) ? $items[0]['value'] : '';
|
||||
db_insert('faq_questions')
|
||||
->fields(array(
|
||||
'nid' => $node->nid,
|
||||
'vid' => $node->vid,
|
||||
'question' => $node->title,
|
||||
'detailed_question' => $detailed_question['value'],
|
||||
'detailed_question' => $detailed_question,
|
||||
))
|
||||
->execute();
|
||||
}
|
||||
@@ -416,6 +416,8 @@ function faq_page($tid = 0, $faq_display = '', $category_display = '') {
|
||||
module_load_include('inc', 'pathauto');
|
||||
}
|
||||
|
||||
$faqpath = _faq_path();
|
||||
|
||||
// Things to provide translations for.
|
||||
$default_values = array(
|
||||
t('Frequently Asked Questions'),
|
||||
@@ -426,7 +428,7 @@ function faq_page($tid = 0, $faq_display = '', $category_display = '') {
|
||||
|
||||
$output = $output_answers = '';
|
||||
drupal_add_css(drupal_get_path('module', 'faq') . '/faq.css');
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == $faqpath) {
|
||||
drupal_set_title(t(variable_get('faq_title', 'Frequently Asked Questions')));
|
||||
}
|
||||
if (!module_exists("taxonomy")) {
|
||||
@@ -441,7 +443,7 @@ function faq_page($tid = 0, $faq_display = '', $category_display = '') {
|
||||
drupal_goto($alias['alias']);
|
||||
}
|
||||
}
|
||||
if (drupal_match_path($_GET['q'], 'faq-page/*')) {
|
||||
if (drupal_match_path($_GET['q'], $faqpath . '/*')) {
|
||||
faq_set_breadcrumb($current_term);
|
||||
}
|
||||
}
|
||||
@@ -571,7 +573,7 @@ function faq_page($tid = 0, $faq_display = '', $category_display = '') {
|
||||
}
|
||||
$valid_vocab = TRUE;
|
||||
|
||||
if ($category_display == "new_page") {
|
||||
if ($category_display == 'new_page') {
|
||||
$vocab_items = _get_indented_faq_terms($vid, 0);
|
||||
$items = array_merge($items, $vocab_items);
|
||||
}
|
||||
@@ -616,16 +618,22 @@ function faq_page($tid = 0, $faq_display = '', $category_display = '') {
|
||||
}
|
||||
}
|
||||
|
||||
$faq_description = t(variable_get('faq_description', ''));
|
||||
$format = variable_get('faq_description_format', 0);
|
||||
$faq_description_default = array('value' => '', 'format' => filter_fallback_format());
|
||||
$faq_description = variable_get('faq_description', $faq_description_default);
|
||||
$format = $faq_description['format'];
|
||||
|
||||
if ($format) {
|
||||
$faq_description = check_markup($faq_description, $format);
|
||||
$description = check_markup($faq_description['value'], $format);
|
||||
}
|
||||
else {
|
||||
$description = check_plain($faq_description['value']);
|
||||
}
|
||||
|
||||
return theme('faq_page',
|
||||
array(
|
||||
'content' => $output,
|
||||
'answers' => $output_answers,
|
||||
'description' => $faq_description,
|
||||
'description' => $description,
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -943,7 +951,7 @@ function faq_block_view($delta) {
|
||||
$block['subject'] = t('FAQ Categories');
|
||||
$items = array();
|
||||
foreach ($terms as $name => $tid) {
|
||||
$items[] = l(faq_tt("taxonomy:term:$tid:name", $name), 'faq-page/' . $tid);
|
||||
$items[] = l(faq_tt("taxonomy:term:$tid:name", $name), _faq_path() . '/' . $tid);
|
||||
}
|
||||
$list_style = variable_get('faq_category_listing', 'ul');
|
||||
$block['content'] = theme('item_list',
|
||||
@@ -1015,7 +1023,7 @@ function _get_indented_faq_terms($vid, $tid) {
|
||||
->fetchField();
|
||||
|
||||
if ($term_node_count > 0) {
|
||||
$path = "faq-page/$term->tid";
|
||||
$path = _faq_path() . "/$term->tid";
|
||||
|
||||
if (!drupal_lookup_path('alias', arg(0) . '/' . $term->tid) && module_exists('pathauto')) {
|
||||
$alias = pathauto_create_alias('faq', 'insert', arg(0) . '/' . $term->tid, array('term' => $term));
|
||||
@@ -1134,7 +1142,7 @@ function faq_get_faq_list() {
|
||||
|
||||
foreach ($nodes as $node) {
|
||||
if (node_access('view', $node)) {
|
||||
$items[] = l($node->question, "node/$node->nid");
|
||||
$items[] = l($node->title, "node/$node->nid");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1217,7 +1225,7 @@ function faq_view_question(&$data, $node, $path = NULL, $anchor = NULL) {
|
||||
}
|
||||
|
||||
// Get the detailed question.
|
||||
$detailed_question = '';
|
||||
$detailed_question = array();
|
||||
if ($dq = field_get_items('node', $node, 'field_detailed_question')) {
|
||||
$detailed_question = reset($dq);
|
||||
}
|
||||
@@ -1225,7 +1233,7 @@ function faq_view_question(&$data, $node, $path = NULL, $anchor = NULL) {
|
||||
if (variable_get('faq_display', 'questions_top') != 'hide_answer'
|
||||
&& !empty($detailed_question['value'])
|
||||
&& variable_get('faq_question_length', 'short') == 'both') {
|
||||
$question .= '<div class="faq-detailed-question">' . $detailed_question['safe_value'] . '</div>';
|
||||
$question .= '<div class="faq-detailed-question">' . $detailed_question['value'] . '</div>';
|
||||
}
|
||||
$data['question'] = $question;
|
||||
}
|
||||
@@ -1461,7 +1469,7 @@ function faq_view_child_category_headers($term) {
|
||||
$term_image = taxonomy_image_display($child_term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
$term_vars['link'] = l(faq_tt("taxonomy:term:$child_term->tid:name", $child_term->name), "faq-page/$child_term->tid");
|
||||
$term_vars['link'] = l(faq_tt("taxonomy:term:$child_term->tid:name", $child_term->name), _faq_path() . "/$child_term->tid");
|
||||
$term_vars['description'] = check_markup(faq_tt("taxonomy:term:$child_term->tid:description", $child_term->description));
|
||||
$term_vars['count'] = $term_node_count;
|
||||
$term_vars['term_image'] = $term_image;
|
||||
@@ -1482,7 +1490,7 @@ function faq_pathauto($op) {
|
||||
$settings['module'] = 'faq';
|
||||
$settings['groupheader'] = t('FAQ category page settings');
|
||||
$settings['patterndescr'] = t('Default path pattern (applies to all FAQ categories with blank patterns below)');
|
||||
$settings['patterndefault'] = t('faq-page/[term:tid]');
|
||||
$settings['patterndefault'] = t(_faq_path() . '/[term:tid]');
|
||||
$settings['batch_update_callback'] = 'faq_pathauto_bulkupdate';
|
||||
$settings['token_type'] = 'term';
|
||||
return (object) $settings;
|
||||
@@ -1496,7 +1504,7 @@ function faq_pathauto($op) {
|
||||
* Implements hook_path_alias_types().
|
||||
*/
|
||||
function faq_path_alias_types() {
|
||||
$objects['faq-page/'] = t('FAQ pages');
|
||||
$objects[_faq_path() . '/'] = t('FAQ pages');
|
||||
return $objects;
|
||||
}
|
||||
|
||||
@@ -1511,6 +1519,7 @@ function faq_pathauto_bulkupdate() {
|
||||
$context['sandbox']['current'] = 0;
|
||||
}
|
||||
|
||||
$faq_path = _faq_path();
|
||||
// Get the allowed vocabs.
|
||||
$vocabularies = taxonomy_get_vocabularies('faq');
|
||||
$vocab_omit = variable_get('faq_omit_vocabulary', array());
|
||||
@@ -1524,7 +1533,7 @@ function faq_pathauto_bulkupdate() {
|
||||
|
||||
// Get tids that need aliasing.
|
||||
$query = db_select('taxonomy_term_data', 'td');
|
||||
$query->leftJoin('url_alias', 'ua', "CONCAT('faq-page/', td.tid) = ua.source");
|
||||
$query->leftJoin('url_alias', 'ua', "CONCAT($faq_path . '/', td.tid) = ua.source");
|
||||
$query->addField('td', 'tid');
|
||||
$query->isNull('ua.source');
|
||||
$query->condition('td.tid', $context['sandbox']['current'], '>');
|
||||
@@ -1549,7 +1558,7 @@ function faq_pathauto_bulkupdate() {
|
||||
|
||||
$terms = taxonomy_term_load_multiple($tids);
|
||||
foreach ($terms as $term) {
|
||||
pathauto_create_alias('faq', 'bulkupdate', 'faq-page/' . $term->tid, array('term' => $term));
|
||||
pathauto_create_alias('faq', 'bulkupdate', $faq_path . '/' . $term->tid, array('term' => $term));
|
||||
}
|
||||
$context['sandbox']['count'] += count($tids);
|
||||
$context['sandbox']['current'] = max($tids);
|
||||
@@ -1573,7 +1582,7 @@ function faq_taxonomy_term_insert($term) {
|
||||
if ((isset($vocab_omit[$vid]) && $vocab_omit[$vid] != 0) || ($term->vid != $vid)) {
|
||||
continue;
|
||||
}
|
||||
$alias = pathauto_create_alias('faq', 'insert', 'faq-page/' . $term->tid, array('term' => $term));
|
||||
$alias = pathauto_create_alias('faq', 'insert', _faq_path() . '/' . $term->tid, array('term' => $term));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1591,7 +1600,7 @@ function faq_taxonomy_term_update($term) {
|
||||
if ((isset($vocab_omit[$vid]) && $vocab_omit[$vid] != 0) || ($term->vid != $vid)) {
|
||||
continue;
|
||||
}
|
||||
$alias = pathauto_create_alias('faq', 'update', 'faq-page/' . $term->tid, array('term' => $term));
|
||||
$alias = pathauto_create_alias('faq', 'update', _faq_path() . '/' . $term->tid, array('term' => $term));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1602,7 +1611,7 @@ function faq_taxonomy_term_update($term) {
|
||||
function faq_taxonomy_term_delete($term) {
|
||||
if (module_exists('pathauto')) {
|
||||
module_load_include('inc', 'pathauto');
|
||||
pathauto_path_delete_all("faq-page/{$term->tid}");
|
||||
pathauto_path_delete_all(_faq_path() . "/{$term->tid}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1617,15 +1626,16 @@ function faq_taxonomy_term_delete($term) {
|
||||
*/
|
||||
function faq_set_breadcrumb($term = NULL) {
|
||||
$breadcrumb = array();
|
||||
$faq_path = _faq_path();
|
||||
if (variable_get('faq_custom_breadcrumbs', TRUE)) {
|
||||
if (module_exists("taxonomy") && $term) {
|
||||
$breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq-page/' . $term->tid);
|
||||
$breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), $faq_path . '/' . $term->tid);
|
||||
while ($parents = taxonomy_get_parents($term->tid)) {
|
||||
$term = array_shift($parents);
|
||||
$breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq-page/' . $term->tid);
|
||||
$breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), $faq_path . '/' . $term->tid);
|
||||
}
|
||||
}
|
||||
$breadcrumb[] = l(t(variable_get('faq_title', 'Frequently Asked Questions')), 'faq-page');
|
||||
$breadcrumb[] = l(t(variable_get('faq_title', 'Frequently Asked Questions')), $faq_path);
|
||||
$breadcrumb[] = l(t('Home'), NULL, array('attributes' => array('title' => variable_get('site_name', ''))));
|
||||
$breadcrumb = array_reverse($breadcrumb);
|
||||
return drupal_set_breadcrumb($breadcrumb);
|
||||
@@ -1815,7 +1825,7 @@ function theme_field_detailed_question($variables) {
|
||||
}
|
||||
|
||||
// Render the items.
|
||||
$output .= '<div class="faq-detailed-question">' . $variables['safe_value'] . '</div>';
|
||||
$output .= '<div class="faq-detailed-question">' . $variables['value'] . '</div>';
|
||||
|
||||
// Render the top-level DIV.
|
||||
if (isset($variables['classes']) && isset($variables['attributes'])) {
|
||||
@@ -1856,3 +1866,10 @@ function theme_faq_draggable_question_order_table($variables) {
|
||||
$output .= drupal_render_children($form);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the path for the faq page.
|
||||
*/
|
||||
function _faq_path() {
|
||||
return variable_get('faq_path', 'faq-page');
|
||||
}
|
||||
|
@@ -172,20 +172,20 @@ class FaqAccessTestClass extends FaqTestCase {
|
||||
function testFaqAccess() {
|
||||
|
||||
// Verify that anonymous user has no access to the faq page
|
||||
$this->faqVerifyNoAccess('faq-page');
|
||||
$this->faqVerifyNoAccess(_faq_path());
|
||||
|
||||
// Create and login user
|
||||
$normal_user = $this->drupalCreateUser();
|
||||
$this->drupalLogin($normal_user);
|
||||
// Verify that logged in user has no access to the faq page
|
||||
$this->faqVerifyNoAccess('faq-page');
|
||||
$this->faqVerifyNoAccess(_faq_path());
|
||||
$this->drupalLogout();
|
||||
|
||||
$view_faq_user = $this->drupalCreateUser(array('view faq page'));
|
||||
$this->drupalLogin($view_faq_user);
|
||||
|
||||
// Verify that the faq page is visible and available but empty
|
||||
$this->drupalGet('faq-page');
|
||||
$this->drupalGet(_faq_path());
|
||||
$this->assertText(t('Frequently Asked Questions'), t('FAQ page is available for view faq page permissions.'));
|
||||
|
||||
}
|
||||
@@ -217,14 +217,14 @@ class CreateFaqTestCase extends FaqTestCase {
|
||||
// Show the detailed question
|
||||
$this->drupalGet('admin/config/content/faq/questions');
|
||||
// Set faq to allow long question text and labeled questions and answers
|
||||
$this->drupalPost('admin/config/content/faq/questions', array('faq_question_long_form' => '1', 'faq_qa_mark' => '1'), t('Save configuration'));
|
||||
$this->drupalPost('admin/config/content/faq/questions', array('faq_question_length' => 'both'), t('Save configuration'));
|
||||
$this->drupalPost('admin/config/content/faq/questions', array('faq_question_long_form' => '1', 'faq_qa_mark' => '1'), t('Save configuration'));
|
||||
$this->drupalPost('admin/config/content/faq/questions', array('faq_question_length' => 'both'), t('Save configuration'));
|
||||
|
||||
$this->afaq_user = $this->drupalCreateUser(array('create faq content', 'view faq page'));
|
||||
$this->drupalLogin($this->afaq_user);
|
||||
$this->afaq_user = $this->drupalCreateUser(array('create faq content', 'view faq page'));
|
||||
$this->drupalLogin($this->afaq_user);
|
||||
|
||||
// Verify that the faq page is visible and available but empty
|
||||
$this->drupalGet('faq-page');
|
||||
$this->drupalGet(_faq_path());
|
||||
$this->assertText(t('Frequently Asked Questions'), t('FAQ page is available for view faq page permissions.'));
|
||||
|
||||
// Fill in the Create FAQ node 1 form and post it
|
||||
@@ -242,7 +242,7 @@ class CreateFaqTestCase extends FaqTestCase {
|
||||
|
||||
// Check that faq is found on the correct taxonomy term page too
|
||||
$this->drupalGet('taxonomy/term/' . $this->term->tid);
|
||||
$this->assertText(t('@title', array('@title' => $this->faq1['title'])));
|
||||
$this->assertText(t('@title', array('@title' => $this->faq1['title'])));
|
||||
|
||||
// Fill in the Create FAQ node 2 form and post it
|
||||
$this->faq2 = array();
|
||||
@@ -261,12 +261,12 @@ class CreateFaqTestCase extends FaqTestCase {
|
||||
|
||||
|
||||
// Verify that logged in user has no access to the faq page
|
||||
$this->faqVerifyNoAccess('faq-page');
|
||||
$this->faqVerifyNoAccess(_faq_path());
|
||||
|
||||
// Check that the FAQ page is available and that the correct term is listed as grouping for the new FAQ node
|
||||
$view_faq_user = $this->drupalCreateUser(array('view faq page'));
|
||||
$this->drupalLogin($view_faq_user);
|
||||
$this->drupalGet('faq-page');
|
||||
$this->drupalGet(_faq_path());
|
||||
$this->assertText(t('Frequently Asked Questions'), t('FAQ page is available for view faq page permissions.'));
|
||||
$this->assertText($this->faq1['title'], t('Created FAQ node 1 available on FAQ page.'));
|
||||
$this->assertText($this->faq1[$this->instance['field_name'] . '[' . $langcode .']'], t('Term for node 1 available on FAQ page.'));
|
||||
@@ -276,7 +276,7 @@ class CreateFaqTestCase extends FaqTestCase {
|
||||
// Navigate to FAQ node created on FAQ page
|
||||
$this->clickLink(t($this->faq1['title']));
|
||||
$this->assertText(t($this->faq1["field_detailed_question[$langcode][0][value]"]), t('Detailed question visible')); // Dependant on the question setting
|
||||
$this->assertText(t($this->faq1["body[$langcode][0][value]"]), t('Answer visible'));
|
||||
$this->assertText(t($this->faq1["body[$langcode][0][value]"]), t('Answer visible'));
|
||||
|
||||
// Enable categorisation of FAQ nodes
|
||||
// Create and log in user with create and administer FAQ permissions
|
||||
@@ -290,7 +290,7 @@ class CreateFaqTestCase extends FaqTestCase {
|
||||
$this->drupalLogout();
|
||||
|
||||
$this->drupalLogin($view_faq_user);
|
||||
$this->drupalGet('faq-page');
|
||||
$this->drupalGet(_faq_path());
|
||||
$this->assertText(t('Frequently Asked Questions'), t('FAQ page is available for view faq page permissions.'));
|
||||
$this->assertText($this->faq1['title'], t('Created FAQ node 1 available on FAQ page.'));
|
||||
$this->assertText($this->faq1[$this->instance['field_name'] . '[' . $langcode .']'], t('Term for node 1 not available on FAQ page.'));
|
||||
@@ -323,7 +323,7 @@ class CRAUDFaqTestCase extends FaqTestCase {
|
||||
public function testFaqCreate() {
|
||||
|
||||
// Verify that logged in user has no access to the faq page
|
||||
$this->faqVerifyNoAccess('faq-page');
|
||||
$this->faqVerifyNoAccess(_faq_path());
|
||||
|
||||
// Log in user with create FAQ permissions
|
||||
$this->drupalLogin($this->faq_user);
|
||||
@@ -353,7 +353,7 @@ class CRAUDFaqTestCase extends FaqTestCase {
|
||||
$this->drupalLogin($faq_view_user);
|
||||
|
||||
// Verify visibility on faq page
|
||||
$this->drupalGet('faq-page'); // Load faq page
|
||||
$this->drupalGet(_faq_path()); // Load faq page
|
||||
$this->assertText($edit['title']); // Node should be listed here
|
||||
$this->drupalGet('node/' . $node->nid); // It should also be possible to open the node directly
|
||||
|
||||
|
@@ -63,7 +63,7 @@ function template_preprocess_faq_category_hide_answer(&$variables) {
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == _faq_path()) {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
@@ -85,7 +85,7 @@ function template_preprocess_faq_category_hide_answer(&$variables) {
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
if (module_exists('taxonomy_image') && function_exists('taxonomy_image_display')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ function template_preprocess_faq_category_hide_answer(&$variables) {
|
||||
|
||||
// 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-page') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != _faq_path()) || $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);
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,7 @@ function template_preprocess_faq_category_new_page(&$variables) {
|
||||
// Initialise some variables.
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == _faq_path()) {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
@@ -83,7 +83,7 @@ function template_preprocess_faq_category_new_page(&$variables) {
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
if (module_exists('taxonomy_image') && function_exists('taxonomy_image_display')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ function template_preprocess_faq_category_new_page(&$variables) {
|
||||
|
||||
// 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-page') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != _faq_path()) || $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);
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ function template_preprocess_faq_category_questions_inline(&$variables) {
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == _faq_path()) {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
@@ -107,7 +107,7 @@ function template_preprocess_faq_category_questions_inline(&$variables) {
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
if (module_exists('taxonomy_image') && function_exists('taxonomy_image_display')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ function template_preprocess_faq_category_questions_inline(&$variables) {
|
||||
|
||||
// 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-page') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != _faq_path()) || $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);
|
||||
}
|
||||
|
||||
|
@@ -103,7 +103,7 @@ function template_preprocess_faq_category_questions_top(&$variables) {
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == _faq_path()) {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
@@ -128,7 +128,7 @@ function template_preprocess_faq_category_questions_top(&$variables) {
|
||||
|
||||
// Get taxonomy image.
|
||||
$variables['term_image'] = '';
|
||||
if (module_exists('taxonomy_image')) {
|
||||
if (module_exists('taxonomy_image') && function_exists('taxonomy_image_display')) {
|
||||
$variables['term_image'] = taxonomy_image_display($term->tid, array('class' => 'faq-tax-image'));
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ function template_preprocess_faq_category_questions_top(&$variables) {
|
||||
|
||||
// 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-page') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != _faq_path()) || $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);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ function template_preprocess_faq_category_questions_top_answers(&$variables) {
|
||||
$this_page = $_GET['q'];
|
||||
$get_child_terms = 0;
|
||||
// Check if we're on a faq page.
|
||||
if (arg(0) == 'faq-page') {
|
||||
if (arg(0) == _faq_path()) {
|
||||
// Check if we're on a categorized faq page.
|
||||
if (is_numeric(arg(1))) {
|
||||
$get_child_terms = arg(1);
|
||||
@@ -277,7 +277,7 @@ function template_preprocess_faq_category_questions_top_answers(&$variables) {
|
||||
|
||||
// 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-page') || $hide_child_terms) && $category_display == 'hide_qa')) {
|
||||
if (($get_child_terms && $category_display == 'categories_inline') || ((($show_term_page_children && $this_page != _faq_path()) || $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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user