Ignore:
Timestamp:
Jun 14, 2013, 7:02:17 PM (7 years ago)
Author:
mistic100
Message:

rewrite config page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/admin.php

    r22725 r23209  
    1717  $conf['cryptographp'] = array(
    1818    'activate_on'     => array(
    19           'picture'     => isset($_POST['activate_on']['picture']),
    20           'category'    => isset($_POST['activate_on']['category']) || !$loaded['category'],
    21           'register'    => isset($_POST['activate_on']['register']),
    22           'contactform' => isset($_POST['activate_on']['contactform']) || !$loaded['contactform'],
    23           'guestbook'   => isset($_POST['activate_on']['guestbook']) || !$loaded['guestbook'],
     19          'picture'     => in_array('picture', $_POST['activate_on']),
     20          'category'    => in_array('category', $_POST['activate_on']) || !$loaded['category'],
     21          'register'    => in_array('register', $_POST['activate_on']),
     22          'contactform' => in_array('contactform', $_POST['activate_on']) || !$loaded['contactform'],
     23          'guestbook'   => in_array('guestbook', $_POST['activate_on']) || !$loaded['guestbook'],
    2424          ),
    2525    'comments_action' => $_POST['comments_action'],
     
    6868}
    6969
    70 function presets_to_js($presets)
    71 {
    72   $out = null;
    73  
    74   foreach ($presets as $name => $param)
    75   {
    76     $out.= '
    77 function apply_'.$name.'() {
    78   $("input[name=perturbation]").val("'.$param['perturbation'].'");
    79   $("input[name=image_bg_color]").val("'.$param['image_bg_color'].'");
    80   $("input[name=text_color]").val("'.$param['text_color'].'");
    81   $("input[name=num_lines]").val("'.$param['num_lines'].'");
    82   $("input[name=line_color]").val("'.$param['line_color'].'");
    83   $("input[name=noise_level]").val("'.$param['noise_level'].'");
    84   $("input[name=noise_color]").val("'.$param['noise_color'].'");
    85   $("input[name=ttf_file]").val(["'.$param['ttf_file'].'"]);
    86 }';
    87   }
    88    
    89   return $out;
    90 }
    91 
    9270$template->assign(array(
    9371  'crypto' => $conf['cryptographp'],
    9472  'loaded' => $loaded,
    9573  'fonts' => list_fonts(CRYPTO_PATH.'securimage/fonts'),
    96   'presets' => array_keys($presets),
    97   'PRESETS_FUNC' => presets_to_js($presets),
     74  'PRESETS' => $presets,
    9875  'CRYPTO_PATH' => CRYPTO_PATH,
    9976  ));
Note: See TracChangeset for help on using the changeset viewer.