Skip to content
Permalink
Browse files

Rename the plugin.

  • Loading branch information...
gamma committed Apr 24, 2017
1 parent 29637cc commit fc11132953980e407f713b7c583a188acca49a3a
Showing with 26 additions and 25 deletions.
  1. +1 −0 README.md
  2. +1 −1 action.php
  3. +5 −5 helper.php
  4. +5 −5 plugin.info.txt
  5. +7 −7 style.css
  6. +7 −7 syntax.php
@@ -0,0 +1 @@
# NamespaceSearch Plugin
@@ -1,7 +1,7 @@
<?php
if(!defined('DOKU_INC')) die();
class action_plugin_fancysearch extends DokuWiki_Action_Plugin {
class action_plugin_namespacesearch extends DokuWiki_Action_Plugin {
/**
* Register its handlers with the DokuWiki's event controller
@@ -10,7 +10,7 @@
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
class helper_plugin_fancysearch extends DokuWiki_Plugin {
class helper_plugin_namespacesearch extends DokuWiki_Plugin {
function tpl_searchform($namespaces, $return = false) {
global $QUERY;
@@ -30,10 +30,10 @@ function tpl_searchform($namespaces, $return = false) {
list($ns, $name, $class) = $namespaces[0];
$namespaceSelect = '<input name="namespace" value="'.hsc($ns).'" type="hidden"/>';
} else {
$namespaceSelect = '<select class="fancysearch_namespace" name="namespace">';
$namespaceSelect = '<select class="namespacesearch_namespace" name="namespace">';
foreach ($namespaces as $element) {
list($ns, $name, $class) = $element;
$namespaceSelect .= '<option class="fancysearch_ns_'.hsc($class).'" value="'.hsc($ns).'"'.($cur_val === $ns ? ' selected="selected"' : '').'>'.$name.'</option>';
$namespaceSelect .= '<option class="namespacesearch_ns_'.hsc($class).'" value="'.hsc($ns).'"'.($cur_val === $ns ? ' selected="selected"' : '').'>'.$name.'</option>';
}
$namespaceSelect .= '</select>';
}
@@ -42,9 +42,9 @@ function tpl_searchform($namespaces, $return = false) {
$searchForm = substr_replace($searchForm, $namespaceSelect, strpos($searchForm, '<input'), 0);
if ( $return ) {
return '<div id="dokuwiki__sitetools" class="fancysearch__container">'.$searchForm.'</div>';
return '<div id="dokuwiki__sitetools" class="namespacesearch__container">'.$searchForm.'</div>';
} else {
print '<div class="fancysearch__container">'.$searchForm.'</div>';
print '<div class="namespacesearch__container">'.$searchForm.'</div>';
}
}
@@ -1,7 +1,7 @@
base fancysearch
base namespacesearch
author Adrian Lang
email dokuwiki@cosmocode.de
date 2015-05-28
name Fancysearch Plugin
email tools@inetsoftware.de
date 2017-04-24
name NamespaceSearch Plugin (formerly Fancysearch)
desc Provides a dropdown list for common namespaces enhancing the search input.
url https://github.com/cosmocode/fancysearch
url https://github.com/i-net-software/dokuwiki-plugin-namespacesearch
@@ -1,18 +1,18 @@
#dokuwiki__sitetools.fancysearch__container {
#dokuwiki__sitetools.namespacesearch__container {
font-size: 1em;
}

div.fancysearch__container form.search {
div.namespacesearch__container form.search {
margin-left: auto;
margin-right: auto;
display: block;
}

div.fancysearch__container form.search div.no {
div.namespacesearch__container form.search div.no {
display: inline-block;
}

select.fancysearch_namespace {
select.namespacesearch_namespace {
background: transparent;
border: none;
display: inline-block;
@@ -29,15 +29,15 @@ select.fancysearch_namespace {
padding: 0px 10px;
}

select.fancysearch_namespace:hover {
select.namespacesearch_namespace:hover {
background: __highlight__;
}

select.fancysearch_namespace option:nth-child(2n+1) {
select.namespacesearch_namespace option:nth-child(2n+1) {
background: __light__;
}

select.fancysearch_namespace option {
select.namespacesearch_namespace option {
background: __highlight__;
}

@@ -13,14 +13,14 @@
require_once(DOKU_PLUGIN.'syntax.php');
class syntax_plugin_fancysearch extends DokuWiki_Syntax_Plugin {
class syntax_plugin_namespacesearch extends DokuWiki_Syntax_Plugin {
function getType() { return 'substition'; }
function getPType() { return 'block'; }
function getSort() { return 98; }
function connectTo($mode) {
$this->Lexer->addSpecialPattern('{{fancysearch>.*?}}', $mode, 'plugin_fancysearch');
$this->Lexer->addSpecialPattern('{{namespacesearch>.*?}}', $mode, 'plugin_namespacesearch');
}
function handle($match, $state, $pos, Doku_Handler $handler) {
@@ -51,10 +51,10 @@ function render($mode, Doku_Renderer $renderer, $data) {
$renderer->nocache();
$helper = &plugin_load('helper', 'fancysearch');
$helper = &plugin_load('helper', 'namespacesearch');
$form = new Doku_Form('fancySearchForm', wl($ID));
$form->addElement(form_makeTextField('fancySearchField', $FANCYDATA['fancySearchField'], $this->getLang('keywords') . ':', 'fancySearchField', null, array('autocomplete'=>'off')));
$form = new Doku_Form('namespacesearchForm', wl($ID));
$form->addElement(form_makeTextField('namespacesearchField', $FANCYDATA['namespacesearchField'], $this->getLang('keywords') . ':', 'namespacesearchField', null, array('autocomplete'=>'off')));
/* List of Namespaces for the scope */
$names = array();
@@ -75,7 +75,7 @@ function render($mode, Doku_Renderer $renderer, $data) {
}
$renderer->doc .= $helper->tpl_searchform($names, true);
// $this->fancySearchSuggestionInserter($renderer);
// $this->namespacesearchSuggestionInserter($renderer);
return true;
}
@@ -93,7 +93,7 @@ function _capture_form_output($form) {
return trim($output);
}
function fancySearchSuggestionInserter(&$renderer) {
function namespacesearchSuggestionInserter(&$renderer) {
global $FANCYDATA, $lang, $conf, $ID;
if ( !empty($FANCYDATA['query']) ) {

0 comments on commit fc11132

Please sign in to comment.
You can’t perform that action at this time.