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!

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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,475
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice