From: <var...@us...> - 2015-02-19 10:59:22
|
Revision: 9550 http://sourceforge.net/p/phpwiki/code/9550 Author: vargenau Date: 2015-02-19 10:59:14 +0000 (Thu, 19 Feb 2015) Log Message: ----------- Move function ActionButton from themes/MonoBook/themeinfo.php to lib/WikiTheme.php: used by blog theme Modified Paths: -------------- trunk/lib/WikiTheme.php trunk/themes/MonoBook/themeinfo.php Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2015-02-19 10:56:50 UTC (rev 9549) +++ trunk/lib/WikiTheme.php 2015-02-19 10:59:14 UTC (rev 9550) @@ -185,6 +185,30 @@ return $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options); } +function ActionButton($action, $label = false, $page_or_rev = false, $options = false) +{ + global $WikiTheme; + global $request; + if (is_array($action)) { + $attr = $action; + $act = isset($attr['action']) ? $attr['action'] : 'browse'; + } else + $act = $action; + $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin'; + /* if selected action is current then prepend selected */ + $curract = $request->getArg("action"); + if ($curract == $act and $curract != 'browse') + $class = "selected $class"; + if (!empty($options['class'])) { + if ($curract == 'browse') + $class = "$class " . $options['class']; + else + $class = $options['class']; + } + return HTML::li(array('class' => $class), + $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options)); +} + class WikiTheme { public $HTML_DUMP_SUFFIX = ''; Modified: trunk/themes/MonoBook/themeinfo.php =================================================================== --- trunk/themes/MonoBook/themeinfo.php 2015-02-19 10:56:50 UTC (rev 9549) +++ trunk/themes/MonoBook/themeinfo.php 2015-02-19 10:59:14 UTC (rev 9550) @@ -18,33 +18,8 @@ require_once 'lib/WikiTheme.php'; require_once 'themes/wikilens/themeinfo.php'; -function ActionButton($action, $label = false, $page_or_rev = false, $options = false) -{ - global $WikiTheme; - global $request; - if (is_array($action)) { - $attr = $action; - $act = isset($attr['action']) ? $attr['action'] : 'browse'; - } else - $act = $action; - $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin'; - /* if selected action is current then prepend selected */ - $curract = $request->getArg("action"); - if ($curract == $act and $curract != 'browse') - $class = "selected $class"; - if (!empty($options['class'])) { - if ($curract == 'browse') - $class = "$class " . $options['class']; - else - $class = $options['class']; - } - return HTML::li(array('class' => $class), - $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options)); -} - class WikiTheme_MonoBook extends WikiTheme_Wikilens { - /* this adds selected to the class */ function makeActionButton($action, $label = false, $page_or_rev = false, $options = false) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |