doPreview(array(), '', $data['key']); $result['content'] = Fac()->getTemplate('admin/constructor/constructor', array('key' => $data['key'])); if (!empty($preview)) { $result['preview'] = $preview; } } return $result; } public function getPreview($data) { $result = array(); if (isset($data['key'])) { $atts = !empty($data['params']) ? $data['params'] : array(); $preview = Fac()->doPreview($atts, '', $data['key']); if (!empty($preview)) { $result['preview'] = $preview; } } return $result; } public function getShortcode($data) { $result = array(); if (isset($data['key'])) { $atts = !empty($data['params']) ? $data['params'] : array(); $s = ''; foreach ($atts as $key => $value) { if (!empty($value)) { if (is_string($value)) { $s .= ' ' . $key . '="' . $value . '"'; } else { $s .= ' ' . $key . '=' . $value; } } } $result['shortcode'] = '[' . $data['key'] . $s . ']'; } return $result; } }