pref filters index: markup cleanup

This commit is contained in:
Andrew Dolgov 2021-02-13 14:05:25 +03:00
parent 5127c29297
commit b112198991
1 changed files with 58 additions and 69 deletions

View File

@ -710,65 +710,58 @@ class Pref_Filters extends Handler_Protected {
$filter_search = ($_SESSION["prefs_filter_search"] ?? ""); $filter_search = ($_SESSION["prefs_filter_search"] ?? "");
} }
print "<div dojoType='dijit.layout.BorderContainer' gutters='false'>"; ?>
print "<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='top'>"; <div dojoType='dijit.layout.BorderContainer' gutters='false'>
print "<div dojoType='fox.Toolbar'>"; <div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='top'>
<div dojoType='fox.Toolbar'>
print "<div style='float : right; padding-right : 4px;'> <div style='float : right; padding-right : 4px;'>
<input dojoType=\"dijit.form.TextBox\" id=\"filter_search\" size=\"20\" type=\"search\" <input dojoType="dijit.form.TextBox" id="filter_search" size="20" type="search"
value=\"$filter_search\"> value="<?php echo $filter_search ?>">
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('filterTree').reload()\">". <button dojoType="dijit.form.Button" onclick="dijit.byId('filterTree').reload()">
__('Search')."</button> <?php echo __('Search') ?></button>
</div>";
print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('filterTree').model.setAllChecked(true)\"
dojoType=\"dijit.MenuItem\">".__('All')."</div>";
print "<div onclick=\"dijit.byId('filterTree').model.setAllChecked(false)\"
dojoType=\"dijit.MenuItem\">".__('None')."</div>";
print "</div></div>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Filters.edit()\">".
__('Create filter')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').joinSelectedFilters()\">".
__('Combine')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').editSelectedFilter()\">".
__('Edit')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').resetFilterOrder()\">".
__('Reset sort order')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').removeSelectedFilters()\">".
__('Remove')."</button> ";
print "</div>"; # toolbar
print "</div>"; # toolbar-frame
print "<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>";
print "<div id='filterlistLoading'>
<img src='images/indicator_tiny.gif'>".
__("Loading, please wait...")."</div>";
print "<div dojoType=\"fox.PrefFilterStore\" jsId=\"filterStore\"
url=\"backend.php?op=pref-filters&method=getfiltertree\">
</div> </div>
<div dojoType=\"lib.CheckBoxStoreModel\" jsId=\"filterModel\" store=\"filterStore\"
query=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Filters\" <div dojoType="fox.form.DropDownButton">
childrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\"> <span><?php echo __('Select') ?></span>
<div dojoType="dijit.Menu" style="display: none;">
<div onclick="dijit.byId('filterTree').model.setAllChecked(true)"
dojoType="dijit.MenuItem"><?php echo __('All') ?></div>
<div onclick="dijit.byId('filterTree').model.setAllChecked(false)"
dojoType="dijit.MenuItem"><?php echo __('None') ?></div>
</div> </div>
<div dojoType=\"fox.PrefFilterTree\" id=\"filterTree\" </div>
dndController=\"dijit.tree.dndSource\"
betweenThreshold=\"5\" <button dojoType="dijit.form.Button" onclick="return Filters.edit()">
model=\"filterModel\" openOnClick=\"true\"> <?php echo __('Create filter') ?></button>
<script type=\"dojo/method\" event=\"onLoad\" args=\"item\"> <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').joinSelectedFilters()">
Element.hide(\"filterlistLoading\"); <?php echo __('Combine') ?></button>
<button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').editSelectedFilter()">
<?php echo __('Edit') ?></button>
<button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').resetFilterOrder()">
<?php echo __('Reset sort order') ?></button>
<button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').removeSelectedFilters()">
<?php echo __('Remove') ?></button>
</div>
</div>
<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>
<div id='filterlistLoading'>
<img src='images/indicator_tiny.gif'> <?php echo __("Loading, please wait...") ?>
</div>
<div dojoType="fox.PrefFilterStore" jsId="filterStore"
url="backend.php?op=pref-filters&method=getfiltertree">
</div>
<div dojoType="lib.CheckBoxStoreModel" jsId="filterModel" store="filterStore"
query="{id:'root'}" rootId="root" rootLabel="Filters"
childrenAttrs="items" checkboxStrict="false" checkboxAll="false">
</div>
<div dojoType="fox.PrefFilterTree" id="filterTree" dndController="dijit.tree.dndSource"
betweenThreshold="5" model="filterModel" openOnClick="true">
<script type="dojo/method" event="onLoad" args="item">
Element.hide("filterlistLoading");
</script> </script>
<script type=\"dojo/method\" event=\"onClick\" args=\"item\"> <script type="dojo/method" event="onClick" args="item">
var id = String(item.id); var id = String(item.id);
var bare_id = id.substr(id.indexOf(':')+1); var bare_id = id.substr(id.indexOf(':')+1);
@ -776,15 +769,11 @@ class Pref_Filters extends Handler_Protected {
Filters.edit(bare_id); Filters.edit(bare_id);
} }
</script> </script>
</div>
</div>"; </div>
<?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefFilters") ?>
print "</div>"; #pane </div>
<?php
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefFilters");
print "</div>"; #container
} }
function newrule() { function newrule() {