Skip to content

Commit

Permalink
update to 2018-10-12
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfromearth committed Oct 12, 2018
1 parent 2b08042 commit ea5bd6e
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 15 deletions.
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: php

matrix:
include:
- php: "7.2"
env: DOKUWIKI=master
- php: "7.2"
env: DOKUWIKI=release_stable_2018-04-22a
- php: "7.1"
env: DOKUWIKI=master
- php: "7.1"
env: DOKUWIKI=release_stable_2018-04-22a
- php: "7.0"
env: DOKUWIKI=master
- php: "7.0"
env: DOKUWIKI=release_stable_2018-04-22a
- php: "5.6"
env: DOKUWIKI=master
- php: "5.6"
env: DOKUWIKI=release_stable_2018-04-22a
- php: "5.6"
env: DOKUWIKI=release_stable_2017-02-19e
- php: "5.6"
env: DOKUWIKI=release_stable_2016-06-26e
- php: "5.6"
env: DOKUWIKI=release_stable_2015-08-10a

before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh
install: sh travis.sh
script:
- cd _test
- phpunit --group plugin_textrotate
31 changes: 31 additions & 0 deletions _test/syntax.test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* @group plugin_textrotate
* @group plugins
*/
class plugin_textrotate_syntax_test extends DokuWikiTest {

protected $pluginsEnabled = array(
'textrotate'
);
public function setup() {
parent::setup();
$this->_createPages();
}


public function test_basic_syntax() {
$xhtml = p_wiki_xhtml('test:plugin_textrotate');
$doc = phpQuery::newDocument($xhtml);

$img = pq('img',$doc);

echo $doc;

}

protected function _createPages() {
saveWikiText('test:plugin_textrotate', '!!textrotate!!', 'test');

}
}
8 changes: 5 additions & 3 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
*/

if (!defined('DOKU_INC')) die();
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
require_once (DOKU_PLUGIN . 'action.php');

class action_plugin_textrotate extends DokuWiki_Action_Plugin {
/**
* Register the eventhandlers
*/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());

if(!function_exists('ImageCreate')) {
msg('plugin textrotate: install image php-gd package', -1, '', '', MSG_ADMINS_ONLY);
}
}

/**
* Inserts the toolbar button
*/
function insert_button(&$event, $param) {
function insert_button(Doku_Event $event, $param) {
$event->data[] = array(
'type' => 'format',
'title' => 'Vertikaler Text generieren',
Expand Down
6 changes: 3 additions & 3 deletions plugin.info.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base textrotate
author lisps
email
date 2013-10-25
author lisps, peterfromearth
email coder@peterfromearth.de
date 2018-10-12
name TextRotate Plugin
desc converts a string into an image and rotates it
url http://dokuwiki.org/plugin:textrotate
11 changes: 2 additions & 9 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author lisps
*/

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.'syntax.php');
if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');

if (!defined('DOKU_INC')) die();
/*
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
Expand Down Expand Up @@ -95,7 +88,7 @@ function render($mode, Doku_Renderer $renderer, $data)
$file = $basedir.'/'. $img_name .'.png';

if(!file_exists($file)||true) {
@mkdir($basedir,777,true);
@mkdir($basedir,755,true);

$width = 15;
$height = strlen($text)*10;
Expand Down

0 comments on commit ea5bd6e

Please sign in to comment.