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/blog_theme.php

    r2175 r2182  
    6666} 
    6767 
    68 # -- Check for module configuration -- 
    69 $conf_file = false; 
    70 if (!empty($_REQUEST['conf']) && !empty($_REQUEST['module'])) { 
    71      if (!$core->themes->moduleExists($_REQUEST['module'])) { 
    72           $core->error->add(__('Unknow module ID')); 
    73      } 
    74      else { 
    75           $module = $core->themes->getModules($_REQUEST['module']); 
    76           $module = adminModulesList::parseModuleInfo($_REQUEST['module'], $module); 
    77  
    78           if (!file_exists(path::real($module['root'].'/_config.php'))) { 
    79                $core->error->add(__('This module has no configuration file.')); 
    80           } 
    81           else { 
    82                $conf_file = path::real($module['root'].'/_config.php'); 
    83           } 
    84      } 
    85 } 
    86  
    8768# -- Display module configuration page -- 
    88 if ($conf_file) { 
     69if ($list->setConfigurationFile($core->themes, $core->blog->settings->system->theme)) { 
     70 
     71     # Get content before page headers 
     72     include $list->getConfigurationFile(); 
     73 
     74     # Gather content 
     75     $list->setConfigurationContent(); 
     76 
     77     # Display page 
    8978     dcPage::open(__('Blog appearance'), 
     79          dcPage::jsPageTabs(). 
     80          dcPage::jsColorPicker(). 
    9081 
    9182          # --BEHAVIOR-- themesToolsHeaders 
    92           $core->callBehavior('themesToolsHeaders', $core, $module['id']), 
     83          $core->callBehavior('themesToolsHeaders', $core, true), 
    9384 
    9485          dcPage::breadcrumb( 
     
    10495     } 
    10596 
    106      try { 
    107           if (!$module['standalone_config']) { 
    108                echo 
    109                '<form id="module_config" action="'.$list->getPageURL('conf=1').'" method="post" enctype="multipart/form-data">'. 
    110                '<h3>'.sprintf(__('Configure theme "%s"'), html::escapeHTML($module['name'])).'</h3>'. 
    111                '<p><a class="back" href="'.$list->getPageURL().'#themes">'.__('Back').'</a></p>'; 
    112           } 
    113           define('DC_CONTEXT_THEME', true); 
    114  
    115           include $conf_file; 
    116  
    117           if (!$module['standalone_config']) { 
    118                echo 
    119                '<p class="clear"><input type="submit" name="save" value="'.__('Save').'" />'. 
    120                form::hidden('module', $module['id']). 
    121                $core->formNonce().'</p>'. 
    122                '</form>'; 
    123           } 
    124      } 
    125      catch (Exception $e) { 
    126           echo '<div class="error"><p>'.$e->getMessage().'</p></div>'; 
    127      } 
     97     # Display previously gathered content 
     98     $list->getConfigurationContent(); 
    12899 
    129100     dcPage::close(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map