Location: PHPKode > projects > MembersGear > membersgear/templates/admin_protected_folder.tpl
{$ADMIN_HEADER}
<div id="content" class="setdiv">
    {if $msg neq ''}
            <div {if $err eq 'true'} class="errormsg" {else} class="succmsg" {/if} style="width:500px">{$msg}</div>
           {/if} 
    <div id="full-contentdiv">
          <div class="righttop">
                <h2><center>
                     {if $IsEdit eq 'yes'}                   
                         Edit Protected folder
                     {else}
                         Add Protected folder
                     {/if}   
                    </center></h2>                                      
            </div>
         <div class="whole-page clear">
                
            <!-- Place your content here -->
                {if $IsEdit eq 'yes'}
                     {assign var="action" value="update"}
                {else}
                   
                    {assign var="action" value="insert"}
                  
                {/if}

                    <form name="addform" method="post" action="admin_protected_folder.php?action={$action}">

                         <div class="formformat">      
                                <table border="0" align="center"  width="95%" cellpadding="0" cellspacing="0">    

                                    <tbody>

                                    <tr>

                                <td class="right-side-text"><label>Folder <label class="star">*</label></label></label></td>

                                <td class="left-side-text">

                                <input type="text" name="folder"  class="txtcss" readonly size="70" {if $IsEdit eq 'yes'} value="{$folder}" {else}value="{$folder}" {/if}> 

                                 <input type="button"  onclick="window.open('../includes/phptreeview/browse_web_directory.php','treeview','height=500,width=600,scrollbars=yes');return false;" value="Browse" {if $IsEdit eq 'yes'} disabled  class="btndisabled"{else}class="btncss" {/if}> 

                                </td>
                                
                            </tr>
                                {if $IsEdit eq 'yes'}<input type="hidden" name="editId" value="{$editId}">{/if}
                

                            <tr>

                                <td class="right-side-text"><label>Protection Method <label class="star">*</label></label></label></td>

                               <td class="left-side-text">
                                     
                                     <select id="protection_method" name="protection_method" class="selectcss"  style="width:370px">
                                        <option value="">select..</option>
                                         {foreach from=$protection item="prod" key="k"}  
                                          <option value="{$protection[$k].id}"  {if $protection[$k].id eq $protection_method}selected{/if}>{if $protection[$k].value eq 'new_rewrite'} new_rewrite (recommended) {else} {$protection[$k].value} {/if}</option>
                                        {/foreach}

                                    </select>
                                        
                                     </select>       

                                 </td>

                            </tr>

                            <tr>

                                <td class="right-side-text"><label>Required Products Subscription <label class="star">*</label></label></label></td>

                               <td class="left-side-text">

                                  <select name="products[]" id="products"  multiple size="3" class="selectcss" style="width:370px;height:100px">
                                      {foreach from=$products item="prod" key="k"}
                                          <option value="{$k}" {foreach from=$editProducts item=prod1}{if $prod1 eq $k }selected{/if}{/foreach}>{$prod}</option>
                                        {/foreach}
                                    </select>
  
                                </td>

                            </tr>

                            
                            <tr>

                               <td class="right-side-text"><label>Show Invalid Access Message </label></td>

                               <td class="left-side-text">

                                 <select name="show_iam" id="show_iam" class="selectcss" style="width:370px" onChange="document.getElementById('iam_tr').style.display=this.value==0?'none':'';" >

                                    <option value=0 selected  >Don't Show</option>

                                    <option value=1 {if $invalid_access eq '1'}selected{/if}>Show</option>

                                 </select>

                                </td>

                            </tr>
                            {if $IsEdit eq 'yes' or $postback eq 'true'}
                                 {if $invalid_access eq '1'}        
                                  
                                      <tr style="" id="iam_tr">
                                  {else}
                                     <tr style="display:none" id="iam_tr">     
                                 {/if}     
                            {else}
                                <tr style="display:none" id="iam_tr">
                             {/if}   
                                 <td class="right-side-text"><label>Invalid Access Message</label><label class="star">*</label></td>

                                 <td class="left-side-text">  

                                    <textarea id="invalid_access_message" name="invalid_access_message"  style="width:363px" class="txtareacss"  cols="60">{if $invalid_access eq '1'}{$invalid_access_message}{/if}</textarea>

                                </td> 

                            </tr>
                        
                        <tr>
                            <td>
                                 &nbsp;
                            </td>
                            <td>
                                <div style="width: 350px ! important;margin:0px 0px 5px 5px !important;" class="comment-div">
                                    <strong>You may use the following Protection Method for folder protection:</strong><br/>
                                    
                                    <b>.htaccess : </b>.htaccess protects all file and it will popup login box to be displayed when member enters into protected area, and it is impossible to avoid this box with this method of protection.<br/><br/>
                                    
                                    <b>php_include : </b>This method can protect only PHP files and applications, nothing else. This method does not protect images, HTML files or downloadable content in the protected folder - it protects PHP files only.<br/><br/>
                                    
                                    <b>new_rewrite (recommended): </b>This method can protect any type of content, if the user will not logged in, user will see your login form before access the files.<br/>
                                </div>
                            </td>
                     </tr>
                        
                        <tr>
                             <td class="right-side-text">&nbsp;</td>
                             <td class="buttontd">
                                    <input class="btncss" type="submit" {if $IsEdit eq 'yes'}value="Save"{else} value="Add"{/if}>
                                    <input type="button" value="Cancel" class="btncss" onclick="javascript:window.history.go(-1);">
                             </td>
                        </tr> 
               
               </tbody>
           </table>            
            </div>

    </form>
    </div>
</div>
        
 
 </div>


{literal}
 <script language="JavaScript" type="text/javascript">
              var frmvalidator  = new Validator("addform");
              frmvalidator.EnableMsgsTogether();

              frmvalidator.addValidation("folder","req","Please select Folder..");
              frmvalidator.addValidation("protection_method","dontselect=''","Please select Protection Method.");
              frmvalidator.addValidation("products","selone_option","Please select Product."); 
              // frmvalidator.addValidation("invalid_access_message","req","Please enter Invalid Access Message..");
              frmvalidator.addValidation("invalid_access_message","maxlen=1000","Max Length for Invalid Access Message is 1000.");
              frmvalidator.setAddnlValidationFunction("accessMessageValidation"); 
              function accessMessageValidation()
                {
                  var selectedvalue=document.getElementById('show_iam').value;
                  var messval=document.getElementById('invalid_access_message').value;
                  if(selectedvalue==1)
                  {
                    if(messval=="")
                     {
                       alert("Plase enter Message..");
                       document.getElementById('invalid_access_message').focus(); 
                       return false; 
                     }
                     else
                      return true;
                  }
                  
                  
                }                                                    
                        
              
            </script>
       
<script language='javascript' type="text/javascript">

function browseForFolder(val){

  wnd = window.open('selectfolders.php',

          '', 'dependent=1,scrollbars=1,directories=0,height=550,width=450,location=0');

  wnd.focus();

}

</script>
 {/literal}

{$ADMIN_FOOTER}
Return current item: MembersGear