*/
class Settings extends \WP_Piwik\Admin {
/**
* Builds and displays the settings page
*/
public function show() {
if (isset($_GET['sitebrowser']) && $_GET['sitebrowser']) {
new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik);
return;
}
if (isset($_GET['clear']) && $_GET['clear']) {
$this->clear($_GET['clear'] == 2);
self::$wpPiwik->resetRequest();
echo '
', $id, $description );
}
/**
* Show a checkbox option
*
* @param string $id option id
* @param string $name descriptive option name
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param string $onChange javascript for onchange event (default: empty)
*/
private function showCheckbox($id, $name, $description, $isHidden = false, $groupName = '', $hideDescription = true, $onChange = '') {
printf ( '
', $name, $id, $onChange, $this->getDescription ( $id, $description, $hideDescription ) );
}
/**
* Show a textarea option
*
* @param string $id option id
* @param string $name descriptive option name
* @param int $rows number of rows to show
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param string $onChange javascript for onchange event (default: empty)
* @param boolean $isReadonly set textarea to read only (default: false)
* @param boolean $global set to false if the textarea shows a site-specific option (default: true)
*/
private function showTextarea($id, $name, $rows, $description, $isHidden, $groupName, $hideDescription = true, $onChange = '', $isReadonly = false, $global = true) {
printf (
'
:
%s
', $name, $id, $onChange, ($global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id )), $this->getDescription ( $id, $description, $hideDescription ) );
}
/**
* Show a simple text
*
* @param string $text Text to show
*/
private function showText($text) {
printf ( '
%s
', $text );
}
/**
* Show an input option
*
* @param string $id option id
* @param string $name descriptive option name
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param string $rowName define a class name to access the specific option row by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param boolean $wide Create a wide box (default: false)
*/
private function showInput($id, $name, $description, $isHidden = false, $groupName = '', $rowName = false, $hideDescription = true, $wide = false) {
printf ( '
%s
', $isHidden ? 'hidden ' : '', $groupName ? $groupName : '', $rowName ? ' id="' . $groupName . '-' . $rowName . '"' : '', $name, $id, htmlentities(self::$settings->getGlobalOption( $id ), ENT_QUOTES, 'UTF-8', false), !empty($description) ? $this->getDescription ( $id, $description, $hideDescription ) : '' );
}
/**
* Show a select box option
*
* @param string $id option id
* @param string $name descriptive option name
* @param array $options list of options to show array[](option id => descriptive name)
* @param string $description option description
* @param string $onChange javascript for onchange event (default: empty)
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param boolean $global set to false if the textarea shows a site-specific option (default: true)
*/
private function showSelect($id, $name, $options = array(), $description = '', $onChange = '', $isHidden = false, $groupName = '', $hideDescription = true, $global = true) {
$optionList = '';
$default = $global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id );
if (is_array ( $options ))
foreach ( $options as $key => $value )
$optionList .= sprintf ( '', $key, $value );
printf ( '
var $j = jQuery.noConflict();';
}
/**
* Show credits
*/
public function showCredits() {
?>
: Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., Nicolas, J., Andre M., Steve J., Jakub P., ditho.berlin, Robert R., Simon B., Grzegorz O., Bjarne O., !
jqPlot (License: GPL 2.0 and MIT) and jQuery Sparklines (License: New BSD License).','wp-piwik'); ?>
, !
you for using my plugin. It is the best commendation if my piece of code is really used!','wp-piwik'); ?>