* @param string $color * @return array */ public function get_button_styling($size, $autowidth, $style, $format, $color) { return array('size' => ($size == 'default' ? get_option('podlove_subscribe_button_default_size', $size) : $size) . self::interpret_autowidth_attribute($autowidth), 'style' => $style == 'default' ? get_option('podlove_subscribe_button_default_style', $style) : $style, 'format' => $format == 'default' ? get_option('podlove_subscribe_button_default_format', $format) : $format, 'color' => isset($color) ? $color : get_option('podlove_subscribe_button_default_color', $color), 'json-data' => 'podcastData' . $this->id); } /** * Helper function to interpret the given $autowidth value correctly * @param string $autowidth * @return string */ private static function interpret_autowidth_attribute($autowidth) { if ($autowidth == 'default' && get_option('podlove_subscribe_button_default_autowidth') !== 'on') { return ''; } if ($autowidth !== 'default' && $autowidth !== 'on') { return ''; } return ' auto'; } } Button::property('id', 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY'); Button::property('name', 'VARCHAR(255)'); Button::property('title', 'VARCHAR(255)'); Button::property('subtitle', 'VARCHAR(255)'); Button::property('description', 'TEXT'); Button::property('cover', 'VARCHAR(255)'); Button::property('feeds', 'TEXT');