Ignore:
Timestamp:
07/01/11 12:16:30 (9 years ago)
Author:
plg
Message:

feature 2372 added: shortcut to edit CSS file from the themes page. If plugin
LocalFiles Editor is active, a link "CSS" is displayed under each active theme
and goes directly to the CSS edition page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/main.inc.php

    r10351 r11586  
    4747} 
    4848 
     49function localfiles_css_link() 
     50{ 
     51  global $template; 
     52   
     53  $template->set_prefilter('themes', 'localfiles_css_link_prefilter'); 
     54} 
     55 
     56function localfiles_css_link_prefilter($content, &$smarty) 
     57{ 
     58  $search = '#{if isset\(\$theme.admin_uri\)}.*?{/if}#s'; 
     59  $replacement = ' 
     60{if isset($theme.admin_uri)} 
     61      <br><a href="{$theme.admin_uri}" title="{\'Configuration\'|@translate}">{\'Configuration\'|@translate}</a> 
     62      | <a href="admin.php?page=plugin-LocalFilesEditor-css&amp;theme={$theme.id}">CSS</a> 
     63{else} 
     64      <br><a href="admin.php?page=plugin-LocalFilesEditor-css&amp;theme={$theme.id}">CSS</a> 
     65{/if} 
     66'; 
     67 
     68  return preg_replace($search, $replacement, $content); 
     69} 
     70 
    4971add_event_handler('get_admin_plugin_menu_links', 'localfiles_admin_menu'); 
    50  
     72add_event_handler('loc_begin_admin', 'localfiles_css_link'); 
    5173?> 
Note: See TracChangeset for help on using the changeset viewer.