Dotclear


Ignore:
Timestamp:
09/29/13 23:10:54 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
dcRepo
Message:

Add rest service to get more module info on modules list through ajax

Location:
inc/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r2113 r2156  
    604604          self::jsVar('dotclear.msg.load_enhanced_uploader', 
    605605               __('Loading enhanced uploader, please wait.')). 
     606 
     607          self::jsVar('dotclear.msg.module_author', 
     608               __('Author:')). 
     609          self::jsVar('dotclear.msg.module_details', 
     610               __('Details')). 
     611          self::jsVar('dotclear.msg.module_support', 
     612               __('Support:')). 
     613          self::jsVar('dotclear.msg.module_help', 
     614               __('Aide:')). 
     615          self::jsVar('dotclear.msg.module_section', 
     616               __('Section:')). 
     617          self::jsVar('dotclear.msg.module_tags', 
     618               __('Tags:')). 
    606619               "\n//]]>\n". 
    607620          "</script>\n"; 
  • inc/admin/lib.moduleslist.php

    r2149 r2156  
    88     public static  $allow_multi_install; 
    99 
     10     protected $list_id = 'unknow'; 
     11 
    1012     protected $path = false; 
    1113     protected $path_writable = false; 
     
    3638     { 
    3739          return null; 
     40     } 
     41 
     42     public function newList($list_id) 
     43     { 
     44          $this->modules = array(); 
     45          $this->page_tab = ''; 
     46          $this->list_id = $list_id; 
     47 
     48          return $this; 
    3849     } 
    3950 
     
    236247          $this->modules = array(); 
    237248          foreach($modules as $id => $module) { 
    238                $this->modules[$id] = $this->setModuleInfo($id, $module); 
     249               $this->modules[$id] = self::setModuleInfo($id, $module); 
    239250          } 
    240251 
     
    247258     } 
    248259 
    249      protected function setModuleInfo($id, $module) 
     260     public static function setModuleInfo($id, $module) 
    250261     { 
    251262          $label = empty($module['label']) ? $id : $module['label']; 
     
    264275                    'parent'            => null, 
    265276                    'priority'               => 1000, 
    266                     'standalone_config' => false 
     277                    'standalone_config' => false, 
     278                    'support'                => '', 
     279                    'section'                => '', 
     280                    'tags'                   => '', 
     281                    'details'                => '' 
    267282               ), 
    268283               # Module's values 
     
    317332          echo  
    318333          '<div class="table-outer">'. 
    319           '<table class="modules"><caption class="hidden">'.html::escapeHTML(__('Modules list')).'</caption><tr>'; 
     334          '<table id="'.html::escapeHTML($this->list_id).'" class="modules'.(in_array('expander', $cols) ? ' expandable' : '').'">'. 
     335          '<caption class="hidden">'.html::escapeHTML(__('Modules list')).'</caption><tr>'; 
     336/* 
     337          if (in_array('expander', $cols)) { 
     338               echo 
     339               '<th class="minimal"></th>'; 
     340          } 
     341//*/ 
    320342/* 
    321343          if ($this->getSearchQuery() !== null) { 
     
    378400 
    379401               echo  
    380                '<tr class="line" id="'.$this->getPageTab().'_p_'.html::escapeHTML($id).'">'; 
    381  
     402               '<tr class="line" id="'.html::escapeHTML($this->list_id).'_m_'.html::escapeHTML($id).'" title="plop">'; 
     403/* 
     404               if (in_array('expander', $cols)) { 
     405                    echo 
     406                    '<td class="minimal expander" title="'.html::escapeHTML($id).'"></td>'; 
     407               } 
     408//*/ 
     409/* 
     410               if ($this->getSearchQuery() !== null) { 
     411                    echo  
     412                    '<td class="nowrap count">'.$module['accuracy'].'</td>'; 
     413               } 
     414//*/ 
    382415               if (in_array('icon', $cols)) { 
    383416                    echo  
    384417                    '<td class="nowrap icon">'.sprintf( 
    385418                         '<img alt="%1$s" title="%1$s" src="%2$s" />',  
    386                          html::escapeHTML($id), file_exists($module['root'].'/icon.png') ? 'index.php?pf='.$id.'/icon.png' : 'images/favicon.png' 
     419                         html::escapeHTML($id), file_exists($module['root'].'/icon.png') ? 'index.php?pf='.$id.'/icon.png' : 'images/module.png' 
    387420                    ).'</td>'; 
    388421               } 
    389 /* 
    390                if ($this->getSearchQuery() !== null) { 
    391                     echo  
    392                     '<td class="nowrap count">'.$module['accuracy'].'</td>'; 
    393                } 
    394 //*/ 
     422 
    395423               # Link to config file 
    396424               $config = in_array('config', $cols) && !empty($module['root']) && file_exists(path::real($module['root'].'/_config.php')); 
     
    430458                    '<td class="nowrap">'; 
    431459 
    432                     $this->displayInlineActions($id, $module, $actions); 
     460                    $this->displayLineActions($id, $module, $actions); 
    433461 
    434462                    echo 
     
    450478     } 
    451479 
    452      protected function displayInlineActions($id, $module, $actions) 
     480     protected function displayLineActions($id, $module, $actions) 
    453481     { 
    454482          $submits = array(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map