Jump to content

Hide if service is not active


Romain F.

Recommended Posts

8 hours ago, wtricks said:

I'd edit the template file adding and if. use {debug} to find the variable then enclose everything into an if

{include file="$template/pageheader.tpl" title=$domain}
{if $modulecustombuttonresult}
{if $modulecustombuttonresult == "success"}
{include file="$template/includes/alert.tpl" type="success" msg=$LANG.moduleactionsuccess textcenter=true idname="alertModuleCustomButtonSuccess"}
{else}
{include file="$template/includes/alert.tpl" type="error" msg=$LANG.moduleactionfailed|cat:' ':$modulecustombuttonresult textcenter=true idname="alertModuleCustomButtonFailed"}
{/if}
{/if}
{if $pendingcancellation}
{include file="$template/includes/alert.tpl" type="error" msg=$LANG.cancellationrequestedexplanation textcenter=true idname="alertPendingCancellation"}
{/if}
{if $unpaidInvoice}
<div class="alert alert-{if $unpaidInvoiceOverdue}danger{else}warning{/if}" id="alert{if $unpaidInvoiceOverdue}Overdue{else}Unpaid{/if}Invoice">
   <div class="pull-right">
      <a href="viewinvoice.php?id={$unpaidInvoice}" class="btn btn-xs btn-{if $unpaidInvoiceOverdue}danger{else}warning{/if}">
      {lang key='payInvoice'}
      </a>
   </div>
   {$unpaidInvoiceMessage}
</div>
{/if}
<ul class="nav nav-tabs" id="tabs">
   <li class="active"><a href="#tabOverview" data-toggle="tab">{$LANG.information}</a></li>
   {if $modulechangepassword}
   <li><a href="#tabChangepw" data-toggle="tab">{$LANG.serverchangepassword}</a></li>
   {/if}
   {if $downloads}
   <li><a href="#tabDownloads" data-toggle="tab">{$LANG.downloadstitle}</a></li>
   {/if}
   {if $addonsavailable}
   <li><a href="#tabAddons" data-toggle="tab">{$LANG.clientareahostingaddons}</a></li>
   {/if}
   {if $packagesupgrade || $configoptionsupgrade || $showcancelbutton || $modulecustombuttons}
   <li class="dropdown">
      <a class="dropdown-toggle" data-toggle="dropdown" href="#">{$LANG.productmanagementactions}</a>
      <ul class="dropdown-menu">
         {foreach from=$modulecustombuttons key=label item=command}
         <li><a href="clientarea.php?action=productdetails&amp;id={$id}&amp;modop=custom&amp;a={$command}">{$label}</a></li>
         {/foreach}
         {if $packagesupgrade}
         <li><a href="upgrade.php?type=package&amp;id={$id}">{$LANG.upgradedowngradepackage}</a></li>
         {/if}
         {if $configoptionsupgrade}
         <li><a href="upgrade.php?type=configoptions&amp;id={$id}">{$LANG.upgradedowngradeconfigoptions}</a></li>
         {/if}
         {if $showcancelbutton}
         <li><a href="clientarea.php?action=cancel&amp;id={$id}">{$LANG.clientareacancelrequestbutton}</a></li>
         {/if}
      </ul>
   </li>
   {/if}
</ul>
<div class="tab-content">
   <div class="tab-pane active" id="tabOverview">
      {if $tplOverviewTabOutput}
      {$tplOverviewTabOutput}
      {if $serverdata.type eq 'cpanel'}
      {if $moduleclientarea}
      <div class="moduleoutput text-right">{$moduleclientarea|replace:'modulebutton':'btn'}</div>
      {/if}
      {/if}
      {else}
      <div class="product-details clearfix">
         <div class="row">
            <div class="col-md-6 text-center">
               <div class="product-icon">
                  <span class="fa-stack fa-2x">
                  <i class="fa fa-circle fa-stack-2x"></i>
                  <i class="fal fa-{if $type eq "hostingaccount" || $type == "reselleraccount"}globe-europe{elseif $type eq "server"}hdd{else}archive{/if} fa-stack-1x fa-inverse"></i>
                  </span>
                  <h4>{$product} <span class="label label-default label-{$status|strtolower}">{$status}</span></h4>
                  <h4><small>{$groupname}</small></h4>
               </div>
               {if $showcancelbutton || $packagesupgrade}
               <div class="row">
                  {if $packagesupgrade}
                  <div class="col-xs-{if $showcancelbutton}6{else}12{/if}">
                     <a href="upgrade.php?type=package&amp;id={$id}" class="btn btn-block btn-success">{$LANG.upgrade}</a>
                  </div>
                  {/if}
                  {if $showcancelbutton}
                  <div class="col-xs-{if $packagesupgrade}6{else}12{/if}">
                     <a href="clientarea.php?action=cancel&amp;id={$id}" class="btn btn-block btn-danger {if $pendingcancellation}disabled{/if}">{if $pendingcancellation}{$LANG.cancellationrequested}{else}{$LANG.clientareacancelrequestbutton}{/if}</a>
                  </div>
                  {/if}
               </div>
               {/if}
            </div>
            <div class="col-md-6 product-extra">
               <dl class="dl-horizontal">
                  <dt><strong>{$LANG.clientareahostingregdate} :</strong></dt>
                  <dd>{$regdate}</dd>
                  <dt><strong>{$LANG.clientareahostingnextduedate} :</strong></dt>
                  <dd>{$nextduedate}</dd>
                  <!--{if $firstpaymentamount neq $recurringamount}
                  <dt><strong>{$LANG.firstpaymentamount} :</strong></dt>
                  <dd>{$firstpaymentamount}</dd>
                  {/if}-->
                  {if $billingcycle != $LANG.orderpaymenttermonetime && $billingcycle != $LANG.orderfree}
                  <dt><strong>{$LANG.recurringamount} :</strong></dt>
                  <dd>{$recurringamount}</dd>
                  {/if}
                  <dt><strong>{$LANG.orderbillingcycle} :</strong></dt>
                  <dd>{$billingcycle}</dd>
                  <dt><strong>{$LANG.orderpaymentmethod} :</strong></dt>
                  <dd>{$paymentmethod}</dd>
                  {if $suspendreason}
                  <dt><strong>{$LANG.suspendreason} :</strong></dt>
                  <dd>{$suspendreason}</dd>
                  {/if}
               </dl>
            </div>
         </div>
      </div>
      {foreach $hookOutput as $output}
      <div>
         {$output}
      </div>
      {/foreach}
      {if $domain || $moduleclientarea || $configurableoptions || $customfields || $lastupdate}
      <div class="row clearfix">
         <div class="col-xs-12">
            <ul class="nav nav-tabs nav-tabs-overflow">
               {if $domain}
               <li class="active">
                  <a href="#domain" data-toggle="tab"><i class="fal fa-info fa-fw"></i> {if $type eq "server"}{$LANG.sslserverinfo}{elseif ($type eq "hostingaccount" || $type eq "reselleraccount") && $serverdata}{$LANG.hostingInfo}{else}{$LANG.clientareahostingdomain}{/if}</a>
               </li>
               {elseif $moduleclientarea}
               <li class="active">
                  <a href="#manage" data-toggle="tab"><i class="fal fa-cog fa-fw"></i> {$LANG.manage}</a>
               </li>
               {/if}
               {if $configurableoptions}
               <li{if !$domain && !$moduleclientarea} class="active"{/if}>
               <a href="#configoptions" data-toggle="tab"><i class="fal fa-cubes fa-fw"></i> {$LANG.orderconfigpackage}</a>
               </li>
               {/if}
               {if $customfields}
               <li{if !$domain && !$moduleclientarea && !$configurableoptions} class="active"{/if}>
               <a href="#additionalinfo" data-toggle="tab"><i class="fal fa-plus fa-fw"></i> {$LANG.additionalInfo}</a>
               </li>
               {/if}
               {if $lastupdate}
               <li{if !$domain && !$moduleclientarea && !$configurableoptions && !$customfields} class="active"{/if}>
               <a href="#resourceusage" data-toggle="tab"><i class="fal fa-chart-bar fa-fw"></i> {$LANG.resourceUsage}</a>
               </li>
               {/if}
            </ul>
         </div>
      </div>
      <div class="tab-content product-details-tab-container">
         {if $domain}
         <div class="tab-pane fade in active text-center" id="domain">
            {if $type eq "server"}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.serverhostname} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$domain}
               </div>
            </div>
            {if $dedicatedip}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.primaryIP} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$dedicatedip}
               </div>
            </div>
            {/if}
            {if $assignedips}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.assignedIPs} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$assignedips|nl2br}
               </div>
            </div>
            {/if}
            <!--{if $ns1 || $ns2}
               <div class="row">
                   <div class="col-sm-5 text-right">
                       <strong>{$LANG.domainnameservers} :</strong>
                   </div>
                   <div class="col-sm-7 text-left">
                       {$ns1}<br />{$ns2}
                   </div>
               </div>
               {/if}-->
            {else}
            {if $domain}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.orderdomain} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$domain}
               </div>
            </div>
            {/if}
            <!--{if $username}
               <div class="row">
                   <div class="col-sm-5 text-right">
                       <strong>{$LANG.serverusername} :</strong>
                   </div>
                   <div class="col-sm-7 text-left">
                       {$username}
                   </div>
               </div>
               {/if}
               {if $serverdata}
               <div class="row">
                   <div class="col-sm-5 text-right">
                       <strong>{$LANG.servername} :</strong>
                   </div>
                   <div class="col-sm-7 text-left">
                       {$serverdata.hostname}
                   </div>
               </div>-->
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.domainregisternsip} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$serverdata.ipaddress}
               </div>
            </div>
            {if $serverdata.nameserver1 || $serverdata.nameserver2 || $serverdata.nameserver3 || $serverdata.nameserver4 || $serverdata.nameserver5}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.domainnameservers} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {if $serverdata.nameserver1}{$serverdata.nameserver1} ({$serverdata.nameserver1ip})<br />{/if}
                  {if $serverdata.nameserver2}{$serverdata.nameserver2} ({$serverdata.nameserver2ip})<br />{/if}
                  {if $serverdata.nameserver3}{$serverdata.nameserver3} ({$serverdata.nameserver3ip})<br />{/if}
                  {if $serverdata.nameserver4}{$serverdata.nameserver4} ({$serverdata.nameserver4ip})<br />{/if}
                  {if $serverdata.nameserver5}{$serverdata.nameserver5} ({$serverdata.nameserver5ip})<br />{/if}
               </div>
            </div>
            {/if}
            {/if}
            {if $domain && $sslStatus}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.sslState.sslStatus} :</strong>
               </div>
               <div class="col-sm-7 text-left{if $sslStatus->isInactive()} ssl-inactive{/if}">
                  <img src="{$sslStatus->getImagePath()}" width="12"> {$sslStatus->getStatusDisplayLabel()}
               </div>
            </div>
            {if $sslStatus->isActive()}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.sslState.startDate} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$sslStatus->startDate->toClientDateFormat()}
               </div>
            </div>
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.sslState.expiryDate} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$sslStatus->expiryDate->toClientDateFormat()}
               </div>
            </div>
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$LANG.sslState.issuerName} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$sslStatus->issuerName}
               </div>
            </div>
            {/if}
            {/if}
            <br>
            <!--<p>
               <a href="http://{$domain}" class="btn btn-default" target="_blank">{$LANG.visitwebsite}</a>
               {if $domainId}
               <a href="clientarea.php?action=domaindetails&id={$domainId}" class="btn btn-default" target="_blank">{$LANG.managedomain}</a>
               {/if}
               <input type="button" onclick="popupWindow('whois.php?domain={$domain}','whois',650,420);return false;" value="{$LANG.whoisinfo}" class="btn btn-default" />
               </p>-->
            {/if}
            {if $moduleclientarea}
            <div class="text-center module-client-area">
               {$moduleclientarea}
            </div>
            {/if}
         </div>
         {if $sslStatus}
         <div class="tab-pane fade text-center" id="ssl-info">
            {if $sslStatus->isActive()}
            <div class="alert alert-success" role="alert">
               {lang key='sslActive' expiry=$sslStatus->expiryDate->toClientDateFormat()}
            </div>
            {else}
            <div class="alert alert-warning ssl-required" role="alert">
               {lang key='sslRequired'}
            </div>
            {/if}
         </div>
         {/if}
         {elseif $moduleclientarea}
         <div class="tab-pane fade{if !$domain} in active{/if} text-center" id="manage">
            {if $moduleclientarea}
            <div class="text-center module-client-area">
               {$moduleclientarea}
            </div>
            {/if}
         </div>
         {/if}
         {if $configurableoptions}
         <div class="tab-pane fade{if !$domain && !$moduleclientarea} in active{/if} text-center" id="configoptions">
            {foreach from=$configurableoptions item=configoption}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$configoption.optionname} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {if $configoption.optiontype eq 3}{if $configoption.selectedqty}{$LANG.yes}{else}{$LANG.no}{/if}{elseif $configoption.optiontype eq 4}{$configoption.selectedqty} x {$configoption.selectedoption}{else}{$configoption.selectedoption}{/if}
               </div>
            </div>
            {/foreach}
         </div>
         {/if}
         {if $customfields}
         <div class="tab-pane fade{if !$domain && !$moduleclientarea && !$configurableoptions} in active{/if} text-center" id="additionalinfo">
            {foreach from=$customfields item=field}
            <div class="row">
               <div class="col-sm-5 text-right">
                  <strong>{$field.name} :</strong>
               </div>
               <div class="col-sm-7 text-left">
                  {$field.value}
               </div>
            </div>
            {/foreach}
         </div>
         {/if}
         {if $lastupdate}
         <div class="tab-pane fade text-center" id="resourceusage">
            <div class="col-sm-10 col-sm-offset-1">
               <div class="col-sm-6">
                  <h4>{$LANG.diskSpace}</h4>
                  <input type="text" value="{$diskpercent|substr:0:-1}" class="dial-usage" data-width="100" data-height="100" data-min="0" data-readOnly="true" />
                  <p>{$diskusage} MB / {$disklimit} MB</p>
               </div>
               <div class="col-sm-6">
                  <h4>{$LANG.bandwidth}</h4>
                  <input type="text" value="{$bwpercent|substr:0:-1}" class="dial-usage" data-width="100" data-height="100" data-min="0" data-readOnly="true" />
                  <p>{$bwusage} MB / {$bwlimit} MB</p>
               </div>
            </div>
            <div class="clearfix">
            </div>
            <br/>
            <p class="text-muted"><strong>{$LANG.clientarealastupdated} :</strong> {$lastupdate}</p>
            <script src="{$BASE_PATH_JS}/jquery.knob.js"></script>
            <script type="text/javascript">
               jQuery(function() {ldelim}
                   jQuery(".dial-usage").knob({ldelim}'format':function (v) {ldelim} alert(v); {rdelim}{rdelim});
                   {rdelim});
            </script>
         </div>
         {/if}
      </div>
      {/if}
      <script src="{$BASE_PATH_JS}/bootstrap-tabdrop.js"></script>
      <script type="text/javascript">
         jQuery('.nav-tabs-overflow').tabdrop();
      </script>
      {/if}
   </div>
   <div class="tab-pane" id="tabDownloads">
      <h3>{$LANG.downloadstitle}</h3>
      {include file="$template/includes/alert.tpl" type="info" msg="{lang key="clientAreaProductDownloadsAvailable"}" textcenter=true}
      <div class="row">
         {foreach from=$downloads item=download}
         <div class="col-xs-10 col-xs-offset-1">
            <h4>{$download.title}</h4>
            <p>
               {$download.description}
            </p>
            <p>
               <a href="{$download.link}" class="btn btn-default"><i class="fal fa-download"></i> {$LANG.downloadname}</a>
            </p>
         </div>
         {/foreach}
      </div>
   </div>
   <div class="tab-pane" id="tabAddons">
      <h3>{$LANG.clientareahostingaddons}</h3>
      {if $addonsavailable}
      {include file="$template/includes/alert.tpl" type="info" msg="{lang key="clientAreaProductAddonsAvailable"}" textcenter=true}
      {/if}
      <div class="row">
         {foreach from=$addons item=addon}
         <div class="col-xs-10 col-xs-offset-1">
            <h4>{$addon.name}</h4>
            <p>
               {$addon.pricing}
            </p>
            <p>
               {$LANG.registered}: {$addon.regdate}
            </p>
            <p>
               {$LANG.clientareahostingnextduedate}: {$addon.nextduedate}
            </p>
            <p>
               <span class="label status-{$addon.rawstatus|strtolower}">{$addon.status}</span>
            </p>
            <div class="form-group">{$addon.managementActions}</div>
         </div>
         {/foreach}
      </div>
   </div>
   <div class="tab-pane" id="tabChangepw">
      <h3>{$LANG.serverchangepassword}</h3>
      {if $modulechangepwresult}
      {if $modulechangepwresult == "success"}
      {include file="$template/includes/alert.tpl" type="success" msg=$modulechangepasswordmessage textcenter=true}
      {elseif $modulechangepwresult == "error"}
      {include file="$template/includes/alert.tpl" type="error" msg=$modulechangepasswordmessage|strip_tags textcenter=true}
      {/if}
      {/if}
      <form using-password-strength" method="post" action="{$smarty.server.PHP_SELF}?action=productdetails#tabChangepw" role="form">
         <input type="hidden" name="id" value="{$id}" />
         <input type="hidden" name="modulechangepassword" value="true" />
         <div class="row">
            <div class="col-md-6">
               <div id="newPassword1" class="form-group">
                  <label class="control-label" for="inputNewPassword1">{$LANG.newpassword}</label>
                  <input type="password" name="newpw" id="inputNewPassword1" class="form-control" autocomplete="off" />  
               </div>
            </div>
            <div class="col-md-6">
               <div id="newPassword2" class="form-group">
                  <label class="control-label" for="inputNewPassword2">{$LANG.confirmnewpassword}</label>
                  <input type="password" name="confirmpw" id="inputNewPassword2" class="form-control" autocomplete="off" /> 
               </div>
            </div>
         </div>
         <div class="row">
            <div class="col-md-12">
               <div class="form-group text-center">
                  <input class="btn btn-primary" type="submit" name="submit" value="{$LANG.clientareasavechanges}" />
                  <input class="btn btn-default" type="reset" value="{$LANG.cancel}" />
               </div>
            </div>
         </div>
</form>
</div>
</div>

Thank you for your help.

Link to comment
Share on other sites

1 hour ago, brian! said:

i'd go along with wtricks - what the template is doing is key here... if there's already an exiting {if} statement that shows these tabs, then there might be an option to manipulate their removal with a hook, or hiding with CSS.

Do you know a code implemented directly in the clientareaproductdetails.tpl file ?

That allows you to display something only when the service is detected as active, otherwise it is not displayed.

Thanks,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated