-250 Removals
+109 Additions

Created by:phpboost

# IF C_QUESTIONS # # IF C_QUESTIONS #
<script> <script>
<!-- <!--
# IF C_MODERATION # var questions_number = {QUESTIONS_NUMBER};
var FaqQuestions = function(id){
this.id = id;
this.questions_number = {QUESTIONS_NUMBER};
};
FaqQuestions.prototype = { function delete_question(id_question)
init_sortable : function() { {
jQuery("ul#questions-list").sortable({
handle: '.sortable-selector',
placeholder: '<div class="dropzone">' + ${escapejs(LangLoader::get_message('position.drop_here', 'common'))} + '</div>'
});
},
serialize_sortable : function() {
jQuery('#tree').val(JSON.stringify(this.get_sortable_sequence()));
},
get_sortable_sequence : function() {
var sequence = jQuery("ul#questions-list").sortable("serialize").get();
return sequence[0];
},
change_reposition_pictures : function() {
sequence = this.get_sortable_sequence();
var length = sequence.length;
for(var i = 0; i < length; i++)
{
if (jQuery('#list-' + sequence[i].id).is(':first-child'))
jQuery("#move-up-" + sequence[i].id).hide();
else
jQuery("#move-up-" + sequence[i].id).show();
if (jQuery('#list-' + sequence[i].id).is(':last-child'))
jQuery("#move-down-" + sequence[i].id).hide();
else
jQuery("#move-down-" + sequence[i].id).show();
}
}
};
var FaqQuestion = function(id, faq_questions){
this.id = id;
this.FaqQuestions = faq_questions;
if (FaqQuestions.questions_number > 1)
FaqQuestions.change_reposition_pictures();
};
FaqQuestion.prototype = {
delete : function() {
if (confirm(${escapejs(LangLoader::get_message('confirm.delete', 'status-messages-common'))})) if (confirm(${escapejs(LangLoader::get_message('confirm.delete', 'status-messages-common'))}))
{ {
jQuery.ajax({ jQuery.ajax({
url: '${relative_url(FaqUrlBuilder::ajax_delete())}', url: '${relative_url(FaqUrlBuilder::ajax_delete())}',
type: "post", type: "post",
dataType: "json", dataType: "json",
data: {'id' : this.id, 'token' : '{TOKEN}'}, data: {'id' : id_question, 'token' : '{TOKEN}'},
success: function(returnData) { success: function(returnData) {
if(returnData.code > 0) { if(returnData.code > 0) {
jQuery("#list-" + returnData.code).remove(); jQuery("#question-" + returnData.code).remove();
# IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN # # IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN #
jQuery("#title-question-" + returnData.code).remove(); jQuery("#title-question-" + returnData.code).remove();
# ENDIF # # ENDIF #
FaqQuestions.init_sortable(); if (returnData.questions_number == 0) {
FaqQuestions.questions_number--;
FaqQuestions.change_reposition_pictures();
if (FaqQuestions.questions_number == 1) {
jQuery("#position-update-button").hide();
} else if (FaqQuestions.questions_number == 0) {
jQuery("#position-update-form").hide();
# IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN # # IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN #
jQuery("#questions-titles-list").hide(); jQuery("#questions-titles-list").hide();
# ENDIF # # ENDIF #
jQuery("#no-item-message").show(); jQuery("#no-item-message").show();
} }
} }
} }
}); });
} }
} }
};
var FaqQuestions = new FaqQuestions('questions-list');
jQuery(document).ready(function() {
FaqQuestions.init_sortable();
jQuery('li.sortable-element').on('mouseout',function(){
FaqQuestions.change_reposition_pictures();
});
});
# ELSE #
var questions_number = {QUESTIONS_NUMBER};
function delete_question(id_question)
{
if (confirm(${escapejs(LangLoader::get_message('confirm.delete', 'status-messages-common'))}))
{
jQuery.ajax({
url: '${relative_url(FaqUrlBuilder::ajax_delete())}',
type: "post",
dataType: "json",
data: {'id' : id_question, 'token' : '{TOKEN}'},
success: function(returnData) {
if(returnData.code > 0) {
jQuery("#question-" + returnData.code).remove();
# IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN #
jQuery("#title-question-" + returnData.code).remove();
# ENDIF #
if (returnData.questions_number == 0) {
# IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN #
jQuery("#questions-titles-list").hide();
# ENDIF #
jQuery("#no-item-message").show();
}
}
}
});
}
}
# ENDIF #
# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN # # IF C_DISPLAY_TYPE_ANSWERS_HIDDEN #
function show_answer(id_question) function show_answer(id_question)
{ {
if (jQuery("#question" + id_question)) { if (jQuery("#question" + id_question)) {
if(jQuery("#answer" + id_question).css('display') == 'none') if(jQuery("#answer" + id_question).css('display') == 'none')
{ {
jQuery("#answer" + id_question).fadeIn(); jQuery("#answer" + id_question).fadeIn();
jQuery("#question" + id_question).removeClass('fa-caret-right'); jQuery("#question" + id_question).removeClass('fa-caret-right');
jQuery("#question" + id_question).addClass('fa-caret-down'); jQuery("#question" + id_question).addClass('fa-caret-down');
} }
else else
{ {
jQuery("#answer" + id_question).fadeOut(); jQuery("#answer" + id_question).fadeOut();
jQuery("#question" + id_question).removeClass('fa-caret-down'); jQuery("#question" + id_question).removeClass('fa-caret-down');
jQuery("#question" + id_question).addClass('fa-caret-right'); jQuery("#question" + id_question).addClass('fa-caret-right');
}
} }
} }
}
jQuery(document).ready(function() { jQuery(document).ready(function() {
var anchor = window.location.hash; var anchor = window.location.hash;
var id_question; var id_question;
id_question = anchor.substring(9,anchor.length); id_question = anchor.substring(9,anchor.length);
if (anchor.substring(0,9) == "#question" && id_question.match(/^[0-9]+$/)) if (anchor.substring(0,9) == "#question" && id_question.match(/^[0-9]+$/))
show_answer(id_question); show_answer(id_question);
}); });
# ENDIF # # ENDIF #
--> -->
</script> </script>
# ENDIF # # ENDIF #
# INCLUDE MSG # # INCLUDE MSG #
<section id="module-faq"> <section id="module-faq">
<header> <header>
<div class="cat-actions">
<a href="${relative_url(SyndicationUrlBuilder::rss('faq', ID_CAT))}" aria-label="${LangLoader::get_message('syndication', 'common')}"><i class="fa fa-syndication" aria-hidden="true" title="${LangLoader::get_message('syndication', 'common')}"></i></a>
# IF C_CATEGORY #
# IF C_DISPLAY_REORDER_LINK #
<a href="{U_REORDER_QUESTIONS}" aria-label="{@faq.reorder_questions}"><i class="fa fa-exchange-alt fa-fw" aria-hidden="true" title="{@faq.reorder_questions}"></i></a>
# ENDIF #
# IF IS_ADMIN #
<a href="{U_EDIT_CATEGORY}" aria-label="${LangLoader::get_message('edit', 'common')}"><i class="fa fa-edit fa-fw" aria-hidden="true" title="${LangLoader::get_message('edit', 'common')}"></i></a>
# ENDIF #
# ENDIF #
</div>
<h1> <h1>
<a href="${relative_url(SyndicationUrlBuilder::rss('faq', ID_CAT))}" title="${LangLoader::get_message('syndication', 'common')}"><i class="fa fa-syndication"></i></a> # IF C_PENDING #
# IF C_PENDING #{@faq.pending}# ELSE #{@module_title}# IF NOT C_ROOT_CATEGORY # - {CATEGORY_NAME}# ENDIF ## ENDIF # # IF C_CATEGORY ## IF IS_ADMIN #<a href="{U_EDIT_CATEGORY}" title="${LangLoader::get_message('edit', 'common')}"><i class="fa fa-edit smaller"></i></a># ENDIF ## ENDIF # {@faq.pending}
# ELSE #
{@module_title}# IF NOT C_ROOT_CATEGORY # - {CATEGORY_NAME}# ENDIF #
# ENDIF #
</h1> </h1>
# IF C_CATEGORY_DESCRIPTION #
<div class="cat-description">
{CATEGORY_DESCRIPTION}
</div>
# ENDIF #
</header> </header>
# IF C_CATEGORY_DESCRIPTION #
<div class="cat-description">
{CATEGORY_DESCRIPTION}
</div>
# ENDIF #
# IF C_SUB_CATEGORIES # # IF C_SUB_CATEGORIES #
<div class="subcat-container elements-container# IF C_SEVERAL_CATS_COLUMNS # columns-{NUMBER_CATS_COLUMNS}# ENDIF #"> <div class="subcat-container elements-container# IF C_SEVERAL_CATS_COLUMNS # columns-{NUMBER_CATS_COLUMNS}# ENDIF #">
# START sub_categories_list # # START sub_categories_list #
<div class="subcat-element block"> <div class="subcat-element block">
<div class="subcat-content"> <div class="subcat-content">
# IF sub_categories_list.C_CATEGORY_IMAGE #<a itemprop="about" href="{sub_categories_list.U_CATEGORY}"><img itemprop="thumbnailUrl" src="{sub_categories_list.CATEGORY_IMAGE}" alt="{sub_categories_list.CATEGORY_NAME}" /></a># ENDIF # # IF sub_categories_list.C_CATEGORY_IMAGE #
<br /> <a class="subcat-thumbnail" itemprop="about" href="{sub_categories_list.U_CATEGORY}" title="{sub_categories_list.CATEGORY_NAME}">
<a itemprop="about" href="{sub_categories_list.U_CATEGORY}">{sub_categories_list.CATEGORY_NAME}</a> <img itemprop="thumbnailUrl" src="{sub_categories_list.CATEGORY_IMAGE}" alt="{sub_categories_list.CATEGORY_NAME}" />
<br /> </a>
<span class="small">{sub_categories_list.QUESTIONS_NUMBER} # IF sub_categories_list.C_MORE_THAN_ONE_QUESTION #${TextHelper::lcfirst(LangLoader::get_message('faq.questions', 'common', 'faq'))}# ELSE #${TextHelper::lcfirst(LangLoader::get_message('faq.form.question', 'common', 'faq'))}# ENDIF #</span> # ENDIF #
<a class="subcat-title" itemprop="about" href="{sub_categories_list.U_CATEGORY}">{sub_categories_list.CATEGORY_NAME}</a>
<span class="subcat-options">{sub_categories_list.QUESTIONS_NUMBER} # IF sub_categories_list.C_MORE_THAN_ONE_QUESTION #${TextHelper::lcfirst(LangLoader::get_message('faq.questions', 'common', 'faq'))}# ELSE #${TextHelper::lcfirst(LangLoader::get_message('faq.form.question', 'common', 'faq'))}# ENDIF #</span>
</div> </div>
</div> </div>
# END sub_categories_list # # END sub_categories_list #
<div class="spacer"></div> <div class="spacer"></div>
</div> </div>
# IF C_SUBCATEGORIES_PAGINATION #<span class="center"># INCLUDE SUBCATEGORIES_PAGINATION #</span># ENDIF # # IF C_SUBCATEGORIES_PAGINATION #<span class="center"># INCLUDE SUBCATEGORIES_PAGINATION #</span># ENDIF #
# ELSE # # ELSE #
<div class="spacer"></div> <div class="spacer"></div>
# ENDIF # # ENDIF #
# IF C_QUESTIONS # # IF C_QUESTIONS #
# IF C_PENDING # # IF C_PENDING #
# IF C_MORE_THAN_ONE_QUESTION # # IF C_MORE_THAN_ONE_QUESTION #
# INCLUDE SORT_FORM # # INCLUDE SORT_FORM #
<div class="spacer"></div> <div class="spacer"></div>
# ENDIF # # ENDIF #
# ENDIF # # ENDIF #
# IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN # # IF NOT C_DISPLAY_TYPE_ANSWERS_HIDDEN #
<div id="questions-titles-list"> <div id="questions-titles-list">
<ol> <ol>
# START questions # # START questions #
<li id="title-question-{questions.ID}"# IF questions.C_NEW_CONTENT # class="new-content"# ENDIF #> <li id="title-question-{questions.ID}"# IF questions.C_NEW_CONTENT # class="new-content"# ENDIF #>
<a href="#question{questions.ID}">{questions.QUESTION}</a> <a href="#question{questions.ID}">{questions.QUESTION}</a>
</li> </li>
# END questions # # END questions #
</ol> </ol>
<hr /> <hr />
</div> </div>
# ENDIF # # ENDIF #
<div class="content elements-container"> <div class="elements-container">
# IF C_MODERATION # # START questions #
<form action="{REWRITED_SCRIPT}" method="post" id="position-update-form" onsubmit="FaqQuestions.serialize_sortable();"> <article id="article-faq-{questions.ID}" itemscope="itemscope" itemtype="http://schema.org/CreativeWork" class="article-faq article-several# IF questions.C_NEW_CONTENT # new-content# ENDIF #">
<fieldset id="questions-management"> <header class="faq-question-element">
<ul id="questions-list" class="sortable-block"> <h3 class="question-title">
# START questions # # IF questions.C_ACTION_USER #
<li class="sortable-element# IF questions.C_NEW_CONTENT # new-content# ENDIF #" id="list-{questions.ID}" data-id="{questions.ID}"> <span class="actions"><a href="{questions.U_LINK}" aria-label="{questions.L_LINK_QUESTION}"><i class="fa fa-hand-point-right fa-fw" aria-hidden="true" title="{questions.L_LINK_QUESTION}"></i></a></span>
<div class="sortable-selector" title="${LangLoader::get_message('position.move', 'common')}"></div> # ELSE #
<div class="sortable-title"> <span class="actions actions-menu question-actions" id="question-{questions.ID}-actions">
<h3 class="question-title"> <a href="" title="{@faq.actions.menu}" class="actions-title" onclick="open_submenu('question-{questions.ID}-actions', 'opened', 'question-actions');return false;"><i class="fa fa-actions-menu"></i></a>
# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN # <ul class="actions-submenu">
<a href="" onclick="show_answer({questions.ID});return false;" title="{questions.L_SHOW_ANSWER}"><i id="question{questions.ID}" class="fa fa-caret-right question-anchor"></i></a> <li class="action"><a href="{questions.U_LINK}" title="{questions.L_LINK_QUESTION}" onclick="copy_to_clipboard('{questions.U_ABSOLUTE_LINK}');"><i class="fa fa-hand-point-right fa-fw" aria-hidden="true"></i> {questions.L_LINK_QUESTION}</a></li>
<a href="" onclick="show_answer({questions.ID});return false;" title="{questions.QUESTION}">{questions.QUESTION}</a> # IF questions.C_EDIT #
# ELSE # <li class="action"><a href="{questions.U_EDIT}" title="${LangLoader::get_message('edit', 'common')}"><i class="fa fa-edit fa-fw" aria-hidden="true"></i> ${LangLoader::get_message('edit', 'common')}</a></li>
<i id="question{questions.ID}" class="fa fa-caret-right question-anchor"></i> # ENDIF #
<span>{questions.QUESTION}</span> # IF questions.C_DELETE #
# ENDIF # <li class="action"><a href="" onclick="delete_question({questions.ID});return false;" title="${LangLoader::get_message('delete', 'common')}"><i class="fa fa-delete" aria-hidden="true"></i> ${LangLoader::get_message('delete', 'common')}</a></li>
</h3> # ENDIF #
<div class="sortable-actions"> </ul>
# IF C_MORE_THAN_ONE_QUESTION #
<a href="" title="${LangLoader::get_message('position.move_up', 'common')}" id="move-up-{questions.ID}" onclick="return false;"><i class="fa fa-arrow-up"></i></a>
<a href="" title="${LangLoader::get_message('position.move_down', 'common')}" id="move-down-{questions.ID}" onclick="return false;"><i class="fa fa-arrow-down"></i></a>
# ENDIF #
<a href="{questions.U_EDIT}" title="${LangLoader::get_message('edit', 'common')}"><i class="fa fa-edit"></i></a>
<a href="" onclick="return false;" title="${LangLoader::get_message('delete', 'common')}" id="delete-{questions.ID}"><i class="fa fa-delete"></i></a>
</div>
<div id="answer{questions.ID}" class="faq-answer-container"# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN # style="display: none;"# ENDIF #>
<div itemprop="text">{questions.ANSWER}</div>
</div>
</div>
<div class="spacer"></div>
<script>
<!--
jQuery(document).ready(function() {
var faq_question = new FaqQuestion({questions.ID}, FaqQuestions);
jQuery('#delete-{questions.ID}').on('click',function(){
faq_question.delete();
});
if (FaqQuestions.questions_number > 1) {
jQuery('#move-up-{questions.ID}').on('click',function(){
var li = jQuery(this).closest('li');
li.insertBefore( li.prev() );
FaqQuestions.change_reposition_pictures();
});
jQuery('#move-down-{questions.ID}').on('click',function(){
var li = jQuery(this).closest('li');
li.insertAfter( li.next() );
FaqQuestions.change_reposition_pictures();
});
}
});
-->
</script>
</li>
# END questions #
</ul>
</fieldset>
# IF C_MORE_THAN_ONE_QUESTION #
<fieldset class="fieldset-submit" id="position-update-button">
<button type="submit" name="submit" value="true" class="submit">${LangLoader::get_message('position.update', 'common')}</button>
<input type="hidden" name="token" value="{TOKEN}">
<input type="hidden" name="tree" id="tree" value="">
</fieldset>
# ENDIF #
</form>
# ELSE #
# START questions #
<article id="article-faq-{questions.ID}" itemscope="itemscope" itemtype="http://schema.org/CreativeWork" class="article-faq article-several# IF questions.C_NEW_CONTENT # new-content# ENDIF #">
<header class="faq-question-element">
<h3 class="question-title">
# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN #
<a href="" onclick="show_answer({questions.ID});return false;" title="{questions.L_SHOW_ANSWER}"><i id="question{questions.ID}" class="fa fa-caret-right question-anchor"></i></a>
<a href="" onclick="show_answer({questions.ID});return false;" title="{questions.QUESTION}"><span itemprop="name">{questions.QUESTION}</span></a>
# ELSE #
<i id="question{questions.ID}" class="fa fa-caret-right question-anchor"></i>
<span itemprop="name">{questions.QUESTION}</span>
# ENDIF #
</h3>
<span class="actions">
<a href="{questions.U_LINK}" title="{questions.L_LINK_QUESTION}"><i class="fa fa-flag"></i></a>
# IF questions.C_EDIT #
<a href="{questions.U_EDIT}" title="${LangLoader::get_message('edit', 'common')}"><i class="fa fa-edit"></i></a>
# ENDIF #
# IF questions.C_DELETE #
<a href="" onclick="delete_question({questions.ID});return false;" title="${LangLoader::get_message('delete', 'common')}"><i class="fa fa-delete"></i></a>
# ENDIF #
</span> </span>
# ENDIF #
<meta itemprop="url" content="{questions.U_LINK}">
</header> # IF C_DISPLAY_TYPE_ANSWERS_HIDDEN #
<a href="" onclick="show_answer({questions.ID});return false;" title="{questions.L_SHOW_ANSWER}"><i id="question{questions.ID}" class="fa fa-caret-right fa-fw question-anchor"></i></a>
<div class="content"> <a href="" onclick="show_answer({questions.ID});return false;" title="{questions.QUESTION}"><span itemprop="name">{questions.QUESTION}</span></a>
<div id="answer{questions.ID}" class="faq-answer-container"# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN # style="display: none;"# ENDIF #> # ELSE #
<div itemprop="text">{questions.ANSWER}</div> <i id="question{questions.ID}" class="fa fa-caret-right fa-fw question-anchor"></i>
</div> <span itemprop="name">{questions.QUESTION}</span>
</div> # ENDIF #
</h3>
<footer></footer> <meta itemprop="url" content="{questions.U_LINK}">
</article> </header>
# END questions #
# ENDIF # <div id="answer{questions.ID}" class="content faq-answer-container"# IF C_DISPLAY_TYPE_ANSWERS_HIDDEN # style="display: none;"# ENDIF #>
<div itemprop="text">{questions.ANSWER}</div>
</div>
<footer></footer>
</article>
# END questions #
</div> </div>
# ENDIF # # ENDIF #
# IF NOT C_HIDE_NO_ITEM_MESSAGE # # IF NOT C_HIDE_NO_ITEM_MESSAGE #
<div id="no-item-message"# IF C_QUESTIONS # style="display: none;"# ENDIF #> <div id="no-item-message"# IF C_QUESTIONS # style="display: none;"# ENDIF #>
<div class="center"> <div class="center">
${LangLoader::get_message('no_item_now', 'common')} ${LangLoader::get_message('no_item_now', 'common')}
</div> </div>
</div> </div>
# ENDIF # # ENDIF #
<footer></footer> <footer></footer>
</section> </section>
Editor
Original Text
Changed Text
Recommended videos