Dotclear


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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