for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* DokuWiki Plugin styling (Action Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <[email protected]>
*/
class action_plugin_styling extends DokuWiki_Action_Plugin
{
* Registers a callback functions
* @param Doku_Event_Handler $controller DokuWiki's event controller object
* @return void
public function register(Doku_Event_Handler $controller)
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handleHeader');
}
* Adds the preview parameter to the stylesheet loading in non-js mode
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
public function handleHeader(Doku_Event &$event, $param)
$param
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
global $ACT;
global $INPUT;
if ($ACT != 'admin' || $INPUT->str('page') != 'styling') return;
if (!auth_isadmin()) return;
// set preview
$len = count($event->data['link']);
for ($i = 0; $i < $len; $i++) {
if ($event->data['link'][$i]['rel'] == 'stylesheet' &&
strpos($event->data['link'][$i]['href'], 'lib/exe/css.php') !== false
) {
$event->data['link'][$i]['href'] .= '&preview=1&tseed='.time();
// vim:ts=4:sw=4:et:
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.