Changeset 25752 for trunk/themes


Ignore:
Timestamp:
Nov 29, 2013, 2:00:40 PM (10 years ago)
Author:
plg
Message:

smartpocket, configuration: simpler yes/no checkboxes (with fontello icons, same as AdminTools checkboxes)

Location:
trunk/themes/smartpocket/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/smartpocket/admin/admin.inc.php

    r23718 r25752  
    1111if(isset($_POST['submit_smartpocket']))
    1212{
    13   $config_send['loop']=(isset($_POST['loop']) and $_POST['loop']=="false") ? false : true;
    14   $config_send['autohide']=(isset($_POST['autohide']) and $_POST['autohide']=="0") ? 0 : 5000;
     13  $config_send['loop'] = isset($_POST['loop']);
     14  $config_send['autohide'] = (isset($_POST['autohide']) ? 5000 : 0);
    1515 
    1616  $conf['smartpocket'] = serialize($config_send);
  • trunk/themes/smartpocket/admin/admin.tpl

    r23718 r25752  
    1 {combine_css path="themes/default/js/ui/theme/jquery.ui.button.css"}
    2 {combine_css path="themes/smartpocket/admin/jquery.ui.button.css"}
    3 {footer_script require='jquery.ui.button'}
    4 {literal}
    5 jQuery(document).ready(function(){
    6   jQuery( ".radio" ).buttonset();
     1{html_style}
     2.graphicalCheckbox {
     3  font-size:16px;
     4  line-height:16px;
     5}
     6
     7input[type=checkbox] {
     8  display:none;
     9}
     10{/html_style}
     11
     12{footer_script}{literal}
     13jQuery(document).ready(function() {
     14  jQuery('form li label input[type=checkbox]').change(function() {
     15    var graphicalCheckbox = jQuery(this).parent().find('.graphicalCheckbox');
     16    if (jQuery(this).is(':checked')) {
     17      jQuery(graphicalCheckbox).removeClass('icon-check-empty').addClass('icon-check');
     18    }
     19    else {
     20      jQuery(graphicalCheckbox).removeClass('icon-check').addClass('icon-check-empty');
     21    }
     22  });
    723});
    8 {/literal}
    9 {/footer_script}
     24{/literal}{/footer_script}
    1025
    1126<div class="titrePage">
     
    1732    <legend>{'Slideshow Options'|@translate}</legend>
    1833    <ul>
    19       <li class="radio" >
    20         <label for="loop"><span class="property">{'Loop the slideshow'|@translate}</span>&nbsp;</label>
    21         <input type="radio" id="loop_true" name="loop" value="true" {if $options.loop}checked="checked"{/if}><label for="loop_true">{'Yes'|@translate}</label>
    22         <input type="radio" id="loop_false" name="loop" value="false" {if !$options.loop}checked="checked"{/if}><label for="loop_false">{'No'|@translate}</label>
    23       </li>
    24       <li class="radio" >
    25         <label for="autohide"><span class="property">{'Autohide the bar of the slideshow'|@translate}</span>&nbsp;</label>
    26         <input type="radio" id="autohide_on" name="autohide" value="5000" {if $options.autohide==5000}checked="checked"{/if}><label for="autohide_on">{'Yes'|@translate}</label>
    27         <input type="radio" id="autohide_off" name="autohide" value="0" {if $options.autohide==0}checked="checked"{/if}><label for="autohide_off">{'No'|@translate}</label>
    28       </li>
     34
     35      <li><label>
     36        <span class="property">{'Loop the slideshow'|translate}</span>&nbsp;
     37        <span class="graphicalCheckbox icon-check{if not $options.loop}-empty{/if}">&nbsp;</span>
     38        <input type="checkbox" name="loop"{if $options.loop} checked="checked"{/if}>
     39      </label></li>
     40
     41      <li><label>
     42        <span class="property">{'Autohide the bar of the slideshow'|translate}</span>&nbsp;
     43        <span class="graphicalCheckbox icon-check{if $options.autohide != 5000}-empty{/if}">&nbsp;</span>
     44        <input type="checkbox" name="autohide"{if $options.autohide == 5000} checked="checked"{/if}>
     45      </label></li>
     46
    2947    </ul>
    3048  </fieldset>
Note: See TracChangeset for help on using the changeset viewer.