getTemplate('admin/constructor/constructor', array('key' => $data['key'])); $result['preview'] = '
' . Fac()->doShortcode(array(), '', $data['key']) . '
'; } $return = json_encode($result); header('Content-Length: '.strlen($return)); header('Content-type: application/json'); echo $return; die(); //return $result; } public function getPreview($data) { $result = array(); if (isset($data['key'])) { $atts = !empty($data['params']) ? $data['params'] : array(); $result['preview'] = '' . Fac()->doShortcode($atts, '', $data['key']) . '
'; } $return = json_encode($result); header('Content-Length: '.strlen($return)); header('Content-type: application/json'); echo $return; die(); //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 = json_encode($result); header('Content-Length: '.strlen($return)); header('Content-type: application/json'); echo $return; die(); //return $result; } }