<!--#set global $pane="Index Sites"#-->
<!--#set global $help_uri="configure-indexers-0-7"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->

<div class="colmask">
    <form action="saveNewzbin" method="post" name="fullform" id="fullform">
    <input type="hidden" id="session" name="session" value="$session" />
    <div class="section">
        <div class="col2">
            <h3>NzbMatrix $T('accountInfo')</h3>
            <p>$T('explain-nzbmatrix')</p>
        </div><!-- /col2 -->
        <div class="col1">
            <fieldset>
                <div class="field-pair alt">
                    <label class="config" for="matrix_username">$T('opt-username_matrix')</label>
                    <input type="text" name="matrix_username" id="matrix_username" value="$matrix_username" size="30" />
                    <span class="desc">$T('explain-username_matrix')</span>
                </div>
                <div class="field-pair">
                    <label class="config" for="matrix_apikey">$T('opt-apikey_matrix')</label>
                    <input type="text" name="matrix_apikey" id="matrix_apikey" value="$matrix_apikey" size="35" />
                    <span class="desc">$T('explain-apikey_matrix')</span>
                </div>
                <div class="field-pair alt">
                    <label class="config" for="matrix_del_bookmark">$T('opt-newzbin_unbookmark')</label>
                    <input type="checkbox" name="matrix_del_bookmark" id="matrix_del_bookmark" value="1" <!--#if int($matrix_del_bookmark) > 0 then 'checked="checked"' else ""#--> />
                    <span class="desc">$T('explain-newzbin_unbookmark')</span>
                </div>
                <div class="field-pair">
                    <input type="submit" value="$T('button-saveChanges')" class="saveButton" />
                </div>
            </fieldset>
        </div><!-- /col1 -->
    </div><!-- /section -->
    <div class="padding alt">
        <input type="submit" value="$T('button-saveChanges')" class="saveButton" />
        <input type="button" value="$T('button-restart') SABnzbd" class="sabnzbd_restart" />
    </div>
    </form>
</div><!-- /colmask -->

<script>
\$(document).ready(function(){
    \$('#matrix_apikey').click(function(){ \$(this).select() });
    \$('#getBookmarks2').click(function(){ window.location='getBookmarks?session='+apikey; });
    \$('#hideBookmarks').click(function(){ window.location='hideBookmarks?session='+apikey; });
    \$('#showBookmarks').click(function(){ window.location='showBookmarks?session='+apikey; });
});
</script>
<script>
\$(document).ready(function(){
    \$('#getBookmarks').click(function(event){
      \$.ajax({
        type: "GET",
        url: "../../tapi",
        data: {mode: 'newzbin', name: 'get_bookmarks', output: 'json', apikey: '$session' },
        beforeSend: function(){
          \$('#getBookmarks').attr("disabled", "disabled");
          \$('#getBookmarks-result').removeClass("success failure").addClass("loading");
        },
        complete: function(){
          \$('#getBookmarks').removeAttr("disabled");
          \$('#getBookmarks-result').removeClass("loading");
        },
        success: function(data){
          if(data.status == true)
            \$('#getBookmarks-result').addClass("success");
          else {
            \$('#getBookmarks-result').addClass("failure")
            alert(data.error);
          }
        }
      });
    });
});
</script>

<!--#include $webdir + "/_inc_footer_uc.tmpl"#-->
