/**
  * Constructor
  *
  * @uses AbstractWidget::__construct()
  *
  * @param \WP_Customize_Manager $manager
  * @param string                $id
  * @param array                 $args
  */
 public function __construct($manager, $id, array $args)
 {
     parent::__construct($manager, $id, $args);
     if (!empty($args['available_widgets'])) {
         $this->_available_widgets = $args['available_widgets'];
     }
     add_action('customize_controls_print_footer_scripts', function () {
         $this->_render_widgets_list();
     });
 }
示例#2
0
 public function _toHtml()
 {
     if (!$this->_brandHelper->getConfig('general_settings/enable')) {
         return;
     }
     $carousel_layout = $this->getConfig('carousel_layout');
     if ($carousel_layout == 'owl_carousel') {
         $this->setTemplate('widget/brand_list_owl.phtml');
     } else {
         $this->setTemplate('widget/brand_list_bootstrap.phtml');
     }
     if (($template = $this->getConfig('template')) != '') {
         $this->setTemplate($template);
     }
     return parent::_toHtml();
 }
 /**
  * @param string $id
  * @param array $options
  */
 public function __construct($id, array $options = [])
 {
     parent::__construct($options);
     $this->id = $id;
 }
示例#4
0
文件: Box.php 项目: neatphp/neat
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->top = new Bar();
     $this->bottom = new Bar();
 }
示例#5
0
 public function render()
 {
     /*
      * Refs #620
      * Client commands are applied to the appointed widget to keep the view consistent
      * in both CLIENT and SERVER modes.
      */
     $this->invokeCommands();
     $content = parent::render();
     if ($this->canEscapeUnobstrusive($this->getAttribute('flags', 0))) {
         $content = $this->escapeUnobstrusive($content);
     }
     if (NETHGUI_ENABLE_INCLUDE_WIDGET) {
         $types = array_merge(array('Nethgui:base'), $this->getJsWidgetTypes());
         foreach ($types as $type) {
             $typeParts = explode(':', $type);
             $this->getRenderer()->includeFile(sprintf('%s/Js/jquery.nethgui.%s.js', $typeParts[0], $typeParts[1]));
         }
     }
     return $content;
 }
示例#6
0
 /**
  * Sets the template
  *
  * @return void
  */
 public function _construct()
 {
     parent::_construct();
     $this->setTemplate('widget/taxvat.phtml');
 }
示例#7
0
 /**
  * Test '%s' and '%d' formats to verify that '%s' returns a string and '%d' returns a numeric
  * string when AbstractWidget::getFieldName() is invoked.
  *
  * @param string $format Field name format (e.g. '%s' or '%d')
  * @param string $fieldName The field name
  * @param string $expectedValue The value we expect from AbstractWidget::getFieldName
  * @param string $method The method to invoke on the result from getFieldName() should return true
  *
  * @dataProvider getFieldNameDataProvider
  */
 public function testGetFieldName($format, $fieldName, $expectedValue, $method)
 {
     $this->_block->setData(self::KEY_FIELD_NAME_FORMAT, $format);
     $this->assertTrue(call_user_func($method, $blockFieldName = $this->_block->getFieldName($fieldName)));
     $this->assertEquals($expectedValue, $blockFieldName);
 }
示例#8
0
 protected function getInputProps()
 {
     $props = parent::getInputProps();
     return $props;
 }
示例#9
0
 public function render($data = array())
 {
     parent::render($this->getData());
 }
示例#10
0
 protected function getInputProps()
 {
     $props = parent::getInputProps();
     $props['type'] = 'text';
     return $props;
 }