1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed $canChangeStyle and $canChangeLanguage check in footer, but not in Account Preferences

Discussion in 'Resolved Bug Reports' started by Vincent, Apr 10, 2011.

  1. Vincent

    Vincent Well-Known Member

    I think the title explains enough.

    By example, if there is only 1 style or language, registered members cannot see a style-change or language-change link in the footer, yet they can see the dropdown menu in Account Preferences with 1 option in the dropdown menu.

    A
    Code:
    <xen:if is="{$canChangeStyle}">
    and
    Code:
    <xen:if is="{$canChangeLanguage}">
    would do fine in Account Preferences :D
     
    Romchik® likes this.
  2. Vincent

    Vincent Well-Known Member

    I think this is something that can easily be fixed in 1.0.2, so here's what you have to do exactly :)

    In account_preferences, change
    Code:
    <dl class="ctrlUnit">
    <dt><label for="ctrl_style_id">{xen:phrase style}:</label></dt>
    <dd>
    <select name="style_id" class="textCtrl OptOut" id="ctrl_style_id" autofocus="on">
    <option value="0">({xen:phrase use_default_style}: {$defaultStyle.title})</option>
    <optgroup label="{xen:phrase styles}:">
    <xen:foreach loop="$styles" key="$styleId" value="$style">
    <xen:if is="{$style.user_selectable} OR {$visitor.is_admin}">
    <option value="{$styleId}" class="{$style.depthClass}" {xen:selected '{$styleId} == {$visitor.style_id}'}>{$style.depthPrefix}{$style.title}</option>
    </xen:if>
    </xen:foreach>
    </optgroup>
    </select>
    <p class="explain">{xen:phrase you_may_view_site_in_any_of_styles_provided_here}</p>
    </dd>
    </dl>
    To
    Code:
    <xen:if is="{$canChangeStyle}">
    <dl class="ctrlUnit">
    <dt><label for="ctrl_style_id">{xen:phrase style}:</label></dt>
    <dd>
    <select name="style_id" class="textCtrl OptOut" id="ctrl_style_id" autofocus="on">
    <option value="0">({xen:phrase use_default_style}: {$defaultStyle.title})</option>
    <optgroup label="{xen:phrase styles}:">
    <xen:foreach loop="$styles" key="$styleId" value="$style">
    <xen:if is="{$style.user_selectable} OR {$visitor.is_admin}">
    <option value="{$styleId}" class="{$style.depthClass}" {xen:selected '{$styleId} == {$visitor.style_id}'}>{$style.depthPrefix}{$style.title}</option>
    </xen:if>
    </xen:foreach>
    </optgroup>
    </select>
    <p class="explain">{xen:phrase you_may_view_site_in_any_of_styles_provided_here}</p>
    </dd>
    </dl>
    </xen:if>
    
    And

    Code:
    <dl class="ctrlUnit">
    <dt><label for="ctrl_language_id">{xen:phrase language}:</label></dt>
    <dd>
    <select name="language_id" class="textCtrl" id="ctrl_language_id">
    <xen:foreach loop="$languages" key="$languageId" value="$language">
    <option value="{$languageId}" {xen:selected '{$languageId} == {$visitor.effectiveLanguageId}'}>{$language.title}</option>
    </xen:foreach>
    </select>
    <p class="explain">{xen:phrase interface_of_site_can_be_displayed_using_any_languages}</p>
    </dd>
    </dl>
    To

    Code:
    <xen:if is="{$canChangeLanguage}">
    <dl class="ctrlUnit">
    <dt><label for="ctrl_language_id">{xen:phrase language}:</label></dt>
    <dd>
    <select name="language_id" class="textCtrl" id="ctrl_language_id">
    <xen:foreach loop="$languages" key="$languageId" value="$language">
    <option value="{$languageId}" {xen:selected '{$languageId} == {$visitor.effectiveLanguageId}'}>{$language.title}</option>
    </xen:foreach>
    </select>
    <p class="explain">{xen:phrase interface_of_site_can_be_displayed_using_any_languages}</p>
    </dd>
    </dl>
    </xen:if>
    
     
  3. Mike

    Mike XenForo Developer Staff Member

    I've changed this.
     
    Vincent likes this.

Share This Page