Dotclear

Changeset 2241:4168cffbc76e


Ignore:
Timestamp:
10/04/13 10:34:31 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
dcRepo
Message:

Open action per module to plugin, enjoy

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_theme.php

    r2237 r2241  
    134134 
    135135          $list 
    136                ->initList('theme-update') 
     136               ->setList('theme-update') 
    137137               ->setTab('themes') 
    138138               ->setModules($modules) 
     
    163163 
    164164     $list 
    165           ->initList('theme-activate') 
     165          ->setList('theme-activate') 
    166166          ->setTab('themes') 
    167167          ->setModules($modules) 
    168168          ->displayModules( 
    169169               /* cols */          array('sshot', 'distrib', 'name', 'config', 'desc', 'author', 'version', 'parent'), 
    170                /* actions */  array('select', 'deactivate', 'delete') 
     170               /* actions */  array('select', 'behavior', 'deactivate', 'delete') 
    171171          ); 
    172172 
     
    185185 
    186186     $list 
    187           ->initList('theme-deactivate') 
     187          ->setList('theme-deactivate') 
    188188          ->setTab('themes') 
    189189          ->setModules($modules) 
     
    210210 
    211211          $list 
    212                ->initList('theme-new') 
     212               ->setList('theme-new') 
    213213               ->setTab('new') 
    214214               ->setModules($modules) 
  • admin/plugins.php

    r2237 r2241  
    157157 
    158158          $list 
    159                ->initList('plugin-update') 
     159               ->setList('plugin-update') 
    160160               ->setTab('update') 
    161161               ->setModules($modules) 
     
    188188 
    189189     $list 
    190           ->initList('plugin-activate') 
     190          ->setList('plugin-activate') 
    191191          ->setTab('plugins') 
    192192          ->setModules($modules) 
    193193          ->displayModules( 
    194194               /* cols */          array('expander', 'icon', 'name', 'config', 'version', 'desc', 'distrib'), 
    195                /* actions */  array('deactivate', 'delete') 
     195               /* actions */  array('deactivate', 'delete', 'behavior') 
    196196          ); 
    197197} 
     
    206206 
    207207          $list 
    208                ->initList('plugin-deactivate') 
     208               ->setList('plugin-deactivate') 
    209209               ->setTab('plugins') 
    210210               ->setModules($modules) 
     
    232232 
    233233          $list 
    234                ->initList('plugin-new') 
     234               ->setList('plugin-new') 
    235235               ->setTab('new') 
    236236               ->setModules($modules) 
  • admin/style/default.css

    r2240 r2241  
    15831583     font-size: 1.33em; 
    15841584     } 
     1585input { 
     1586     margin-bottom: 1em; 
     1587     } 
    15851588/* ------------------------------------------------------------------ categories.php */ 
    15861589#categories { 
     
    23582361     background: #ff6; 
    23592362     padding: 3px 0.5em 2px; 
     2363     } 
     2364input[type=submit].delete.debug, a.delete.debug { 
     2365     background: #ff6; 
    23602366     } 
    23612367/* ---------------------------------------------- Couleurs ajoutées via javascript    
  • inc/admin/lib.moduleslist.php

    r2227 r2241  
    7575      * @return     adminModulesList self instance 
    7676      */ 
    77      public function initList($id) 
     77     public function setList($id) 
    7878     { 
    7979          $this->data = array(); 
     
    8282 
    8383          return $this; 
     84     } 
     85 
     86     /** 
     87      * Get list ID. 
     88      * 
     89      * @return     List ID 
     90      */ 
     91     public function getList() 
     92     { 
     93          return $this->list_id; 
    8494     } 
    8595 
     
    136146     { 
    137147          return $this->path_writable  
    138                && preg_match('!^'.$this->path_pattern.'!', $root)  
     148               && (preg_match('!^'.$this->path_pattern.'!', $root) || defined('DC_DEV') && DC_DEV)  
    139149               && $this->core->auth->isSuperAdmin(); 
    140150     } 
     
    652662                    # Delete 
    653663                    case 'delete': if ($this->isDeletablePath($module['root'])) { 
     664                         $dev = !preg_match('!^'.$this->path_pattern.'!', $module['root']) && defined('DC_DEV') && DC_DEV ? ' debug' : ''; 
    654665                         $submits[] =  
    655                          '<input type="submit" class="delete" name="delete" value="'.__('Delete').'" />'; 
     666                         '<input type="submit" class="delete '.$dev.'" name="delete" value="'.__('Delete').'" />'; 
    656667                    } break; 
    657668 
     
    667678                         '<input type="submit" name="update" value="'.__('Update').'" />'; 
    668679                    } break; 
    669                } 
    670           } 
     680 
     681                    # Behavior 
     682                    case 'behavior': 
     683 
     684                         # --BEHAVIOR-- adminModulesListGetActions 
     685                         $tmp = $this->core->callBehavior('adminModulesListGetActions', $this, $id, $module); 
     686 
     687                         if (!empty($tmp)) { 
     688                              $submits[] = $tmp; 
     689                         } 
     690                    break; 
     691               } 
     692          } 
     693 
    671694 
    672695          return $submits; 
     
    798821               elseif (!empty($_POST['update'])) { 
    799822 
    800                     $updated = $store->get(); 
     823                    $updated = $this->store->get(); 
    801824                    if (!isset($updated[$id])) { 
    802825                         throw new Exception(__('No such module.')); 
     
    830853                    dcPage::addSuccessNotice(__('Module has been successfully updated.')); 
    831854                    http::redirect($this->getURL()); 
     855               } 
     856               else { 
     857 
     858                    # --BEHAVIOR-- adminModulesListDoActions 
     859                    $this->core->callBehavior('adminModulesListDoActions', $this, $id, $prefix); 
     860 
    832861               } 
    833862          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map