/** * Convert the class to data-* attribute friendly associative array * will become data-key="value" * Exclude values if default * * @return array associative array */ public function toHTMLDataArray() { $data = parent::toHTMLDataArray(); if (isset($this->href)) { $data['href'] = $this->href; } if (isset($this->layout) && $this->layout !== 'standard') { $data['layout'] = $this->layout; } if (isset($this->send_button) && $this->send_button === true) { $data['send'] = 'true'; } if (isset($this->show_faces) && $this->show_faces === true) { $data['show-faces'] = 'true'; } if (isset($this->width) && is_int($this->width) && $this->width > 0) { $data['width'] = strval($this->width); } if (isset($this->action) && $this->action !== 'like') { $data['action'] = $this->action; } return $data; }
/** * Convert the class to data-* attribute friendly associative array * * will become data-key="value". Exclude values if default * * @since 1.1 * * @return array associative array */ public function toHTMLDataArray() { $data = parent::toHTMLDataArray(); if (isset($this->href)) { $data['href'] = $this->href; } return $data; }
/** * Convert the class to data-* attribute friendly associative array. * * will become data-key="value". Exclude values if default. * * @since 1.1 * * @return array associative array */ public function toHTMLDataArray() { if (!isset($this->href)) { return array(); } $data = parent::toHTMLDataArray(); $data['href'] = $this->href; // show_faces only if standard layout if (isset($this->layout) && $this->layout !== 'standard') { $data['layout'] = $this->layout; } else { if (isset($this->show_faces) && $this->show_faces === true) { $data['show-faces'] = 'true'; } } if (isset($this->width) && is_int($this->width)) { $data['width'] = strval($this->width); } return $data; }
/** * Convert the class to data-* attribute friendly associative array * * will become data-key="value". Exclude values if default * * @since 1.1 * * @return array associative array */ public function toHTMLDataArray() { $data = parent::toHTMLDataArray(); if (isset($this->href)) { $data['href'] = $this->href; } if (isset($this->trigger)) { $data['trigger'] = $this->trigger; } if (isset($this->read_time) && $this->read_time !== 30) { // default: 30 $data['read-time'] = strval($this->read_time); } if (isset($this->action) && $this->action !== 'like') { // default: like $data['action'] = $this->action; } if (isset($this->side)) { // default: auto $data['side'] = $this->side; } if (isset($this->site) && is_array($this->site) && !empty($this->site)) { $data['site'] = implode(',', $this->site); } if (isset($this->num_recommendations) && $this->num_recommendations != 2) { // default: 2 $data['num-recommendations'] = strval($this->num_recommendations); } if (isset($this->max_age) && $this->max_age != 0) { // default: 0 (no limit) $data['max-age'] = $this->max_age; } // remove generic social plugin properties not applicable to recommendations bar foreach (array('font', 'colorscheme') as $prop) { unset($data[$prop]); } return $data; }
/** * Convert the class to data-* attribute friendly associative array * will become data-key="value" * Exclude values if default * * @return array associative array */ public function toHTMLDataArray() { $data = parent::toHTMLDataArray(); if (isset($this->site)) { $data['site'] = $this->site; } if (isset($this->action) && is_array($this->action) && !empty($this->action)) { $data['action'] = implode(',', $this->action); } if (isset($this->app_id)) { $data['app-id'] = $this->app_id; } if (isset($this->width) && is_int($this->width) && $this->width > 0 && $this->width !== 300) { // default 300 $data['width'] = strval($this->width); } if (isset($this->height) && is_int($this->height) && $this->height > 0 && $this->height !== 300) { // default 300 $data['height'] = strval($this->height); } if (isset($this->header) && $this->header === false) { // default true $data['header'] = 'false'; } else { $data['header'] = 'true'; } if (isset($this->border_color)) { $data['border-color'] = $this->border_color; } if (isset($this->linktarget)) { $data['linktarget'] = $this->linktarget; } if (isset($this->max_age) && is_int($this->max_age) && $this->max_age > 0 && $this->max_age < 181) { // default 0 $data['max-age'] = strval($this->max_age); } return $data; }