Skip to content
Permalink
Browse files

[plugin:clear] add inline-plugin (&clear([right|left]);)

  • Loading branch information
nao-pon committed Oct 24, 2013
1 parent 3b7c471 commit 367e5872fa0bb1bcee15c2c7163b1d0f3ae4f8a0
Showing with 15 additions and 3 deletions.
  1. +15 −3 xoops_trust_path/modules/xpwiki/plugin/clear.inc.php
@@ -1,6 +1,5 @@
<?php
// PukiWiki - Yet another WikiWikiWeb clone
// $Id: clear.inc.php,v 1.3 2012/01/07 07:48:20 nao-pon Exp $
//
// Clear plugin - inserts a CSS class 'clear', to set 'clear:both'

@@ -11,12 +10,25 @@ function plugin_clear_init () {
}

function plugin_clear_convert() {
list($side) = array_pad(func_get_args(), 1, '');
$args = func_get_args();
$class = $this->getClass($args);
return '<div class="'.$class .'"></div>';
}

function plugin_clear_inline() {
$args = func_get_args();
array_pop($args);
$class = $this->getClass($args);
return '<span class="'.$class .'" style="display: block;"></span>';
}

private function getClass($args) {
list($side) = array_pad($args, 1, '');
$side = strtolower($side);
$class = 'clear';
if (in_array($side, array('left', 'right'))) {
$class .= '_'.$side;
}
return '<div class="'.$class .'"></div>';
return $class;
}
}

0 comments on commit 367e587

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