Dotclear


Ignore:
Timestamp:
10/01/13 09:44:02 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
dcRepo
Message:

Enable complex loop (get, post, redirect) in themes and plugins configuration files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/plugins.php

    r2175 r2182  
    6363)); 
    6464 
    65 # -- Check for module configuration -- 
    66 $conf_file = false; 
    67 if (!empty($_REQUEST['conf']) && !empty($_REQUEST['module'])) { 
    68      if (!$core->plugins->moduleExists($_REQUEST['module'])) { 
    69           $core->error->add(__('Unknow module ID')); 
    70      } 
    71      else { 
    72           $module = $core->plugins->getModules($_REQUEST['module']); 
    73           $module = adminModulesList::parseModuleInfo($_REQUEST['module'], $module); 
    74  
    75           if (!file_exists(path::real($module['root'].'/_config.php'))) { 
    76                $core->error->add(__('This module has no configuration file.')); 
    77           } 
    78           else { 
    79                $conf_file = path::real($module['root'].'/_config.php'); 
    80           } 
    81      } 
    82 } 
    83  
    8465# -- Display module configuration page -- 
    85 if ($conf_file) { 
     66if ($list->setConfigurationFile($core->plugins)) { 
     67 
     68     # Get content before page headers 
     69     include $list->getConfigurationFile(); 
     70 
     71     # Gather content 
     72     $list->setConfigurationContent(); 
     73 
     74     # Display page 
    8675     dcPage::open(__('Plugins management'), 
    8776 
    8877          # --BEHAVIOR-- pluginsToolsHeaders 
    89           $core->callBehavior('pluginsToolsHeaders', $core, $module['id']), 
     78          $core->callBehavior('pluginsToolsHeaders', $core, true), 
    9079 
    9180          dcPage::breadcrumb( 
     
    9786     ); 
    9887 
     88     # Message 
    9989     if (!empty($_GET['done'])){ 
    10090          dcPage::success(__('Plugin successfully configured.')); 
    10191     } 
    10292 
    103      try { 
    104           if (!$module['standalone_config']) { 
    105                echo 
    106                '<form id="module_config" action="'.$list->getPageURL('conf=1').'" method="post" enctype="multipart/form-data">'. 
    107                '<h3>'.sprintf(__('Configure plugin "%s"'), html::escapeHTML($module['name'])).'</h3>'. 
    108                '<p><a class="back" href="'.$list->getPageURL().'#plugins">'.__('Back').'</a></p>'; 
    109           } 
    110           define('DC_CONTEXT_PLUGIN', true); 
    111  
    112           include $conf_file; 
    113  
    114           if (!$module['standalone_config']) { 
    115                echo 
    116                '<p class="clear"><input type="submit" name="save" value="'.__('Save').'" />'. 
    117                form::hidden('module', $module['id']). 
    118                $core->formNonce().'</p>'. 
    119                '</form>'; 
    120           } 
    121      } 
    122      catch (Exception $e) { 
    123           echo '<div class="error"><p>'.$e->getMessage().'</p></div>'; 
    124      } 
     93     # Display previously gathered content 
     94     $list->getConfigurationContent(); 
    12595 
    12696     dcPage::close(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map