コード例 #1
0
    function lineCreateHTML($dataLine)
    {
        $html = null;
        $Layout = new PBLayout();
        $columnCount = $Layout->getLayoutColumnCount($dataLine['data']['layout']);
        for ($i = 0; $i < $columnCount; $i++) {
            $componentCount = count($dataLine['column'][$i]['component']);
            $html .= '
				<li class="pb-content-column ' . $Layout->getLayoutColumnCSSClass($dataLine['data']['layout'], $i) . '" id="' . $dataLine['column'][$i]['data']['id'] . '">
				
					<div class="pb-content-column-box">

						<div class="pb-content-column-bar pb-clear-fix">
							<a href="#" class="pb-content-button pb-content-remove-button" title="' . esc_attr__('Remove all components in this column', PLUGIN_PAGE_BUILDER_DOMAIN) . '"></a>
						</div>

						<ul class="pb-reset-list pb-clear-fix">
			';
            if ($componentCount) {
                foreach ($dataLine['column'][$i]['component'] as $value) {
                    $html .= $this->componentCreateHTML($value);
                }
            }
            $html .= '
						</ul>
						
						<div class="pb-content-column-box-caption" style="display:' . ($componentCount ? 'none' : 'block') . '">
							<div>' . __('To start creating content,<br/>drag and drop component here', PLUGIN_PAGE_BUILDER_DOMAIN) . '</div>
						</div>
						
					</div>

				</li>
			';
        }
        $html = '
			<li class="pb-content-line" id="' . $dataLine['data']['id'] . '">
			
				<div class="pb-content-line-bar pb-clear-fix">
					<a href="#" class="pb-content-button pb-content-remove-button" title="' . esc_attr__('Remove this layout', PLUGIN_PAGE_BUILDER_DOMAIN) . '"></a>
					<a href="#" class="pb-content-button pb-content-edit-button" title="' . esc_attr__('Edit this layout', PLUGIN_PAGE_BUILDER_DOMAIN) . '"></a>
					<a href="#" class="pb-content-button pb-content-clone-button" title="' . esc_attr__('Clone this layout', PLUGIN_PAGE_BUILDER_DOMAIN) . '"></a>
					<a href="#" class="pb-content-button pb-content-move-up-button" title="' . esc_attr__('Move up/down this layout', PLUGIN_PAGE_BUILDER_DOMAIN) . '"></a>
				</div>

				<ul class="pb-content-layout pb-reset-list pb-clear-fix layout-' . $dataLine['data']['layout'] . '">
					' . $html . '
				</ul>

			</li>
		';
        return $html;
    }
コード例 #2
0
    function processShortcodeContactFormLayoutLine($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $Validation = new PBValidation();
        if (!$Layout->isLayout($attribute['layout'])) {
            return $html;
        }
        $columnCount = $Layout->getLayoutColumnCount($attribute['layout']);
        for ($i = 1; $i <= $columnCount; $i++) {
            $fieldHTML = null;
            if (!$Validation->isEmpty($attribute['column_' . $i . '_name'])) {
                $field = mb_split(',', $attribute['column_' . $i . '_name']);
                foreach ($field as $fieldValue) {
                    $this->fieldCounter++;
                    $class = array('pb-clear-fix', 'pb-contact-form-field');
                    $fieldHTML .= '
						<div' . PBHelper::createClassAttribute($class) . '>' . $this->createField($fieldValue) . '</div>
					';
                }
            }
            $class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($attribute['layout'], $i - 1), $attribute['column_' . $i . '_css_class']);
            $html .= '
				<li' . PBHelper::createClassAttribute($class) . '>' . $fieldHTML . '</li>
			';
        }
        $class = array('pb-reset-list', 'pb-clear-fix', $Layout->getLayoutCSSClass($attribute['layout']));
        $html = '
			<ul' . PBHelper::createClassAttribute($class) . '>
				' . $html . '
			</ul>
		';
        return PBHelper::formatHTML($html);
    }