Dotclear

Changeset 2267:e59137433afb


Ignore:
Timestamp:
10/04/13 21:37:08 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Parents:
2266:4194798ba665 (diff), 2261:e7aa9cffbc30 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch dcRepo introducing new repository system, full plugins and themes manager revamping, addresses #763 #1456, closes #1458 #1467 #1657 #1661 #1722

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • admin/plugins.php

    r2256 r2267  
    1313require dirname(__FILE__).'/../inc/admin/prepend.php'; 
    1414 
    15 dcPage::checkSuper(); 
    16  
    17 $default_tab = !empty($_REQUEST['tab']) ? html::escapeHTML($_REQUEST['tab']) : 'plugins'; 
    18  
    19 $p_paths = explode(PATH_SEPARATOR, DC_PLUGINS_ROOT); 
    20 $p_path = array_pop($p_paths); 
    21 unset($p_paths); 
    22  
    23 $is_writable = false; 
    24 if (is_dir($p_path) && is_writeable($p_path)) { 
    25      $is_writable = true; 
    26      $p_path_pat = preg_quote($p_path,'!'); 
    27 } 
    28  
    29 $plugin_id = !empty($_POST['plugin_id']) ? $_POST['plugin_id'] : null; 
    30  
    31 if ($is_writable) 
    32 { 
    33      # Delete plugin 
    34      if ($plugin_id && !empty($_POST['delete'])) 
    35      { 
    36           try 
    37           { 
    38                if (empty($_POST['deactivated'])) 
    39                { 
    40                     if (!$core->plugins->moduleExists($plugin_id)) { 
    41                          throw new Exception(__('No such plugin.')); 
    42                     } 
    43                      
    44                     $plugin = $core->plugins->getModules($plugin_id); 
    45                     $plugin['id'] = $plugin_id; 
    46                      
    47                     if (!preg_match('!^'.$p_path_pat.'!', $plugin['root'])) { 
    48                          throw new Exception(__('You don\'t have permissions to delete this plugin.')); 
    49                     } 
    50                      
    51                     # --BEHAVIOR-- pluginBeforeDelete 
    52                     $core->callBehavior('pluginsBeforeDelete', $plugin); 
    53                      
    54                     $core->plugins->deleteModule($plugin_id); 
    55                      
    56                     # --BEHAVIOR-- pluginAfterDelete 
    57                     $core->callBehavior('pluginsAfterDelete', $plugin); 
    58                } 
    59                else 
    60                { 
    61                     $core->plugins->deleteModule($plugin_id,true); 
    62                } 
    63  
    64                dcPage::addSuccessNotice(__('Plugin has been successfully deleted.')); 
    65                http::redirect('plugins.php'); 
    66           } 
    67           catch (Exception $e) 
    68           { 
    69                $core->error->add($e->getMessage()); 
    70           } 
    71      } 
    72      # Deactivate plugin 
    73      elseif ($plugin_id && !empty($_POST['deactivate'])) 
    74      { 
    75           try 
    76           { 
    77                if (!$core->plugins->moduleExists($plugin_id)) { 
    78                     throw new Exception(__('No such plugin.')); 
    79                } 
    80                 
    81                $plugin = $core->plugins->getModules($plugin_id); 
    82                $plugin['id'] = $plugin_id; 
    83                 
    84                if (!$plugin['root_writable']) { 
    85                     throw new Exception(__('You don\'t have permissions to deactivate this plugin.')); 
    86                } 
    87                 
    88                # --BEHAVIOR-- pluginBeforeDeactivate 
    89                $core->callBehavior('pluginsBeforeDeactivate', $plugin); 
    90                      
    91                $core->plugins->deactivateModule($plugin_id); 
    92  
    93                # --BEHAVIOR-- pluginAfterDeactivate 
    94                $core->callBehavior('pluginsAfterDeactivate', $plugin); 
    95                      
    96                http::redirect('plugins.php'); 
    97           } 
    98           catch (Exception $e) 
    99           { 
    100                $core->error->add($e->getMessage()); 
    101           } 
    102      } 
    103      # Activate plugin 
    104      elseif ($plugin_id && !empty($_POST['activate'])) 
    105      { 
    106           try 
    107           { 
    108                $p = $core->plugins->getDisabledModules(); 
    109                if (!isset($p[$plugin_id])) { 
    110                     throw new Exception(__('No such plugin.')); 
    111                } 
    112  
    113                # --BEHAVIOR-- pluginBeforeActivate 
    114                $core->callBehavior('pluginsBeforeActivate', $plugin_id); 
    115                 
    116                $core->plugins->activateModule($plugin_id); 
    117  
    118                # --BEHAVIOR-- pluginAfterActivate 
    119                $core->callBehavior('pluginsAfterActivate', $plugin_id); 
    120                 
    121                http::redirect('plugins.php'); 
    122           } 
    123           catch (Exception $e) 
    124           { 
    125                $core->error->add($e->getMessage()); 
    126           } 
    127      } 
    128      # Plugin upload 
    129      elseif ((!empty($_POST['upload_pkg']) && !empty($_FILES['pkg_file'])) || 
    130           (!empty($_POST['fetch_pkg']) && !empty($_POST['pkg_url']))) 
    131      { 
    132           try 
    133           { 
    134                if (empty($_POST['your_pwd']) || !$core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['your_pwd']))) { 
    135                     throw new Exception(__('Password verification failed')); 
    136                } 
    137                 
    138                if (!empty($_POST['upload_pkg'])) 
    139                { 
    140                     files::uploadStatus($_FILES['pkg_file']); 
    141                      
    142                     $dest = $p_path.'/'.$_FILES['pkg_file']['name']; 
    143                     if (!move_uploaded_file($_FILES['pkg_file']['tmp_name'],$dest)) { 
    144                          throw new Exception(__('Unable to move uploaded file.')); 
    145                     } 
    146                } 
    147                else 
    148                { 
    149                     $url = urldecode($_POST['pkg_url']); 
    150                     $dest = $p_path.'/'.basename($url); 
    151                      
    152                     try 
    153                     { 
    154                          $client = netHttp::initClient($url,$path); 
    155                          $client->setUserAgent('Dotclear - http://www.dotclear.org/'); 
    156                          $client->useGzip(false); 
    157                          $client->setPersistReferers(false); 
    158                          $client->setOutput($dest); 
    159                          $client->get($path); 
    160                     } 
    161                     catch( Exception $e) 
    162                     { 
    163                          throw new Exception(__('An error occurred while downloading the file.')); 
    164                     } 
    165                      
    166                     unset($client); 
    167                } 
    168  
    169                # --BEHAVIOR-- pluginBeforeAdd 
    170                $core->callBehavior('pluginsBeforeAdd', $plugin_id); 
    171                                
    172                $ret_code = $core->plugins->installPackage($dest,$core->plugins); 
    173  
    174                # --BEHAVIOR-- pluginAfterAdd 
    175                $core->callBehavior('pluginsAfterAdd', $plugin_id); 
    176                if ($ret_code == 2) { 
    177                     dcPage::addSuccessNotice(__('Plugin has been successfully upgraded')); 
    178                } else { 
    179                     dcPage::addSuccessNotice(__('Plugin has been successfully installed.')); 
    180                } 
    181                http::redirect('plugins.php'); 
    182           } 
    183           catch (Exception $e) 
    184           { 
    185                $core->error->add($e->getMessage()); 
    186                $default_tab = 'addplugin'; 
    187           } 
    188      } 
    189 } 
    190  
    191 # Plugin install 
    192 $plugins_install = $core->plugins->installModules(); 
    193  
    194 /* DISPLAY Main page 
    195 -------------------------------------------------------- */ 
     15dcPage::check('admin'); 
     16 
     17# -- "First time" settings setup -- 
     18if ($core->blog->settings->system->plugins_allow_multi_install === null) { 
     19     $core->blog->settings->system->put( 
     20          'plugins_allow_multi_install', false, 'boolean', 'Allow multi-installation for plugins', true, true 
     21     ); 
     22} 
     23if ($core->blog->settings->system->store_plugin_url === null) { 
     24     $core->blog->settings->system->put( 
     25          'store_plugin_url', 'http://update.dotaddict.org/dc2/plugins.xml', 'string', 'Plugins XML feed location', true, true 
     26     ); 
     27} 
     28 
     29# -- Page helper -- 
     30$list = new adminModulesList( 
     31     $core->plugins,  
     32     DC_PLUGINS_ROOT,  
     33     $core->blog->settings->system->store_plugin_url 
     34); 
     35 
     36$list::$allow_multi_install = $core->blog->settings->system->plugins_allow_multi_install; 
     37$list::$distributed_modules = array( 
     38     'aboutConfig', 
     39     'akismet', 
     40     'antispam', 
     41     'attachments', 
     42     'blogroll', 
     43     'blowupConfig', 
     44     'daInstaller', 
     45     'fairTrackbacks', 
     46     'importExport', 
     47     'maintenance', 
     48     'pages', 
     49     'pings', 
     50     'simpleMenu', 
     51     'tags', 
     52     'themeEditor', 
     53     'userPref', 
     54     'widgets' 
     55); 
     56 
     57# -- Display module configuration page -- 
     58if ($list->setConfiguration()) { 
     59 
     60     # Get content before page headers 
     61     include $list->includeConfiguration(); 
     62 
     63     # Gather content 
     64     $list->getConfiguration(); 
     65 
     66     # Display page 
     67     dcPage::open(__('Plugins management'), 
     68 
     69          # --BEHAVIOR-- pluginsToolsHeaders 
     70          $core->callBehavior('pluginsToolsHeaders', $core, true), 
     71 
     72          dcPage::breadcrumb( 
     73               array( 
     74                    html::escapeHTML($core->blog->name) => '', 
     75                    __('Plugins management') => $list->getURL('',false), 
     76                    '<span class="page-title">'.__('Plugin configuration').'</span>' => '' 
     77               )) 
     78     ); 
     79 
     80     # Display previously gathered content 
     81     $list->displayConfiguration(); 
     82 
     83     dcPage::close(); 
     84 
     85     # Stop reading code here 
     86     return; 
     87} 
     88 
     89# -- Execute actions -- 
     90try { 
     91     $list->doActions('plugins'); 
     92} 
     93catch (Exception $e) { 
     94     $core->error->add($e->getMessage()); 
     95} 
     96 
     97# -- Plugin install -- 
     98$plugins_install = null; 
     99if (!$core->error->flag()) { 
     100     $plugins_install = $core->plugins->installModules(); 
     101} 
     102 
     103# -- Page header -- 
    196104dcPage::open(__('Plugins management'), 
    197105     dcPage::jsLoad('js/_plugins.js'). 
    198      dcPage::jsPageTabs($default_tab), 
     106     dcPage::jsPageTabs(). 
     107 
     108     # --BEHAVIOR-- pluginsToolsHeaders 
     109     $core->callBehavior('pluginsToolsHeaders', $core, false), 
     110 
    199111     dcPage::breadcrumb( 
    200112          array( 
     
    204116); 
    205117 
    206 if (!empty($_GET['removed'])) { 
    207      dcPage::success(__('Plugin has been successfully deleted.')); 
    208 } 
    209 if (!empty($_GET['added'])) { 
    210      dcPage::success(($_GET['added'] == 2 ? __('Plugin has been successfully upgraded') : __('Plugin has been successfully installed.'))); 
    211 } 
    212  
    213 # Plugins install messages 
    214 if (!empty($plugins_install['success'])) 
    215 { 
    216      echo '<div class="static-msg">'.__('Following plugins have been installed:').'<ul>'; 
     118# -- Plugins install messages -- 
     119if (!empty($plugins_install['success'])) { 
     120     echo  
     121     '<div class="static-msg">'.__('Following plugins have been installed:').'<ul>'; 
     122 
    217123     foreach ($plugins_install['success'] as $k => $v) { 
    218           echo '<li>'.$k.'</li>'; 
    219      } 
    220      echo '</ul></div>'; 
    221 } 
    222 if (!empty($plugins_install['failure'])) 
    223 { 
    224      echo '<div class="error">'.__('Following plugins have not been installed:').'<ul>'; 
     124          echo  
     125          '<li>'.$k.'</li>'; 
     126     } 
     127 
     128     echo  
     129     '</ul></div>'; 
     130} 
     131if (!empty($plugins_install['failure'])) { 
     132     echo  
     133     '<div class="error">'.__('Following plugins have not been installed:').'<ul>'; 
     134 
    225135     foreach ($plugins_install['failure'] as $k => $v) { 
    226           echo '<li>'.$k.' ('.$v.')</li>'; 
    227      } 
    228      echo '</ul></div>'; 
    229 } 
    230  
    231 # List all active plugins 
    232 echo '<p>'.__('Plugins add new functionalities to Dotclear. '. 
    233 'Here you can activate or deactivate installed plugins.').'</p>'; 
    234  
    235 echo (!$core->plugins->moduleExists('daInstaller') ? 
    236      sprintf('<p><strong>'.__('You can find additional plugins for your blog on %s.').'</strong></p>', 
    237           '<a href="http://plugins.dotaddict.org/dc2/">Dotaddict</a>') : 
    238      sprintf('<p><strong>'.__('You can find additional plugins for your blog on %s or using the %s.').'</strong></p>', 
    239           '<a href="http://plugins.dotaddict.org/dc2/">Dotaddict</a>', 
    240           '<a href="plugin.php?p=daInstaller">'.__('DotAddict.org Installer').'</a>')); 
    241  
    242 if ($is_writable) { 
    243      echo '<p>'.__('To install or upgrade a plugin you generally just need to upload it '. 
    244      'in "Install or upgrade a plugin" section.'); 
    245 } else { 
    246      echo '<p>'.__('To install or upgrade a plugin you just need to extract it in your plugins directory.'); 
    247 } 
    248 echo '</p>'; 
     136          echo  
     137          '<li>'.$k.' ('.$v.')</li>'; 
     138     } 
     139 
     140     echo  
     141     '</ul></div>'; 
     142} 
     143 
     144# -- Display modules lists -- 
     145if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 
     146 
     147     # Updated modules from repo 
     148     $modules = $list->store->get(true); 
     149     if (!empty($modules)) { 
     150          echo  
     151          '<div class="multi-part" id="update" title="'.html::escapeHTML(__('Update plugins')).'">'. 
     152          '<h3>'.html::escapeHTML(__('Update plugins')).'</h3>'. 
     153          '<p>'.sprintf( 
     154               __('There is one plugin to update available from repository.', 'There are %s plugins to update available from repository.', count($modules)), 
     155               count($modules) 
     156          ).'</p>'; 
     157 
     158          $list 
     159               ->setList('plugin-update') 
     160               ->setTab('update') 
     161               ->setModules($modules) 
     162               ->displayModules( 
     163                    /*cols */      array('icon', 'name', 'version', 'current_version', 'desc'), 
     164                    /* actions */  array('update') 
     165               ); 
     166 
     167          echo 
     168          '<p class="info vertical-separator">'.sprintf( 
     169               __("Visit %s repository, the resources center for Dotclear."), 
     170               '<a href="http://dotaddict.org/dc2/plugins">Dotaddict</a>' 
     171               ). 
     172          '</p>'. 
     173 
     174          '</div>'; 
     175     } 
     176} 
    249177 
    250178echo 
    251 '<div class="multi-part" id="plugins" title="'.__('Plugins').'">'; 
    252  
    253 $p_available = $core->plugins->getModules(); 
    254 uasort($p_available,create_function('$a,$b','return strcasecmp($a["name"],$b["name"]);')); 
    255 if (!empty($p_available))  
    256 { 
     179'<div class="multi-part" id="plugins" title="'.__('Installed plugins').'">'; 
     180 
     181# Activated modules 
     182$modules = $list->modules->getModules(); 
     183if (!empty($modules)) { 
     184      
     185     echo  
     186     '<h3>'.($core->auth->isSuperAdmin() ?__('Activated plugins') : __('Installed plugins')).'</h3>'. 
     187     '<p>'.__('You can configure and manage installed plugins from this list.').'</p>'; 
     188 
     189     $list 
     190          ->setList('plugin-activate') 
     191          ->setTab('plugins') 
     192          ->setModules($modules) 
     193          ->displayModules( 
     194               /* cols */          array('expander', 'icon', 'name', 'config', 'version', 'desc', 'distrib'), 
     195               /* actions */  array('deactivate', 'delete', 'behavior') 
     196          ); 
     197} 
     198 
     199# Deactivated modules 
     200if ($core->auth->isSuperAdmin()) { 
     201     $modules = $list->modules->getDisabledModules(); 
     202     if (!empty($modules)) { 
     203          echo 
     204          '<h3>'.__('Deactivated plugins').'</h3>'. 
     205          '<p>'.__('Deactivated plugins are installed but not usable. You can activate them from here.').'</p>'; 
     206 
     207          $list 
     208               ->setList('plugin-deactivate') 
     209               ->setTab('plugins') 
     210               ->setModules($modules) 
     211               ->displayModules( 
     212                    /* cols */          array('icon', 'name', 'distrib'), 
     213                    /* actions */  array('activate', 'delete') 
     214               ); 
     215     } 
     216} 
     217 
     218echo  
     219'</div>'; 
     220 
     221if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 
     222 
     223     # New modules from repo 
     224     $search = $list->getSearch(); 
     225     $modules = $search ? $list->store->search($search) : $list->store->get(); 
     226 
     227     if (!empty($search) || !empty($modules)) { 
     228          echo 
     229          '<div class="multi-part" id="new" title="'.__('Add plugins').'">'. 
     230          '<h3>'.__('Add plugins from repository').'</h3>'. 
     231          '<p>'.__('Search and install plugins directly from repository.').'</p>'; 
     232 
     233          $list 
     234               ->setList('plugin-new') 
     235               ->setTab('new') 
     236               ->setModules($modules) 
     237               ->displaySearch() 
     238               ->displayIndex() 
     239               ->displayModules( 
     240                    /* cols */          array('expander', 'name', 'score', 'version', 'desc'), 
     241                    /* actions */  array('install'), 
     242                    /* nav limit */     true 
     243               ); 
     244 
     245          echo 
     246          '<p class="info vertical-separator">'.sprintf( 
     247               __("Visit %s repository, the resources center for Dotclear."), 
     248               '<a href="http://dotaddict.org/dc2/plugins">Dotaddict</a>' 
     249               ). 
     250          '</p>'. 
     251 
     252          '</div>'; 
     253     } 
     254 
     255     # Add a new plugin 
    257256     echo 
    258      '<h3>'.__('Activated plugins').'</h3>'. 
    259      '<div class="table-outer clear">'. 
    260      '<table class="plugins"><tr>'. 
    261      '<th>'.__('Plugin').'</th>'. 
    262      '<th class="nowrap">'.__('Version').'</th>'. 
    263      '<th class="nowrap">'.__('Details').'</th>'. 
    264      '<th class="nowrap">'.__('Action').'</th>'. 
    265      '</tr>'; 
    266       
    267      $distrib_plugins = array('aboutConfig','akismet','antispam','attachments','blogroll','blowupConfig','daInstaller', 
    268           'fairTrackbacks','importExport','maintenance','pages','pings','simpleMenu','tags','themeEditor','userPref','widgets'); 
    269      $distrib_img = '<img src="images/dotclear_pw.png"'. 
    270           ' alt="'.__('Plugin from official distribution').'" title="'.__('Plugin from official distribution').'" />'; 
    271  
    272      foreach ($p_available as $k => $v) 
    273      { 
    274           $is_deletable = $is_writable && preg_match('!^'.$p_path_pat.'!',$v['root']); 
    275           $is_deactivable = $v['root_writable']; 
    276           $is_distrib = in_array($k, $distrib_plugins); 
    277            
    278           echo 
    279           '<tr class="line wide">'. 
    280           '<td class="minimal nowrap"><strong>'.html::escapeHTML($k).'</strong></td>'. 
    281           '<td class="minimal">'.html::escapeHTML($v['version']).'</td>'. 
    282           '<td class="maximal'.($is_distrib ? ' distrib' : '').'"><strong>'.html::escapeHTML(__($v['name'])).'</strong> '. 
    283           '<br />'.html::escapeHTML(__($v['desc'])).($is_distrib ? ' '.$distrib_img : '').'</td>'. 
    284           '<td class="nowrap action">'; 
    285            
    286           if ($is_deletable || $is_deactivable) 
    287           { 
    288                echo 
    289                '<form action="plugins.php" method="post">'. 
    290                '<div>'. 
    291                $core->formNonce(). 
    292                form::hidden(array('plugin_id'),html::escapeHTML($k)). 
    293                ($is_deactivable ? '<input type="submit" name="deactivate" value="'.__('Deactivate').'" /> ' : ''). 
    294                ($is_deletable ? '<input type="submit" class="delete" name="delete" value="'.__('Delete').'" /> ' : ''). 
    295                '</div>'. 
    296                '</form>'; 
    297           } 
    298            
    299           echo 
    300           '</td>'. 
    301           '</tr>'; 
    302      } 
     257     '<div class="multi-part" id="addplugin" title="'.__('Install or upgrade manually').'">'. 
     258     '<h3>'.__('Add plugins from a package').'</h3>'. 
     259     '<p>'.__('You can install plugins by uploading or downloading zip files.').'</p>'; 
     260 
     261     $list->displayManualForm(); 
     262 
    303263     echo 
    304      '</table></div>'; 
    305 } 
    306  
    307 $p_disabled = $core->plugins->getDisabledModules(); 
    308 uksort($p_disabled,create_function('$a,$b','return strcasecmp($a,$b);')); 
    309 if (!empty($p_disabled)) 
    310 { 
    311      echo 
    312      '<h3>'.__('Deactivated plugins').'</h3>'. 
    313      '<div class="clear table-outer">'. 
    314      '<table class="plugins"><tr>'. 
    315      '<th>'.__('Plugin').'</th>'. 
    316      '<th class="nowrap">'.__('Action').'</th>'. 
    317      '</tr>'; 
    318       
    319      foreach ($p_disabled as $k => $v) 
    320      { 
    321           $is_deletable = $is_writable && preg_match('!^'.$p_path_pat.'!',$v['root']); 
    322           $is_activable = $v['root_writable']; 
    323            
    324           echo 
    325           '<tr class="line wide">'. 
    326           '<td class="maximal nowrap"><strong>'.html::escapeHTML($k).'</strong></td>'. 
    327           '<td class="nowrap action">'; 
    328            
    329           if ($is_deletable || $is_activable) 
    330           { 
    331                echo 
    332                '<form action="plugins.php" method="post">'. 
    333                '<div>'. 
    334                $core->formNonce(). 
    335                form::hidden(array('plugin_id'),html::escapeHTML($k)). 
    336                form::hidden(array('deactivated'),1). 
    337                ($is_activable ? '<input type="submit" name="activate" value="'.__('Activate').'" /> ' : ''). 
    338                ($is_deletable ? '<input type="submit" class="delete" name="delete" value="'.__('Delete').'" /> ' : ''). 
    339                '</div>'. 
    340                '</form>'; 
    341           } 
    342            
    343           echo 
    344           '</td>'. 
    345           '</tr>'; 
    346      } 
    347      echo 
    348      '</table></div>'; 
    349 } 
    350  
    351 echo '</div>'; 
    352  
    353 # Add a new plugin 
    354 echo 
    355 '<div class="multi-part" id="addplugin" title="'.__('Install or upgrade a plugin').'">'; 
    356  
    357 if ($is_writable) 
    358 { 
    359      echo '<p>'.__('You can install plugins by uploading or downloading zip files.').'</p>'; 
    360       
    361      # 'Upload plugin' form 
    362      echo 
    363      '<form method="post" action="plugins.php" id="uploadpkg" enctype="multipart/form-data" class="fieldset">'. 
    364      '<h3>'.__('Upload a zip file').'</h3>'. 
    365      '<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file:').'</label> '. 
    366      '<input type="file" id="pkg_file" name="pkg_file" /></p>'. 
    367      '<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '. 
    368      form::password(array('your_pwd','your_pwd1'),20,255).'</p>'. 
    369      '<p><input type="submit" name="upload_pkg" value="'.__('Upload plugin').'" />'. 
    370      $core->formNonce(). 
    371      '</p>'. 
    372      '</form>'; 
    373       
    374      # 'Fetch plugin' form 
    375      echo 
    376      '<form method="post" action="plugins.php" id="fetchpkg" class="fieldset">'. 
    377      '<h3>'.__('Download a zip file').'</h3>'. 
    378      '<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file URL:').'</label> '. 
    379      form::field(array('pkg_url','pkg_url'),40,255).'</p>'. 
    380      '<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '. 
    381      form::password(array('your_pwd','your_pwd2'),20,255).'</p>'. 
    382      '<p><input type="submit" name="fetch_pkg" value="'.__('Download plugin').'" />'. 
    383      $core->formNonce().'</p>'. 
    384      '</form>'; 
    385 } 
    386 else 
    387 { 
    388      echo 
    389      '<p class="static-msg">'. 
    390      __('To enable this function, please give write access to your plugins directory.'). 
    391      '</p>'; 
    392 } 
    393 echo '</div>'; 
     264     '</div>'; 
     265} 
    394266 
    395267# --BEHAVIOR-- pluginsToolsTabs 
    396 $core->callBehavior('pluginsToolsTabs',$core); 
     268$core->callBehavior('pluginsToolsTabs', $core); 
     269 
     270# -- Notice for super admin -- 
     271if ($core->auth->isSuperAdmin() && !$list->isWritablePath()) { 
     272     echo  
     273     '<p class="warning">'.__('Some functions are disabled, please give write access to your plugins directory to enable them.').'</p>'; 
     274} 
    397275 
    398276dcPage::close(); 
    399 ?> 
  • admin/style/default.css

    r2260 r2267  
    11341134     #help-button span { 
    11351135          padding: .5em 0 .1em 0; 
    1136           border-bottom: 1px solid #2373A8; 
    11371136          } 
    11381137     #content.with-help #help-button { 
     
    17641763          border-bottom: none; 
    17651764          } 
    1766  
     1765.medias-delete { 
     1766     text-align: right; 
     1767     } 
    17671768.zip-dl { 
    17681769     background: transparent url(package.png) no-repeat 0 50%; 
     
    18351836.upload-fileinfo { 
    18361837     margin-left: 0; 
    1837 /*   margin-bottom: .4em;*/ 
    18381838     } 
    18391839.upload-fileinfo input { 
     
    23322332/* caché pour tout le monde */ 
    23332333.hide, .button.hide { 
    2334      display: none; 
     2334     display: none !important; 
    23352335     } 
    23362336/* Caché sauf pour les revues d'écran */ 
  • admin/style/default.css

    r2264 r2267  
    158158     -moz-box-sizing: border-box;  
    159159     -webkit-box-sizing: border-box;  
    160      box-sizing: border-box;   
     160     box-sizing: border-box; 
     161     text-align: left; 
    161162     } 
    162163.two-boxes { 
     
    11081109          } 
    11091110#help-button { 
    1110      background: transparent url(../images/page_help.png) no-repeat 6px center; 
     1111     background: transparent url(help-mini.png) no-repeat 6px center; 
    11111112     position: absolute; 
    11121113     top: 0; 
     
    15381539                    } 
    15391540/* ------------------------------------------------------------------- blog_theme.php */ 
    1540 #themes { 
    1541      margin: 0; 
    1542      width: 100%; 
    1543      padding: 0; 
    1544      } 
    1545      .theme-details { 
    1546           border-top: 1px solid #ccc; 
    1547           padding: 12px; 
    1548           display: inline-block; 
    1549           vertical-align: top; 
    1550           width: 284px; 
    1551           } 
    1552           .theme-details.current-theme { 
    1553                background: #eef; 
    1554                } 
    1555           .theme-details:hover { 
    1556                background: #f3f3f3; 
    1557                } 
    1558           .theme-shot img { 
    1559                display: block; 
    1560                border: 1px solid #ccc; 
    1561                margin-bottom: 1.5em; 
    1562                } 
    1563           span.theme-desc { 
    1564                display: block; 
    1565                } 
    1566           span.theme-version { 
    1567                color: #676e78; 
    1568                } 
    1569           .theme-css { 
    1570                display: block; 
    1571                } 
    1572      #themes-actions { 
    1573           border-bottom: 1px solid #999; 
    1574           margin-bottom: 3em; 
    1575           } 
    1576 /* Themes list, JS version */ 
    1577 #themes-wrapper { 
    1578      display: table; 
    1579      } 
    1580      #themes-wrapper #themes { 
    1581           display: table-cell; 
    1582           vertical-align: top; 
    1583           padding-left: 1em; 
    1584           } 
    1585      #theme-box { 
    1586           display: table-cell; 
    1587           vertical-align: top; 
    1588           padding: 0; 
    1589           width: 312px; 
    1590           border: 1px solid #ccc; 
    1591           border-radius: 3px; 
    1592           } 
    1593           #theme-box .theme-shot, 
    1594           #theme-box .theme-info, 
    1595           #theme-box .theme-actions { 
    1596                background: #eef; 
    1597                padding: 1em 16px; 
    1598                margin: 0; 
    1599                } 
    1600           #theme-box .theme-shot img { 
    1601                display: block; 
    1602                width: 280px; 
    1603                height: 245px; 
    1604                border: 1px solid #ccc; 
    1605                } 
    1606           #theme-box h4 { 
    1607                color: #000; 
    1608                background: #eef; 
    1609                } 
    1610           #theme-box span.theme-version { 
    1611                color: #676e78; 
    1612                } 
    1613           #theme-box span.theme-parent-ok { 
    1614                color: #676e78; 
    1615                } 
    1616           #theme-box span.theme-parent-missing { 
    1617                color: #c00; 
    1618                font-weight:bold; 
    1619                } 
    1620           #theme-box .theme-actions { 
    1621                border-bottom: 1px solid #ccc; 
    1622                } 
    1623 #themes .theme-details-js { 
     1541.box.theme { 
     1542     margin: .5em; 
     1543     padding: 1em 1em .5em 1em; 
     1544     border: 1px solid #ccc; 
     1545     } 
     1546#theme-new .box.theme { 
     1547     width: 280px; 
     1548     } 
     1549.module-name { 
     1550     margin-bottom: .5em; 
     1551     } 
     1552.module-sshot img { 
     1553     border: 1px solid #ddd; 
     1554     padding: .5em; 
     1555     background: #f7f7f7; 
     1556     box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); 
     1557     } 
     1558.module-actions { 
     1559     margin-top: 1em; 
     1560     } 
     1561.bloc-toggler { 
     1562     text-align: right; 
     1563     } 
     1564.bloc-toggler img { 
     1565     opacity: .4; 
     1566     } 
     1567.bloc-toggler img:hover { 
     1568     opacity: 1; 
     1569     } 
     1570span.module-version:before { 
     1571     content: "- "; 
     1572     } 
     1573.toggle-bloc .mod-more { 
     1574     display: block; 
     1575     margin-left: 0; 
     1576     } 
     1577.box.current-theme { 
     1578     width: 652px; 
     1579     margin: .5em; 
     1580     padding: 1em 0 .5em 1em; 
     1581     background: #FCFDFD; 
     1582     border: 1px solid #9AC123; 
     1583     -webkit-border-radius: .5em; 
     1584     border-radius: .5em; 
     1585     min-height: 330px;   
     1586     } 
     1587.current-theme .module-sshot img { 
    16241588     float: left; 
    1625      width: 120px; 
    1626      height: 150px; 
    1627      margin: 0 12px 24px; 
    1628      padding: 12px 12px 0; 
    1629      text-align: center; 
    1630      background: #f3f3f3; 
    1631      border: 1px solid #ddd; 
    1632      cursor: pointer; 
    1633      border-radius: 4px; 
    1634      } 
    1635      #themes .theme-details-js label { 
    1636           cursor: pointer; 
    1637           } 
    1638      #themes .theme-details-js.theme-selected { 
    1639           background: #e7e7e7; 
    1640           border: 1px solid #999; 
    1641           } 
    1642      #themes .theme-details-js .theme-shot img { 
    1643           width: 120px; 
    1644           height: 105px; 
    1645           border: 1px solid #fff; 
    1646           } 
    1647      #themes a:focus div, #themes a:hover div, 
    1648      #themes a:focus div.current-theme, #themes a:hover div.current-theme { 
    1649           background: #bee74b; 
    1650           } 
     1589     margin-right: 2em; 
     1590     margin-bottom: 1em; 
     1591     } 
     1592.current-theme .module-name { 
     1593     color: #D33800; 
     1594     margin-bottom: 1em; 
     1595     font-size: 1.33em; 
     1596     } 
     1597.box.theme input { 
     1598     margin-bottom: 1em; 
     1599     } 
     1600.current-actions { 
     1601     width: auto; 
     1602     overflow: hidden; 
     1603     padding-top: 3em; 
     1604     margin: 1.5em 0 2em; 
     1605     background: transparent url(../images/minus-theme.png) no-repeat left top; 
     1606     } 
    16511607/* ------------------------------------------------------------------ categories.php */ 
    16521608#categories { 
     
    19541910          } 
    19551911/* -------------------------------------------------------------------- plugins.php */ 
    1956 #plugins td.action { 
     1912.modules td.module-actions, .modules td.module-icon { 
    19571913     vertical-align: middle; 
    19581914     } 
    1959 .distrib img { 
     1915.modules td.module-icon img:last-child { 
     1916     width: 16px; 
     1917     height: 16px; 
     1918     } 
     1919.modules td.module-icon img.expand { 
     1920     margin-bottom: 3px; 
     1921     } 
     1922.modules td.module-distrib img { 
    19601923     display: block; 
    19611924     float: right; 
    1962      margin-top: -1em; 
     1925     } 
     1926.modules dt { 
     1927     font-weight: bold; 
     1928     } 
     1929.modules a.module-details { 
     1930     background: transparent url(search.png) no-repeat 2px 2px; 
     1931     padding: 4px 4px 0 20px; 
     1932     } 
     1933.modules a.module-support { 
     1934     background: transparent url(help12.png) no-repeat 2px 2px; 
     1935     padding: 4px 4px 0 20px; 
     1936     } 
     1937#m_search {     
     1938     background: transparent url(search.png) no-repeat 4px center; 
     1939     padding-left: 20px; 
     1940     } 
     1941.modules tr.expand, .modules td.expand { 
     1942     background: #f7f7f7; 
     1943     border-color: #bee74b; 
     1944     } 
     1945.modules tr.expand td:first-child { 
     1946     font-weight: bold; 
     1947     background: #DFE5E7; 
     1948     } 
     1949.modules td.expand { 
     1950     padding: 0; 
     1951     border-top: 1px solid #e5e5e5; 
     1952     } 
     1953.mod-more, .mod-more li { 
     1954     margin: .25em 0 0 1em; 
     1955     padding: 0; 
     1956     list-style-type: none; 
     1957     } 
     1958.mod-more { 
     1959     padding-top: .5em; 
    19631960     } 
    19641961/* ---------------------------------------------------------- post.php, page.php */ 
     
    23832380     } 
    23842381.debug { 
    2385      background: #FF6; 
     2382     background: #ff6; 
    23862383     padding: 3px 0.5em 2px; 
    2387      } 
     2384     } 
     2385input[type=submit].delete.debug, a.delete.debug { 
     2386     background: #ff6; 
     2387     } 
    23882388/* ---------------------------------------------- Couleurs ajoutées via javascript    
    23892389/* color-picker.js */ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map