Giter Club home page Giter Club logo

tindexmenu's Introduction

tindexmenu's People

Contributors

erial avatar geekspirit avatar theinvisible avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

tindexmenu's Issues

use of deprecated function search_callback in syntax/indexmenu.php

There is a bunch of calls to deprecated function search_callback in indexmenu.php.
This function was removed from dokuwiki trunk, so it crashes the site.
I made a workarround by copy/paste the function into the action.php file.

/**

  • Wrapper around deprecated search_callback.
    *
  • @deprecated
    */

function search_callback($func,&$data,$base,$file,$type,$lvl,$opts){
return call_user_func_array($func, array(&$data,$base,$file,$type,$lvl,$opts));
}

script.js not loading

In action.php:

81 $event->data["script"][] = array ( "type" => "text/javascript",
82 "charset" => "utf-8",
83 "_data" => "",
84 "src" => DOKU_BASE."lib/plugins/indexmenu/script.js"

proposed changes in ajax.php (with diff)

Again multiple references to the old indexmenu plugin. They might be replaced:

diff --git a/ajax.php b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/ajax.php
index a543ecf..0516e38 100644
--- a/ajax.php
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/ajax.php
@@ -1,9 +1,10 @@
 <?php
 /**
- * AJAX Backend for indexmenu
+ * AJAX Backend for tindexmenu
  *
  * @author Samuele Tognini <[email protected]> mod. by Rene Hadler <[email protected]>
  * @license     GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @author     rene [dot] hadler [at] iteas [dot] at
  */

 //fix for Opera XMLHttpRequests
@@ -15,7 +16,7 @@ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../..
 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
 require_once(DOKU_INC.'inc/init.php');
 require_once(DOKU_INC.'inc/auth.php');
-if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."indexmenu/images");
+if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."tindexmenu/images");
 //close session
 session_write_close();

@@ -34,7 +35,7 @@ class ajax_indexmenu_plugin {
                $succ=false;
                //send the zip
                if ($req == 'send' and isset($_REQUEST['t'])) {
-                       include(DOKU_PLUGIN.'indexmenu/inc/repo.class.php');
+                       include(DOKU_PLUGIN.'tindexmenu/inc/repo.class.php');
                        $repo=new repo_indexmenu_plugin;
                        $succ=$repo->send_theme($_REQUEST['t']);
                }
@@ -66,7 +67,7 @@ class ajax_indexmenu_plugin {
         */

        function local_themes() {
-               $list='indexmenu,'.DOKU_URL.",lib/plugins/indexmenu/images,";
+               $list='indexmenu,'.DOKU_URL.",lib/plugins/tindexmenu/images,";
                $data=array();
                $handle=@opendir(INDEXMENU_IMG_ABSDIR);
                while (false !== ($file = readdir($handle))) {
@@ -148,7 +149,7 @@ class ajax_indexmenu_plugin {
         * @author Andreas Gohr <[email protected]>
         */
        function print_index($ns) {
-               require_once(DOKU_PLUGIN.'indexmenu/syntax/indexmenu.php');
+               require_once(DOKU_PLUGIN.'tindexmenu/syntax/indexmenu.php');
                global $conf;
                $idxm=new syntax_plugin_indexmenu_indexmenu();
                $ns=$idxm->_parse_ns(rawurldecode($ns));

proposed cahnges in syntax/tag.php

Without the changes, there are references to the old indexmenu plugin, and this indexmenu plugin has to be installed in order to run the tindexmenu. Work around with:

diff --git a/syntax/tag.php b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/syntax/tag.php
index 962f7ef..cbc1e93 100644
--- a/syntax/tag.php
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/syntax/tag.php
@@ -5,6 +5,7 @@
  *
  * @license     GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * @author      Samuele Tognini <[email protected]>
+ * @author     rene [dot] hadler [at] iteas [dot] at
  *
  */

@@ -25,10 +26,10 @@ class syntax_plugin_indexmenu_tag extends DokuWiki_Syntax_Plugin {
     return array(
                 'author' => 'Samuele Tognini',
                 'email'  => '[email protected]',
-                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'indexmenu/VERSION.txt')),
+                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'tindexmenu/VERSION.txt')),
                 'name'   => 'Indexmenu tag',
                 'desc'   => 'Indexmenu tag plugin.',
-                'url'    => 'http://wiki.splitbrain.org/plugin:indexmenu'
+                'url'    => 'http://wiki.splitbrain.org/plugin:tindexmenu'
                 );
   }

local path for admmenu.js

When loading usrmenu.js/admmenu.js in action.php, it renders the local path to se client:

60 $jsmenu=DOKU_BASE."lib/plugins/indexmenu/jsmenu/";
61 /$jsmenu=DOKU_PLUGIN."indexmenu/jsmenu/";/

relics in admin.php (with diff)

In several locations, the plugin still refers to the old indexmenu plugin. I found some places in admin.php and corrected them:

diff --git a/admin.php b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/admin.php
index 99b6e12..9ca592b 100644
--- a/admin.php
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/admin.php
@@ -1,17 +1,18 @@
 <?php
 /**
- * Indexmenu Admin Plugin:   Indexmenu Component.
+ * tIndexmenu Admin Plugin:   Indexmenu Component.
  *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * @author     Samuele Tognini <[email protected]>
+ * @author     rene [dot] hadler [at] iteas [dot] at
  */

 if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
 require_once(DOKU_PLUGIN.'admin.php');
 require_once (DOKU_INC.'inc/HTTPClient.php');
-require_once(DOKU_PLUGIN."indexmenu/inc/pclzip.lib.php");
-if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."indexmenu/images");
+require_once(DOKU_PLUGIN."tindexmenu/inc/pclzip.lib.php");
+if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."tindexmenu/images");
 define('INDEXMENU_ICOS','base,folder,folderopen,folderh,folderhopen,page,plus,minus,nolines_plus,nolines_minus,minusbottom,plusbottom,join,joinbottom,line,empty');

 class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
@@ -28,12 +29,12 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
    */
   function getInfo(){
     return array(
-                'author' => 'Samuele Tognini',
-                'email'  => '[email protected]',
-                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'indexmenu/VERSION.txt')),
+                'author' => 'Samuele Tognini, Rene Hadler',
+                'email'  => '[email protected], [email protected]',
+                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'tindexmenu/VERSION.txt')),
                 'name'   => 'Indexmenu (admin plugin component)',
                 'desc'   => 'Indexmenu admin functions.',
-                'url'    => 'http://wiki.splitbrain.org/plugin:indexmenu',
+                'url'    => 'http://wiki.splitbrain.org/plugin:tindexmenu',
                 );
   }

@@ -137,7 +138,7 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
     $turl="";
     $info="";
     //get list
-    $data=$this->_remotequery($this->repos['url'][$n]."/lib/plugins/indexmenu/ajax.php?req=local");
+    $data=$this->_remotequery($this->repos['url'][$n]."/lib/plugins/tindexmenu/ajax.php?req=local");
     $data=explode(",",$data);
     //print themes
     for ($i=3;$i<count($data);$i++) {
@@ -172,7 +173,7 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
        }
       } else {
        $act="install";
-       ptln('      <a href="'.$this->repos['url'][$n]."$repo/lib/plugins/indexmenu/ajax.php?req=send&amp;t=".$theme.'">Download</a>');
+       ptln('      <a href="'.$this->repos['url'][$n]."$repo/lib/plugins/tindexmenu/ajax.php?req=send&amp;t=".$theme.'">Download</a>');
       }
       $this->_form_open($act,$n);
       if ($n==0 && !is_file(INDEXMENU_IMG_ABSDIR."/".$theme."/info.txt")) {
@@ -200,7 +201,7 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
     $tmp=$absdir."/tmp";

     //send theme list request
-    if (!$zipfile=io_download($repo."/lib/plugins/indexmenu/ajax.php?req=send&t=".$name,"$tmp/",true)) {
+    if (!$zipfile=io_download($repo."/lib/plugins/tindexmenu/ajax.php?req=send&t=".$name,"$tmp/",true)) {
       msg($this->getLang('down_err').": $name",-1);
       $return=false;
     } else {
@@ -271,7 +272,7 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
   function upload($theme,$info) {
     $return=true;
     $host='samuele.netsons.org';
-    $path='/dokuwiki/lib/plugins/indexmenu/upload/index.php';
+    $path='/dokuwiki/lib/plugins/tindexmenu/upload/index.php';
     //TODO: merge zip creation with that in ajax.php (create a class?)
     if (!$absdir=$this->checktmpsubdir()) return false;
     $tmp=$absdir."/tmp";
@@ -316,7 +317,7 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
          $buf .= fgets($fp,3200);
        }
        fclose($fp);
-       //parse resply
+       //parse reply
        if (preg_match("/<!--indexmenu-->(.*)<!--\/indexmenu-->/s",$buf,$match)) {
          $str=substr($match[1],4,7);
          switch ($str) {
@@ -348,6 +349,8 @@ class admin_plugin_indexmenu extends DokuWiki_Admin_Plugin {
    * @author Samuele Tognini <[email protected]>
    */
   function _checkupdates() {
+  }
+  function _checkupdates_but_not_for_me() {
     require_once (DOKU_INC.'inc/HTTPClient.php');
     global $conf;
     global $INFO;

tindexmenu / indexmenu

There are references to both names in the code. Paths are referred to as tindexmenu, but functions are named as indexmenu.

diff for wrong references in action.php

Also in action.php there rae some references to the indexmenu instead of tindexmenu. Look at the following output:

diff --git a/action.php b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/action.php
index 44084e7..7513677 100644
--- a/action.php
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/action.php
@@ -1,9 +1,10 @@
 <?php
 /**
- * Indexmenu Action Plugin:   Indexmenu Component.
+ * tIndexmenu Action Plugin:   Indexmenu Component.
  *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * @author     Samuele Tognini <[email protected]> mod. by Rene Hadler <[email protected]>
+ * @author     rene [dot] hadler [at] iteas [dot] at
  */

 if(!defined('DOKU_INC')) die();
@@ -19,7 +20,7 @@ class action_plugin_indexmenu extends DokuWiki_Action_Plugin {
     return array(
                 'author' => 'Samuele Tognini mod. by Rene Hadler',
                 'email'  => '[email protected]',
-                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'indexmenu/VERSION.txt')),
+                'date'   => rtrim(io_readFile(DOKU_PLUGIN.'tindexmenu/VERSION.txt')),
                 'name'   => 'Indexmenu (action plugin component)',
                 'desc'   => 'Indexmenu action functions.',
                 'url'    => 'https://bitbucket.org/iteas/tindexmenu',
@@ -56,7 +57,7 @@ class action_plugin_indexmenu extends DokuWiki_Action_Plugin {
   function _hookjs(&$event, $param) {
     global $ID;
     global $INFO;
-    $jsmenu=DOKU_BASE."lib/plugins/indexmenu/jsmenu/";
+    $jsmenu=DOKU_PLUGIN."tindexmenu/jsmenu/";

     if ($INFO['userinfo']['grps']) {
       $jsmenu .= ($this->_notadmin()) ? "usrmenu.js" : "admmenu.js";
@@ -73,9 +74,9 @@ class action_plugin_indexmenu extends DokuWiki_Action_Plugin {
     $event->data["script"][] = array ( "type" => "text/javascript",
                                        "charset" => "utf-8",
                                        "_data" => "",
-                                       "src" => DOKU_BASE."lib/plugins/indexmenu/indexmenu-full.js"
+                                       "src" => DOKU_BASE."lib/plugins/tindexmenu/indexmenu-full.js"
                                        );
-
+
     $event->data["script"][] = array ( "type" => "text/javascript",
                                        "charset" => "utf-8",
                                        "_data" => "var indexmenu_ID='".idfilter($ID)."'"

compatibility issue in script.js with patch

I found one line in script.js that still requires compatibility.js (which is not included any more, see dokuwiki/dokuwiki@9942118). To solve it, you can apply a simple patch:

diff --git a/script.js b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/script.js
index cede593..b4a3132 100644
--- a/script.js
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/script.js
@@ -90,7 +90,10 @@ function indexmenu_showPicker(pickerid,btn){
 }

 function indexmenu_loadtoolbar(){
-    var toolbar = $('tool__bar');
+    var element = 'tool__bar';
+    if (typeof element == 'string')
+        var toolbar = document.getElementById(element);
     if(!toolbar) return;
     indexmenu_loadJs(DOKU_BASE+'lib/plugins/indexmenu/edit.js');
 }

proposed changes in syntax/indexmenu.php

Again, some references to the old indexmenu plugin:

diff --git a/syntax/indexmenu.php b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/syntax/indexmenu.php
index 6f06b46..f56e93a 100644
--- a/syntax/indexmenu.php
+++ b/srv/www/htdocs/dokuwiki/lib/plugins/tindexmenu/syntax/indexmenu.php
@@ -4,12 +4,13 @@
  *
  * @license     GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * @author      Samuele Tognini <[email protected]> mod. by Rene Hadler <[email protected]>
+ * @author     rene [dot] hadler [at] iteas [dot] at
  *
  */

 if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
-if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."indexmenu/images");
+if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR',DOKU_PLUGIN."tindexmenu/images");
 require_once(DOKU_PLUGIN.'syntax.php');
 require_once(DOKU_INC.'inc/search.php');

@@ -31,10 +32,10 @@ class syntax_plugin_indexmenu_indexmenu extends DokuWiki_Syntax_Plugin {
                return array(
                                'author' => 'Samuele Tognini',
                                'email'  => '[email protected]',
-                               'date'   => rtrim(io_readFile(DOKU_PLUGIN.'indexmenu/VERSION.txt')),
-                               'name'   => 'Indexmenu',
+                               'date'   => rtrim(io_readFile(DOKU_PLUGIN.'tindexmenu/VERSION.txt')),
+                               'name'   => 'tIndexmenu',
                                'desc'   => 'Insert the index of a specified namespace.',
-                               'url'    => 'http://wiki.splitbrain.org/plugin:indexmenu'
+                               'url'    => 'http://wiki.splitbrain.org/plugin:tindexmenu'
                );
        }

@@ -277,7 +278,7 @@ class syntax_plugin_indexmenu_indexmenu extends DokuWiki_Syntax_Plugin {
                        $output .= "<script type='text/javascript' charset='utf-8'>\n";
                        $output .= "<!--//--><![CDATA[//><!--\n";
                        $output .= "indexmenu_nojsqueue.push(new Array('".$js_name."','".utf8_encodeFN($js_opts['jsajax'])."'));\n";
-                       $output .= "jQuery(function(){indexmenu_loadJs(DOKU_BASE+'lib/plugins/indexmenu/nojsindex.js');});\n";
+                       $output .= "jQuery(function(){indexmenu_loadJs(DOKU_BASE+'lib/plugins/tindexmenu/nojsindex.js');});\n";
                        $output .= "//--><!]]>\n";
                        $output .= "</script>\n";
                }

Fix directory of default install from github

I installed by github download ~/master. It installed to 'theinvisible-tindexmenu'.

I doesn't work that states.

I found it and change directory's name to 'indexmenu'.

Please fix that directory's name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.