Ignore:
Timestamp:
Jun 7, 2011, 9:44:37 PM (13 years ago)
Author:
mistic100
Message:

big code cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/admin.php

    r10984 r11267  
    66
    77// +-----------------------------------------------------------------------+
    8 //        Tabsheet
     8//                         Save configuration                              |
    99// +-----------------------------------------------------------------------+
    10 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    11 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'config';
     10if (isset($_POST['config_submit']))
     11{
     12  $conf['comments_on_albums'] = array(
     13    'icon_color' => $_POST['icon_color'],
     14    'icon_color_over' => $_POST['icon_color_over'],
     15    );
    1216 
    13 $tabsheet = new tabsheet();
    14 $tabsheet->add('config', l10n('Configuration'), COA_ADMIN . '-config');   // Configuration
    15 $tabsheet->select($page['tab']);
    16 $tabsheet->assign();
     17  conf_update_param('comments_on_albums', serialize($conf['comments_on_albums']));
     18  array_push($page['infos'], l10n('Information data registered in database'));
     19
     20
    1721
    1822// +-----------------------------------------------------------------------+
    19 //        Template
     23//                               Template                                  |
    2024// +-----------------------------------------------------------------------+
    21 $template->assign(array(
    22   'COA_PATH' => COA_PATH,
    23   'COA_ADMIN' => COA_ADMIN,
    24 ));
    2525
    26 include(COA_PATH.'admin/' . $page['tab'] . '.php');
     26// available icons
     27$dh = opendir(COA_PATH . 'template/s26');
     28while (($file = readdir($dh)) !== false )
     29{
     30  if ($file !== '.' AND $file !== '..' AND in_array(strtolower(get_extension($file)), array('jpg', 'png', 'gif')))
     31  {
     32    $template->append('COLORS', $file);
     33  }
     34}
     35closedir($dh);
     36 
     37$template->assign(
     38  array(
     39    'COA_PATH' => COA_PATH,
     40    'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
     41    'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
     42    )
     43  );
     44
     45$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
     46$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     47
    2748?>
Note: See TracChangeset for help on using the changeset viewer.