_args = $args; $this->_html = $registry->get( 'html.helper' ); } /** * Set value within current object scope * * Value name is formed as {$attribute} with underscore ('_') prefixed. * * @param string $attribute Name of attribute to set. * @param mixed $value Value to set for attribute. * * @return Ai1ec_Html_Element_Settings Instance of self. */ public function set( $attribute, $value ) { $this->{'_' . $attribute} = $value; return $this; } /** * Override to include any initialization logics. * * @return void Method output is ignored. */ protected function _initialize() { } /** * Generate settings output line. * * @param string $output Generated output to finalize. * @param bool $wrap Whether content should be wrapped with div or not. * * @return string Finalized HTML snippet. */ public function render( $output = '', $wrap = true, $hidden = false ) { if ( isset( $this->_args['renderer']['condition'] ) ) { $condition = $this->_args['renderer']['condition']; if ( is_bool( $condition ) ) { $render = $condition; } else { $callback = explode( ':', $this->_args['renderer']['condition'] ); try { $render = $this->_registry->dispatch( $callback[0], $callback[1] ); } catch (Ai1ec_Bootstrap_Exception $exception) { $render = ''; } } if ( ! $render ) { return ''; } } if ( ! $wrap ) { return $output; } if ( $hidden ) { return '