本文整理汇总了PHP中AviaHtmlHelper::render_element方法的典型用法代码示例。如果您正苦于以下问题:PHP AviaHtmlHelper::render_element方法的具体用法?PHP AviaHtmlHelper::render_element怎么用?PHP AviaHtmlHelper::render_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AviaHtmlHelper
的用法示例。
在下文中一共展示了AviaHtmlHelper::render_element方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editor_element
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_element($params)
{
//fetch all registered sidebars
$sidebars = AviaHelper::get_registered_sidebars();
if (empty($params['args']['widget_area'])) {
$params['args']['widget_area'] = reset($sidebars);
}
$element = array('subtype' => $sidebars, 'type' => 'select', 'std' => htmlspecialchars_decode($params['args']['widget_area']), 'class' => 'avia-recalc-shortcode', 'data' => array('attr' => 'widget_area'));
$inner = "<img src='" . $this->config['icon'] . "' title='" . $this->config['name'] . "' />";
$inner .= "<div class='avia-element-label'>" . $this->config['name'] . "</div>";
$inner .= AviaHtmlHelper::render_element($element);
$params['class'] = "";
$params['content'] = NULL;
$params['innerHtml'] = $inner;
return $params;
}
示例2: editor_element
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_element($params)
{
//fetch all registered slides and save them to the slides array
$slides = avia_find_layersliders(true);
if (empty($params['args']['id']) && is_array($slides)) {
$params['args']['id'] = reset($slides);
}
$element = array('subtype' => $slides, 'type' => 'select', 'std' => $params['args']['id'], 'class' => 'avia-recalc-shortcode', 'data' => array('attr' => 'id'));
$inner = "<img src='" . $this->config['icon'] . "' title='" . $this->config['name'] . "' />";
if (empty($slides)) {
$inner .= "<div><a target='_blank' href='" . admin_url('admin.php?page=layerslider') . "'>" . __('No Layer Slider Found. Click here to create one', 'avia_framework') . "</a></div>";
} else {
$inner .= "<div class='avia-element-label'>" . $this->config['name'] . "</div>";
$inner .= AviaHtmlHelper::render_element($element);
$inner .= "<a target='_blank' href='" . admin_url('admin.php?page=layerslider') . "'>" . __('Edit Layer Slider here', 'avia_framework') . "</a>";
}
$params['class'] = "av_sidebar";
$params['content'] = NULL;
$params['innerHtml'] = $inner;
return $params;
}