Dotclear


Ignore:
Timestamp:
08/16/13 10:39:47 (12 years ago)
Author:
Dsls
Branch:
default
Message:
  • Added foldable sidebar entries,
  • Added new behavior : adminPostFormSidebarItems
  • Sidebar entries are now manageable from plugins

see #1533

Location:
plugins/tags
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/tags/_admin.php

    r1365 r1392  
    1818require dirname(__FILE__).'/_widgets.php'; 
    1919 
    20 $core->addBehavior('adminPostFormSidebar',array('tagsBehaviors','tagsField')); 
     20$core->addBehavior('adminPostFormSidebarItems',array('tagsBehaviors','tagsField')); 
    2121 
    2222$core->addBehavior('adminAfterPostCreate',array('tagsBehaviors','setTags')); 
     
    7171     } 
    7272      
    73      public static function tagsField($post) 
     73     public static function tagsField($items,$post) 
    7474     { 
    7575          $meta =& $GLOBALS['core']->meta; 
     
    8080               $value = ($post) ? $meta->getMetaStr($post->post_meta,'tag') : ''; 
    8181          } 
    82            
    83           echo 
    84           '<h5><label for="post_tags">'.__('Tags:').'</label></h5>'. 
    85           '<div class="p" id="tags-edit">'.form::textarea('post_tags',20,3,$value,'maximal').'</div>'; 
     82          $items['metas-box']['items']['post_tags']= 
     83          '<h5><label class="s-tags" for="post_tags">'.__('Tags:').'</label></h5>'. 
     84          '<div class="p s-tags" id="tags-edit">'.form::textarea('post_tags',20,3,$value,'maximal').'</div>'; 
    8685     } 
    8786      
  • plugins/tags/_define.php

    r1179 r1392  
    1818     /* Version */            '1.2', 
    1919     array( 
    20           'permissions' =>    'usage,contentadmin' 
     20          'permissions' =>    'usage,contentadmin', 
     21          'priority' =>       998 
    2122     ) 
    2223); 
  • plugins/tags/js/post.js

    r1112 r1392  
    5858          }); 
    5959     }); 
     60                
     61     $('h5 .s-tags').toggleWithLegend($('.s-tags').not('label'),{ 
     62               cookie: 'post_tags' 
     63     }); 
     64 
    6065}); 
    6166 
Note: See TracChangeset for help on using the changeset viewer.

Sites map