mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2025-08-01 15:54:34 +00:00
code style fixes
This commit is contained in:
@ -166,7 +166,7 @@ class ConfigParser
|
|||||||
|
|
||||||
$line = preg_split('/\s*:\s*/', $line, 2);
|
$line = preg_split('/\s*:\s*/', $line, 2);
|
||||||
$line[0] = strtolower($line[0]);
|
$line[0] = strtolower($line[0]);
|
||||||
if(!isset($line[1])) $line[1] = '';
|
if (!isset($line[1])) $line[1] = '';
|
||||||
|
|
||||||
return $line;
|
return $line;
|
||||||
}
|
}
|
||||||
|
@ -165,8 +165,8 @@ class syntax_plugin_struct_output extends DokuWiki_Syntax_Plugin
|
|||||||
|
|
||||||
$rendercontext['hasdata'] = true;
|
$rendercontext['hasdata'] = true;
|
||||||
|
|
||||||
if($format == 'xhtml') {
|
if ($format == 'xhtml') {
|
||||||
$renderer->doc .= '<div class="struct_output_'.$schemadata->getSchema()->getTable().'">';
|
$renderer->doc .= '<div class="struct_output_' . $schemadata->getSchema()->getTable() . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
$renderer->table_open();
|
$renderer->table_open();
|
||||||
@ -197,7 +197,7 @@ class syntax_plugin_struct_output extends DokuWiki_Syntax_Plugin
|
|||||||
$renderer->tabletbody_close();
|
$renderer->tabletbody_close();
|
||||||
$renderer->table_close();
|
$renderer->table_close();
|
||||||
|
|
||||||
if($format == 'xhtml') {
|
if ($format == 'xhtml') {
|
||||||
$renderer->doc .= '</div>';
|
$renderer->doc .= '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class Decimal extends AbstractMultiBaseType
|
|||||||
$unitsh = array('', 'k', 'M', 'G', 'T');
|
$unitsh = array('', 'k', 'M', 'G', 'T');
|
||||||
$unitsl = array('', 'm', 'µ', 'n', 'p', 'f', 'a');
|
$unitsl = array('', 'm', 'µ', 'n', 'p', 'f', 'a');
|
||||||
|
|
||||||
$exp = floor(log10($value)/3);
|
$exp = floor(log10($value) / 3);
|
||||||
|
|
||||||
if ($exp < 0) {
|
if ($exp < 0) {
|
||||||
$units = $unitsl;
|
$units = $unitsl;
|
||||||
@ -52,12 +52,16 @@ class Decimal extends AbstractMultiBaseType
|
|||||||
$pfkey = $exp;
|
$pfkey = $exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($units) <= ($pfkey+1)) { //check if number is within prefixes
|
if (count($units) <= ($pfkey + 1)) { //check if number is within prefixes
|
||||||
$pfkey = sizeof($units)-1;
|
$pfkey = sizeof($units) - 1;
|
||||||
$exp = $pfkey * $exp/abs($exp);
|
$exp = $pfkey * $exp / abs($exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
$R->cdata($this->config['prefix'] . $value / 10**($exp*3) . "\xE2\x80\xAF" . $units[$pfkey] . $this->config['postfix'] );
|
$R->cdata(
|
||||||
|
$this->config['prefix'] .
|
||||||
|
$value / 10 ** ($exp * 3) . "\xE2\x80\xAF" . $units[$pfkey] .
|
||||||
|
$this->config['postfix']
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +87,7 @@ class Decimal extends AbstractMultiBaseType
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$R->cdata($this->config['prefix'] . $value . $this->config['postfix'] );
|
$R->cdata($this->config['prefix'] . $value . $this->config['postfix']);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class Page extends AbstractMultiBaseType
|
|||||||
if ($namespace) {
|
if ($namespace) {
|
||||||
// namespace may be relative, resolve in current context
|
// namespace may be relative, resolve in current context
|
||||||
$namespace .= ':foo'; // resolve expects pageID
|
$namespace .= ':foo'; // resolve expects pageID
|
||||||
$resolver = new PageResolver($INPUT->str('ns').':foo'); // resolve relative to current namespace
|
$resolver = new PageResolver($INPUT->str('ns') . ':foo'); // resolve relative to current namespace
|
||||||
$namespace = $resolver->resolveId($namespace);
|
$namespace = $resolver->resolveId($namespace);
|
||||||
$namespace = getNS($namespace);
|
$namespace = getNS($namespace);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user