本文整理汇总了PHP中PBHelper::createClassAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP PBHelper::createClassAttribute方法的具体用法?PHP PBHelper::createClassAttribute怎么用?PHP PBHelper::createClassAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PBHelper
的用法示例。
在下文中一共展示了PBHelper::createClassAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processShortcodeDivider
function processShortcodeDivider($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Align = new PBAlign();
$Border = new PBBorder();
$Validation = new PBValidation();
$style = array();
$class = array('pb-divider', 'pb-clear-fix');
if ($Validation->isNumber($attribute['line_width'], 0, 9999)) {
$style['width'] = $attribute['line_width'] . 'px';
}
if ($Validation->isNumber($attribute['line_height'], 0, 9999)) {
$style['border-bottom-width'] = $attribute['line_height'] . 'px';
}
if (array_key_exists($attribute['line_style'], $Border->style)) {
$style['border-style'] = $attribute['line_style'];
}
if ($Validation->isColor($attribute['line_color'])) {
$style['border-color'] = PBColor::getColor($attribute['line_color']);
}
if (array_key_exists($attribute['align'], $Align->align)) {
array_push($class, $Align->getCSSClass($attribute['align']));
}
if ($Validation->isNumber($attribute['margin_top'], 0, 9999)) {
$style['margin-top'] = $attribute['margin_top'] . 'px';
}
if ($Validation->isNumber($attribute['margin_bottom'], 0, 9999)) {
$style['margin-bottom'] = $attribute['margin_bottom'] . 'px';
}
array_push($class, $attribute['css_class']);
$html = '
<div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></div>
';
return PBHelper::formatHTML($html);
}
示例2: processShortcodeCounterListItem
function processShortcodeCounterListItem($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Validation = new PBValidation();
if ($Validation->isEmpty($attribute['name'])) {
return $html;
}
if (!$Validation->isNumber($attribute['value'], 0, 99999, false)) {
return $html;
}
$lineCharacterAfter = null;
$lineCharacterBefore = null;
if ($Validation->isNotEmpty($this->character['before'])) {
$lineCharacterBefore = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-before')) . '>' . esc_html($this->character['before']) . '</span>';
}
if ($Validation->isNotEmpty($this->character['after'])) {
$lineCharacterAfter = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-after')) . '>' . esc_html($this->character['after']) . '</span>';
}
$html = '
<li class="pb-value-' . (int) $attribute['value'] . '">
<span class="pb-counter-list-label">' . esc_html($attribute['name']) . '</span>
<span class="pb-counter-list-value">
' . $lineCharacterBefore . '
<span class="pb-counter-list-value-value">' . (int) $attribute['value'] . '</span>
' . $lineCharacterAfter . '
</span>
<span class="pb-counter-list-foreground"></span>
<span class="pb-counter-list-background"></span>
</li>
';
return PBHelper::formatHTML($html);
}
示例3: processShortcodeScreenPreloader
function processShortcodeScreenPreloader($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Validation = new PBValidation();
if (!$Validation->isColor($attribute['bg_color'])) {
return $html;
}
if (!$Validation->isNumber($attribute['z_index'], 0, 999999)) {
return $html;
}
$style = array();
$class = array('pb-screen-preloader', $attribute['css_class']);
$style['z-index'] = $attribute['z_index'];
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
$id = PBHelper::createId('pb_screen_preloader');
$html = '
<div' . PBHelper::createStyleAttribute($style) . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '"></div>
<div class="pb-script-tag">
<script type="text/javascript">
jQuery(document).ready(function($)
{
$(\'#' . $id . '\').PBScreenPreloader();
});
</script>
</div>
';
return PBHelper::formatHTML($html);
}
示例4: processShortcodeText
function processShortcodeText($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$class = array('pb-text', $attribute['css_class']);
$html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>';
return PBHelper::formatHTML($html, PBHelper::formatContent($content));
}
示例5: processShortcodeIframe
function processShortcodeIframe($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
if ($Validation->isEmpty($attribute['src'])) {
return null;
}
$style = array(array(), array());
if ((int) $attribute['width'] > 0) {
$style[0]['width'] = (int) $attribute['width'] . 'px';
}
if ((int) $attribute['height'] > 0) {
$style[1]['height'] = (int) $attribute['height'] . 'px';
$style[1]['padding-bottom'] = '0px';
}
$class = array(array('pb-iframe', $attribute['css_class']), array('pb-iframe-content'));
$html = '
<div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style[0]) . '>
<div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style[1]) . '>
<iframe src="' . esc_attr($attribute['src']) . '"></iframe>
</div>
</div>
';
return PBHelper::formatCode($html);
}
示例6: processShortcodeAccordion
function processShortcodeAccordion($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Easing = new PBEasing();
$Validation = new PBValidation();
if (!$Validation->isNumber($attribute['active'], 0, 999)) {
return $html;
}
if (!$Validation->isBool($attribute['disabled'])) {
return $html;
}
if (!$Validation->isBool($attribute['collapsible'])) {
return $html;
}
if (!$Validation->isBool($attribute['close_at_start'])) {
return $html;
}
if (!array_key_exists($attribute['height_style'], $this->heightStyle)) {
return $html;
}
if (!$Validation->isBool($attribute['animation_enable'])) {
return $html;
}
if (!$Validation->isNotEmpty($attribute['animation_duration'], 0, 99999)) {
return $html;
}
if (!array_key_exists($attribute['animation_easing'], $Easing->easingType)) {
return $html;
}
if (!$Validation->isNumber($attribute['header_font_size'], 0, 100)) {
return $html;
}
$key = array('active', 'disabled', 'collapsible', 'height_style', 'close_at_start', 'animation_enable', 'animation_duration', 'animation_easing');
foreach ($key as $index) {
$option[$index] = $attribute[$index];
}
$option['header_important_default'] = PBComponentData::get($this->getComponentId(), 'header_important_default');
$id = PBHelper::createId('pb_accordion');
$class = array('pb-accordion', 'pb-clear-fix', $attribute['css_class']);
PBComponentData::set('accordion', 'header_font_size', $attribute['header_font_size'], true);
$html = '
<div' . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '">
' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
</div>
<div class="pb-script-tag">
<script type="text/javascript">
jQuery(document).ready(function($)
{
$("#' . $id . '").PBAccordion(' . json_encode($option) . ');
});
</script>
</div>
';
return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
}
示例7: processShortcodeList
function processShortcodeList($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
$classBullet = null;
if ($Validation->isNotEmpty($attribute['bullet'])) {
$classBullet = 'pb-list-' . PBHelper::createHash($attribute['bullet']);
}
$class = array('pb-list', $classBullet, $attribute['css_class']);
$html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>';
return PBHelper::formatHTML($html, $content);
}
示例8: processShortcodeSpace
function processShortcodeSpace($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$style = array();
$Validation = new PBValidation();
if ($Validation->isNumber($attribute['height'], -9999, 9999)) {
if ((int) $attribute['height'] >= 0) {
$style['height'] = (int) $attribute['height'] . 'px';
} else {
$style['margin-top'] = (int) $attribute['height'] . 'px';
}
}
$class = array('pb-space', 'pb-clear-fix', $attribute['css_class']);
$html = '<div' . PBHelper::createClassAttribute(array('pb-space-line')) . '></div><div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></div>';
return PBHelper::formatHTML($html);
}
示例9: processShortcodeLayoutColumn
function processShortcodeLayoutColumn($attribute, $content, $tag)
{
$Layout = new PBLayout();
$attribute = $this->processAttribute($tag, $attribute);
$index = PBComponentData::get('layout', 'index');
$layout = PBComponentData::get('layout', 'layout');
$class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($layout, $index));
$html = '
<li' . PBHelper::createClassAttribute($class) . '>
<div class="pb-space-line"></div>
<div>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>
</li>
';
PBComponentData::set('layout', 'index', $index + 1);
return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
}
示例10: processShortcodeHeader
function processShortcodeHeader($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$style = array();
$Font = new PBFont();
$Header = new PBHeader();
$Validation = new PBValidation();
if ($Validation->isEmpty($content)) {
return $html;
}
if (!array_key_exists($attribute['important'], $Header->important)) {
return $html;
}
if (!$Validation->isBool($attribute['underline_enable'])) {
return $html;
}
if ($Validation->isNumber($attribute['font_size'], 1, 200, true)) {
$style['font-size'] = $attribute['font_size'] . 'px';
}
if (array_key_exists($attribute['font_weight'], $Font->weight)) {
$style['font-weight'] = $attribute['font_weight'];
}
if (array_key_exists($attribute['font_style'], $Font->style)) {
$style['font-style'] = $attribute['font_style'];
}
if ($Validation->isColor($attribute['font_color'])) {
$style['color'] = PBColor::getColor($attribute['font_color']);
}
if ($Validation->isColor($attribute['background_color'])) {
$style['background-color'] = PBColor::getColor($attribute['background_color']);
}
if ($Validation->isNotEmpty($attribute['line_height'])) {
$style['line-height'] = $attribute['line_height'];
}
if ($Validation->isNumber($attribute['text_indent'], 0, 999)) {
$style['text-indent'] = $attribute['text_indent'] . 'px';
}
$class = array(array('pb-header', $attribute['css_class']), array('pb-header-content'), array('pb-header-underline'));
$html = '<h' . (int) $attribute['important'] . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '><span' . PBHelper::createClassAttribute($class[1]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</span>' . ($attribute['underline_enable'] == 1 ? '<span' . PBHelper::createClassAttribute($class[2]) . '></span>' : null) . '</h' . (int) $attribute['important'] . '>';
return PBHelper::formatHTML($html, $content);
}
示例11: start_el
function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
{
$level = null;
$Validation = new PBValidation();
for ($i = 0; $i < $depth; $i++) {
$level .= '--';
}
if (!is_null($level)) {
$level .= ' ';
}
$linkClass = array();
if ($Validation->isNotEmpty($object->target)) {
array_push($linkClass, 'pb-window-target-blank');
}
$output .= '
<li class="' . join(' ', (array) $object->classes) . '">
<a href="' . esc_attr($object->url) . '"' . PBHelper::createClassAttribute($linkClass) . '>' . $level . $object->title . '</a>
</li>
';
}
示例12: start_el
function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
{
$this->iconClass = null;
if ($depth == 0) {
$this->icon = $object->icon;
$this->mega_menu_layout_column_index = 0;
$this->mega_menu_enable = $object->mega_menu_enable;
$this->mega_menu_layout = $object->mega_menu_layout;
if ($object->icon != '-1') {
$this->iconClass = 'pb-menu-icon pb-menu-icon-' . PBHelper::createHash($object->icon);
}
}
if ($this->mega_menu_enable == 1) {
if ($depth == 0 || $depth == 2) {
$output .= '<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-1' : null) . ' ' . $this->iconClass . ' ' . '">';
}
if ($depth == 1) {
$Layout = new PBLayout();
$class = array('sf-mega-section', 'pb-layout-' . $Layout->getLayoutColumnCSSClass($this->mega_menu_layout, $this->mega_menu_layout_column_index));
$output .= '
<div' . PBHelper::createClassAttribute($class) . '>
';
$this->mega_menu_layout_column_index++;
}
if ($depth == 1) {
$output .= '
<span class="sf-mega-header">' . esc_html($object->title) . '</span>
';
} else {
$output .= '
<a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a>
';
}
} else {
$output .= '
<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-0' : null) . ' ' . $this->iconClass . ' ' . '">
<a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a>
';
}
}
示例13: processShortcodeList
function processShortcodeList($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
$classBullet = null;
if ($Validation->isNotEmpty($attribute['bullet'])) {
$classBullet = 'pb-list-icon-name-' . PBHelper::createHash($attribute['bullet']);
}
$class = array('pb-list', 'pb-list-icon-type-gr', $classBullet, $attribute['css_class']);
} else {
$class = array('pb-list', 'pb-list-icon-type-fa', $attribute['css_class']);
}
$id = PBHelper::createId('pb_list');
$html = '<div' . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '">' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>';
if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'fa' && $Validation->isNotEmpty($attribute['font_icon_name'])) {
$option = array();
$option['icon_type'] = 'fa';
if ($Validation->isNotEmpty($attribute['font_icon_name'])) {
$option['font_icon_name'] = $attribute['font_icon_name'];
}
if ($Validation->isColor($attribute['font_icon_color'])) {
$option['font_icon_color'] = $attribute['font_icon_color'];
}
if ($Validation->isNumber($attribute['font_icon_size'], 1, 200)) {
$option['font_icon_size'] = $attribute['font_icon_size'];
}
$html .= '
<div class="pb-script-tag">
<script type="text/javascript">
jQuery(document).ready(function($)
{
$(\'#' . $id . '\').PBList(' . json_encode($option) . ');
});
</script>
</div>
';
}
return PBHelper::formatHTML($html, $content);
}
示例14: processShortcodeBlockquote
function processShortcodeBlockquote($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Validation = new PBValidation();
if ($Validation->isEmpty($content)) {
return $html;
}
$class = array('pb-blockquote', $attribute['css_class']);
if ($Validation->isNotEmpty($attribute['author'])) {
$html = '<div class="pb-blockquote-author">— ' . $attribute['author'] . '</div>';
}
$html = '
<div' . PBHelper::createClassAttribute($class) . '>
<blockquote>
' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
</blockquote>
' . $html . '
</div>
';
return PBHelper::formatHTML($html, PBHelper::formatContent($content));
}
示例15: processShortcodeVideo
function processShortcodeVideo($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$src = $this->parseVideoURL($attribute['src'], $attribute['type']);
if ($src === false) {
return $html;
}
$style = array();
if ((int) $attribute['player_width'] > 0) {
$style['width'] = (int) $attribute['player_width'] . 'px';
}
$class = array(array('pb-video', $attribute['css_class']), array('pb-video-content'));
$html = '
<div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '>
<div' . PBHelper::createClassAttribute($class[1]) . '>
<iframe src="' . esc_attr($src) . '"></iframe>
</div>
</div>
';
return PBHelper::formatHTML($html);
}