Dotclear

Changeset 587:98698950a78c for plugins


Ignore:
Timestamp:
07/13/11 11:05:17 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
themes
Message:

Le menu simple peut dorénavant être placé en widget

Location:
plugins/simpleMenu
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_admin.php

    r534 r587  
    2828                preg_match('/plugin.php\?p=simpleMenu(&.*)?$/',$_SERVER['REQUEST_URI']), 
    2929                $core->auth->check('usage,contentadmin',$core->blog->id)); 
     30 
     31require dirname(__FILE__).'/_widgets.php'; 
    3032?> 
  • plugins/simpleMenu/_define.php

    r586 r587  
    1616     /* Description*/         "Simple menu for Dotclear", 
    1717     /* Author */             "Franck Paul", 
    18      /* Version */            '0.7', 
     18     /* Version */            '0.8', 
    1919     array( 
    2020          'permissions' =>    'admin' 
  • plugins/simpleMenu/_public.php

    r567 r587  
    1212if (!defined('DC_RC_PATH')) { return; } 
    1313 
     14require dirname(__FILE__).'/_widgets.php'; 
     15 
    1416# Simple menu template functions 
    1517$core->tpl->addValue('SimpleMenu',array('tplSimpleMenu','simpleMenu')); 
     
    1719class tplSimpleMenu 
    1820{ 
     21     # Template function 
    1922     public static function simpleMenu($attr) 
    2023     { 
     
    3235                    "'".addslashes($description)."'". 
    3336               '); ?>'; 
     37     } 
     38      
     39     # Widget function 
     40     public static function simpleMenuWidget($w) 
     41     { 
     42          global $core, $_ctx; 
     43           
     44          if ($w->homeonly && $core->url->type != 'default') { 
     45               return; 
     46          } 
     47 
     48          $menu = tplSimpleMenu::displayMenu(); 
     49          if ($menu == '') { 
     50               return; 
     51          } 
     52 
     53          return '<div class="simple-menu">'.($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : '').$menu.'</div>'; 
    3454     } 
    3555      
  • plugins/simpleMenu/index.php

    r573 r587  
    109109 
    110110# --BEHAVIOR-- adminSimpleMenuAddType 
    111 # Should add an item to $items as an array(<label>,<optional step (true or false)>) 
     111# Should add an item to $items[<id>] as an array(<label>,<optional step (true or false)>) 
    112112$core->callBehavior('adminSimpleMenuAddType',$items); 
    113113 
Note: See TracChangeset for help on using the changeset viewer.

Sites map