Example #1
0
 /**
  * Creates a new instance of the class and adds all the options
  *
  * @param array       $input
  * @param UTCW_Plugin $plugin
  *
  * @since 2.3
  */
 public function __construct(array $input, UTCW_Plugin $plugin)
 {
     $this->addOption('text_transform', 'set', array('values' => array('lowercase', 'uppercase', 'capitalize'), 'default' => 'none'));
     $this->addOption('link_underline', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('link_bold', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('link_italic', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('hover_underline', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('hover_bold', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('hover_italic', 'set', array('values' => $this->optionalBooleanValues));
     $this->addOption('link_border_style', 'set', array('values' => $this->borderStyleValues));
     $this->addOption('hover_border_style', 'set', array('values' => $this->borderStyleValues));
     $this->addOption('alignment', 'set', array('values' => $this->alignmentValues, 'default' => ''));
     $this->addOption('display', 'set', array('values' => $this->displayValues));
     $this->addOption('title_type', 'set', array('values' => $this->titleTypeValues));
     $this->addOption('link_bg_color', 'color');
     $this->addOption('hover_bg_color', 'color');
     $this->addOption('link_border_color', 'color', array('default' => 'none'));
     $this->addOption('hover_color', 'color', array('default' => 'default'));
     $this->addOption('hover_border_color', 'color', array('default' => 'none'));
     $this->addOption('letter_spacing', 'measurement', array('default' => 'normal'));
     $this->addOption('word_spacing', 'measurement', array('default' => 'normal'));
     $this->addOption('tag_spacing', 'measurement', array('default' => 'auto'));
     $this->addOption('line_height', 'measurement', array('default' => 'inherit'));
     $this->addOption('link_border_width', 'measurement');
     $this->addOption('hover_border_width', 'measurement');
     $this->addOption('title', 'string', array('default' => 'Tag Cloud'));
     $this->addOption('separator', 'string', array('default' => ' '));
     $this->addOption('prefix', 'string');
     $this->addOption('suffix', 'string');
     $this->addOption('before_widget', 'string');
     $this->addOption('after_widget', 'string');
     $this->addOption('before_title', 'string');
     $this->addOption('after_title', 'string');
     $this->addOption('title_custom_template', 'string');
     $this->addOption('show_title', 'boolean', array('default' => true));
     $this->addOption('show_links', 'boolean', array('default' => true));
     $this->addOption('show_title_text', 'boolean', array('default' => true));
     $this->addOption('show_post_count', 'boolean', array('default' => false));
     $this->addOption('prevent_breaking', 'boolean', array('default' => false));
     $this->addOption('avoid_theme_styling', 'boolean', array('default' => false));
     $this->addOption('debug', 'boolean');
     parent::__construct($input, $plugin);
 }
Example #2
0
 /**
  * Creates a new instance of the class and adds all the options
  *
  * @param array       $input
  * @param UTCW_Plugin $plugin
  *
  * @since 2.3
  */
 public function __construct(array $input, UTCW_Plugin $plugin)
 {
     $this->addOption('strategy', 'class', array('classMap' => array('popularity' => 'UTCW_PopularityStrategy', 'random' => 'UTCW_RandomStrategy', 'creation' => 'UTCW_CreationTimeStrategy', 'current_list' => 'UTCW_CurrentListStrategy'), 'baseClass' => 'UTCW_SelectionStrategy', 'default' => 'popularity', 'factory' => array($this, 'strategyFactory')));
     $this->addOption('order', 'set', array('values' => array('name', 'random', 'slug', 'id', 'color', 'count')));
     $this->addOption('tags_list_type', 'set', array('values' => array('exclude', 'include')));
     $this->addOption('color', 'set', array('values' => array('none', 'random', 'set', 'span')));
     $this->addOption('color_span_to', 'color', array('default' => ''));
     $this->addOption('color_span_from', 'color', array('default' => ''));
     $this->addOption('color_set', 'array', array('type' => 'color'));
     $this->addOption('taxonomy', 'array', array('type' => 'set', 'typeOptions' => array('values' => $plugin->getAllowedTaxonomies()), 'default' => array('post_tag')));
     $this->addOption('post_type', 'array', array('type' => 'set', 'typeOptions' => array('values' => $plugin->getAllowedPostTypes()), 'default' => array('post')));
     $this->addOption('authors', 'array', array('type' => 'integer'));
     $this->addOption('tags_list', 'array', array('type' => 'integer'));
     $this->addOption('post_term', 'array', array('type' => 'integer'));
     $this->addOption('size_from', 'measurement', array('default' => '10px'));
     $this->addOption('size_to', 'measurement', array('default' => '30px'));
     $this->addOption('max', 'integer', array('default' => 45, 'min' => 1));
     $this->addOption('minimum', 'integer', array('default' => 1));
     $this->addOption('days_old', 'integer');
     $this->addOption('reverse', 'boolean');
     $this->addOption('case_sensitive', 'boolean');
     $this->addOption('post_term_query_var', 'boolean');
     $this->plugin = $plugin;
     parent::__construct($input, $plugin);
     $this->checkSizes();
 }