Floodlight.php
author Dan
Sun, 21 Dec 2008 23:10:15 -0500
changeset 0 4d19ad17b07c
child 1 c9c49ce179e9
permissions -rw-r--r--
First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     1
<?php
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     2
/**!info**
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     3
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     4
  "Plugin Name"  : "Floodlight",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     5
  "Plugin URI"   : "http://enanocms.org/plugin/floodlight",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     6
  "Description"  : "A much broader search than Spotlight. Adds auto-completion to the Search sidebar block.",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     7
  "Author"       : "Dan Fuhry",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     8
  "Version"      : "1.1.5",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
     9
  "Author URI"   : "http://enanocms.org/"
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    10
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    11
**!*/
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    12
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    13
$plugins->attachHook('sidebar_fetch_return', 'floodlight_inject_searchflags($return);');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    14
$plugins->attachHook('autofill_json_request', 'floodlight_perform_search($dataset);');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    15
$plugins->attachHook('session_started', 'floodlight_add_js_page();');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    16
$plugins->attachHook('common_post', 'floodlight_intercept_search();');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    17
$plugins->attachHook('compile_template', 'floodlight_add_js();');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    18
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    19
function floodlight_inject_searchflags(&$return)
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    20
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    21
  if ( strstr($return[0], '<input name="q"') )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    22
  {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    23
    $hackme =& $return[0];
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    24
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    25
  else if ( strstr($return[1], '<input name="q"') )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    26
  {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    27
    $hackme =& $return[1];
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    28
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    29
  else
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    30
  {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    31
    return;
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    32
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    33
  $hackme = str_replace('<input name="q"', '<input name="q" autocomplete="off" onkeyup="this.onkeyup = null; this.className = \'autofill floodlight\'; autofill_init_element(this, {});"', $hackme);
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    34
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    35
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    36
function floodlight_perform_search(&$dataset)
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    37
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    38
  global $db, $session, $paths, $template, $plugins; // Common objects
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    39
  if ( $_GET['type'] == 'floodlight' )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    40
  {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    41
    $results = perform_search($_GET['userinput'], $warnings, false, $word_list);
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    42
    if ( count($results) > 5 )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    43
    {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    44
      $results = array_slice($results, 0, 5);
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    45
    }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    46
    foreach ( $results as $result )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    47
    {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    48
      $dataset[] = array(
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    49
          0 => "go:{$paths->nslist[$result['namespace']]}{$result['page_id']}",
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    50
          'title' => str_replace(array('<highlight>', '</highlight>'), array('<b>', '</b>'), $result['page_name']),
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    51
          'score' => $result['score'],
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    52
          'type' => $result['page_note'],
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    53
          'size' => $result['page_length'],
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    54
        );
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    55
    }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    56
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    57
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    58
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    59
function floodlight_add_js_page()
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    60
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    61
  global $db, $session, $paths, $template, $plugins; // Common objects
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    62
  $paths->add_page(array(
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    63
      'name' => 'Floodlight Javascript',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    64
      'urlname' => 'FloodlightJS',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    65
      'namespace' => 'Special',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    66
      'visible' => 0,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    67
      'protected' => 0,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    68
      'comments_on' => 0,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    69
      'special' => 0
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    70
    ));
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    71
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    72
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    73
function floodlight_intercept_search()
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    74
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    75
  global $db, $session, $paths, $template, $plugins; // Common objects
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    76
  if ( $paths->page_id == 'Search' && $paths->namespace == 'Special' )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    77
  {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    78
    if ( isset($_GET['q']) && preg_match('/^go:/', $_GET['q']) )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    79
    {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    80
      redirect(makeUrl(preg_replace('/^go:/', '', $_GET['q'])), '', '', 0);
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    81
    }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    82
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    83
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    84
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    85
function floodlight_add_js()
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    86
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    87
  global $db, $session, $paths, $template, $plugins; // Common objects
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    88
  $template->add_header('<script type="text/javascript" src="' . makeUrlNS('Special', 'FloodlightJS', false, true) . '"></script>');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    89
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    90
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    91
function page_Special_FloodlightJS()
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    92
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    93
  global $db, $session, $paths, $template, $plugins; // Common objects
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    94
  header('Content-type: text/javascript');
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    95
  header('ETag: ' . sha1(__FILE__));
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    96
  
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    97
  global $aggressive_optimize_html;
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    98
  $aggressive_optimize_html = false;
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
    99
  
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   100
  echo <<<EOF
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   101
addOnloadHook(function()
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   102
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   103
  var autofill_schemas = window.autofill_schemas || {};
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   104
  autofill_schemas.floodlight = {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   105
    init: function(element, fillclass, params)
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   106
    {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   107
      params = params || {};
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   108
      $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   109
          minChars: 3,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   110
          formatItem: function(row, _, __)
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   111
          {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   112
            var type = ( typeof(row.type) == 'string' ) ? row.type : '';
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   113
            var html = '<big>' + row.title + '</big> <small>' + type + '</small>';
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   114
            html += '<br /><small>' + \$lang.get('floodlight_lbl_score') + row.score + '% | ' + row.size + '</small>';
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   115
            return html;
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   116
          },
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   117
          tableHeader: '<tr><th>' + \$lang.get('floodlight_table_heading') + '</th></tr>',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   118
          showWhenNoResults: true,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   119
          onItemSelect: function(li)
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   120
          {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   121
            window.location = makeUrl(li.selectValue.replace(/^go:/, ''));
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   122
          },
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   123
          width: 300,
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   124
          noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + \$lang.get('floodlight_msg_no_results') + '</td></tr>',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   125
      });
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   126
    }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   127
  };
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   128
});
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   129
EOF;
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   130
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   131
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   132
/**!language**
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   133
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   134
The following text up to the closing comment tag is JSON language data.
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   135
It is not PHP code but your editor or IDE may highlight it as such. This
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   136
data is imported when the plugin is loaded for the first time; it provides
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   137
the strings displayed by this plugin's interface.
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   138
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   139
You should copy and paste this block when you create your own plugins so
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   140
that these comments and the basic structure of the language data is
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   141
preserved. All language data is in the same format as the Enano core
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   142
language files in the /language/* directories. See the Enano Localization
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   143
Guide and Enano API Documentation for further information on the format of
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   144
language files.
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   145
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   146
The exception in plugin language file format is that multiple languages
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   147
may be specified in the language block. This should be done by way of making
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   148
the top-level elements each a JSON language object, with elements named
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   149
according to the ISO-639-1 language they are representing. The path should be:
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   150
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   151
  root => language ID => categories array, ( strings object => category \
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   152
  objects => strings )
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   153
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   154
All text leading up to first curly brace is stripped by the parser; using
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   155
a code tag makes jEdit and other editors do automatic indentation and
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   156
syntax highlighting on the language data. The use of the code tag is not
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   157
necessary; it is only included as a tool for development.
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   158
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   159
<code>
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   160
{
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   161
  // english
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   162
  eng: {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   163
    categories: [ 'meta', 'floodlight' ],
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   164
    strings: {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   165
      meta: {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   166
        floodlight: 'Floodlight plugin'
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   167
      },
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   168
      floodlight: {
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   169
        table_heading: 'Search results',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   170
        msg_no_results: 'No results',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   171
        lbl_score: 'Relevance: ',
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   172
      }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   173
    }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   174
  }
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   175
}
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   176
</code>
4d19ad17b07c First revision, seems working. Yes, using a className of "autofill floodlight" will give your theme/whatever support for this plugin.
Dan
parents:
diff changeset
   177
**!*/