/** * Admin view * * @param type $instance array. */ public function form($instance) { $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('Widget title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $widget_id_field = new UI_Input_Fox(array('id' => $this->get_field_id('widget_id'), 'name' => $this->get_field_name('widget_id'), 'value' => Utils::array_get($instance, 'widget_id'), 'placeholder' => __('Set widget id', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Widget ID', PHOTOLAB_BASE_TM_ALIAS))); $widget_id_html = $widget_id_field->output(); $screen_name_field = new UI_Input_Fox(array('id' => $this->get_field_id('screen_name'), 'name' => $this->get_field_name('screen_name'), 'value' => Utils::array_get($instance, 'screen_name'), 'placeholder' => __('Input your twitter name', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Twitter name', PHOTOLAB_BASE_TM_ALIAS))); $screen_name_html = $screen_name_field->output(); echo View::make('widgets/back-end/twitter-timeline', array('title_html' => $title_html, 'widget_id_html' => $widget_id_html, 'screen_name_html' => $screen_name_html)); }
/** * Admin view * * @param type $instance array. */ public function form($instance) { $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('Widget title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $app_id_field = new UI_Input_Fox(array('id' => $this->get_field_id('app_id'), 'name' => $this->get_field_name('app_id'), 'value' => Utils::array_get($instance, 'app_id'), 'placeholder' => __('app id', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Facebook application ID', PHOTOLAB_BASE_TM_ALIAS))); $app_id_html = $app_id_field->output(); $page_title_field = new UI_Input_Fox(array('id' => $this->get_field_id('page_title'), 'name' => $this->get_field_name('page_title'), 'value' => Utils::array_get($instance, 'page_title'), 'placeholder' => __('page title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Facebook page title', PHOTOLAB_BASE_TM_ALIAS))); $page_title_html = $page_title_field->output(); $facebook_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('facebook_url'), 'name' => $this->get_field_name('facebook_url'), 'value' => Utils::array_get($instance, 'facebook_url'), 'placeholder' => __('url', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Facebook page url', PHOTOLAB_BASE_TM_ALIAS))); $facebook_url_html = $facebook_url_field->output(); $tabs_field = new UI_Select_Fox(array('id' => $this->get_field_id('tabs'), 'name' => $this->get_field_name('tabs'), 'default' => Utils::array_get($instance, 'tabs'), 'options' => $this->tabs)); $tabs_html = $tabs_field->output(); $width_field = new UI_Input_Fox(array('id' => $this->get_field_id('width'), 'name' => $this->get_field_name('width'), 'value' => Utils::array_get($instance, 'width'), 'placeholder' => __('width', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Width', PHOTOLAB_BASE_TM_ALIAS))); $width_html = $width_field->output(); $height_field = new UI_Input_Fox(array('id' => $this->get_field_id('height'), 'name' => $this->get_field_name('height'), 'value' => Utils::array_get($instance, 'height'), 'placeholder' => __('height', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Height', PHOTOLAB_BASE_TM_ALIAS))); $height_html = $height_field->output(); $small_header_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('small_header'), 'class' => 'pull-right', 'name' => $this->get_field_name('small_header'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'small_header'))); $small_header_html = $small_header_field->output(); $adaptive_width_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('adaptive_width'), 'class' => 'pull-right', 'name' => $this->get_field_name('adaptive_width'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'adaptive_width'))); $adaptive_width_html = $adaptive_width_field->output(); $hide_cover_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('hide_cover'), 'class' => 'pull-right', 'name' => $this->get_field_name('hide_cover'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'hide_cover'))); $hide_cover_html = $hide_cover_field->output(); $freinds_face_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('freinds_face'), 'class' => 'pull-right', 'name' => $this->get_field_name('freinds_face'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'freinds_face'))); $freinds_face_html = $freinds_face_field->output(); echo View::make('widgets/back-end/facebook-page', array('title_html' => $title_html, 'app_id_html' => $app_id_html, 'page_title_html' => $page_title_html, 'facebook_url_html' => $facebook_url_html, 'tabs_html' => $tabs_html, 'width_html' => $width_html, 'height_html' => $height_html, 'small_header_html' => $small_header_html, 'adaptive_width_html' => $adaptive_width_html, 'hide_cover_html' => $hide_cover_html, 'freinds_face_html' => $freinds_face_html)); }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { ${$key} = !empty($instance[$key]) ? $instance[$key] : $value; } // Custom js wp_register_script('tm-post-slider-script-admin', plugins_url('assets/js/admin.min.js', __FILE__)); wp_localize_script('tm-post-slider-script-admin', 'TMWidgetParam', array('ajaxurl' => admin_url('admin-ajax.php'), 'button_is' => $this->get_field_id('button_is'))); wp_enqueue_script('tm-post-slider-script-admin'); // Custom styles wp_register_style('tm-post-slider-admin', plugins_url('assets/css/admin.min.css', __FILE__)); wp_enqueue_style('tm-post-slider-admin'); // include ui-elements require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-switcher.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-input.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-select.php'; $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => $title, 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => $categories, 'options' => $categories_array)); $categories_html = $category_field->output(); $count_field = new UI_Input_Fox(array('id' => $this->get_field_id('count'), 'name' => $this->get_field_name('count'), 'value' => $count, 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $count_html = $count_field->output(); $button_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('button_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('button_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $button_is)); $button_is_html = $button_is_field->output(); $button_text_field = new UI_Input_Fox(array('id' => $this->get_field_id('button_text'), 'name' => $this->get_field_name('button_text'), 'value' => $button_text, 'placeholder' => __('read more...', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Button text', PHOTOLAB_BASE_TM_ALIAS))); $button_text_html = $button_text_field->output(); $arrows_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('arrows_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('arrows_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $arrows_is)); $arrows_is_html = $arrows_is_field->output(); $bullets_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('bullets_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('bullets_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $bullets_is)); $bullets_is_html = $bullets_is_field->output(); $thumbnails_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('thumbnails_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('thumbnails_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $thumbnails_is)); $thumbnails_is_html = $thumbnails_is_field->output(); $autoplay_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('autoplay'), 'class' => 'pull-right', 'name' => $this->get_field_name('autoplay'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $autoplay)); $autoplay_html = $autoplay_field->output(); // show view require 'views/widget-form.php'; }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { // Include assets $this->admin_assets(); $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title widget', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => Utils::array_get($instance, 'categories'), 'options' => $categories_array)); $categories_html = $category_field->output(); $tags_list = get_tags(array('hide_empty' => 0)); $tags_array = array('0' => 'not selected'); foreach ($tags_list as $tag_item) { $tags_array[$tag_item->term_id] = $tag_item->name; } $tag_field = new UI_Select_Fox(array('id' => $this->get_field_id('tags'), 'name' => $this->get_field_name('tags'), 'default' => Utils::array_get($instance, 'tags'), 'options' => $tags_array)); $tags_html = $tag_field->output(); $cols_count_field = new UI_Select_Fox(array('id' => $this->get_field_id('cols_count'), 'name' => $this->get_field_name('cols_count'), 'default' => Utils::array_get($instance, 'cols_count'), 'options' => array(2 => 2, 3 => 3))); $cols_count_html = $cols_count_field->output(); $posts_count_field = new UI_Input_Fox(array('id' => $this->get_field_id('posts_count'), 'name' => $this->get_field_name('posts_count'), 'value' => Utils::array_get($instance, 'posts_count'), 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $posts_count_html = $posts_count_field->output(); $posts_offset_field = new UI_Input_Fox(array('id' => $this->get_field_id('posts_offset'), 'name' => $this->get_field_name('posts_offset'), 'value' => Utils::array_get($instance, 'posts_offset'), 'placeholder' => __('posts offset', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Offset', PHOTOLAB_BASE_TM_ALIAS))); $posts_offset_html = $posts_offset_field->output(); $title_length_field = new UI_Input_Fox(array('id' => $this->get_field_id('title_length'), 'name' => $this->get_field_name('title_length'), 'value' => Utils::array_get($instance, 'title_length'), 'placeholder' => __('title length', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title length', PHOTOLAB_BASE_TM_ALIAS))); $title_length_html = $title_length_field->output(); $padding_field = new UI_Input_Fox(array('id' => $this->get_field_id('padding'), 'name' => $this->get_field_name('padding'), 'value' => Utils::array_get($instance, 'padding'), 'placeholder' => __('padding', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Padding', PHOTOLAB_BASE_TM_ALIAS))); $padding_html = $padding_field->output(); // Show view echo View::make('widgets/back-end/image-grid', array('title_html' => $title_html, 'categories_html' => $categories_html, 'tags_html' => $tags_html, 'cols_count_html' => $cols_count_html, 'posts_count_html' => $posts_count_html, 'posts_offset_html' => $posts_offset_html, 'title_length_html' => $title_length_html, 'padding_html' => $padding_html)); }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { ${$key} = !empty($instance[$key]) ? $instance[$key] : $value; } wp_enqueue_media(); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); // Custom styles wp_register_style('tm-about-author-admin', plugins_url('assets/css/admin.min.css', __FILE__)); wp_enqueue_style('tm-about-author-admin'); // Custom script wp_register_script('tm-about-author-admin', plugins_url('assets/js/', __FILE__) . 'admin.min.js', array('jquery')); wp_localize_script('tm-about-author-admin', 'TMAboutAuthorWidgetParam', array('image' => $this->get_field_id('image'), 'avatar' => $this->get_field_id('avatar'))); wp_enqueue_script('tm-about-author-admin'); wp_enqueue_style('thickbox'); // include ui-elements require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-input.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-select.php'; $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => $title, 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title widget', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $users_list = get_users(); foreach ($users_list as $user) { $users[$user->ID] = $user->display_name; } $users_field = new UI_Select_Fox(array('id' => $this->get_field_id('user_id'), 'name' => $this->get_field_name('user_id'), 'default' => $user_id, 'options' => $users)); $users_html = $users_field->output(); $url_field = new UI_Input_Fox(array('id' => $this->get_field_id('url'), 'name' => $this->get_field_name('url'), 'value' => $url, 'placeholder' => __('detail url', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Detail url', PHOTOLAB_BASE_TM_ALIAS))); $url_html = $url_field->output(); $text_link_field = new UI_Input_Fox(array('id' => $this->get_field_id('text_link'), 'name' => $this->get_field_name('text_link'), 'value' => $text_link, 'placeholder' => __('link text', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Link text', PHOTOLAB_BASE_TM_ALIAS))); $text_link_html = $text_link_field->output(); $upload_file_field = new UI_Input_Fox(array('id' => $this->get_field_id('upload_image_button'), 'class' => 'upload_image_button button-image', 'type' => 'button', 'name' => $this->get_field_name('upload_image_button'), 'value' => __('Upload image', PHOTOLAB_BASE_TM_ALIAS))); $upload_html = $upload_file_field->output(); $image_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('image'), 'class' => ' custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image'), 'value' => $image)); $image_html = $image_url_field->output(); $delete_image_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('delete_image'), 'class' => 'delete_image_url button-image', 'type' => 'button', 'name' => $this->get_field_name('delete_image'), 'value' => __('Delete image', PHOTOLAB_BASE_TM_ALIAS))); $delete_image_html = $delete_image_url_field->output(); $user_info = get_userdata($user_id); $default_avatar = plugins_url('images/', __FILE__) . 'default-avatar.png'; if (!empty($image)) { $main_avatar = $image; } else { $main_avatar = $default_avatar; } // show view require 'views/widget-form.php'; }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { $instance[$key] = !empty($instance[$key]) ? $instance[$key] : $value; } $this->admin_assets(); $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => Utils::array_get($instance, 'categories'), 'options' => $categories_array)); $categories_html = $category_field->output(); $tags_list = get_tags(array('hide_empty' => 0)); $tags_array = array('0' => 'not selected'); foreach ($tags_list as $tag_item) { $tags_array[$tag_item->term_id] = $tag_item->name; } $tag_field = new UI_Select_Fox(array('id' => $this->get_field_id('tags'), 'name' => $this->get_field_name('tags'), 'default' => Utils::array_get($instance, 'tags'), 'options' => $tags_array)); $tags_html = $tag_field->output(); $count_field = new UI_Input_Fox(array('id' => $this->get_field_id('count'), 'name' => $this->get_field_name('count'), 'value' => Utils::array_get($instance, 'count'), 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $count_html = $count_field->output(); $title_length_field = new UI_Input_Fox(array('id' => $this->get_field_id('title_length'), 'name' => $this->get_field_name('title_length'), 'value' => Utils::array_get($instance, 'title_length'), 'placeholder' => __('symbols length', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title length', PHOTOLAB_BASE_TM_ALIAS))); $title_length_html = $title_length_field->output(); $excerpt_length_field = new UI_Input_Fox(array('id' => $this->get_field_id('excerpt_length'), 'name' => $this->get_field_name('excerpt_length'), 'value' => Utils::array_get($instance, 'excerpt_length'), 'placeholder' => __('symbols length', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Excerpt length', PHOTOLAB_BASE_TM_ALIAS))); $excerpt_length_html = $excerpt_length_field->output(); $button_text_field = new UI_Input_Fox(array('id' => $this->get_field_id('button_text'), 'name' => $this->get_field_name('button_text'), 'value' => Utils::array_get($instance, 'button_text'), 'placeholder' => __('read more', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Button text', PHOTOLAB_BASE_TM_ALIAS))); $button_text_html = $button_text_field->output(); $show_date_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_date'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_date'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_date'))); $show_date_html = $show_date_field->output(); $show_author_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_author'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_author'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_author'))); $show_author_html = $show_author_field->output(); $show_comments_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_comments'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_comments'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_comments'))); $show_comments_html = $show_comments_field->output(); $show_categories_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_categories'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_categories'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_categories'))); $show_categories_html = $show_categories_field->output(); $show_tags_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_tags'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_tags'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_tags'))); $show_tags_html = $show_tags_field->output(); // Show view echo View::make('widgets/back-end/custom-posts', array('title_html' => $title_html, 'categories_html' => $categories_html, 'tags_html' => $tags_html, 'count_html' => $count_html, 'title_length_html' => $title_length_html, 'excerpt_length_html' => $excerpt_length_html, 'button_text_html' => $button_text_html, 'show_date_html' => $show_date_html, 'show_author_html' => $show_author_html, 'show_comments_html' => $show_comments_html, 'show_categories_html' => $show_categories_html, 'show_tags_html' => $show_tags_html)); }
/** * Admin view * * @param type $instance array. */ public function form($instance) { $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('Widget title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $app_key_field = new UI_Input_Fox(array('id' => $this->get_field_id('app_key'), 'name' => $this->get_field_name('app_key'), 'value' => Utils::array_get($instance, 'app_key'), 'placeholder' => __('api key', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Youtube API key', PHOTOLAB_BASE_TM_ALIAS))); $app_key_html = $app_key_field->output(); $channel_name_field = new UI_Input_Fox(array('id' => $this->get_field_id('channel_name'), 'name' => $this->get_field_name('channel_name'), 'value' => Utils::array_get($instance, 'channel_name'), 'placeholder' => __('channel name', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Channel name', PHOTOLAB_BASE_TM_ALIAS))); $channel_name_html = $channel_name_field->output(); $channel_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('channel_url'), 'name' => $this->get_field_name('channel_url'), 'value' => Utils::array_get($instance, 'channel_url'), 'placeholder' => __('channel url', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Channel url', PHOTOLAB_BASE_TM_ALIAS))); $channel_url_html = $channel_url_field->output(); echo View::make('widgets/back-end/youtube-subscribe', array('title_html' => $title_html, 'app_key_html' => $app_key_html, 'channel_name_html' => $channel_name_html, 'channel_url_html' => $channel_url_html)); }
/** * Create admin form for widget * * @param type $instance array. * @since 1.1 */ public function form($instance) { $this->admin_assets(); $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title widget', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $users_list = get_users(); foreach ($users_list as $user) { $users[$user->ID] = $user->display_name; } $users_field = new UI_Select_Fox(array('id' => $this->get_field_id('user_id'), 'name' => $this->get_field_name('user_id'), 'default' => Utils::array_get($instance, 'user_id'), 'options' => $users)); $users_html = $users_field->output(); $url_field = new UI_Input_Fox(array('id' => $this->get_field_id('url'), 'name' => $this->get_field_name('url'), 'value' => Utils::array_get($instance, 'url'), 'placeholder' => __('detail url', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Detail url', PHOTOLAB_BASE_TM_ALIAS))); $url_html = $url_field->output(); $text_link_field = new UI_Input_Fox(array('id' => $this->get_field_id('text_link'), 'name' => $this->get_field_name('text_link'), 'value' => Utils::array_get($instance, 'text_link'), 'placeholder' => __('link text', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Link text', PHOTOLAB_BASE_TM_ALIAS))); $text_link_html = $text_link_field->output(); $upload_file_field = new UI_Input_Fox(array('id' => $this->get_field_id('upload_image_button'), 'class' => 'upload_image_button button-image', 'type' => 'button', 'name' => $this->get_field_name('upload_image_button'), 'value' => __('Upload image', PHOTOLAB_BASE_TM_ALIAS))); $upload_html = $upload_file_field->output(); $image_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('image'), 'class' => ' custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image'), 'value' => Utils::array_get($instance, 'image'))); $image_html = $image_url_field->output(); $delete_image_url_field = new UI_Input_Fox(array('id' => $this->get_field_id('delete_image'), 'class' => 'delete_image_url button-image', 'type' => 'button', 'name' => $this->get_field_name('delete_image'), 'value' => __('Delete image', PHOTOLAB_BASE_TM_ALIAS))); $delete_image_html = $delete_image_url_field->output(); $user_info = get_userdata(Utils::array_get($instance, 'user_id')); $default_avatar = Utils::assets_url() . '/images/default-avatar.png'; if (!empty($image)) { $main_avatar = $image; } else { $main_avatar = $default_avatar; } echo View::make('widgets/back-end/about-author', array('title_html' => $title_html, 'users_html' => $users_html, 'url_html' => $url_html, 'text_link_html' => $text_link_html, 'upload_html' => $upload_html, 'delete_image_html' => $delete_image_html, 'image_html' => $image_html, 'avatar_id' => $this->get_field_id('avatar'), 'default_image' => $default_avatar, 'avatar' => $main_avatar)); }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { $instance[$key] = !empty($instance[$key]) ? $instance[$key] : $value; } $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => Utils::array_get($instance, 'categories'), 'options' => $categories_array)); $categories_html = $category_field->output(); $tags_list = get_tags(array('hide_empty' => 0)); $tags_array = array('0' => 'not selected'); foreach ($tags_list as $tag_item) { $tags_array[$tag_item->term_id] = $tag_item->name; } $tag_field = new UI_Select_Fox(array('id' => $this->get_field_id('tags'), 'name' => $this->get_field_name('tags'), 'default' => Utils::array_get($instance, 'tags'), 'options' => $tags_array)); $tags_html = $tag_field->output(); $count_field = new UI_Input_Fox(array('id' => $this->get_field_id('count'), 'name' => $this->get_field_name('count'), 'value' => Utils::array_get($instance, 'count'), 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $count_html = $count_field->output(); $slides_per_view_field = new UI_Input_Fox(array('id' => $this->get_field_id('slides_per_view'), 'name' => $this->get_field_name('slides_per_view'), 'value' => Utils::array_get($instance, 'slides_per_view'), 'placeholder' => __('slides per view', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Items per view', PHOTOLAB_BASE_TM_ALIAS))); $slides_per_view_html = $slides_per_view_field->output(); $length_field = new UI_Input_Fox(array('id' => $this->get_field_id('length'), 'name' => $this->get_field_name('length'), 'value' => Utils::array_get($instance, 'length'), 'placeholder' => __('symbols length', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Symbols length', PHOTOLAB_BASE_TM_ALIAS))); $length_html = $length_field->output(); // Show view echo View::make('widgets/back-end/posts-carousel', array('title_html' => $title_html, 'categories_html' => $categories_html, 'tags_html' => $tags_html, 'count_html' => $count_html, 'slides_per_view_html' => $slides_per_view_html, 'length_html' => $length_html)); }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { ${$key} = !empty($instance[$key]) ? $instance[$key] : $value; } // Custom styles wp_register_style('tm-image-grid-admin', plugins_url('assets/css/admin.min.css', __FILE__)); wp_enqueue_style('tm-image-grid-admin'); // include ui-elements require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-input.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-select.php'; $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => $title, 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title widget', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => $categories, 'options' => $categories_array)); $categories_html = $category_field->output(); $cols_count_field = new UI_Select_Fox(array('id' => $this->get_field_id('cols_count'), 'name' => $this->get_field_name('cols_count'), 'default' => $cols_count, 'options' => array(2 => 2, 3 => 3))); $cols_count_html = $cols_count_field->output(); $posts_count_field = new UI_Input_Fox(array('id' => $this->get_field_id('posts_count'), 'name' => $this->get_field_name('posts_count'), 'value' => $posts_count, 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $posts_count_html = $posts_count_field->output(); $posts_offset_field = new UI_Input_Fox(array('id' => $this->get_field_id('posts_offset'), 'name' => $this->get_field_name('posts_offset'), 'value' => $posts_offset, 'placeholder' => __('posts offset', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Offset', PHOTOLAB_BASE_TM_ALIAS))); $posts_offset_html = $posts_offset_field->output(); $title_length_field = new UI_Input_Fox(array('id' => $this->get_field_id('title_length'), 'name' => $this->get_field_name('title_length'), 'value' => $title_length, 'placeholder' => __('title length', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Title length', PHOTOLAB_BASE_TM_ALIAS))); $title_length_html = $title_length_field->output(); $padding_field = new UI_Input_Fox(array('id' => $this->get_field_id('padding'), 'name' => $this->get_field_name('padding'), 'value' => $padding, 'placeholder' => __('padding', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Padding', PHOTOLAB_BASE_TM_ALIAS))); $padding_html = $padding_field->output(); // show view require 'views/widget-form.php'; }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { ${$key} = !empty($instance[$key]) ? $instance[$key] : $value; } wp_enqueue_media(); // Media uploader wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); // Custom styles wp_register_style('tm-categories-tiles-admin', plugins_url('assets/css/admin.min.css', __FILE__)); wp_enqueue_style('tm-categories-tiles-admin'); wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css'); // Custom script wp_register_script('tm-categories-tiles-admin', plugins_url('assets/js/', __FILE__) . 'admin.min.js', array('jquery')); wp_enqueue_script('tm-categories-tiles-admin'); wp_enqueue_style('thickbox'); // include ui-elements require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-switcher.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-input.php'; require_once __DIR__ . '/admin/lib/fox-ui-elements/ui-select.php'; $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => $title, 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $theme_field = new UI_Select_Fox(array('id' => $this->get_field_id('theme'), 'name' => $this->get_field_name('theme'), 'default' => $theme, 'options' => $this->themes)); $theme_html = $theme_field->output(); $switcher = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_count'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_count'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => $show_count)); $show_count_html = $switcher->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('1' => 'default'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } // Universal $default_image = plugins_url('images/', __FILE__) . 'default-image.jpg'; $tiles_items = array(); if (is_array($categories) && count($categories) > 0) { foreach ($categories as $key => $category_item) { $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('category_' . $key), 'name' => $this->get_field_name('category[]'), 'default' => $category_item['category'], 'options' => $categories_array)); $image_field = new UI_Input_Fox(array('id' => $this->get_field_id('image_' . $key), 'class' => 'custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image[]'), 'value' => $categories[$key]['image'])); $tiles_items[] = array('src' => $categories[$key]['image'], 'image' => $image_field->output(), 'category' => $category_field->output()); } } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('category_new'), 'name' => $this->get_field_name('category_new[]'), 'default' => 0, 'options' => $categories_array)); $image_field = new UI_Input_Fox(array('id' => $this->get_field_id('image_new'), 'class' => 'custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image_new[]'), 'value' => '')); $tile_new = array('image' => $image_field->output(), 'category' => $category_field->output()); // show view require 'views/widget-form.php'; }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { // Include assets $this->admin_assets(); $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $theme_field = new UI_Select_Fox(array('id' => $this->get_field_id('theme'), 'name' => $this->get_field_name('theme'), 'default' => Utils::array_get($instance, 'theme'), 'options' => $this->themes)); $theme_html = $theme_field->output(); $switcher = new UI_Switcher_Fox(array('id' => $this->get_field_id('show_count'), 'class' => 'pull-right', 'name' => $this->get_field_name('show_count'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'show_count'))); $show_count_html = $switcher->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('1' => 'default'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } // Universal $default_image = Utils::assets_url() . '/images/default-image.jpg'; $categories = Utils::array_get($instance, 'categories'); $tiles_items = array(); if (is_array($categories) && count($categories) > 0) { foreach ($categories as $key => $category_item) { $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('category_' . $key), 'name' => $this->get_field_name('category[]'), 'default' => $category_item['category'], 'options' => $categories_array)); $image_field = new UI_Input_Fox(array('id' => $this->get_field_id('image_' . $key), 'class' => 'custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image[]'), 'value' => $categories[$key]['image'])); $tiles_items[] = array('src' => $categories[$key]['image'], 'image' => $image_field->output(), 'category' => $category_field->output()); } } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('category_new'), 'name' => $this->get_field_name('category_new[]'), 'default' => 0, 'options' => $categories_array)); $image_field = new UI_Input_Fox(array('id' => $this->get_field_id('image_new'), 'class' => 'custom-image-url', 'type' => 'hidden', 'name' => $this->get_field_name('image_new[]'), 'value' => '')); $tile_new = array('image' => $image_field->output(), 'category' => $category_field->output()); // show view echo View::make('widgets/back-end/categories-tiles', array('title_html' => $title_html, 'theme_html' => $theme_html, 'show_count_html' => $show_count_html, 'tiles_items' => $tiles_items, 'default_image' => $default_image, 'tile_new' => $tile_new)); }
/** * Create admin form for widget * * @param type $instance array. */ public function form($instance) { foreach ($this->instance_default as $key => $value) { $instance[$key] = !empty($instance[$key]) ? $instance[$key] : $value; } $title_field = new UI_Input_Fox(array('id' => $this->get_field_id('title'), 'class' => 'title', 'name' => $this->get_field_name('title'), 'value' => Utils::array_get($instance, 'title'), 'placeholder' => __('New title', PHOTOLAB_BASE_TM_ALIAS))); $title_html = $title_field->output(); $categories_list = get_categories(array('hide_empty' => 0)); $categories_array = array('0' => 'not selected'); foreach ($categories_list as $category_item) { $categories_array[$category_item->term_id] = $category_item->name; } $category_field = new UI_Select_Fox(array('id' => $this->get_field_id('categories'), 'name' => $this->get_field_name('categories'), 'default' => Utils::array_get($instance, 'categories'), 'options' => $categories_array)); $categories_html = $category_field->output(); $tags_list = get_tags(array('hide_empty' => 0)); $tags_array = array('0' => 'not selected'); foreach ($tags_list as $tag_item) { $tags_array[$tag_item->term_id] = $tag_item->name; } $tag_field = new UI_Select_Fox(array('id' => $this->get_field_id('tags'), 'name' => $this->get_field_name('tags'), 'default' => Utils::array_get($instance, 'tags'), 'options' => $tags_array)); $tags_html = $tag_field->output(); $count_field = new UI_Input_Fox(array('id' => $this->get_field_id('count'), 'name' => $this->get_field_name('count'), 'value' => Utils::array_get($instance, 'count'), 'placeholder' => __('posts count', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Count of posts', PHOTOLAB_BASE_TM_ALIAS))); $count_html = $count_field->output(); $button_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('button_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('button_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'button_is'))); $button_is_html = $button_is_field->output(); $button_text_field = new UI_Input_Fox(array('id' => $this->get_field_id('button_text'), 'name' => $this->get_field_name('button_text'), 'value' => Utils::array_get($instance, 'button_text'), 'placeholder' => __('read more...', PHOTOLAB_BASE_TM_ALIAS), 'label' => __('Button text', PHOTOLAB_BASE_TM_ALIAS))); $button_text_html = $button_text_field->output(); $arrows_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('arrows_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('arrows_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'arrows_is'))); $arrows_is_html = $arrows_is_field->output(); $bullets_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('bullets_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('bullets_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'bullets_is'))); $bullets_is_html = $bullets_is_field->output(); $thumbnails_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('thumbnails_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('thumbnails_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'thumbnails_is'))); $thumbnails_is_html = $thumbnails_is_field->output(); $autoplay_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('autoplay'), 'class' => 'pull-right', 'name' => $this->get_field_name('autoplay'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'autoplay'))); $autoplay_html = $autoplay_field->output(); // Show view echo View::make('widgets/back-end/posts-slider', array('title_html' => $title_html, 'categories_html' => $categories_html, 'tags_html' => $tags_html, 'count_html' => $count_html, 'button_is_html' => $button_is_html, 'button_is' => $this->get_field_name('button_is'), 'button_text_html' => $button_text_html, 'arrows_is_html' => $arrows_is_html, 'bullets_is_html' => $bullets_is_html, 'thumbnails_is_html' => $thumbnails_is_html, 'autoplay_html' => $autoplay_html)); }
/** * Create admin form for widget * * @param type $instance array. * * @since 1.1 */ public function form($instance) { foreach ($this->instance_default as $key => $value) { $instance[$key] = !empty($instance[$key]) ? $instance[$key] : $value; } $this->admin_assets(); $first_block_field = new UI_Select_Fox(array('id' => $this->get_field_id('first_block'), 'name' => $this->get_field_name('first_block'), 'default' => Utils::array_get($instance, 'first_block'), 'options' => $this->blocks_list)); $first_block_html = $first_block_field->output(); $subscribe_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('subscribe_is') . ' subscribe_is', 'class' => 'pull-right', 'name' => $this->get_field_name('subscribe_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'subscribe_is'))); $subscribe_is_html = $subscribe_is_field->output(); $subscribe_title_field = new UI_Input_Fox(array('id' => $this->get_field_id('subscribe_title'), 'name' => $this->get_field_name('subscribe_title'), 'value' => Utils::array_get($instance, 'subscribe_title'), 'label' => __('Subscribe title', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('Subscribe title', PHOTOLAB_BASE_TM_ALIAS))); $subscribe_title_html = $subscribe_title_field->output(); $subscribe_description_field = new UI_Input_Fox(array('id' => $this->get_field_id('subscribe_description'), 'name' => $this->get_field_name('subscribe_description'), 'value' => Utils::array_get($instance, 'subscribe_description'), 'label' => __('Subscribe description', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('Subscribe description', PHOTOLAB_BASE_TM_ALIAS))); $subscribe_description_html = $subscribe_description_field->output(); $api_key_field = new UI_Input_Fox(array('id' => $this->get_field_id('api_key'), 'name' => $this->get_field_name('api_key'), 'value' => Utils::array_get($instance, 'api_key'), 'label' => __('MailChimp ApiKey', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('MailChimp ApiKey', PHOTOLAB_BASE_TM_ALIAS))); $api_key_html = $api_key_field->output(); $list_id_field = new UI_Input_Fox(array('id' => $this->get_field_id('list_id'), 'name' => $this->get_field_name('list_id'), 'value' => Utils::array_get($instance, 'list_id'), 'label' => __('MailChimp list id', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('MailChimp list id', PHOTOLAB_BASE_TM_ALIAS))); $list_id_html = $list_id_field->output(); $success_message_field = new UI_Input_Fox(array('id' => $this->get_field_id('success_message'), 'name' => $this->get_field_name('success_message'), 'value' => Utils::array_get($instance, 'success_message'), 'label' => __('Success message', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('Success', PHOTOLAB_BASE_TM_ALIAS))); $success_message_html = $success_message_field->output(); $failed_message_field = new UI_Input_Fox(array('id' => $this->get_field_id('failed_message'), 'name' => $this->get_field_name('failed_message'), 'value' => Utils::array_get($instance, 'failed_message'), 'label' => __('Failed message', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('Failed', PHOTOLAB_BASE_TM_ALIAS))); $failed_message_html = $failed_message_field->output(); $social_is_field = new UI_Switcher_Fox(array('id' => $this->get_field_id('social_is'), 'class' => 'pull-right', 'name' => $this->get_field_name('social_is'), 'values' => array('true' => 'ON', 'false' => 'OFF'), 'default' => Utils::array_get($instance, 'social_is'))); $social_is_html = $social_is_field->output(); $social_title_field = new UI_Input_Fox(array('id' => $this->get_field_id('social_title'), 'name' => $this->get_field_name('social_title'), 'value' => Utils::array_get($instance, 'social_title'), 'label' => __('Social title', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('Social title', PHOTOLAB_BASE_TM_ALIAS))); $social_title_html = $social_title_field->output(); $social_description_field = new UI_Input_Fox(array('id' => $this->get_field_id('social_description'), 'name' => $this->get_field_name('social_description'), 'value' => Utils::array_get($instance, 'social_description'), 'label' => __('Social description', PHOTOLAB_BASE_TM_ALIAS), 'placeholder' => __('social description', PHOTOLAB_BASE_TM_ALIAS))); $social_description_html = $social_description_field->output(); $social_items = array(); $social_buttons = Utils::array_get($instance, 'social_buttons'); if (is_array($social_buttons) && count($social_buttons) > 0) { foreach ($social_buttons as $key => $button) { $service_field = new UI_Input_Fox(array('id' => $this->get_field_id('service_' . $key), 'name' => $this->get_field_name('service[]'), 'value' => $button['service'], 'datalist' => $this->social_list, 'placeholder' => __('choose or input social media', PHOTOLAB_BASE_TM_ALIAS))); $url_field = new UI_Input_Fox(array('id' => $this->get_field_id('url_' . $key), 'name' => $this->get_field_name('url[]'), 'value' => $button['url'], 'placeholder' => __('input url to your page', PHOTOLAB_BASE_TM_ALIAS))); $social_items[] = array('service' => $service_field->output(), 'url' => $url_field->output()); } } $service_field = new UI_Input_Fox(array('id' => $this->get_field_id('service_new'), 'name' => $this->get_field_name('service_new[]'), 'value' => '', 'datalist' => $this->social_list, 'placeholder' => __('choose or input social media', PHOTOLAB_BASE_TM_ALIAS))); $url_field = new UI_Input_Fox(array('id' => $this->get_field_id('url_new'), 'name' => $this->get_field_name('ur_newl[]'), 'value' => '', 'placeholder' => __('input url to your page', PHOTOLAB_BASE_TM_ALIAS))); $social_new = array('service' => $service_field->output(), 'url' => $url_field->output()); // Show view echo View::make('widgets/back-end/subscribe-and-social', array('first_block_html' => $first_block_html, 'subscribe_is_html' => $subscribe_is_html, 'subscribe_title_html' => $subscribe_title_html, 'subscribe_description_html' => $subscribe_description_html, 'api_key_html' => $api_key_html, 'list_id_html' => $list_id_html, 'success_message_html' => $success_message_html, 'failed_message_html' => $failed_message_html, 'social_is_html' => $social_is_html, 'social_title_html' => $social_title_html, 'social_description_html' => $social_description_html, 'social_items' => $social_items, 'social_new' => $social_new)); }