Changeset 26439


Ignore:
Timestamp:
Jan 4, 2014, 2:54:52 PM (7 years ago)
Author:
mistic100
Message:

make help button globally available in $EXTDESC_BUTTON template variable

Location:
extensions/ExtendedDescription
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/include/admin.inc.php

    r26430 r26439  
    2020{
    2121  global $page, $template;
     22 
     23  load_language('plugin.lang', EXTENDED_DESC_PATH);
     24  $template->set_filename('extdesc_button', realpath(EXTENDED_DESC_PATH . 'template/help_button.tpl'));
     25  $template->assign_var_from_handle('EXTDESC_BUTTON', 'extdesc_button');
    2226
    23   $target = null;
    2427  switch ($page['page'])
    2528  {
     
    3639      $target = 'notification_by_mail';
    3740      break;
    38     case 'plugin':
    39       if ($_GET['section'] == 'AdditionalPages/admin.php') $target = 'plugin_admin_content';
    40       if ($_GET['section'] == 'header_manager/admin.php')  $target = 'header_manager';
    41       break;
    4241  }
    4342
    44   if (!empty($target))
     43  if (isset($target))
    4544  {
    46     load_language('plugin.lang', EXTENDED_DESC_PATH);
    4745    $template->set_prefilter($target, 'add_ed_help_prefilter');
    4846  }
     
    5149function add_ed_help_prefilter($content)
    5250{
    53   global $template;
    54   $themeconf = $template->get_template_vars('themeconf');
    55 
    56   $search = '</textarea>';
    57   $add = '
    58 {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}
    59 <a href="./admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="'.l10n('Use Extended Description tags...').'" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="'.$themeconf['admin_icon_dir'].'/help.png" class="button" alt="'.l10n('Use Extended Description tags...').'"></a>';
    60 
    61   return str_replace($search, $search.$add, $content);
     51  return str_replace('</textarea>', '</textarea> {$EXTDESC_BUTTON}', $content);
    6252}
    6353
Note: See TracChangeset for help on using the changeset viewer.