model = $model; } //////////////////////////////////////////////////////////////////////////////////////// // Public Methods // //////////////////////////////////////////////////////////////////////////////////////// public function display() { } function widget($args, $instance) { extract($args); $title = (isset($instance['title']) ? $instance['title'] : ""); $type = (isset($instance['type']) ? $instance['type'] : "gallery"); $gallery_id = (isset($instance['gallery_id']) ? $instance['gallery_id'] : 0); $album_id = (isset($instance['album_id']) ? $instance['album_id'] : 0); $show = (isset($instance['show']) ? $instance['show'] : "random"); $count = (isset($instance['count']) ? $instance['count'] : 4); $width = (isset($instance['width']) ? $instance['width'] : 100); $height = (isset($instance['height']) ? $instance['height'] : 100); $theme_id = (isset($instance['theme_id']) ? $instance['theme_id'] : 0); // Before widget. echo $before_widget; // Title of widget. if ($title) { echo $before_title . $title . $after_title; } // Widget output. if ($type == 'gallery') { require_once(WD_BWG_DIR . '/frontend/controllers/BWGControllerThumbnails.php'); $controller_class = 'BWGControllerThumbnails'; } else { require_once(WD_BWG_DIR . '/frontend/controllers/BWGControllerAlbum_compact_preview.php'); $controller_class = 'BWGControllerAlbum_compact_preview'; } $controller = new $controller_class(); global $bwg; $params = array ( 'from' => 'widget', 'gallery_type' => $type, 'id' => ($type == 'gallery' ? $gallery_id : $album_id), 'show' => $show, 'count' => $count, 'width' => $width, 'height' => $height, 'theme_id' => $theme_id); $controller->execute($params, 1, $bwg); $bwg++; // After widget. echo $after_widget; } // Widget Control Panel. function form($instance, $id_title, $name_title, $id_type, $name_type, $id_show, $name_show, $id_gallery_id, $name_gallery_id, $id_album_id, $name_album_id, $id_count, $name_count, $id_width, $name_width, $id_height, $name_height, $id_theme_id, $name_theme_id) { $defaults = array( 'title' => 'Photo Gallery', 'type' => 'gallery', 'gallery_id' => 0, 'album_id' => 0, 'show' => 'random', 'count' => 4, 'width' => 100, 'height' => 100, 'theme_id' => 0, ); $instance = wp_parse_args((array) $instance, $defaults); $gallery_rows = $this->model->get_gallery_rows_data(); $album_rows = $this->model->get_album_rows_data(); $theme_rows = $this->model->get_theme_rows_data(); ?>

" value="gallery" class="sel_gallery" onclick="bwg_change_type(event, this)" /> " value="album" class="sel_album" onclick="bwg_change_type(event, this)" />

;">

;">

" value="random" onclick='jQuery(this).nextAll(".bwg_hidden").first().attr("value", "random");' /> " value="first" onclick='jQuery(this).nextAll(".bwg_hidden").first().attr("value", "first");' /> " value="last" onclick='jQuery(this).nextAll(".bwg_hidden").first().attr("value", "last");' />

x px