Dotclear


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

Move maintenance configuration to the new plugins configurator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/plugins.php

    r2158 r2163  
    4343); 
    4444 
     45 
     46# -- Check for module configuration -- 
     47$conf_file = false; 
     48if (!empty($_REQUEST['conf']) && !empty($_REQUEST['module'])) { 
     49     if (!$core->plugins->moduleExists($_REQUEST['module'])) { 
     50          $core->error->add(__('Unknow module ID')); 
     51     } 
     52     else { 
     53          $module = $core->plugins->getModules($_REQUEST['module']); 
     54          $module = adminModulesList::setModuleInfo($_REQUEST['module'], $module); 
     55 
     56          if (!file_exists(path::real($module['root'].'/_config.php'))) { 
     57               $core->error->add(__('This module has no configuration file.')); 
     58          } 
     59          else { 
     60               $conf_file = path::real($module['root'].'/_config.php'); 
     61          } 
     62     } 
     63} 
     64 
     65# -- Display module configuration page -- 
     66if ($conf_file) { 
     67     dcPage::open(__('Plugins management'), 
     68 
     69          # --BEHAVIOR-- pluginsToolsHeaders 
     70          $core->callBehavior('pluginsToolsHeaders', $core, $module['id']), 
     71 
     72          dcPage::breadcrumb( 
     73               array( 
     74                    html::escapeHTML($core->blog->name) => '', 
     75                    '<a href="'.$list->getPageURL().'">'.__('Plugins management').'</a>' => '', 
     76                    '<span class="page-title">'.__('Plugin configuration').'</span>' => '' 
     77               )) 
     78     ); 
     79 
     80     if (!empty($_GET['done'])){ 
     81          dcPage::success(__('Plugin successfully configured.')); 
     82     } 
     83 
     84     try { 
     85          if (!$module['standalone_config']) { 
     86               echo 
     87               '<form id="module_config" action="'.$list->getPageURL('conf=1').'" method="post" enctype="multipart/form-data">'. 
     88               '<h3>'.sprintf(__('Configure plugin "%s"'), html::escapeHTML($module['name'])).'</h3>'. 
     89               '<p><a class="back" href="'.$list->getPageURL().'#plugins">'.__('Back').'</a></p>'; 
     90          } 
     91 
     92          include $conf_file; 
     93 
     94          if (!$module['standalone_config']) { 
     95               echo 
     96               '<p class="clear"><input type="submit" name="save" value="'.__('Save').'" />'. 
     97               form::hidden('module', $module['id']). 
     98               $core->formNonce().'</p>'. 
     99               '</form>'; 
     100          } 
     101     } 
     102     catch (Exception $e) { 
     103          echo '<div class="error"><p>'.$e->getMessage().'</p></div>'; 
     104     } 
     105 
     106     dcPage::close(); 
     107 
     108     # Stop reading code here 
     109     return; 
     110} 
     111 
    45112# -- Execute actions -- 
    46 if ($core->auth->isSuperAdmin() && $list->isPathWritable()) { 
     113if (empty($_POST['conf']) && $core->auth->isSuperAdmin() && $list->isPathWritable()) { 
    47114 
    48115     # Plugin upload 
     
    106173 
    107174     # --BEHAVIOR-- pluginsToolsHeaders 
    108      $core->callBehavior('pluginsToolsHeaders', $core), 
     175     $core->callBehavior('pluginsToolsHeaders', $core, false), 
    109176 
    110177     dcPage::breadcrumb( 
Note: See TracChangeset for help on using the changeset viewer.

Sites map