Ignore:
Timestamp:
Mar 29, 2011, 11:35:00 PM (14 years ago)
Author:
patdenice
Message:

Update configuration after regeneration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/regenerateThumbnails/main.inc.php

    r9922 r9931  
    3838function rg_element_set_global_add_action()
    3939{
    40   global $template, $conf, $page, $pwg_loaded_plugins;
    41 
    42   load_language('plugin.lang', REGENERATE_THUMBNAILS_PATH);
    43   include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
    44 
    45   $template->set_filename('regenerateThumbnails', realpath(REGENERATE_THUMBNAILS_PATH.'element_set_global_action.tpl'));
    46 
    47   if (isset($_SESSION['regeneratedThumbnail']))
    48   {
    49     $template->delete_compiled_templates();
    50     array_push($page['infos'], l10n('Thumbnails have been regenerated'));
    51     unset($_SESSION['regeneratedThumbnail']);
    52   }
    53 
    54   foreach (get_upload_form_config() as $param_shortname => $param)
    55   {
    56     $param_name = 'upload_form_'.$param_shortname;
    57     $form_values[$param_shortname] = $conf[$param_name];
    58   }
    59 
    60   if (isset($pwg_loaded_plugins['square_thumbnails']))
    61   {
    62     load_language('plugin.lang', SQUARE_THUMB_PATH);
    63     $template->assign(array('SQUARE' => @$conf['upload_form_thumb_square']));
    64   }
    65 
    66   $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
    67   if ($_GET['page'] == 'plugin')
    68     $redirect_url .= '-regenerateThumbnails';
    69  
    70   $template->assign(array(
    71     'upload_form_settings' => $form_values,
    72     'all_elements' => $page['cat_elements_id'],
    73     'redirect_url' => $redirect_url,
    74     )
    75   );
    76 
    77   if ($template->get_template_vars('redirect_url') == null)
    78     $template->assign('redirect_url', get_root_url().'admin.php?page='.$_GET['page']);
    79 
    80   $template->append('element_set_global_plugins_actions', array(
    81     'ID' => 'regenerateThumbnails',
    82     'NAME' => l10n('Regenerate Thumbnails'),
    83     'CONTENT' => $template->parse('regenerateThumbnails', true),
    84     )
    85   );
    86 
    87   $template->set_prefilter('batch_manager_global', 'regenerate_prefilter');
     40  include(REGENERATE_THUMBNAILS_PATH.'element_set_global_action.php');
    8841}
    8942
     
    14295    );
    14396
    144   $_SESSION['regeneratedThumbnail'] = true;
    145 
    14697  return true;
    14798}
Note: See TracChangeset for help on using the changeset viewer.