public function do_shortcode_tag($content)
    {
        $output = "";
        $this->setShortcodeString($content[0]);
        $settings = $this->getSettings();
        switch ($this->shortcode) {
            case 'dt_row':
            case 'dt_inner_row':
            case 'dt_inner_row_1':
                $output = '<div class="element-builder element-row" data-tag="' . $this->shortcode . '" data-column="12">
<div class="builder_handlediv" title="' . __('Click to toggle row', 'detheme_builder') . '"></div>
                  <h3 class="row-title">' . __('Row', 'detheme_builder') . '</h3>
                  <div class="inside_row">
                  <div class="element-toolbar">
                  <div class="toolbar-panel-left">
                  <div class="element-holder"><i title="' . __('Move this row', 'detheme_builder') . '"  class="flaticon-pointer2"></i></div>
                      <div class="toolbar row-selection"><div class="select-column"><div title="' . __('Change column', 'detheme_builder') . '"  class="dashicons dashicons-menu"></div></div>
                        <ul class="option-column-group">
                          <li class="option-column"><a href="#" class="column_1" data-column="12"><span></span></a></li>
                          <li class="option-column"><a href="#" class="column_2" data-column="6 6"><span></span><span></span></a></li>
                          <li class="option-column"><a href="#" class="column_3" data-column="4 4 4"><span></span><span></span><span></span></a></li>
                          <li class="option-column"><a href="#" class="column_4" data-column="3 3 3 3"><span></span><span></span><span></span><span></span></a></li>
                          <li class="option-column"><a href="#" class="column_6" data-column="2 2 2 2 2 2"><span></span><span></span><span></span><span></span><span></span><span></span></a></li>
                          <li class="option-column"><a href="#" class="column_custom">' . __('Custom', 'detheme_builder') . '</a></li>
                        </ul>
                      </div>
                      <div class="toolbar element-shortcode"><a title="' . __('Show this shortcode', 'detheme_builder') . '" href="#">&lt;/&gt;</a></div>
                      <div class="toolbar element-setting" data-title="' . __('Row', 'detheme_builder') . '"><a title="' . __('Edit this row', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-generic"></div></a></div>
                    </div>
                    <ul class="toolbar-panel-right">
                      <li class="toolbar element-copy"><a title="' . __('Copy this row', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-page"></div></a></li>
                      <li class="toolbar element-delete"><a title="' . __('Delete this row', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-no-alt"></div></a></li>
                      <li class="toolbar element-up"><a title="' . __('Move up this row', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-arrow-up-alt"></div></a></li>
                      <li class="toolbar element-down"><a title="' . __('Move down this row', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-arrow-down-alt"></div></a></li>
                    </ul>

                  </div>
                  <div class="open-tag render-tag">[' . $this->shortcode . ' ' . trim($content[3]) . ']</div>
                  <div class="column-container">' . $this->content . '</div>
                  <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
                  </div>
                </div>';
                break;
            case 'dt_column':
            case 'dt_inner_column':
            case 'dt_inner_column_1':
                $this->atts['column'] = isset($this->atts['column']) ? $this->atts['column'] : 12;
                $css_column = in_array($this->atts['column'], array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) ? "col-" . min((int) $this->atts['column'], 12) : "col_custom_" . $this->atts['column'];
                $output = '<div class="element-builder element-column ' . $css_column . '" data-column="' . $this->atts['column'] . '" data-tag="' . $this->shortcode . '">
            <div class="toolbar element-setting" data-title="' . __('Column', 'detheme_builder') . '"><a title="' . __('Edit this column', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-generic"></div></a></div>
            <div class="toolbar element-addshortcode"><a title="' . __('Add shortcode to this column', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-welcome-edit-page"></div></a></div>
            <div class="open-tag render-tag">[' . $this->shortcode . ' ' . preg_replace('/column=\\"(.*)\\"/', '', trim($content[3])) . ']</div>
            <div class="element-content dropable-element">' . $this->content . '</div>
            <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
          </div>';
                break;
            default:
                if ($settings['is_container']) {
                    $output = '<div class="element-builder element-container element-' . $this->shortcode . '" data-tag="' . $this->shortcode . '">
            <div class="element-holder"><i title="' . __('Move this element', 'detheme_builder') . '" class="flaticon-pointer2"></i></div>
            <div class="element-panel">
              <div class="element-holder-label">' . $settings['title'] . '</div>
              <div class="element-toolbar">
                <div class="toolbar element-setting" data-title="' . $settings['title'] . '"><a title="' . __('Edit this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-edit"></div></a></a></div>
                <div class="toolbar element-shortcode"><a title="' . __('Show this shortcode', 'detheme_builder') . '" href="#">&lt;/&gt;</a></div>
                <div class="toolbar element-copy"><a title="' . __('Copy this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-page"></div></a></div>
                <div class="toolbar element-delete"><a title="' . __('Delete this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-no-alt"></div></a></div>
              </div>
            </div>
            <div class="open-tag render-tag">[' . $this->shortcode . " " . trim($content[3]) . ']</div>
            <div class="element-content dropable-element">' . $this->content . '</div>
            <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
           </div>';
                } elseif ($settings['as_parent']) {
                    $output = '<div class="element-builder element-parent element-' . $this->shortcode . '" data-child="' . (is_array($settings['as_parent']) ? @implode(",", $settings['as_parent']) : $settings['as_parent']) . '" data-tag="' . $this->shortcode . '">
            <div class="element-holder"><i title="' . __('Move this element', 'detheme_builder') . '" class="flaticon-pointer2"></i></div>
          <div class="element-panel">
          <div class="element-holder-label">' . $settings['title'] . '</div>
          <div class="children-toolbar">';
                    if (is_array($settings['as_parent'])) {
                        foreach ($settings['as_parent'] as $child) {
                            if ($childElement = get_dt_element($child)) {
                                $childSettings = $childElement->getSettings();
                                $output .= '<div class="toolbar"><a title="' . sprintf(__('Add %s', 'detheme_builder'), $childSettings['title']) . '" href="#" data-child="' . $child . '"><div class="dashicons dashicons-plus-alt"></div> ' . $childSettings['title'] . '</a></div>';
                            }
                        }
                    } else {
                        if ($childElement = get_dt_element($settings['as_parent'])) {
                            $childSettings = $childElement->getSettings();
                            $output .= '<div class="toolbar"><a title="' . sprintf(__('Add %s', 'detheme_builder'), $childSettings['title']) . '" href="#" data-child="' . $settings['as_parent'] . '"><div class="dashicons dashicons-plus-alt"></div> ' . $childSettings['title'] . '</a></div>';
                        }
                    }
                    $output .= '</div>
            <div class="element-toolbar">
              <div class="toolbar element-setting" data-title="' . $settings['title'] . '"><a title="' . __('Edit this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-edit"></div></a></a></div>
              <div class="toolbar element-shortcode"><a title="' . __('Show this shortcode', 'detheme_builder') . '" href="#">&lt;/&gt;</a></div>
              <div class="toolbar element-copy"><a title="' . __('Copy this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-page"></div></a></div>
              <div class="toolbar element-delete"><a title="' . __('Delete this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-no-alt"></div></a></div>
            </div>
            </div>
            <div class="open-tag render-tag">[' . $this->shortcode . " " . trim($content[3]) . ']</div>
            <div class="element-content dropable-element">' . $this->content . '</div>
            <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
           </div>';
                } elseif ($settings['as_child']) {
                    $output = '<div class="element-builder element-child element-' . $this->shortcode . '" data-parent="' . $settings['as_child'] . '" data-tag="' . $this->shortcode . '">
            <div class="element-holder"><i title="' . __('Move this element', 'detheme_builder') . '" class="flaticon-pointer2"></i></div>
            <div class="element-toolbar element-panel">
                <div class="element-holder-label">' . $settings['title'] . '</div>
                <div class="toolbar element-setting" data-title="' . $settings['title'] . '"><a title="' . __('Edit this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-edit"></div></a></a></div>
                <div class="toolbar element-copy"><a title="' . __('Copy this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-page"></div></a></div>
                <div class="toolbar element-delete"><a title="' . __('Delete this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-no-alt"></div></a></div>
            </div>
            <div class="element-preview">' . $this->preview_admin() . '</div>
            <div class="open-tag render-tag">[' . $this->shortcode . " " . trim($content[3]) . ']</div>
            <textarea class="content-tag render-tag">' . $this->content . '</textarea>
            <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
           </div>';
                } else {
                    $output = '<div class="element-builder element-frebase element-' . $this->shortcode . '" data-tag="' . $this->shortcode . '">
            <div class="element-holder"><i title="' . __('Move this element', 'detheme_builder') . '" class="flaticon-pointer2"></i></div>
            <div class="element-panel">
              <div class="element-holder-label">' . $settings['title'] . '</div>
              <div class="element-toolbar">
                <div class="toolbar element-setting" data-title="' . $settings['title'] . '"><a title="' . __('Edit this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-edit"></div></a></a></div>
                <div class="toolbar element-shortcode"><a title="' . __('Show this shortcode', 'detheme_builder') . '" href="#">&lt;/&gt;</a></div>
                <div class="toolbar element-copy"><a title="' . __('Copy this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-admin-page"></div></a></div>
                <div class="toolbar element-delete"><a title="' . __('Delete this element', 'detheme_builder') . '" href="#"><div class="dashicons dashicons-no-alt"></div></a></div>
              </div>
            </div>
            <div class="element-preview">' . $this->preview_admin() . '</div>
            <div class="open-tag render-tag">[' . $this->shortcode . " " . trim($content[3]) . ']</div>
            <textarea class="content-tag render-tag">' . $this->content . '</textarea>
            <div class="close-tag render-tag">[/' . $this->shortcode . ']</div>
           </div>';
                }
                break;
        }
        return $output;
    }
Пример #2
0
/**
* 
* @since 1.3.2
*/
function remove_dt_element_option($shortcode_id, $optionName)
{
    if ($shortcode_id == '') {
        return false;
    }
    $element = get_dt_element($shortcode_id);
    if (!$element) {
        return false;
    }
    $element->removeOption($optionName);
}