本文整理匯總了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;
}