/** * Return HTML markup for a input type * * @brief Simple button * * @param string $label Optional. Button label. If empty default is 'Update' * @param array $args Optional. A keys value array for additional settings * * 'type' => 'submit', * 'name' => 'button-update', * 'classes' => ' button-primary', * 'additional_classes' => '', * 'data' => '' * * @return string HTML input type submit */ public static function button($label = '', $args = array()) { $default_args = array('type' => 'submit', 'name' => 'button-update', 'classes' => ' button button-primary alignright', 'additional_classes' => '', 'data' => array()); $args = wp_parse_args($args, $default_args); // Label if (empty($label)) { $label = __('Update', WPDK_TEXTDOMAIN); } // Name attribute if (empty($args['name'])) { $name = ''; } else { $name = sprintf('name="%s"', $args['name']); } // Build data $data = WPDKHTMLTag::dataInline($args['data']); // Build classes $classes = WPDKHTMLTag::classInline($args['classes'], $args['additional_classes']); WPDKHTML::startCompress(); ?> <input type="<?php echo $args['type']; ?> " <?php echo $name; ?> <?php echo $data; ?> class="<?php echo $classes; ?> " value="<?php echo $label; ?> " /> <?php return WPDKHTML::endHTMLCompress(); }
/** * Return the HTML markup for alert * * @brief Get HTML * * @return string * */ public function html() { // Permanent dismiss if (!empty($this->dismissed) && !empty($this->id) && in_array(md5($this->id), array_keys($this->dismissed))) { return; } WPDKHTML::startCompress(); ?> <div <?php echo empty($this->id) ? '' : 'id="' . $this->id . '"'; ?> <?php echo empty($this->data) ? '' : self::dataInline($this->data); ?> class="<?php echo self::classInline($this->class, array($this->type, 'wpdk-alert', $this->dismissable ? 'alert-dismissable' : '', 'fade', 'in', 'clearfix')); ?> "> <?php echo $this->_dismissButton(); ?> <?php echo $this->_title(); ?> <?php echo $this->_content(); ?> </div> <?php return WPDKHTML::endHTMLCompress(); }
/** * Return the HTML markup to display the delete row button. * * @brief Button delete row * * @return string */ private function buttonDelete() { WPDKHTML::startCompress(); ?> <button class="wpdk-dt-delete-row"> <?php WPDKGlyphIcons::display(WPDKGlyphIcons::MINUS_SQUARED); ?> </button> <?php return WPDKHTML::endHTMLCompress(); }