Changeset 1248

Show
Ignore:
Timestamp:
01/15/08 23:16:12 (23 months ago)
Author:
bchoate
Message:

Updates to refresh templates dialog to handle case where a single template set is available. BugId:65372

Location:
branches/release-27
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-27/lib/MT/App/CMS.pm

    r1242 r1248  
    2036520365        } 
    2036620366        $param->{'template_set_index'} = $#$sets; 
     20367        $param->{'template_set_count'} = scalar @$sets; 
    2036720368 
    2036820369        $param->{template_sets} = $sets; 
  • branches/release-27/tmpl/cms/dialog/refresh_templates.tmpl

    r1135 r1248  
    5555 
    5656    <mt:setvarblock name="refresh_label"><mt:loop name="template_set_loop"><mt:if name="selected"><__trans phrase="Refresh [_1] template set" params="<mt:var name="label" escape="html">"></mt:if></mt:loop></mt:setvarblock> 
    57          
     57 
    5858    <mtapp:setting 
    5959        id="refresh_templates" 
     
    6868    </mtapp:setting> 
    6969 
     70    <mt:if name="template_set_count" gt="1"> 
    7071    <mt:setvarblock name="new_label"><__trans phrase="Apply a new template set"></mt:setvarblock> 
     72    <mt:setvarblock name="new_hint"><__trans phrase="Deletes all existing templates and install the selected template set."></mt:setvarblock> 
     73    <mt:else> 
     74    <mt:setvarblock name="new_label"><__trans phrase="Reset to factory defaults"></mt:setvarblock> 
     75    <mt:setvarblock name="new_hint"><__trans phrase="Deletes all existing templates and installs factory default template set."></mt:setvarblock> 
     76    </mt:if> 
    7177 
    7278    <mtapp:setting 
     
    7581        show_label="0" 
    7682        show_hint="1" 
    77         hint="<__trans phrase="Deletes all existing templates and installs factory default template set.">" 
     83        hint="$new_hint" 
    7884        label_class="top-label"> 
    7985 
     
    8288        </div> 
    8389 
    84         <mt:if name="template_set_index" gt="1"> 
     90        <mt:if name="template_set_count" gt="1"> 
    8591        <select id="template_set" name="template_set" size="1" disabled="disabled"> 
    8692            <mt:loop name="template_set_loop"> 
    8793            <option value="<mt:var name="key" escape="html">" <mt:if name="selected">selected="selected"</mt:if>><mt:var name="label" escape="html"></option> 
    8894            </mt:loop> 
    89         </select> 
    9095        <mt:else> 
    9196            <mt:loop name="template_set_loop"> 
    92         <input type="hidden" name="template_set" value="<mt:var name="key" escape="html">" /> 
     97            <input type="hidden" name="template_set" value="<mt:var name="key" escape="html">" /> 
    9398            </mt:loop> 
    9499        </mt:if> 
     100        </select> 
    95101 
    96102    </mtapp:setting> 
     103 
    97104 
    98105        <div>