Dotclear

Changeset 2174:6ed25e45a14e


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

Add update message to dashboard icons

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_theme.php

    r2171 r2174  
    7474     else { 
    7575          $module = $core->themes->getModules($_REQUEST['module']); 
    76           $module = adminModulesList::setModuleInfo($_REQUEST['module'], $module); 
     76          $module = adminModulesList::parseModuleInfo($_REQUEST['module'], $module); 
    7777 
    7878          if (!file_exists(path::real($module['root'].'/_config.php'))) { 
  • admin/index.php

    r2159 r2174  
    123123     } 
    124124     $__dashboard_icons['prefs'] = new ArrayObject(array(__('My preferences'),'preferences.php','images/menu/user-pref-b.png')); 
     125} 
     126 
     127# Check plugins and themes update from repository 
     128function dc_check_repository_update($mod, $url, $img, $icon) 
     129{ 
     130     $repo = new dcRepository($mod, $url); 
     131     $repo->check(); 
     132     $upd = $repo->get(true); 
     133     if (!empty($upd)) { 
     134          $icon[0] .= '<br />'.sprintf(__('An update is available', '%s updates are available.', count($upd)),count($upd)); 
     135          $icon[1] .= '#update'; 
     136          $icon[2] = 'images/menu/'.$img.'-b-update.png'; 
     137     } 
     138} 
     139if (isset($__dashboard_icons['plugins'])) { 
     140     dc_check_repository_update($core->plugins, $core->blog->settings->system->repository_plugin_url, 'plugins', $__dashboard_icons['plugins']); 
     141} 
     142if (isset($__dashboard_icons['blog_theme'])) { 
     143     $themes = new dcThemes($core); 
     144     $themes->loadModules($core->blog->themes_path, null); 
     145     dc_check_repository_update($themes, $core->blog->settings->system->repository_theme_url, 'blog-theme', $__dashboard_icons['blog_theme']); 
    125146} 
    126147 
  • admin/plugins.php

    r2171 r2174  
    7171     else { 
    7272          $module = $core->plugins->getModules($_REQUEST['module']); 
    73           $module = adminModulesList::setModuleInfo($_REQUEST['module'], $module); 
     73          $module = adminModulesList::parseModuleInfo($_REQUEST['module'], $module); 
    7474 
    7575          if (!file_exists(path::real($module['root'].'/_config.php'))) { 
  • admin/services.php

    r2156 r2174  
    485485          } 
    486486 
    487           $module = adminModulesList::setModuleInfo($id, $module); 
     487          $module = adminModulesList::parseModuleInfo($id, $module); 
    488488 
    489489          $rsp = new xmlTag('module'); 
  • inc/admin/lib.moduleslist.php

    r2171 r2174  
    243243     { 
    244244          $this->modules = array(); 
    245           foreach($modules as $id => $module) { 
    246                $this->modules[$id] = self::setModuleInfo($id, $module); 
    247           } 
    248  
     245          if (!empty($modules) && is_array($modules)) { 
     246               foreach($modules as $id => $module) { 
     247                    $this->modules[$id] = self::parseModuleInfo($id, $module); 
     248               } 
     249          } 
    249250          return $this; 
    250251     } 
     
    255256     } 
    256257 
    257      public static function setModuleInfo($id, $module) 
     258     public static function parseModuleInfo($id, $module) 
    258259     { 
    259260          $label = empty($module['label']) ? $id : $module['label']; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map