@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb008 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
tmpl
/
cms
/
Path :
Upload File :
New :
File
Dir
//homepage/v-mt/tmpl/cms/search_replace.tmpl
<mt:setvarblock name="page_title"><__trans phrase="Search & Replace"></mt:setvarblock> <mt:setvarblock name="html_head" append="1"> <script type="text/javascript"> <!-- var tableSelect; function init() { // setup tableSelect = new TC.TableSelect( "<$mt:var name="object_type"$>-listing-table" ); tableSelect.rowSelect = true; <mt:unless name="have_results"> getByID('search').focus(); </mt:unless> } TC.attachLoadEvent( init ); function toggleVisibility(c, s) { var e = getByID(s); if (e) { if (c.checked) e.style.display = 'block'; if (!c.checked) e.style.display = 'none'; } } function toggleSearchAndReplace(selection) { var s = getByID('search-bar-search-field'); var r = getByID('search-bar-replace-fields'); var sa = getByID('search-bar-advanced-search'); var ra = getByID('search-bar-advanced-replace'); if (s && r) { if (selection.value == 'search') { s.style.display = 'block'; sa.style.display = 'block'; r.style.display = 'none'; ra.style.display = 'none'; } else if (selection.value == 'replace') { r.style.display = 'block'; ra.style.display = 'block'; s.style.display = 'none'; sa.style.display = 'none'; } } } function reSearch(type) { if (type && (document.search_form['_type'].value != type)) { if (document.search_form['orig_search'] && document.search_form['orig_search'].value != '') { document.search_form['do_search'].value = '1'; } document.search_form['_type'].value = type; document.search_form.submit(); } return false; } function unLimit(newLimit) { document.search_form['limit'].value = newLimit; document.search_form['do_search'].value = '1'; document.search_form.submit(); return false; } function doSearch() { document.search_form['limit'].value = ''; document.search_form['do_search'].value = '1'; document.search_form.submit(); } function doReplace() { // gather ids from checked items listed and put them in the // hidden 'id' field in the search form var ids = new Array(); var div = TC.elementOrId("<$mt:var name="object_type"$>-listing"); var inputs = TC.getElementsByTagAndClassName('input', 'select', div); for (var i = 0; i < inputs.length; i++) { if (inputs[i].checked) { if (inputs[i].value != 'all') ids[ids.length] = inputs[i].value; } } if (ids.length) { document.search_form['replace_ids'].value = ids.join(','); document.search_form['do_replace'].value = '1'; document.search_form.submit(); } else { alert("<__trans phrase="You must select one or more item to replace.">"); } return false; } function focusDateFields(s) { var dateFields = new Array(getByID('datefrom_year'),getByID('datefrom_month'),getByID('datefrom_day'),getByID('dateto_year'),getByID('dateto_month'),getByID('dateto_day')); var datesDisbaled = getByID('dates-disabled'); if (datesDisbaled && (datesDisbaled.value == 1)) { for (var i = 0; i < dateFields.length; i++) { dateFields[i].value = ''; dateFields[i].style.color = '#000'; } datesDisbaled.value = 0; } } function blurDateFields(s) { var dateFields = new Array(getByID('datefrom_year'),getByID('datefrom_month'),getByID('datefrom_day'),getByID('dateto_year'),getByID('dateto_month'),getByID('dateto_day')); var datesDisbaled = getByID('dates-disabled'); var allEmpty = 1; if (datesDisbaled && (datesDisbaled.value == 0)) { for (var i = 0; i < dateFields.length; i++) { if (dateFields[i].value != "") { allEmpty = 0; } } if (allEmpty) { for (var i = 0; i < dateFields.length; i++) { if ((i == 0) || (i == 3)) dateFields[i].value = 'YYYY'; if ((i == 1) || (i == 4)) dateFields[i].value = 'MM'; if ((i == 2) || (i == 5)) dateFields[i].value = 'DD'; dateFields[i].style.color = '#999'; } datesDisbaled.value = 1; } } } //--> </script> </mt:setvarblock> <mt:include name="include/header.tmpl"> <div id="search-form"> <form name="search_form" method="post" action="<mt:var name="script_url">"> <input type="hidden" name="__mode" value="search_replace" /> <input type="hidden" name="_type" value="<mt:var name="object_type">" /> <input type="hidden" name="limit" value="<mt:unless name="limit_all"><mt:var name="limit" escape="html"></mt:unless>" /> <mt:if name="blog_id"> <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" /> </mt:if> <mt:if name="entry_type"> <input type="hidden" name="entry_type" value="<mt:var name="entry_type">" /> </mt:if> <mt:if name="searched"><mt:if name="search"> <input type="hidden" name="orig_search" value="<mt:var name="search" escape="html">" /></mt:if> </mt:if> <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> <input type="hidden" name="return_args" value="<mt:if name="search">search=<mt:var name="search" escape="html">&</mt:if><mt:var name="return_args" escape="html">" /> <input type="hidden" name="replace_ids" value="" /> <input type="hidden" name="do_search" value="" /> <input type="hidden" name="do_replace" value="" /> <div class="tabs"> <ul><mt:loop name="search_tabs"> <li<mt:if name="object_type" eq="$key"> class="yah"</mt:if> id="results-<mt:var name="key">-tab"><a href="javascript:void(0)" onclick="reSearch('<mt:var name="key">'); return false"><span><mt:var name="label"></span></a></li> </mt:loop></ul> </div> <div class="search-bar"> <div class="search-bar-inner"> <mt:if name="have_results"> <mt:if name="can_replace"> <div class="search-bar-toggle"> <label for="search-replace-toggle-search"><input type="radio" id="search-replace-toggle-search" name="search-replace-toggle" value="search" checked="checked" class="rb" onclick="toggleSearchAndReplace(this)" /> <__trans phrase="Search Again"></label> <label for="search-replace-toggle-replace"><input type="radio" id="search-replace-toggle-replace" name="search-replace-toggle" value="replace" class="rb" onclick="toggleSearchAndReplace(this)" /> <__trans phrase="Search & Replace"></label> </div> </mt:if> </mt:if> <div id="search-bar-search-field" class="pkg"> <input name="search" id="search" value="<mt:var name="search" escape="html">" /> <div class="search-button-wrapper"> <button onclick="doSearch()" type="submit" accesskey="s" title="<__trans phrase="Submit search (s)">" id="search-button" class="big-button primary-button" ><__trans phrase="Search"></button> </div> </div> <mt:if name="have_results"> <div id="search-bar-replace-fields" style="display: none;"> <div class="search-bar-replace-wrapper pkg"> <div class="search-bar-replace-label"><label for="search-alt"><__trans phrase="Search"></label></div> <div class="search-bar-replace-field"><input name="search-alt" id="search-alt" value="<mt:var name="search" escape="html">" disabled="disabled" /></div> </div> <div class="search-bar-replace-wrapper pkg"> <div class="search-bar-replace-label"><label for="replace"><__trans phrase="Replace"></label></div> <div class="search-bar-replace-field"> <input name="replace" id="replace" value="<mt:var name="replace" escape="html">" /> <button onclick="doReplace(); return false" type="submit" id="replace-button" class="big-button primary-button" ><__trans phrase="Replace Checked"></button> </div> </div> </div> </mt:if> <div id="search-bar-advanced-search"> <label for="case"><input type="checkbox" id="case" name="case" value="1"<mt:if name="case"> checked="checked"</mt:if> class="cb" /> <__trans phrase="Case Sensitive"></label> <label for="is_regex"><input type="checkbox" id="is_regex" name="is_regex" value="1"<mt:if name="is_regex"> checked="checked"</mt:if> class="cb" /> <__trans phrase="Regex Match"></label> <label for="is_limited"><input type="checkbox" id="is_limited" name="is_limited" value="1"<mt:if name="is_limited"> checked="checked"</mt:if> class="cb" onclick="toggleVisibility(this, 'limited-fields')" /> <__trans phrase="Limited Fields"></label> <mt:if name="can_search_by_date"> <label for="is_dateranged"><input type="checkbox" id="is_dateranged" name="is_dateranged" value="1"<mt:if name="is_dateranged"> checked="checked"</mt:if> class="cb" onclick="toggleVisibility(this, 'date-range')" /> <__trans phrase="Date Range"></label> </mt:if> <mt:if name="can_search_junk"> <label for="is_junk"><input type="checkbox" id="is_junk" name="is_junk" value="1"<mt:if name="is_junk"> checked="checked"</mt:if> class="cb" /> <__trans phrase="Reported as Spam?"></label> </mt:if> </div> <mt:if name="have_results"> <div id="search-bar-advanced-replace"> <label><input type="checkbox" name="replace-case" value="1"<mt:if name="case"> checked="checked"</mt:if> disabled="disabled" class="cb" /> <__trans phrase="Case Sensitive"></label> <label><input type="checkbox" name="replace-is_regex" value="1"<mt:if name="is_regex"> checked="checked"</mt:if> disabled="disabled" class="cb" /> <__trans phrase="Regex Match"></label> <label><input type="checkbox" name="replace-is_limited" value="1"<mt:if name="is_limited"> checked="checked"</mt:if> disabled="disabled" class="cb" /> <__trans phrase="Limited Fields"></label> <mt:if name="can_search_by_date"> <label><input type="checkbox" name="replace-is_dateranged" value="1"<mt:if name="is_dateranged"> checked="checked"</mt:if> disabled="disabled" class="cb" /> <__trans phrase="Date Range"></label> </mt:if> <mt:if name="can_search_junk"> <label><input type="checkbox" name="replace-is_junk" value="1"<mt:if name="is_junk"> checked="checked"</mt:if> disabled="disabled" class="cb" /> <__trans phrase="Reported as Spam?"></label> </mt:if> </div> </mt:if> </div> </div> <div class="advanced-options" id="limited-fields"<mt:unless name="is_limited"> style="display: none;"</mt:unless>> <mt:if name="search_cols"> <div id="<mt:var name="object_type">-fields"> <ul> <mt:loop name="search_cols"> <mt:if name="__first__"><li class="first"><__trans phrase="Search Fields:"></li></mt:if> <li><label for="search_cols-<mt:var name="field">"><input type="checkbox" id="search_cols-<mt:var name="field">" name="search_cols" value="<mt:var name="field">"<mt:if name="selected"> checked="checked"</mt:if> class="cb" /> <mt:var name="label"></label></li> </mt:loop> </ul> </div> </mt:if> </div> <div class="advanced-options" id="date-range"<mt:unless name="is_dateranged"> style="display: none;"</mt:unless>> <input type="hidden" name="dates-disabled" id="dates-disabled" value="<mt:if name="datefrom_year">0<mt:else>1</mt:if>" /> <ul> <li class="first"><__trans phrase="Date Range">:</li> <li><label for="datefrom_year"><__trans phrase="_DATE_FROM">:</label> <input type="text" size="4" maxlength="4" value="<mt:if name="datefrom_year"><mt:var name="datefrom_year"><mt:else>YYYY</mt:if>" name="datefrom_year" id="datefrom_year" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="datefrom_year"> class="prefilled"</mt:if> /> - <input type="text" size="2" maxlength="2" value="<mt:if name="datefrom_month"><mt:var name="datefrom_month"><mt:else>MM</mt:if>" name="datefrom_month" id="datefrom_month" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="datefrom_month"> class="prefilled"</mt:if> /> - <input type="text" size="2" maxlength="2" value="<mt:if name="datefrom_day"><mt:var name="datefrom_day"><mt:else>DD</mt:if>" name="datefrom_day" id="datefrom_day" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="datefrom_day"> class="prefilled"</mt:if> /></li> <li><label for="dateto_year"><__trans phrase="_DATE_TO">:</label> <input type="text" size="4" maxlength="4" value="<mt:if name="dateto_year"><mt:var name="dateto_year"><mt:else>YYYY</mt:if>" name="dateto_year" id="dateto_year" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="dateto_year"> class="prefilled"</mt:if> /> - <input type="text" size="2" maxlength="2" value="<mt:if name="dateto_month"><mt:var name="dateto_month"><mt:else>MM</mt:if>" name="dateto_month" id="dateto_month" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="dateto_month"> class="prefilled"</mt:if> /> - <input type="text" size="2" maxlength="2" value="<mt:if name="dateto_day"><mt:var name="dateto_day"><mt:else>DD</mt:if>" name="dateto_day" id="dateto_day" onfocus="focusDateFields(this)" onblur="blurDateFields(this)"<mt:if name="dateto_day"> class="prefilled"</mt:if> /></li> </ul> </div> </form> </div> <mt:if name="replace_count"> <mtapp:statusmsg id="replace-count" class="success"> <__trans phrase="Successfully replaced [quant,_1,record,records]." params="<mt:var name="replace_count">"> </mtapp:statusmsg> </mt:if> <mt:if name="have_more"> <p><__trans phrase="Showing first [_1] results." params="<mt:var name="limit" escape="html">"> <a href="javascript:void(0)" onclick="return unLimit('all'); return false"><__trans phrase="Show all matches"></a></p> <mt:else> <mt:if name="have_results"> <p><__trans phrase="[quant,_1,result,results] found" params="<mt:var name="count_matches">"></p> </mt:if> </mt:if> <mt:if name="searched" id="search_results"> <mt:ignore>Search results will be placed here from app code.</mt:ignore> </mt:if> <mt:if name="error"> <mtapp:statusmsg id="generic-error" class="error"> <mt:var name="error"> </mtapp:statusmsg> </mt:if> <mt:include name="include/footer.tmpl">