public function start($layout, $params) { wpl_extensions::import_javascript((object) array('param1' => 'wpl-jqplot', 'param2' => 'packages/jqplot/jquery.jqplot.min.js')); wpl_extensions::import_style((object) array('param1' => 'wpl-jqplot', 'param2' => 'packages/jqplot/jquery.jqplot.min.css')); $params['unique_chart_id'] = md5(uniqid(time() . mt_rand(0, mt_getrandmax()), true)); /** include layout **/ $layout_path = _wpl_import($layout, true, true); include $layout_path; }
/** * Runs Controller * @author Howard <*****@*****.**> */ public function run() { $_wpl_request_obj = new $this->_wpl_class(); /** render just wpl plugin output (like tmpl=component in Joomla) **/ if ($this->_wpl_plugin == '1') { wpl_extensions::import_styles_scripts(); $_wpl_request_obj->_wpl_plugin('display'); exit; } $_wpl_request_obj->display(); /** exit **/ exit; }
protected function load_assets() { /** add scripts and style sheet for uploaders **/ $style = array(); $style[] = (object) array('param1' => 'ajax-fileupload-style', 'param2' => 'packages/ajax_uploader/css/style.css'); $style[] = (object) array('param1' => 'ajax-fileupload-ui', 'param2' => 'packages/ajax_uploader/css/jquery.fileupload-ui.css'); foreach ($style as $css) { wpl_extensions::import_style($css); } $scripts = array(); $scripts[] = (object) array('param1' => 'jquery_file_upload', 'param2' => 'packages/ajax_uploader/jquery.fileupload.js'); foreach ($scripts as $script) { wpl_extensions::import_javascript($script); } }
/** * For adding styles and scripts * @author Howard <*****@*****.**> * @return void */ public static function import_styles_scripts() { $wpl_extensions = new wpl_extensions(); $javascripts = $wpl_extensions->get_extensions(1, 'javascript', wpl_global::get_client()); foreach ($javascripts as $javascript) { $wpl_extensions->import_javascript($javascript); } $styles = $wpl_extensions->get_extensions(1, 'style', wpl_global::get_client()); foreach ($styles as $style) { $wpl_extensions->import_style($style); } }
/** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); include _wpl_import('widgets.carousel.scripts.js', true, true); $image_width = isset($this->instance['data']['image_width']) ? $this->instance['data']['image_width'] : 1920; $image_height = isset($this->instance['data']['image_height']) ? $this->instance['data']['image_height'] : 558; $tablet_image_height = isset($this->instance['data']['tablet_image_height']) ? $this->instance['data']['tablet_image_height'] : 400; $phone_image_height = isset($this->instance['data']['phone_image_height']) ? $this->instance['data']['phone_image_height'] : 310; $thumbnail_width = isset($this->instance['data']['thumbnail_width']) ? $this->instance['data']['thumbnail_width'] : 150; $thumbnail_height = isset($this->instance['data']['thumbnail_height']) ? $this->instance['data']['thumbnail_height'] : 60; $auto_play = isset($this->instance['data']['auto_play']) ? $this->instance['data']['auto_play'] : true; $smart_resize = isset($this->instance['data']['smart_resize']) ? $this->instance['data']['smart_resize'] : false; $slide_interval = isset($this->instance['data']['slide_interval']) ? $this->instance['data']['slide_interval'] : 3000; /** add Layout js **/ $js[] = (object) array('param1' => 'modern.slider', 'param2' => 'js/libraries/wpl.modern.slider.min.js'); foreach ($js as $javascript) { wpl_extensions::import_javascript($javascript); } $larg_images = $thumbnail = NULL; foreach ($wpl_properties as $key => $gallery) { if (isset($gallery["items"]["gallery"][0])) { $params = array(); $params['image_name'] = $gallery["items"]["gallery"][0]->item_name; $params['image_parentid'] = $gallery["items"]["gallery"][0]->parent_id; $params['image_parentkind'] = $gallery["items"]["gallery"][0]->parent_kind; $params['image_source'] = wpl_global::get_upload_base_path() . $params['image_parentid'] . DS . $params['image_name']; $image_title = wpl_property::update_property_title($gallery['raw']); if (isset($gallery['items']['gallery'][0]->item_extra2) and trim($gallery['items']['gallery'][0]->item_extra2) != '') { $image_alt = $gallery['items']['gallery'][0]->item_extra2; } else { $image_alt = $gallery['raw']['meta_keywords']; }
<?php /** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); wpl_extensions::import_javascript((object) array('param1' => 'wpl-jqplot-pie', 'param2' => 'packages/jqplot/plugins/jqplot.pieRenderer.min.js')); $this->data = $params; $this->chart_background = (isset($this->data['chart_background']) and trim($this->data['chart_background']) != '') ? $this->data['chart_background'] : '#ffffff'; $this->chart_title = (isset($this->data['chart_title']) and trim($this->data['chart_title']) != '') ? $this->data['chart_title'] : ''; $this->show_value = (isset($this->data['show_value']) and trim($this->data['show_value']) != '') ? $this->data['show_value'] : 0; /** importing js codes **/ $this->_wpl_import($this->tpl_path . '.scripts.pie', true, true); ?> <div id="chartdiv<?php echo $this->data['unique_chart_id']; ?> " style="width: <?php echo $params['chart_width']; ?> ; height: <?php echo $params['chart_height']; ?> ;"></div>
$wpl_properties = isset($params['wpl_properties']) ? $params['wpl_properties'] : array(); $this->property_id = isset($wpl_properties['current']['data']['id']) ? $wpl_properties['current']['data']['id'] : NULL; /** get image params **/ $this->image_width = isset($params['image_width']) ? $params['image_width'] : 360; $this->image_height = isset($params['image_height']) ? $params['image_height'] : 285; $this->image_class = isset($params['image_class']) ? $params['image_class'] : ''; $this->autoplay = (isset($params['autoplay']) and trim($params['autoplay']) != '') ? $params['autoplay'] : 1; $this->resize = (isset($params['resize']) and trim($params['resize']) != '') ? $params['resize'] : 1; $this->rewrite = (isset($params['rewrite']) and trim($params['rewrite']) != '') ? $params['rewrite'] : 0; $this->watermark = (isset($params['watermark']) and trim($params['watermark']) != '') ? $params['watermark'] : 1; /** render gallery **/ $raw_gallery = isset($wpl_properties['current']['items']['gallery']) ? $wpl_properties['current']['items']['gallery'] : array(); $this->gallery = wpl_items::render_gallery($raw_gallery); $js[] = (object) array('param1' => 'jquery.bxslider', 'param2' => wpl_global::get_setting('js_default_path') . '/wpl.jquery.bxslider.min.js'); foreach ($js as $javascript) { wpl_extensions::import_javascript($javascript, true); } /** import js codes **/ $this->_wpl_import($this->tpl_path . '.scripts.pshow', true, true); ?> <div class="wpl_gallery_container" id="wpl_gallery_container<?php echo $this->property_id; ?> " style="width: <?php echo $this->image_width; ?> px"> <?php if (!count($this->gallery)) { echo '<div class="gallery_no_image"></div>'; } else {
<?php /** no direct access * */ defined('_WPLEXEC') or die('Restricted access'); include _wpl_import("widgets.search.scripts.css_backend", true, true); include _wpl_import("widgets.search.scripts.js_backend", true, true); wpl_extensions::import_javascript((object) array('param1' => 'wpl-sly-scrollbar', 'param2' => 'js/libraries/wpl.slyscrollbar.min.js')); ?> <div class="wpl-widget-search-wp wpl-widget-form-wp" id="<?php echo $this->get_field_id('wpl_search_widget_container'); ?> "> <div class="wpl-widget-row"> <label for="<?php echo $this->get_field_id('title'); ?> "><?php echo __('Title', WPL_TEXTDOMAIN); ?> </label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo $instance['title']; ?> "
<?php /** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); $this->_wpl_import($this->tpl_path . '.scripts.js', true, true); $js = (object) array('param1' => 'jquery-video-js-script', 'param2' => 'packages/video-js/video.js'); $style = (object) array('param1' => 'ajax-video-js-style', 'param2' => 'packages/video-js/video-js.min.css'); /** import styles and javascripts **/ wpl_extensions::import_javascript($js); wpl_extensions::import_style($style); /** set params **/ $wpl_properties = isset($params['wpl_properties']) ? $params['wpl_properties'] : array(); $property_id = isset($wpl_properties['current']['data']['id']) ? $wpl_properties['current']['data']['id'] : NULL; $raw_videos = isset($wpl_properties['current']['items']['video']) ? $wpl_properties['current']['items']['video'] : NULL; $videos = wpl_items::render_videos($raw_videos); $video_width = isset($params['video_width']) ? $params['video_width'] : 640; $video_height = isset($params['video_height']) ? $params['video_height'] : 270; if (!count($videos) or !is_array($videos)) { return; } ?> <div class="wpl_videos_container" id="wpl_videos_container<?php echo $property_id; ?> "> <ul class="wpl_videos_list_container"> <?php foreach ($videos as $video) { ?> <li class="wpl_videos_video wpl_video_type<?php echo isset($video['item_cat']) ? $video['item_cat'] : '';
<?php /** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); wpl_extensions::import_javascript((object) array('param1' => 'wpl-jqplot-canvasTextRenderer', 'param2' => 'packages/jqplot/plugins/jqplot.canvasTextRenderer.min.js')); wpl_extensions::import_javascript((object) array('param1' => 'wpl-jqplot-canvasAxisLabelRenderer', 'param2' => 'packages/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js')); $this->data = $params; $this->chart_background = (isset($this->data['chart_background']) and trim($this->data['chart_background']) != '') ? $this->data['chart_background'] : ''; $this->chart_title = (isset($this->data['chart_title']) and trim($this->data['chart_title']) != '') ? $this->data['chart_title'] : ''; /** importing js codes **/ $this->_wpl_import($this->tpl_path . '.scripts.line', true, true); ?> <div id="chartdiv<?php echo $this->data['unique_chart_id']; ?> " style="width: <?php echo $params['chart_width']; ?> ; height: <?php echo $params['chart_height']; ?> ;"></div>