Dotclear


Ignore:
Timestamp:
05/18/11 22:46:23 (12 years ago)
Author:
Moe
Message:

Admin Example 0.2:

  • Dotclear 2.3:
    • added behaviours and images for the new dashboard
    • added required field
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/adminExample/_admin.php

    r1719 r3043  
    88# http://sam.zoy.org/wtfpl/COPYING for more details. 
    99#  
    10 # Icon (icon.png) is from Silk Icons : 
    11 #  http://www.famfamfam.com/lab/icons/silk/ 
     10# Icons by http://dryicons.com 
    1211#  
    1312# ***** END LICENSE BLOCK ***** 
     
    3231     # permissions nécessaires pour afficher le lien 
    3332     $core->auth->check('usage,contentadmin',$core->blog->id)); 
     33 
     34$core->addBehavior('adminDashboardFavs', 
     35     array('adminExampleBehaviors','adminDashboardFavs')); 
     36 
     37$core->addBehavior('adminDashboardFavsIcon', 
     38     array('adminExampleBehaviors','adminDashboardFavsIcon')); 
     39  
     40class adminExampleBehaviors 
     41{ 
     42    public static function adminDashboardFavs($core,$favs) 
     43    { 
     44        $favs['adminExample'] = new ArrayObject(array( 
     45            'adminExample', 
     46            __('Admin example'), 
     47            'plugin.php?p=adminExample', 
     48            'index.php?pf=adminExample/icon.png', 
     49            'index.php?pf=adminExample/icon-big.png', 
     50            'usage,contentadmin', 
     51            null, 
     52            null)); 
     53    } 
     54 
     55    public static function adminDashboardFavsIcon($core,$name,$icon) 
     56    { 
     57               if ($name == 'adminExample') 
     58               { 
     59                    # this is an example to show how the icon, the URL and the URL 
     60                    #  can be changed with a test 
     61                    # ceci est un un exemple pour montrer comment l'icône, l'URL et 
     62                    #  l'image peuvent être changées avec un test 
     63                    if ($core->blog->settings->adminExample->adminexample_active) 
     64                    { 
     65                         $icon[0] = __('Admin example: active'); 
     66                         $icon[1] = 'plugin.php?p=adminExample&tab=settings'; 
     67                         $icon[2] = 'index.php?pf=adminExample/icon-big.png'; 
     68                    } 
     69                    else 
     70                    { 
     71                         $icon[0] = __('Admin example: inactive'); 
     72                         $icon[1] = 'plugin.php?p=adminExample'; 
     73                         $icon[2] = 'index.php?pf=adminExample/icon-block.png'; 
     74                    } 
     75               } 
     76    } 
     77} 
     78 
    3479?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map