Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backup Wizard customization

Discussion in 'User Experience' started by Amber Layton, Oct 26, 2016.

Tags:
  1. Amber Layton

    Amber Layton Registered

    Joined:
    Sep 23, 2015
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Washington State
    cPanel Access Level:
    Root Administrator
    I am needing to customize /backups/wizard-fullbackup.html.tt so it will disable the "Generate Full Backup" if one already exists.

    I'm new to cPanel development, and am a little lost on what to change here.

    I see the file variable set as [% hashref.file.uri() %] within this FOREACH statement:
    [% FOREACH hashref IN backups_list_full_backups %]

    I don't want it in a FOREACH statement, I need it to be standalone code that either displays the generate button or not. Would I use isset? If so, what would be the syntax?

    Thanks
     
  2. Amber Layton

    Amber Layton Registered

    Joined:
    Sep 23, 2015
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Washington State
    cPanel Access Level:
    Root Administrator
    I figured it out - if anyone else needs this functionality, replace this code:

    Code:
      <div class="section">
                <h2 id="hdrGenerateFullBackup">[% locale.maketext("Generate a Full Backup") %]</h2>
             <form id="formDoFullBackup" action="wizard-dofullbackup.html" method="post" enctype="multipart/form-data" name="mainform">
                    [% INCLUDE "fullbackup-include.html.tt" %]
                </form>
    
            </div>
    
    With this code (tailor to your liking):

    Code:
    [% IF hashref.file.uri() %]
    <p class="bg-danger" style="padding: 15px;-webkit-border-radius: 5px; -khtml-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; ">
    You cannot generate a backup while one exists on the server. Please delete the file(s) above from the <a href="../filemanager/index.html">File Manager</a> before creating a new backup.
    </p>
    [% ELSE %]
      <div class="section">
                <h2 id="hdrGenerateFullBackup">[% locale.maketext("Generate a Full Backup") %]</h2>
             <form id="formDoFullBackup" action="wizard-dofullbackup.html" method="post" enctype="multipart/form-data" name="mainform">
                    [% INCLUDE "fullbackup-include.html.tt" %]
                </form>
    
            </div>
    [% END %]
    
     
    cPanelMichael likes this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Amber Layton,

    Thank you for taking the time to post the solution here for other members to see.

    Let us know if you have any additional questions.

    Thanks!
     
Loading...

Share This Page